/* ============================================================
   Cup Quest - a World Cup memory challenge
   Pitch green, gold for stars and cups, teal for Kiko's scarf
   ============================================================ */

:root {
    --grass: #3aa35b;
    --grass-dark: #2b7f45;
    --gold: #ffc93c;
    --teal: #2fb7a4;
    --ink: #2e3148;
    --ink-soft: #66698a;
    --paper: #fffdf7;
    --good: #35c26b;
    --mid: #f4a524;
    --bad: #ef6461;
    --sky: #5b8def;
    --shadow: 0 6px 0 rgba(0, 0, 0, .09), 0 12px 26px rgba(30, 60, 50, .16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
    color: var(--ink);
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 60px, transparent 60px 120px),
        linear-gradient(180deg, #1f3b66 0%, #2c5a8a 22%, #3aa35b 22.2%, #43b066 60%, #3a9c58 100%);
    background-attachment: fixed;
    padding: 64px 14px 40px;
    overflow-x: hidden;
}

/* the crowd in the stands: dots that do a slow wave */
.stands {
    position: fixed;
    inset: 0 0 auto 0;
    height: 22vh;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .55) 2.2px, transparent 2.6px),
        radial-gradient(circle, rgba(255, 201, 60, .5) 2.2px, transparent 2.6px);
    background-size: 18px 14px, 26px 18px;
    background-position: 0 0, 9px 7px;
    animation: crowd 6s ease-in-out infinite;
    opacity: .6;
}

@keyframes crowd {
    50% {
        background-position: 0 -3px, 9px 4px;
    }
}

img.flag {
    width: 1.6em;
    height: 1.2em;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    vertical-align: -.2em;
    background: #eee;
}

img.flag.sm {
    width: 1.2em;
    height: .9em;
    margin-right: 2px;
}

img.flag.big {
    width: 72px;
    height: 54px;
    border-radius: 6px;
}

.team {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    white-space: nowrap;
}

.team .tn {
    font-weight: 700;
}

/* ---------- top bar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 10px;
    background: rgba(20, 40, 70, .55);
    backdrop-filter: blur(6px);
}

.chip {
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 3px 0 rgba(0, 0, 0, .15);
    cursor: pointer;
}

.chip.off {
    opacity: .6;
}

.chip .s {
    color: var(--gold);
    margin-right: 4px;
    text-shadow: 0 1px 0 #b37400;
}

.chip .sk {
    color: var(--teal);
    margin-right: 4px;
}

div.chip {
    cursor: default;
}

/* ---------- screens and cards ---------- */
.screen {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
}

.screen.active {
    display: block;
    animation: pop .35s ease-out;
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

.card {
    background: var(--paper);
    border-radius: 26px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.start-card {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.mascot-holder {
    display: flex;
    justify-content: center;
}

.kiko {
    width: 150px;
    height: 160px;
    animation: bounce 1.4s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-14px) rotate(3deg);
    }
}

.game-title {
    font-family: 'Fredoka One', 'Baloo 2', sans-serif;
    font-size: 54px;
    letter-spacing: 1px;
    color: var(--grass-dark);
    line-height: 1;
    margin: 6px 0 8px;
}

.game-title span {
    color: var(--gold);
    text-shadow: 0 3px 0 #b37400;
}

.tagline {
    font-size: 19px;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.how-to {
    display: grid;
    gap: 10px;
    text-align: left;
    margin: 12px 0 20px;
}

.how-step {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #eef8f0;
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 17px;
}

.how-num {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--grass);
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.c-good {
    color: var(--good);
}

.c-bad {
    color: var(--bad);
}

.btn {
    font-family: inherit;
    font-weight: 800;
    font-size: 18px;
    border: 0;
    border-radius: 16px;
    padding: 12px 22px;
    background: #e8ebf5;
    color: var(--ink);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
    cursor: pointer;
    transition: transform .1s;
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .14);
}

.btn.go {
    background: var(--grass);
    color: #fff;
    box-shadow: 0 4px 0 var(--grass-dark);
}

.btn.big {
    font-size: 24px;
    padding: 16px 40px;
}

.btn:disabled {
    opacity: .5;
    cursor: default;
}

.row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.screen-title {
    font-family: 'Fredoka One', 'Baloo 2', sans-serif;
    font-size: 32px;
    color: var(--ink);
    text-align: center;
}

.screen-sub {
    text-align: center;
    color: var(--ink-soft);
    font-size: 17px;
    margin: 4px 0 8px;
}

.hub-head {
    background: rgba(255, 253, 247, .94);
    border-radius: 22px;
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

/* ---------- stadium (hub) ---------- */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.mode {
    font-family: inherit;
    text-align: left;
    border: 0;
    border-radius: 22px;
    padding: 14px;
    background: var(--paper);
    box-shadow: var(--shadow);
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: transform .15s;
    color: var(--ink);
}

.mode:hover {
    transform: translateY(-3px) rotate(-.5deg);
}

.mode.big {
    grid-column: 1 / -1;
    background: linear-gradient(120deg, #fff6d6, #fffdf7);
    border: 3px solid var(--gold);
}

.mode.big .mode-name {
    font-size: 26px;
}

.mode-ico {
    flex: none;
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: #e9f6ec;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.mode-ico .cup {
    width: 56px;
    height: 66px;
}

.mode-ico .avatar {
    width: 64px;
    height: 70px;
}

.mode-name {
    font-family: 'Fredoka One', 'Baloo 2', sans-serif;
    font-size: 20px;
    line-height: 1.1;
}

.mode-desc {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.2;
}

.stars {
    color: #d9d9e3;
    font-size: 22px;
    letter-spacing: 2px;
}

.stars .on {
    color: var(--gold);
    text-shadow: 0 2px 0 #b37400;
}

.stars.small {
    font-size: 15px;
    color: var(--ink-soft);
    font-weight: 700;
}

.result-card .stars,
.tl-ask .stars,
.bracket-foot .stars {
    text-align: center;
    font-size: 44px;
}

/* simple drawn icons */
.ico-score {
    font-family: 'Fredoka One', sans-serif;
    font-size: 26px;
    color: #fff;
    background: #2e3148;
    padding: 2px 8px;
    border-radius: 8px;
}

.ico-score i {
    color: var(--gold);
    font-style: normal;
    margin: 0 3px;
}

.ico-bracket {
    width: 44px;
    height: 40px;
    position: relative;
}

.ico-bracket i {
    position: absolute;
    border: 4px solid var(--grass-dark);
    border-left: 0;
}

.ico-bracket i:nth-child(1) {
    left: 0;
    top: 0;
    width: 18px;
    height: 16px;
}

.ico-bracket i:nth-child(2) {
    left: 0;
    top: 22px;
    width: 18px;
    height: 16px;
}

.ico-bracket i:nth-child(3) {
    left: 18px;
    top: 8px;
    width: 22px;
    height: 22px;
    border-color: var(--gold);
}

.ico-ball,
.ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #2e3148 0 7px, transparent 7.5px),
        radial-gradient(circle at 18% 30%, #2e3148 0 5px, transparent 5.5px),
        radial-gradient(circle at 82% 30%, #2e3148 0 5px, transparent 5.5px),
        radial-gradient(circle at 30% 86%, #2e3148 0 5px, transparent 5.5px),
        radial-gradient(circle at 70% 86%, #2e3148 0 5px, transparent 5.5px),
        radial-gradient(circle at 35% 30%, #fff, #e3e3ea);
    box-shadow: inset -4px -5px 0 rgba(0, 0, 0, .12), 0 0 0 2px #2e3148;
}

.ico-globe {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 40%, #63c27f 0 9px, transparent 10px), radial-gradient(circle at 70% 65%, #63c27f 0 12px, transparent 13px), #5b8def;
    box-shadow: inset -5px -5px 0 rgba(0, 0, 0, .15);
}

.ico-pin {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    background: var(--bad);
    transform: rotate(-45deg);
    box-shadow: inset 0 0 0 9px var(--bad), inset 0 0 0 30px #fff;
}

.ico-tl {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ico-tl i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 2px #b37400;
}

.ico-book,
.ico-maths,
.ico-boot {
    font-family: 'Fredoka One', sans-serif;
    font-size: 20px;
    color: var(--grass-dark);
}

.ico-boot {
    font-size: 40px;
    color: var(--gold);
    text-shadow: 0 2px 0 #b37400;
}

.ico-album {
    width: 46px;
    height: 36px;
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 12px), var(--teal);
    border: 3px solid var(--teal);
}

/* ---------- quiz ---------- */
.quiz-head {
    background: rgba(255, 253, 247, .95);
    border-radius: 20px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    text-align: center;
}

.quiz-title {
    font-family: 'Fredoka One', 'Baloo 2', sans-serif;
    font-size: 20px;
}

.scoreboard:empty {
    display: none;
}

.sb {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: #1d2033;
    color: #fff;
    border-radius: 12px;
    padding: 4px 12px;
    margin: 6px 0 2px;
    font-weight: 700;
}

.sb b {
    font-family: 'Fredoka One', sans-serif;
    font-size: 26px;
    color: var(--gold);
    min-width: 22px;
}

.sb i {
    font-style: normal;
    opacity: .6;
}

.dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.dots i {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dfe2ee;
}

.dots i.good {
    background: var(--good);
}

.dots i.mid {
    background: var(--mid);
}

.dots i.bad {
    background: var(--bad);
}

/* the pitch strip with goal, keeper and ball */
.pitch {
    position: relative;
    height: 190px;
    margin: 12px 0;
    border-radius: 22px;
    overflow: hidden;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 40px, transparent 40px 80px),
        linear-gradient(180deg, #2c7c46, #3aa35b 40%, #45b56a);
    box-shadow: var(--shadow);
}

.goal {
    position: absolute;
    left: 50%;
    top: 14px;
    width: min(320px, 44%);
    height: 96px;
    transform: translateX(-50%);
}

.goal .net {
    position: absolute;
    inset: 6px 6px 0 6px;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, .45) 0 1.5px, transparent 1.5px 10px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 1.5px, transparent 1.5px 10px),
        rgba(0, 0, 0, .12);
    transform-origin: 50% 0;
}

.goal .post {
    position: absolute;
    top: 0;
    bottom: -4px;
    width: 7px;
    background: #fff;
    border-radius: 3px;
}

.goal .post.l {
    left: 0;
}

.goal .post.r {
    right: 0;
}

.goal .bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 7px;
    background: #fff;
    border-radius: 3px;
}

.spot {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 10px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .8);
    transform: translateX(-50%);
}

.keeper {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 40px;
    height: 66px;
    transform: translateX(-50%);
    transform-origin: 50% 100%;
}

.kp-body {
    position: absolute;
    left: 6px;
    top: 14px;
    width: 28px;
    height: 46px;
    border-radius: 12px 12px 6px 6px;
    background: #ff7a29;
    box-shadow: inset 0 -12px 0 #2e3148;
}

.kp-face {
    position: absolute;
    left: 2px;
    top: -16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1c79f;
    border: 2px solid #2e3148;
}

.kp-face i {
    position: absolute;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2e3148;
}

.kp-face i:first-child {
    left: 5px;
}

.kp-face i:last-child {
    right: 5px;
}

.kp-arm {
    position: absolute;
    top: 16px;
    width: 9px;
    height: 30px;
    border-radius: 6px;
    background: #ff7a29;
    border-bottom: 8px solid #fff;
}

.kp-arm.l {
    left: -4px;
    transform: rotate(35deg);
}

.kp-arm.r {
    right: -4px;
    transform: rotate(-35deg);
}

.pitch.they .kp-body,
.pitch.they .kp-arm {
    background: var(--sky);
}

.ball {
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: 34px;
    height: 34px;
    transform: translate(-50%, 0);
    background:
        radial-gradient(circle at 50% 50%, #2e3148 0 5px, transparent 5.5px),
        radial-gradient(circle at 18% 30%, #2e3148 0 4px, transparent 4.5px),
        radial-gradient(circle at 82% 30%, #2e3148 0 4px, transparent 4.5px),
        radial-gradient(circle at 30% 86%, #2e3148 0 4px, transparent 4.5px),
        radial-gradient(circle at 70% 86%, #2e3148 0 4px, transparent 4.5px),
        radial-gradient(circle at 35% 30%, #fff, #e3e3ea);
}

.pitch-msg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    text-align: center;
    font-family: 'Fredoka One', sans-serif;
    font-size: 40px;
    color: #fff;
    opacity: 0;
    transform: scale(.4);
    pointer-events: none;
    text-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}

.pitch-msg.show {
    opacity: 1;
    transform: scale(1);
    transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), opacity .2s;
}

.pitch-msg.good {
    color: var(--gold);
}

.pitch-msg.mid {
    color: #fff3c4;
}

.pitch-msg.bad {
    color: #ffd1d0;
}

.qcard {
    padding: 18px;
}

.q-meta {
    text-align: center;
    color: var(--ink-soft);
    font-weight: 700;
    font-size: 15px;
}

.q-prompt {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0 10px;
}

.q-note {
    text-align: center;
    color: var(--ink-soft);
    font-size: 15px;
    margin-top: -6px;
    margin-bottom: 8px;
}

.score-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin: 8px 0 14px;
}

.score-row .side {
    text-align: center;
}

.score-row .tn {
    font-weight: 800;
    font-size: 19px;
    margin-top: 4px;
}

.spins {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.dash {
    font-family: 'Fredoka One', sans-serif;
    font-size: 40px;
    color: var(--ink-soft);
}

.spin {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1d2033;
    border-radius: 16px;
    padding: 4px;
}

.spin button {
    font-size: 22px;
    width: 64px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #34395a;
    color: #fff;
    cursor: pointer;
}

.spin button:active {
    background: var(--grass);
}

.spin .val {
    font-family: 'Fredoka One', sans-serif;
    font-size: 48px;
    color: var(--gold);
    line-height: 1.2;
    min-width: 64px;
    text-align: center;
}

.spin.locked button {
    visibility: hidden;
}

.spins.small .val {
    font-size: 36px;
}

.pens-q {
    text-align: center;
    font-size: 18px;
    margin: 4px 0 8px;
}

.qcard .check {
    display: block;
    margin: 6px auto 0;
    font-size: 22px;
    padding: 14px 40px;
}

.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.choices.flags {
    grid-template-columns: repeat(2, 1fr);
}

.choice {
    font-family: inherit;
    font-size: 19px;
    font-weight: 700;
    border: 3px solid #e3e6f0;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    min-height: 58px;
    cursor: pointer;
    color: var(--ink);
    transition: transform .1s, border-color .2s;
}

.choice:hover:not(:disabled) {
    border-color: var(--grass);
    transform: translateY(-2px);
}

.choice:disabled {
    cursor: default;
}

.choice.right {
    border-color: var(--good);
    background: #e7f9ee;
    animation: tada .5s;
}

.choice.wrong {
    border-color: var(--bad);
    background: #fdecec;
    animation: shake .4s;
}

@keyframes tada {
    40% {
        transform: scale(1.06);
    }
}

@keyframes shake {

    25%,
    75% {
        transform: translateX(-6px);
    }

    50% {
        transform: translateX(6px);
    }
}

.feedback {
    margin-top: 14px;
    border-radius: 18px;
    padding: 14px;
    text-align: center;
    animation: pop .3s ease-out;
}

.feedback.good {
    background: #e7f9ee;
}

.feedback.mid {
    background: #fff4dc;
}

.feedback.bad {
    background: #fdecec;
}

.fb-head {
    font-family: 'Fredoka One', sans-serif;
    font-size: 22px;
    margin-bottom: 6px;
}

.fb-body {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.fb-body .sc {
    font-family: 'Fredoka One', sans-serif;
    font-size: 24px;
    margin: 0 6px;
}

.extra {
    font-size: 15px;
    color: var(--ink-soft);
}

.gtable {
    margin: 6px auto;
    border-collapse: collapse;
    font-size: 16px;
}

.gtable td,
.gtable th {
    padding: 3px 8px;
    border-bottom: 1px solid #e3e6f0;
}

.gtable .l {
    text-align: left;
}

/* country / city cards */
.ccard {
    display: flex;
    gap: 14px;
    text-align: left;
    align-items: flex-start;
    background: #fff;
    border-radius: 16px;
    padding: 12px;
}

.ccard-name {
    font-family: 'Fredoka One', sans-serif;
    font-size: 22px;
}

.ccard ul {
    list-style: none;
    font-size: 16px;
}

.ccard li {
    margin: 2px 0;
}

/* ---------- maps ---------- */
.zoomers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}

.zoom {
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    background: #e3eefc;
    color: #24508f;
    cursor: pointer;
}

.map-box {
    border-radius: 16px;
    overflow: hidden;
    background: #a9d4f5;
}

.worldmap {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1000 / 520;
    touch-action: manipulation;
}

.worldmap .sea {
    fill: #a9d4f5;
}

.worldmap path:not(.sea) {
    fill: #e4e1d6;
    stroke: #fff;
    stroke-width: .4;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
}

.worldmap path.tm {
    fill: #f7e3a3;
}

.worldmap .dot {
    fill: #f7b500;
    stroke: #fff;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
}

.worldmap path:not(.sea):hover {
    fill: #cfe8c9;
}

.worldmap .found {
    fill: var(--good) !important;
    animation: blink .5s 4 alternate;
}

.worldmap .miss {
    fill: var(--bad) !important;
}

@keyframes blink {
    to {
        opacity: .4;
    }
}

.map-said {
    text-align: center;
    font-size: 17px;
    min-height: 1.4em;
    margin-top: 6px;
}

.hostmap path:not(.sea) {
    cursor: default;
}

.hostmap .pin {
    fill: var(--bad);
    stroke: #fff;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.hostmap .hit {
    fill: transparent;
    cursor: pointer;
}

.hostmap .city:hover .pin {
    fill: var(--sky);
}

.hostmap .city.found .pin {
    fill: var(--good);
    animation: blink .4s 6 alternate;
}

.hostmap .city.miss .pin {
    fill: #888;
}

/* ---------- picker ---------- */
.pick-card {
    max-width: 900px;
    margin: 0 auto;
}

.pick-label {
    font-weight: 800;
    margin: 14px 0 6px;
    color: var(--grass-dark);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.filter {
    font-family: inherit;
    font-weight: 800;
    font-size: 17px;
    border: 0;
    border-radius: 14px;
    padding: 10px 6px;
    background: #e9f6ec;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .1);
}

.filter small {
    display: block;
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 13px;
}

.teampick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.tbtn {
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    border: 2px solid #e3e6f0;
    border-radius: 14px;
    padding: 8px 4px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.1;
}

.tbtn img.flag {
    width: 48px;
    height: 36px;
}

.tbtn small {
    color: var(--grass-dark);
    font-size: 12px;
}

.tbtn:hover {
    border-color: var(--grass);
}

/* ---------- bracket ---------- */
.bracket-wrap {
    overflow-x: auto;
    border-radius: 20px;
    background: rgba(255, 253, 247, .94);
    box-shadow: var(--shadow);
    padding: 10px;
}

.bracket {
    display: flex;
    gap: 12px;
    min-width: 880px;
}

.bcol {
    flex: 1;
    display: flex;
    flex-direction: column;
    opacity: .85;
}

.bcol.now {
    opacity: 1;
}

.bhead {
    text-align: center;
    font-weight: 800;
    color: var(--grass-dark);
    font-size: 15px;
    margin-bottom: 4px;
}

.bcol.now .bhead {
    color: #fff;
    background: var(--grass);
    border-radius: 999px;
}

.bcells {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 6px;
}

.bm {
    border-radius: 10px;
    background: #f0f2f8;
    padding: 3px;
    display: grid;
    gap: 3px;
}

.bm.ok {
    background: #d9f3e2;
}

.bm.bad {
    background: #fbe0df;
}

.bt {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 0;
    border-radius: 7px;
    padding: 4px 6px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    min-height: 28px;
    cursor: pointer;
}

.bt span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt b small {
    font-size: 11px;
    margin-left: 2px;
}

.bt:disabled {
    cursor: default;
}

.bcol.now .bt:not(:disabled):hover {
    background: #fff6d6;
    outline: 2px solid var(--gold);
}

.bt.win {
    background: #fff;
    box-shadow: inset 4px 0 0 var(--good);
}

.bt.lose {
    opacity: .5;
}

.bt.q {
    justify-content: center;
    color: #b9bccc;
    cursor: default;
}

.bracket-foot {
    margin-top: 12px;
}

/* ---------- timeline ---------- */
.timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 253, 247, .94);
    box-shadow: var(--shadow);
    scroll-snap-type: x proximity;
}

.tl-slot {
    flex: none;
    width: 72px;
    border-radius: 14px;
    background: #f0f2f8;
    padding: 6px 4px;
    text-align: center;
    scroll-snap-align: center;
}

.tl-slot.now {
    background: #fff6d6;
    outline: 3px solid var(--gold);
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    to {
        outline-color: #ffe89c;
    }
}

.tl-slot.filled {
    background: #e7f9ee;
    animation: pop .4s;
}

.tl-slot.filled.late {
    background: #fff4dc;
}

.tl-year {
    font-family: 'Fredoka One', sans-serif;
    font-size: 17px;
}

.tl-flag {
    height: 34px;
    display: grid;
    place-items: center;
    font-family: 'Fredoka One', sans-serif;
    font-size: 24px;
    color: #c4c7d6;
}

.tl-flag img.flag {
    width: 40px;
    height: 30px;
}

.tl-host {
    min-height: 14px;
}

.tl-gap {
    flex: none;
    width: 110px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--ink-soft);
    display: grid;
    place-items: center;
    text-align: center;
    border: 2px dashed #d5d8e4;
    border-radius: 14px;
    padding: 4px;
}

.tl-ask {
    margin-top: 12px;
}

.choices.champs {
    grid-template-columns: repeat(4, 1fr);
}

.choices.champs .choice {
    font-size: 16px;
    padding: 8px 4px;
}

.tl-said {
    text-align: center;
    font-size: 17px;
    min-height: 1.5em;
    margin-top: 10px;
}

.cabinet {
    margin-top: 12px;
    border-radius: 20px;
    padding: 12px;
    background: linear-gradient(180deg, #6b4a2b, #57391f);
    box-shadow: var(--shadow);
    color: #fff;
}

.cab-title {
    font-family: 'Fredoka One', sans-serif;
    text-align: center;
    font-size: 20px;
    color: var(--gold);
}

.cab-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.cab {
    background: rgba(0, 0, 0, .2);
    border-radius: 12px;
    padding: 6px;
    text-align: center;
}

.cab.empty {
    opacity: .5;
}

.cups {
    min-height: 34px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.cup.mini {
    width: 22px;
    height: 30px;
    animation: pop .4s;
}

.cab-n {
    font-size: 14px;
}

.cab-n b {
    color: var(--gold);
    font-size: 18px;
}

/* ---------- mystery star ---------- */
.clues {
    margin: 6px auto 10px;
    max-width: 620px;
    font-size: 18px;
    padding-left: 26px;
}

.clues li {
    margin: 4px 0;
    animation: pop .3s;
}

.qcard .more {
    display: block;
    margin: 0 auto 12px;
}

.choices.stars4 {
    grid-template-columns: repeat(4, 1fr);
}

.choice.star {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    font-size: 15px;
}

.reveal .avatar {
    width: 70px;
    height: 77px;
}

.choice.star .avatar {
    width: 80px;
    height: 88px;
}

/* ---------- album ---------- */
.album {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.agroup {
    background: rgba(255, 253, 247, .95);
    border-radius: 20px;
    padding: 10px;
    box-shadow: var(--shadow);
}

.ag-title {
    font-family: 'Fredoka One', sans-serif;
    color: var(--grass-dark);
    text-align: center;
}

.ag-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sticker {
    perspective: 600px;
    height: 120px;
    cursor: pointer;
}

.st-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .5s;
    transform-style: preserve-3d;
}

.sticker.flipped .st-inner {
    transform: rotateY(180deg);
}

.st-front,
.st-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
}

.st-front {
    background: linear-gradient(160deg, #fff, #eef3ff);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.sticker.have .st-front {
    border-color: var(--gold);
}

.st-front img.flag.big {
    width: 54px;
    height: 40px;
}

.st-back {
    background: #fff6d6;
    transform: rotateY(180deg);
    border: 3px solid var(--gold);
}

.st-name {
    font-weight: 800;
    font-size: 13px;
    margin-top: 4px;
}

.st-q {
    width: 54px;
    height: 40px;
    border-radius: 6px;
    background: #dfe2ee;
    color: #fff;
    font-family: 'Fredoka One', sans-serif;
    font-size: 26px;
    display: grid;
    place-items: center;
}

.sticker.locked {
    opacity: .7;
}

/* ---------- result ---------- */
.result-card {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.cup.lift {
    width: 150px;
    height: 190px;
    animation: lift 1.4s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 18px rgba(255, 201, 60, .8));
}

@keyframes lift {
    from {
        transform: translateY(10px) rotate(-4deg);
    }

    to {
        transform: translateY(-14px) rotate(4deg);
    }
}

.runlog {
    margin-top: 10px;
    background: #f0f2f8;
    border-radius: 14px;
    padding: 10px;
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- confetti and toast ---------- */
.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.confetti i {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translate(var(--dx), 105vh) rotate(var(--rot));
    }
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 200%);
    opacity: 0;
    background: #1d2033;
    color: #fff;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    z-index: 60;
    transition: transform .3s, opacity .3s;
    max-width: 92vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
    .game-title {
        font-size: 42px;
    }

    .q-prompt {
        font-size: 19px;
    }

    .score-row {
        grid-template-columns: 1fr;
    }

    .score-row .side {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    img.flag.big {
        width: 52px;
        height: 39px;
    }

    .choices.champs,
    .cab-row,
    .choices.stars4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .pitch {
        height: 170px;
    }
}
