*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
    min-height: 100vh;
    font-family: Manrope, "Segoe UI", sans-serif;
    background:
        radial-gradient(1000px 520px at 50% -10%, rgba(231, 193, 90, .16), transparent 55%),
        radial-gradient(700px 480px at 100% 100%, rgba(28, 78, 160, .38), transparent 50%),
        #07111f;
    color: #f6f1e6;
}
body.is-admin {
    background: #f4efe6;
    color: #241c16;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.05; margin: 0 0 10px; }
h2 { margin: 0 0 6px; }
p { line-height: 1.5; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #f0d78c; }
body.is-admin a { color: #8a4b12; }
::selection { background: #e7c15a; color: #1a1408; }

.kicker {
    margin: 0 0 6px;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-size: .74rem;
    font-weight: 700;
    color: #e7c15a;
}
body.is-admin .kicker { color: #8a6232; }
.lede { max-width: 40rem; color: #d9d3c6; }
body.is-admin .lede, body.is-admin .fine, body.is-admin .empty { color: #5c5146; }
.fine { color: #c9c1b2; font-size: .92rem; }
.wrap { max-width: 920px; margin: 0 auto; padding: 8px 18px 56px; }
.site, .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.site { max-width: 1120px; margin: 0 auto; padding: 18px 18px 0; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a, .brandlink { color: inherit; text-decoration: none; }
.brandlink { display: inline-flex; align-items: center; font-weight: 800; }
.nav a { padding: 8px 12px; border-radius: 999px; }
.nav a.is-on { background: rgba(231, 193, 90, .16); }
body.is-admin .nav a.is-on { background: #241c16; color: #f4efe6; }
.gem {
    width: 12px; height: 12px; margin-right: 8px;
    transform: rotate(45deg);
    border: 2px solid #e7c15a;
    box-shadow: inset 0 0 0 2px rgba(231, 193, 90, .45);
}

.primary, button.primary {
    background: linear-gradient(180deg, #f2d48a, #c4892d);
    color: #241806;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
}
.ghost, a.ghost, button.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: inherit;
    border: 1px solid rgba(231, 193, 90, .45);
    border-radius: 999px;
    padding: 8px 14px;
    text-decoration: none;
}
body.is-admin .ghost, body.is-admin a.ghost { border-color: #c8b89a; color: #241c16; background: white; }
.textish, button.textish {
    background: none;
    border: 0;
    color: #f0d78c;
    padding: 8px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
body.is-admin .textish { color: #8a4b12; }
.danger {
    background: transparent;
    color: #9d2430;
    border: 1px solid #e4b2a8;
    border-radius: 999px;
    padding: 8px 14px;
}
.flash {
    max-width: 920px;
    margin: 16px auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: #e7f6ec;
    color: #145c32;
}
.flash.bad { background: #fde8e4; color: #8d2418; }
body:not(.is-admin) .flash {
    background: rgba(231, 193, 90, .12);
    color: #f0d78c;
    border: 1px solid rgba(231, 193, 90, .35);
}
body:not(.is-admin) .flash.bad {
    background: rgba(208, 58, 58, .15);
    color: #ffd0d0;
    border-color: rgba(208, 58, 58, .45);
}
.note, .banner, .host-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(231, 193, 90, .22);
}
.thresholds { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.thresholds span, .continue {
    border: 1px solid rgba(231, 193, 90, .35);
    border-radius: 999px;
    padding: 8px 12px;
    color: #f0d78c;
}
.continue {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border-radius: 16px;
    text-decoration: none;
    margin-bottom: 16px;
    color: inherit;
    background: rgba(231, 193, 90, .08);
}
.cards { display: grid; gap: 12px; }
.card, .host-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(231, 193, 90, .22);
}
body.is-admin .card { background: white; border-color: #eadfcd; }
a.host-card {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
}
a.host-card span { display: block; color: #d9d3c6; margin-top: 4px; }
.card h2, .card h3, .card p { margin: 0; }
.card p { color: #c9c1b2; }
body.is-admin .card p { color: #6d6256; }
details {
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
}
body.is-admin details { background: white; }
summary { cursor: pointer; font-weight: 700; }
details p { color: #d5d0c4; }
body.is-admin details p { color: #4e453c; }

.play {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 18px 18px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 22px;
    align-items: start;
}
.stake {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin: 8px 0 0;
}
.risk { margin: 0 0 8px; color: #d5d0c4; }
.jokers { display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.joker {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 2px solid #e7c15a;
    background: radial-gradient(circle at 40% 35%, #1d4f9c, #081226 72%);
    color: #f0d78c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.jk-name { font-weight: 800; font-size: .95rem; }
.jk-sub { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.joker:disabled { opacity: .55; }
.joker.is-used { filter: grayscale(1); opacity: .38; }
.plate {
    position: relative;
    padding: 26px 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 42, 84, .94), rgba(8, 18, 40, .94));
    border: 1px solid rgba(231, 193, 90, .45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
#g-question {
    font-size: clamp(1.45rem, 2.5vw, 2.15rem);
    line-height: 1.25;
    margin: 0;
    overflow-wrap: anywhere;
}
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.answer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 16px;
    border: 0;
    border-radius: 14px;
    text-align: left;
    color: white;
    background: linear-gradient(180deg, #1a4e9a 0%, #0d326e 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .22);
}
.answer .letter {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, .25);
    color: #f0d78c;
    font-weight: 800;
}
.answer .label { overflow-wrap: anywhere; }
.answer:hover:not(:disabled) { filter: brightness(1.08); }
.answer:focus-visible, .joker:focus-visible, .primary:focus-visible, .ghost:focus-visible {
    outline: 2px solid #e7c15a;
    outline-offset: 3px;
}
.answer.is-selected { background: linear-gradient(180deg, #f0a03a, #c56a12); color: #1c1206; }
.answer.is-selected .letter { color: #1c1206; background: rgba(255, 255, 255, .28); }
.answer.is-correct { background: linear-gradient(180deg, #2fba6a, #147a3e); color: white; }
.answer.is-correct .letter { color: white; }
.answer.is-wrong { background: linear-gradient(180deg, #e25b5b, #9d2430); }
.answer.is-wrong .letter { color: white; }
.answer.is-hidden { opacity: 0; pointer-events: none; }
.answer.no-anim { transition: none; }
.answer { transition: opacity .35s ease, transform .35s ease, filter .2s ease; }
.answer.is-locked { animation: pulse .7s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.28); } }

.confirm, .walkrow { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.confirm { margin-top: 16px; }
.ladder-wrap {
    background: rgba(5, 10, 22, .72);
    border: 1px solid rgba(231, 193, 90, .28);
    border-radius: 16px;
    padding: 12px;
}
.ladder-title { margin: 0 0 8px; color: #e7c15a; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
#g-ladder { display: flex; flex-direction: column; gap: 3px; }
.rung {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 7px;
    font-variant-numeric: tabular-nums;
    font-size: .84rem;
    color: #d5deee;
}
.rung.is-safe { color: #f0d78c; font-weight: 700; }
.rung.is-passed { opacity: .42; }
.rung.is-current { background: linear-gradient(90deg, #c96a12, #e7a23a); color: #1a1206; font-weight: 800; opacity: 1; }
.rung.is-failed { color: #ffb4b4; text-decoration: line-through; }
.rung.is-bank { box-shadow: inset 0 0 0 1px #e7c15a; opacity: 1; }

.lifeline-form, .hint, .audience {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(246, 231, 173, .08);
    border: 1px solid rgba(231, 193, 90, .35);
}
.form-help { margin-top: 0; color: #d9d3c6; }
textarea, input[type="text"], input[type="number"], input[type="password"] {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(231, 193, 90, .4);
    background: #0c1830;
    color: white;
}
body.is-admin textarea,
body.is-admin input[type="text"],
body.is-admin input[type="number"],
body.is-admin input[type="password"] {
    background: white;
    color: #241c16;
    border-color: #ddcbb3;
}
.stack { display: grid; gap: 6px; margin: 12px 0; font-weight: 700; }
.vote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.vote { display: grid; gap: 4px; font-weight: 800; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 24px 1fr 48px; gap: 8px; align-items: center; }
.bar-track { height: 12px; background: rgba(255, 255, 255, .12); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e7c15a, #f0a03a); }
.toast {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 60;
    max-width: min(520px, calc(100% - 24px));
    padding: 12px 16px;
    border-radius: 999px;
    background: #f6e7ad;
    color: #2a2108;
    font-weight: 800;
    text-align: center;
}
.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 14, .72);
}
.modal-card, .gate-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 20px;
    text-align: center;
    background: linear-gradient(180deg, #16315c, #0b1730);
    border: 1px solid rgba(231, 193, 90, .5);
}
.modal-card.is-win { box-shadow: 0 0 80px rgba(231, 193, 90, .28); }
.modal-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.modal-actions form { margin: 0; }
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.confetti i {
    position: absolute;
    top: -16px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: fall 2.8s linear infinite;
}
@keyframes fall { to { transform: translateY(105vh) rotate(200deg); opacity: .35; } }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: left;
}
.gate-card .primary { align-self: flex-start; }
.gate-card .textish { align-self: flex-start; }
.gate-card h1 { font-size: 2.2rem; }
.host-shell { max-width: 680px; margin: 0 auto; padding: 12px 16px 48px; }
.host-flag {
    display: inline-block;
    margin: 0 0 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #8d2418;
    color: white;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.secret {
    margin: 12px 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f6e7ad;
    color: #2a2108;
}
.secret .kicker { color: #7a5a16; }
#h-correct-line { margin: 0; font-family: Fraunces, Georgia, serif; font-size: clamp(1.4rem, 4vw, 2rem); }
.host-question h1 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.host-answer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
}
.host-answer.is-key { background: #f6e7ad; color: #2a2108; font-weight: 800; }
.host-answer.is-out { opacity: .55; }
.host-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 18px; }
.host-status p { margin: 4px 0; }

.section-head, .row-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-head { margin-top: 36px; }
.prize-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 16px; }
.prize {
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    background: white;
    border: 1px solid #eadfcd;
    font-size: .85rem;
}
.prize.is-safe { border-color: #c4892d; background: #fff8ea; }
.currency { max-width: 140px; }
.qtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.qtab {
    width: 42px; height: 42px;
    border-radius: 10px;
    border: 1px solid #ddcbb3;
    background: white;
    color: #241c16;
    font-weight: 800;
}
.qtab.is-on { background: #241c16; color: #f4efe6; }
.qtab.is-done { box-shadow: inset 0 -3px 0 #2f8f4e; }
.qtab.is-gap { box-shadow: inset 0 -3px 0 #b4532a; }
.choice {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #eadfcd;
    background: white;
}
.choice:has(input[type="radio"]:checked) { border-color: #2f8f4e; background: #f3fbf6; }
.markcorrect { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 700; }
.savebar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 0;
    background: linear-gradient(180deg, rgba(244, 239, 230, 0), #f4efe6 28%);
}
.print-q { break-inside: avoid; margin: 16px 0; padding-bottom: 8px; border-bottom: 1px solid #eadfcd; }
.print-q ul { padding-left: 18px; }
.print-q .is-correct { font-weight: 800; }
.brandblock { text-align: center; }
.setname, .codepill { margin: 0; }
.codepill { color: #f0d78c; letter-spacing: .08em; }

@media (max-width: 900px) {
    .board { grid-template-columns: 1fr; }
    .ladder-wrap { order: -1; }
    #g-ladder { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .rung { min-width: 108px; flex: 0 0 auto; }
    .joker { width: 76px; height: 76px; }
    .prize-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .answers, .choice { grid-template-columns: 1fr; }
    .vote-grid { grid-template-columns: 1fr 1fr; }
    .card { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
@media print {
    .no-print, .site, .savebar, .row-actions { display: none !important; }
    body, body.is-admin { background: white !important; color: black !important; }
    .print-q .is-correct { outline: 1px solid black; }
}
