:root {
    --bg: #121318;
    --surface: #1c1e26;
    --raised: #262933;
    --line: #373a46;
    --ink: #f5f4ee;
    --muted: #b5b7c3;
    --lime: #d6fb73;
    --coral: #ff997f;
    --cyan: #91e5ef;
    --paper: #f5f4ee;
    --radius: 20px;
    --shadow: 0 24px 60px #0005;
}
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 5; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
a { color: var(--lime); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 5px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-weight: 850; letter-spacing: -.045em; line-height: 1.08; }
h1 { font-size: clamp(2.5rem, 5vw, 4.75rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.75rem); }
h3 { font-size: 1.35rem; }
.app-width { width: min(1280px, calc(100% - 64px)); margin-inline: auto; }
.app-main { min-height: calc(100vh - 190px); padding-block: 48px 72px; }
.app-header { border-bottom: 1px solid var(--line); background: #121318ef; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); }
.app-nav { display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 850; font-size: 1.05rem; line-height: 1.1; letter-spacing: -.03em; }
.brand-mark { position: relative; width: 32px; height: 36px; display: block; border: 2px solid var(--ink); border-radius: 5px; transform: rotate(-12deg); }
.brand-mark::after { content: ""; position: absolute; inset: 3px -9px -5px 7px; background: var(--lime); border: 2px solid var(--bg); border-radius: 5px; transform: rotate(23deg); }
.brand small { display: block; color: var(--muted); font-size: .62rem; letter-spacing: .15em; margin-top: 5px; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links > a:not(.btn) { color: var(--muted); font-weight: 600; font-size: .9rem; }
.nav-links > a:hover, .nav-links > a[aria-current="page"] { color: var(--lime); }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 8px 14px; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 20; background: var(--lime); color: var(--bg); padding: 12px; }
.skip-link:focus { top: 12px; }
.app-footer { padding-block: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.eyebrow { color: var(--lime); font-size: .75rem; text-transform: uppercase; letter-spacing: .17em; font-weight: 800; margin-bottom: 16px; }
.muted, .lead { color: var(--muted); }
.lead { font-size: 1.08rem; max-width: 38rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 12px; padding: 13px 22px; font-weight: 750; line-height: 1.35; cursor: pointer; white-space: normal; }
.btn-primary, .btn-success { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.btn-primary:hover, .btn-success:hover { color: var(--bg); background: #e4ff9e; border-color: #e4ff9e; }
.btn-secondary, .btn-dark { background: var(--raised); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover, .btn-dark:hover { color: var(--ink); border-color: var(--muted); background: var(--surface); }
.btn-danger { color: var(--bg); background: var(--coral); }
.btn-warning { color: var(--bg); background: var(--cyan); }
.btn-lg { padding: 18px 28px; font-size: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary:disabled, .btn-success:disabled { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active,
.btn-success:focus, .btn-success:not(:disabled):not(.disabled):active { color: var(--bg); background: var(--lime); border-color: var(--lime); box-shadow: none; }
.btn-secondary:focus, .btn-dark:focus { box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; min-height: min(760px, calc(100dvh - 180px)); }
.hero h1 { font-size: clamp(3.5rem, 6.7vw, 6.6rem); line-height: .98; margin-bottom: 26px; letter-spacing: -.065em; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--lime); }
.hero .actions { margin-top: 32px; }
.hero-note { margin-top: 24px; font-size: .8rem; color: var(--muted); }
.hero-note span { color: var(--coral); }
.hero-art { position: relative; min-height: 510px; display: flex; align-items: center; justify-content: center; }
.orbit { position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 1px dashed #d6fb7333; }
.orbit::after { content: ""; position: absolute; inset: 45px; border: 1px solid #d6fb731a; border-radius: 50%; }
.hero-card { position: absolute; width: 245px; min-height: 330px; border-radius: 18px; padding: 25px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; font-weight: 800; font-size: 1.55rem; line-height: 1.25; letter-spacing: -.04em; }
.hero-card small { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.hero-card--back { background: var(--coral); color: var(--bg); transform: translate(-94px, -38px) rotate(-17deg); }
.hero-card--front { background: var(--paper); color: var(--bg); transform: translate(98px, 66px) rotate(12deg); }
.hero-card--prompt { background: var(--raised); border: 1px solid #626572; transform: translate(0, -20px) rotate(-4deg); }
.hero-card--prompt .blank { display: inline-block; width: 100%; height: 4px; background: var(--lime); margin-top: 20px; }
.art-sticker { position: absolute; right: 0; top: 22px; background: var(--lime); color: var(--bg); padding: 15px 20px; border-radius: 50%; font-weight: 850; font-size: .8rem; transform: rotate(12deg); line-height: 1.2; text-align: center; }
.art-caption { position: absolute; bottom: 4px; color: var(--cyan); font-size: .8rem; transform: rotate(-5deg); }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-block: 30px 90px; }
.feature-strip > div { padding: 26px; display: flex; gap: 16px; align-items: center; }
.feature-strip > div + div { border-left: 1px solid var(--line); }
.feature-strip--single { grid-template-columns: 1fr; margin-bottom: 0; }
.feature-strip strong { display: block; font-size: .9rem; }
.feature-strip p { margin: 0; font-size: .8rem; color: var(--muted); }
.feature-icon { color: var(--lime); font-size: 1.5rem; font-weight: 850; }
.section-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: end; margin-bottom: 30px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step, .panel, .deck-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.step-number { display: block; color: var(--coral); font-weight: 850; margin-bottom: 36px; font-size: .85rem; }
.step p { color: var(--muted); margin-bottom: 0; font-size: .95rem; }
.form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; max-width: 1040px; margin: 48px auto; }
.form-panel { padding: 36px; }
.form-group { margin-bottom: 24px; }
label { font-size: .85rem; font-weight: 750; margin-bottom: 10px; display: block; }
.form-control { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; min-height: 52px; padding: 12px 16px; width: 100%; }
.form-control:focus { color: var(--ink); background: var(--bg); border-color: var(--lime); box-shadow: none; }
.form-control::placeholder { color: #838695; }
select.form-control { height: auto; }
.form-hint { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.text-danger, .field-validation-error { color: #ffadad !important; font-size: .85rem; }
.validation-summary-valid { display: none; }
.notice { border: 1px solid #ff997f66; background: #ff997f12; padding: 16px 20px; border-radius: 12px; color: var(--coral); margin-bottom: 20px; }
.notice:empty { display: none; }
.room-code { font-family: "Cascadia Code", Consolas, monospace; font-size: clamp(2.5rem, 7vw, 4rem); letter-spacing: .18em; color: var(--lime); font-weight: 800; line-height: 1.2; margin-block: 20px; overflow-wrap: anywhere; }
.room-code-small { font-family: Consolas, monospace; color: var(--lime); letter-spacing: .12em; }
.deck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.deck-tile { color: var(--ink); display: flex; flex-direction: column; min-height: 260px; }
.deck-tile:hover { color: var(--ink); border-color: var(--lime); }
.deck-tile h2 { font-size: 1.8rem; margin-top: auto; }
.deck-tile span:last-child { color: var(--lime); font-size: .85rem; }
.deck-unavailable { color: var(--coral); font-size: .8rem; font-weight: 750; }
.deck-symbol { font-size: 2.5rem; color: var(--coral); margin-bottom: 30px; }
.card-grid, #responseCardsContainer, #selectedResponseCardsContainer { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; width: 100%; }
.card { float: none; margin: 0; width: auto; min-width: 0; min-height: 225px; height: auto; border-radius: 14px; border: 2px solid transparent; padding: 20px 18px; position: relative; display: flex; flex-direction: column; text-align: left; box-shadow: 0 6px 20px #0002; overflow-wrap: anywhere; }
.card::after { content: "CAH / ONLINE"; font-size: .55rem; font-weight: 850; letter-spacing: .16em; display: block; margin-top: auto; padding-top: 24px; opacity: .6; }
.card .text { padding: 0; margin: 0; font-weight: 800; font-size: 1.05rem; line-height: 1.3; letter-spacing: -.025em; }
.dark { color: var(--ink); background: #0c0d11; border-color: #505462; }
.light { color: var(--bg); background: var(--paper); }
.grey { color: var(--muted); background: var(--raised); }
button.card { cursor: pointer; }
.card[data-selected="true"] { background: var(--lime); color: var(--bg); border-color: var(--lime); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--lime); }
.card[data-order]::before { content: attr(data-order); position: absolute; right: 12px; bottom: 12px; width: 26px; height: 26px; background: var(--bg); color: var(--lime); border-radius: 50%; text-align: center; font-size: .85rem; font-weight: 800; line-height: 26px; }
.pick-label { display: block; color: var(--lime); font-size: .7rem; letter-spacing: .15em; margin-bottom: 18px; font-weight: 800; text-transform: uppercase; }
.game-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.game-heading h1 { font-size: 2rem; margin-bottom: 8px; }
.copy-code-button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin-left: 8px; font-size: .7rem; cursor: pointer; }
.connection-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; padding: 7px 12px; border-radius: 30px; border: 1px solid var(--line); color: var(--muted); }
.connection-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.connection-pill[data-connected="true"]::before { background: var(--lime); }
.table-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.game-stage { padding: 28px; border-radius: var(--radius); background: radial-gradient(ellipse at top right, #d6fb730b, transparent 70%), var(--surface); border: 1px solid var(--line); }
#promptCardContainer .card { min-height: 220px; max-width: none; padding: 28px; }
#promptCardContainer .text { font-size: clamp(1.4rem, 2.7vw, 2.1rem); max-width: 650px; }
.round-toolbar { display: flex; gap: 18px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 24px; }
#gameInfo { color: var(--muted); margin: 0; max-width: 500px; font-size: .9rem; }
.round-actions { display: flex; gap: 12px; align-items: center; }
#spinner { display: none; color: var(--lime); font-size: .8rem; }
.table-aside { display: grid; gap: 20px; }
.table-aside .panel { padding: 22px; }
.table { color: var(--ink); margin-bottom: 0; font-size: .85rem; }
.table td, .table th { border-color: var(--line); padding: 12px 4px; vertical-align: middle; }
.table thead th { border-top: 0; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.role-tag { font-size: .55rem; display: inline-block; color: var(--lime); margin-left: 7px; border: 1px solid var(--line); padding: 2px 4px; border-radius: 4px; }
.hand-section { margin-top: 32px; }
.nav-tabs { border-bottom: 1px solid var(--line); margin-bottom: 22px; gap: 24px; }
.nav-tabs .nav-link { border: 0; padding: 12px 0; color: var(--muted); font-weight: 750; border-bottom: 2px solid transparent; border-radius: 0; }
.nav-tabs .nav-link.active { color: var(--lime); background: transparent; border-color: var(--lime); }
.tab-content { width: 100%; }
.responseWrapper { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface); }
.winner-banner { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--lime); background: #d6fb730d; border-radius: 16px; }
.winner-banner h2 { color: var(--lime); margin: 0; font-size: 2rem; }
.empty-state { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: 14px; grid-column: 1 / -1; }
.chat { height: 240px; overflow-y: auto; padding: 0; margin-bottom: 14px; }
#messagesList { list-style: none; padding: 0; margin: 0; }
.chatMessage { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .8rem; overflow-wrap: anywhere; }
.userMessage { font-weight: 750; color: var(--cyan); }
.chatinput { display: flex; gap: 8px; }
.chatinput .form-control { min-width: 0; font-size: .85rem; }
.chatinput .btn { padding-inline: 14px; }
.modal-content { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--line); }
.close { color: var(--ink); text-shadow: none; opacity: 1; }
.practice-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }
.practice-top select { min-width: 220px; }
.practice-answer { padding: 28px; margin-top: 24px; border-radius: 16px; border: 1px solid var(--lime); background: #d6fb730a; font-size: 1.4rem; font-weight: 750; }
.practice-answer strong { color: var(--lime); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
    .btn, .card, .deck-tile { transition: transform .2s ease, box-shadow .2s ease; }
    .btn:not(:disabled):hover { transform: translateY(-2px); }
    button.card:hover { transform: translateY(-6px) rotate(-1deg); }
    .deck-tile:hover { transform: translateY(-5px); }
    .hero-copy, .hero-art, .feature-strip { animation: enter .65s both; }
    .hero-art { animation-delay: .1s; }
    .feature-strip { animation-delay: .2s; }
    .winner-banner { animation: enter .5s both; }
    @keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .fade { transition: none; } }
@media (max-width: 960px) {
    .app-width { width: calc(100% - 32px); }
    .app-main { padding-block: 30px 48px; }
    .app-nav { min-height: 72px; flex-wrap: wrap; padding-block: 14px; }
    .nav-toggle { display: block; }
    .nav-links { display: none; width: 100%; flex-wrap: wrap; gap: 22px; padding-bottom: 10px; }
    .nav-links[data-open="true"] { display: flex; }
    .hero { grid-template-columns: 1fr; gap: 20px; min-height: auto; }
    .hero h1 { font-size: clamp(3.4rem, 12vw, 5.5rem); }
    .hero-art { min-height: 440px; width: 100%; max-width: 460px; margin-inline: auto; overflow: hidden; }
    .hero-card { width: 190px; min-height: 280px; font-size: 1.2rem; padding: 20px; }
    .hero-card--back { transform: translate(-65px, -25px) rotate(-17deg); }
    .hero-card--front { transform: translate(60px, 60px) rotate(12deg); }
    .orbit { width: 300px; height: 300px; }
    .art-sticker { top: 4px; right: 4px; }
    .feature-strip, .steps, .deck-grid, .form-layout, .table-layout { grid-template-columns: 1fr; }
    .feature-strip { margin-block: 16px 48px; }
    .feature-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
    .form-layout { gap: 24px; margin-block: 12px; }
    .form-panel, .panel, .game-stage { padding: 22px; }
    .table-aside { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
    .card-grid, #responseCardsContainer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { padding: 16px; min-height: 200px; }
    .card .text { font-size: 1rem; }
    .practice-top select { min-width: 0; width: 100%; }
}
