:root {
    --bg1: #fff3f8;
    --bg2: #eef2ff;
    --text: #24172d;
    --muted: #6b5f73;
    --card: rgba(255, 255, 255, 0.86);
    --border: rgba(82, 50, 110, 0.13);
    --accent: #7c3aed;
    --accent-dark: #5b21b6;
    --good: #16834f;
    --bad: #c2410c;
    --shadow: 0 24px 70px rgba(50, 30, 70, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, #ffe0ef, transparent 34%),
        radial-gradient(circle at bottom right, #dbeafe, transparent 32%),
        linear-gradient(135deg, var(--bg1), var(--bg2));
}

.container {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0;
}

.narrow { width: min(680px, calc(100% - 28px)); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: clamp(22px, 5vw, 42px);
    backdrop-filter: blur(12px);
    margin-bottom: 22px;
}

.hero { text-align: center; }

h1, h2, p { margin-top: 0; }

h1 {
    font-size: clamp(2rem, 7vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    margin-bottom: 18px;
}

h2 {
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    letter-spacing: -0.03em;
}

.subtitle {
    color: var(--muted);
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    line-height: 1.45;
}

.eyebrow {
    display: inline-block;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.session-button,
.main-button,
.answer-grid button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 20px;
    padding: 18px 20px;
    min-height: 70px;
    font-size: 1.05rem;
    font-weight: 850;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    display: block;
}

.session-button span {
    display: block;
    font-size: 0.82rem;
    font-weight: 650;
    margin-top: 4px;
}

.available,
.main-button {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 12px 25px rgba(124, 58, 237, 0.24);
}

.busy {
    color: #6b5f73;
    background: #eee8f4;
    cursor: not-allowed;
}

.available:hover,
.main-button:hover,
.answer-grid button:hover {
    transform: translateY(-2px);
}

.form-card {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 750;
}

input {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
    font: inherit;
    background: #fff;
}

.back-link {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 16px;
}

.notice,
.error {
    border-radius: 18px;
    padding: 14px 16px;
    font-weight: 750;
}

.notice { background: #ede9fe; }
.error { background: #ffedd5; color: #9a3412; }

.scoreboard {
    display: block;
    align-items: center;
    text-align: center;
}

.scoreboard h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

.scores {
    display: inline-block;
    font-size: 1.1rem;
    min-width: 220px;
}

.scores span,
.result-box p {
    background: rgba(255,255,255,0.75);
    padding: 12px 14px;
    border-radius: 16px;
    margin: 0;
}

.game-card { text-align: center; }

.draw-button { 
    width: min(100%, 440px); 
    margin: auto; 
}

.tiny {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.4;
}

.card-reveal {
    animation: pop 0.35s ease both;
    border: 2px dashed rgba(124, 58, 237, 0.28);
    border-radius: 26px;
    padding: clamp(20px, 5vw, 34px);
    background: rgba(255,255,255,0.66);
}

.category {
    font-size: 1.45rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.subcategory {
    color: var(--accent-dark);
    font-weight: 800;
    margin-bottom: 22px;
}

.card-reveal h2 {
    font-size: clamp(1.6rem, 6vw, 3.1rem);
    line-height: 1.05;
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.answer-grid button { color: white; }
.good { background: linear-gradient(135deg, #22c55e, var(--good)); }
.bad { background: linear-gradient(135deg, #f97316, var(--bad)); }

.final-card { text-align: center; }
.result-box, .gage-box {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.gage-box {
    text-align: left;
    background: rgba(255,255,255,0.7);
    border-radius: 24px;
    padding: 22px;
}

.back-link {
    display: block;
    margin-bottom: 15px;
    color: #555;
    text-decoration: none;
    text-align: center;
}

.counter-pill{
    padding: 5% 0 0 0;
}

@keyframes pop {
    from { transform: scale(0.96) rotate(-1deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

@media (max-width: 720px) {
    .container { padding: 18px 0; }
    .card { border-radius: 22px; }
    .scoreboard { display: block; }
    .scores { min-width: 0; }
    .answer-grid { grid-template-columns: 1fr; }
    .session-button, .main-button, .answer-grid button {
        min-height: 64px;
        font-size: 1rem;
    }
}

.mode-picker {
    border: 2px dashed rgba(124, 58, 237, 0.22);
    border-radius: 22px;
    padding: 18px;
    margin: 4px 0;
}

.mode-picker legend {
    padding: 0 8px;
    color: var(--accent-dark);
    font-weight: 900;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.mode-option {
    position: relative;
    display: grid;
    gap: 6px;
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(255,255,255,0.78);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mode-option:hover {
    transform: translateY(-2px);
}

.mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-option:has(input:checked) {
    border-color: rgba(124, 58, 237, 0.72);
    box-shadow: 0 12px 25px rgba(124, 58, 237, 0.14);
}

.mode-title {
    font-weight: 950;
    font-size: 1.05rem;
}

.mode-description {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.25;
}

.session-button small {
    display: block;
    margin-top: 4px;
    font-size: 0.74rem;
    opacity: 0.8;
}


.language-switcher {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.lang-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.7);
    color: var(--accent-dark);
    font-weight: 900;
    text-decoration: none;
}

.lang-button.selected {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
