:root {
  color-scheme: dark;
  --page: #10110f;
  --page-raised: #171915;
  --surface: #1b1e19;
  --surface-2: #20231e;
  --surface-soft: rgba(255, 255, 255, .035);
  --line: rgba(231, 240, 218, .11);
  --line-strong: rgba(231, 240, 218, .22);
  --ink: #f1f1e9;
  --muted: #9a9f90;
  --faint: #686d62;
  --accent: #d5ff58;
  --accent-rgb: 213, 255, 88;
  --accent-ink: #11140b;
  --second: #ff68bd;
  --second-rgb: 255, 104, 189;
  --third: #75d2ff;
  --danger: #ff5e67;
  --radius: 14px;
  font-family: Inter, "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html[data-theme="glowstage"] { --accent: #ff76d8; --accent-rgb: 255, 118, 216; --second: #7ceaff; --second-rgb: 124, 234, 255; --third: #d5ff58; }
html[data-theme="dustline"] { --accent: #f0b469; --accent-rgb: 240, 180, 105; --second: #d85f51; --second-rgb: 216, 95, 81; --third: #d9ceaa; }
html[data-theme="sunforge"] { --accent: #ffd268; --accent-rgb: 255, 210, 104; --second: #79c9fa; --second-rgb: 121, 201, 250; --third: #ff8f71; }
html[data-theme="haunted"] { --accent: #c2ff66; --accent-rgb: 194, 255, 102; --second: #ad82ff; --second-rgb: 173, 130, 255; --third: #ff7a9a; }
html[data-theme="snowfall"] { --accent: #a8e7ff; --accent-rgb: 168, 231, 255; --second: #ff91c7; --second-rgb: 255, 145, 199; --third: #d3ffef; }
html[data-theme="tet-lanterns"] { --accent: #ffd564; --accent-rgb: 255, 213, 100; --second: #ff6874; --second-rgb: 255, 104, 116; --third: #83e0a6; }
html[data-theme="kawaii"] { --accent: #ff9fd8; --accent-rgb: 255, 159, 216; --second: #a9a1ff; --second-rgb: 169, 161, 255; --third: #b6f6d7; }
html[data-theme="aurora"] { --accent: #76f3c0; --accent-rgb: 118, 243, 192; --second: #8ea9ff; --second-rgb: 142, 169, 255; --third: #ff8fe5; }
html[data-theme="pixel-arcade"] { --accent: #c6ff00; --accent-rgb: 198, 255, 0; --second: #ff4fc8; --second-rgb: 255, 79, 200; --third: #54d7ff; }
html[data-theme="lofi"] { --accent: #edb68e; --accent-rgb: 237, 182, 142; --second: #e9a6c1; --second-rgb: 233, 166, 193; --third: #a1d0bc; }
html[data-theme="street-art"] { --accent: #ffdf35; --accent-rgb: 255, 223, 53; --second: #ff5ca7; --second-rgb: 255, 92, 167; --third: #6edfff; }
html[data-theme="glasswave"] { --accent: #82d8ff; --accent-rgb: 130, 216, 255; --second: #a28cff; --second-rgb: 162, 140, 255; --third: #9effd3; }
html[data-theme="summer-fest"] { --accent: #ffb25e; --accent-rgb: 255, 178, 94; --second: #ff70bb; --second-rgb: 255, 112, 187; --third: #68e3dc; }
html[data-theme="monochrome"] { --accent: #f4f0e6; --accent-rgb: 244, 240, 230; --second: #a9a9a9; --second-rgb: 169, 169, 169; --third: #d2d2d2; }
html[data-theme="bestie-pop"] { --accent: #ff8eb7; --accent-rgb: 255, 142, 183; --second: #9d8cff; --second-rgb: 157, 140, 255; --third: #ffc979; }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--page); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: -1; width: 34rem; height: 34rem; border-radius: 50%; filter: blur(120px); opacity: .12; pointer-events: none; }
.ambient--one { top: -24rem; left: 3%; background: var(--accent); }
.ambient--two { top: 22rem; right: -28rem; background: var(--second); opacity: .09; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 72px; max-width: 1440px; margin: 0 auto; padding: 0 48px; border-bottom: 1px solid rgba(255,255,255,.055); }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 850; letter-spacing: .105em; }
.wordmark-slash { padding: 0 2px; color: var(--accent); }
.wordmark-mark { display: grid; width: 24px; height: 24px; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; transform: rotate(-8deg); }
.wordmark-mark i { display: block; border: 1.5px solid var(--accent); border-radius: 3px; }
.wordmark-mark i:nth-child(2) { background: var(--accent); }
.wordmark-mark i:nth-child(3) { border-color: var(--second); background: var(--second); }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; color: #bdc3b5; font-size: 10px; letter-spacing: .14em; font-weight: 750; }
.live-dot, .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .7); }
.style-open { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); color: var(--ink); font-size: 12px; font-weight: 680; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.style-open:hover { border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .07); transform: translateY(-1px); }
.style-spark { color: var(--accent); font-size: 16px; }

.home-view { width: min(1220px, calc(100% - 80px)); margin: 0 auto; }
.hero-section { position: relative; display: grid; min-height: 560px; grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr); align-items: center; padding: 48px 24px 55px; border-bottom: 1px solid var(--line); }
.hero-copy { position: relative; z-index: 1; max-width: 590px; padding: 18px 0 34px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 20px; color: var(--accent); font-size: 10px; letter-spacing: .17em; font-weight: 800; }
.eyebrow-line { display: inline-block; width: 22px; height: 1px; background: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
.hero-copy h1 { margin: 0; font-size: clamp(46px, 6.1vw, 82px); line-height: .98; letter-spacing: -.075em; font-weight: 800; }
.hero-copy h1 span { color: var(--accent); }
.hero-copy h1 sup { display: inline-block; margin-left: 9px; color: var(--second); font-size: .25em; vertical-align: top; transform: translateY(5px); }
.hero-lede { max-width: 445px; margin: 22px 0 27px; color: #a8ad9e; font-size: 15px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 48px; padding: 0 17px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 780; cursor: pointer; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-2px); }
.button--bright { background: var(--accent); color: var(--accent-ink); box-shadow: 0 7px 30px rgba(var(--accent-rgb), .13); }
.button--bright:hover { box-shadow: 0 9px 34px rgba(var(--accent-rgb), .25); }
.button-arrow { font-size: 18px; line-height: 1; }
.button--outline { border-color: rgba(255,255,255,.18); background: transparent; color: var(--ink); }
.button--outline:hover { border-color: rgba(var(--second-rgb), .7); background: rgba(var(--second-rgb), .07); }
.duo-glyph { color: var(--second); font-size: 14px; letter-spacing: -5px; padding-right: 4px; }
.hero-footnote { display: flex; align-items: center; gap: 8px; margin-top: 25px; color: var(--faint); font-size: 10px; letter-spacing: .015em; }
.tiny-spark { color: var(--second); font-size: 13px; }

.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 455px; isolation: isolate; }
.art-orbit { position: absolute; z-index: -1; width: 420px; height: 420px; border: 1px solid rgba(var(--accent-rgb), .12); border-radius: 50%; transform: rotate(-24deg) scaleY(.63); }
.art-orbit--inner { width: 354px; height: 354px; border-color: rgba(var(--second-rgb), .18); transform: rotate(33deg) scaleY(.67); }
.hero-board { position: relative; display: grid; width: min(350px, 78vw); aspect-ratio: 1; grid-template-columns: repeat(9,1fr); overflow: hidden; border: 1px solid rgba(233,240,220,.25); border-radius: 8px; background: #191c18; box-shadow: 0 32px 90px rgba(0,0,0,.42), 0 0 70px rgba(var(--accent-rgb), .08); transform: rotate(5deg); }
.hero-cell { display: grid; place-items: center; border-right: 1px solid rgba(224,231,211,.10); border-bottom: 1px solid rgba(224,231,211,.10); color: #777d6d; font-size: clamp(11px, 1.6vw, 18px); font-weight: 700; }
.hero-cell:nth-child(9n+3), .hero-cell:nth-child(9n+6) { border-right-color: rgba(224,231,211,.25); }
.hero-cell:nth-child(n+19):nth-child(-n+27), .hero-cell:nth-child(n+46):nth-child(-n+54) { border-bottom-color: rgba(224,231,211,.25); }
.hero-cell--pink { color: var(--second); text-shadow: 0 0 14px rgba(var(--second-rgb),.65); }
.hero-cell--lime { color: var(--accent); text-shadow: 0 0 14px rgba(var(--accent-rgb),.65); }
.art-sticker { position: absolute; z-index: 1; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); background: #252820; box-shadow: 0 8px 28px rgba(0,0,0,.3); color: var(--ink); font-weight: 800; letter-spacing: .1em; }
.art-sticker--top { top: 41px; right: 53px; width: 63px; height: 62px; border-radius: 50%; color: var(--accent); font-size: 9px; line-height: 1.3; transform: rotate(10deg); }
.art-sticker--top b { color: var(--ink); }
.art-sticker--side { bottom: 43px; left: 24px; display: flex; gap: 8px; padding: 9px 12px; border-radius: 4px; font-size: 8px; line-height: 1.25; transform: rotate(-7deg); }
.art-sticker--side span { color: var(--second); font-size: 16px; }
.cursor-tag { position: absolute; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 4px 8px 8px 8px; font-size: 9px; font-weight: 850; letter-spacing: .08em; box-shadow: 0 5px 18px rgba(0,0,0,.35); }
.cursor-tag span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cursor-tag--one { top: 31%; left: 8%; background: var(--second); color: #171014; transform: rotate(-4deg); }
.cursor-tag--two { right: 6%; bottom: 25%; background: var(--accent); color: #16180e; transform: rotate(4deg); }
.art-caption { position: absolute; top: 36%; right: 0; color: rgba(230,239,216,.33); font-size: 8px; line-height: 1.45; letter-spacing: .16em; transform: rotate(90deg) translateX(50%); transform-origin: right center; }

.play-section, .style-section { padding: 42px 0 48px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading h2 { margin: 0; font-size: clamp(23px, 3vw, 34px); line-height: 1.08; letter-spacing: -.05em; }
.streak-mini { display: flex; align-items: center; gap: 11px; min-width: 191px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.streak-flame { color: var(--second); font-size: 21px; }
.streak-mini > span:nth-child(2), .streak-mini > span:last-child { display: grid; gap: 2px; }
.streak-mini b { font-size: 15px; line-height: 1; }
.streak-mini small { color: var(--muted); font-size: 9px; }
.streak-divider { width: 1px; height: 26px; margin: 0 3px; background: var(--line-strong); }
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.setup-card, .room-card { min-width: 0; padding: 19px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.card-topline { display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }
.card-index { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(var(--accent-rgb), .27); border-radius: 6px; color: var(--accent); font-size: 9px; font-weight: 850; }
.card-index--pink { border-color: rgba(var(--second-rgb), .28); color: var(--second); }
.card-kicker { color: #b5b9ad; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.card-decoration { margin-left: auto; color: rgba(var(--accent-rgb), .45); font-size: 20px; }
.card-decoration--pink { color: rgba(var(--second-rgb), .6); font-size: 13px; letter-spacing: -5px; padding-right: 3px; }
.difficulty-picker { display: grid; gap: 7px; }
.difficulty-option { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; background: rgba(255,255,255,.025); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.difficulty-option:hover { background: rgba(255,255,255,.05); }
.difficulty-option.is-active { border-color: rgba(var(--accent-rgb),.35); background: rgba(var(--accent-rgb),.055); }
.difficulty-option > span:nth-child(2) { display: grid; gap: 4px; }
.difficulty-option b { font-size: 11px; font-weight: 760; }
.difficulty-option small { color: var(--muted); font-size: 9px; }
.difficulty-dot { width: 7px; height: 7px; border: 1px solid var(--accent); border-radius: 50%; }
.difficulty-dot--hard { border-color: #ffb85b; }
.difficulty-dot--expert { border-color: var(--second); }
.difficulty-mark { color: #696e63; font-size: 9px; font-weight: 750; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.text-field { width: 100%; height: 39px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(8,9,8,.28); color: var(--ink); font-size: 12px; }
.text-field::placeholder { color: #676c61; }
.text-field:focus { border-color: rgba(var(--accent-rgb),.65); outline: none; }
.daily-card { display: flex; width: 100%; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 11px; border: 1px solid rgba(var(--second-rgb),.18); border-radius: 8px; background: rgba(var(--second-rgb),.045); text-align: left; cursor: pointer; }
.daily-card:hover { border-color: rgba(var(--second-rgb),.46); background: rgba(var(--second-rgb),.08); }
.daily-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: rgba(var(--second-rgb),.13); color: var(--second); font-size: 18px; }
.daily-card > span:nth-child(2) { display: grid; gap: 3px; }
.daily-card b { font-size: 10px; }
.daily-card small { color: var(--muted); font-size: 9px; }
.daily-arrow { margin-left: auto; color: var(--second); font-size: 16px; }
.join-divider { display: flex; align-items: center; gap: 8px; margin: 13px 0 10px; }
.join-divider span { height: 1px; flex: 1; background: var(--line); }
.join-divider small { color: #73786e; font-size: 8px; letter-spacing: .12em; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.room-code-field { min-width: 0; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.button--pink { min-height: 39px; gap: 11px; padding: 0 12px; background: var(--second); color: #1a1016; font-size: 10px; }
.button--pink:hover { background: #ff86ca; }
.form-message { min-height: 14px; margin: 6px 0 0; color: var(--danger); font-size: 10px; }
.form-message.is-success { color: var(--accent); }

.style-section { padding-bottom: 45px; }
.section-heading--styles { margin-bottom: 18px; }
.text-button { padding: 7px 0; border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--accent); }
.text-button span { margin-left: 4px; color: var(--accent); }
.theme-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #1b1d19; cursor: pointer; transition: transform .18s, border-color .18s; }
.theme-card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb),.4); }
.theme-preview { position: relative; display: flex; height: 106px; align-items: center; justify-content: center; overflow: hidden; background: var(--preview-bg, #20241e); }
.theme-preview::before { position: absolute; width: 140px; height: 140px; border: 1px solid var(--preview-ink, var(--accent)); border-radius: 50%; opacity: .14; content: ""; }
.theme-preview::after { position: absolute; right: -8px; bottom: -20px; width: 83px; height: 83px; border: 1px solid var(--preview-hot, var(--second)); border-radius: 50%; opacity: .25; content: ""; }
.preview-grid { position: relative; z-index: 1; display: grid; width: 67px; height: 67px; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); border: 1px solid rgba(255,255,255,.35); transform: rotate(-6deg); }
.preview-grid span { display: grid; place-items: center; border-right: 1px solid rgba(255,255,255,.18); border-bottom: 1px solid rgba(255,255,255,.18); color: var(--preview-ink, var(--accent)); font-size: 9px; font-weight: 800; }
.preview-grid span:nth-child(2n) { color: var(--preview-hot, var(--second)); }
.preview-spark { position: absolute; z-index: 2; top: 20px; right: 24%; color: var(--preview-hot, var(--second)); font-size: 13px; }
.theme-copy { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 10px 11px; }
.theme-copy > span:first-child { display: grid; gap: 3px; min-width: 0; }
.theme-copy b { overflow: hidden; color: #e5e7df; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.theme-copy small { color: var(--muted); font-size: 8px; }
.theme-open-mark { color: #74796d; font-size: 14px; }
.theme-preview--midnight { --preview-bg: radial-gradient(circle at 50% 30%, #39433a, #181b17 65%); --preview-ink: #d5ff58; --preview-hot: #ff68bd; }
.theme-preview--glowstage { --preview-bg: radial-gradient(circle at 70% 20%, #552d54, #211726 67%); --preview-ink: #ff76d8; --preview-hot: #7ceaff; }
.theme-preview--dustline { --preview-bg: linear-gradient(135deg,#30251a,#171817 76%); --preview-ink: #f0b469; --preview-hot: #d85f51; }
.theme-preview--sunforge { --preview-bg: radial-gradient(circle at 50% 25%,#59431e,#1b1a16 72%); --preview-ink: #ffd268; --preview-hot: #79c9fa; }
.theme-preview--haunted { --preview-bg: radial-gradient(circle at 70% 20%,#323041,#191a21 70%); --preview-ink: #c2ff66; --preview-hot: #ad82ff; }
.theme-preview--snowfall { --preview-bg: radial-gradient(circle at 50% 20%,#304050,#171b21 68%); --preview-ink: #a8e7ff; --preview-hot: #ff91c7; }
.theme-preview--tet-lanterns { --preview-bg: radial-gradient(circle at 50% 30%,#552d29,#211817 67%); --preview-ink: #ffd564; --preview-hot: #ff6874; }
.theme-preview--kawaii { --preview-bg: linear-gradient(135deg,#3c293c,#201d2a); --preview-ink: #ff9fd8; --preview-hot: #a9a1ff; }
.theme-preview--aurora { --preview-bg: radial-gradient(ellipse at 50% 30%,#29453b,#171b1b 69%); --preview-ink: #76f3c0; --preview-hot: #8ea9ff; }
.theme-preview--pixel-arcade { --preview-bg: repeating-linear-gradient(0deg,#20231c 0 5px,#26291f 5px 6px); --preview-ink: #c6ff00; --preview-hot: #ff4fc8; }
.theme-preview--lofi { --preview-bg: linear-gradient(135deg,#30271f,#191a19); --preview-ink: #edb68e; --preview-hot: #e9a6c1; }
.theme-preview--street-art { --preview-bg: radial-gradient(circle at 35% 70%,#3e2a28,#191a18 67%); --preview-ink: #ffdf35; --preview-hot: #ff5ca7; }
.theme-preview--glasswave { --preview-bg: linear-gradient(135deg,#21303d,#1b1b29); --preview-ink: #82d8ff; --preview-hot: #a28cff; }
.theme-preview--summer-fest { --preview-bg: radial-gradient(circle at 65% 25%,#503120,#1d1c1a 70%); --preview-ink: #ffb25e; --preview-hot: #ff70bb; }
.theme-preview--monochrome { --preview-bg: linear-gradient(135deg,#393a38,#1b1c1b); --preview-ink: #f4f0e6; --preview-hot: #a9a9a9; }
.theme-preview--bestie-pop { --preview-bg: linear-gradient(135deg,#422b41,#201d2a); --preview-ink: #ff8eb7; --preview-hot: #9d8cff; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 21px 1px 27px; color: #72776b; font-size: 9px; letter-spacing: .06em; }
.footer-dot { padding: 0 5px; color: var(--second); }
.site-footer span:last-child { color: #797d74; letter-spacing: 0; }

/* Game screen */
.game-view { width: min(1390px, calc(100% - 70px)); margin: 0 auto; padding-bottom: 34px; }
.game-topline { display: flex; height: 68px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.back-button, .copy-button { display: inline-flex; align-items: center; gap: 9px; border: 0; background: none; color: #9ca195; font-size: 10px; cursor: pointer; }
.back-button:hover, .copy-button:hover { color: var(--ink); }
.back-button span:first-child { font-size: 18px; }
.room-meta { display: flex; align-items: center; gap: 10px; }
.room-mode-chip { padding: 5px 7px; border: 1px solid rgba(var(--second-rgb),.25); border-radius: 4px; background: rgba(var(--second-rgb),.07); color: var(--second); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.room-code-label { color: #81867b; font-size: 8px; letter-spacing: .12em; }
.room-code-label b { margin-left: 5px; color: var(--ink); font-size: 11px; letter-spacing: .17em; }
.copy-button { padding: 6px; color: var(--accent); font-size: 17px; }
.game-style-button { font-size: 10px; }
.game-style-button span:first-child { color: var(--accent); }
.match-stats { display: grid; grid-template-columns: 1fr 1fr 1.2fr 1fr; align-items: center; max-width: 660px; margin: 21px auto 20px; padding: 0 22px; }
.match-stat { display: grid; gap: 4px; justify-items: center; }
.stat-label { color: #84897e; font-size: 8px; font-weight: 760; letter-spacing: .13em; }
.match-stat b { font-size: 18px; font-weight: 770; }
.match-stat--record b { color: var(--accent); }
.match-stat--timer b { font-variant-numeric: tabular-nums; font-size: 16px; }
.heart-counter { display: flex; justify-content: center; gap: 8px; }
.heart { color: #3b2428; font-size: 26px; line-height: 1; transition: color .25s, transform .25s, text-shadow .25s; }
.heart--alive { color: #ff5e67; text-shadow: 0 0 15px rgba(255,94,103,.2); }
.heart.is-lost { animation: heart-break .48s ease both; }
@keyframes heart-break { 20% { transform: scale(1.25) rotate(-12deg); } 100% { color: #382326; transform: scale(.55) rotate(18deg); opacity: .45; text-shadow: none; } }

.game-layout { display: grid; grid-template-columns: minmax(195px, .68fr) minmax(400px, 1.4fr) minmax(205px, .72fr); align-items: start; gap: clamp(14px, 2.1vw, 30px); }
.team-rail, .duo-rail { min-width: 0; padding: 17px 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.022); }
.rail-label { display: flex; align-items: center; gap: 7px; color: #93988c; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.players-list { display: grid; gap: 9px; margin-top: 16px; }
.player-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 8px; border: 1px solid transparent; border-radius: 8px; background: rgba(255,255,255,.027); }
.player-card--self { border-color: rgba(var(--accent-rgb),.25); background: rgba(var(--accent-rgb),.045); }
.player-avatar { position: relative; display: grid; flex: 0 0 31px; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: rgba(var(--accent-rgb),.15); color: var(--accent); font-size: 12px; font-weight: 850; }
.player-card--peer .player-avatar { background: rgba(var(--second-rgb),.14); color: var(--second); }
.player-avatar::after { position: absolute; right: -2px; bottom: -2px; width: 7px; height: 7px; border: 1px solid var(--page-raised); border-radius: 50%; background: #72776b; content: ""; }
.player-card.is-online .player-avatar::after { background: var(--accent); box-shadow: 0 0 7px rgba(var(--accent-rgb),.6); }
.player-info { display: grid; min-width: 0; gap: 3px; }
.player-info b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.player-info small { color: var(--muted); font-size: 8px; }
.player-player-mark { margin-left: auto; color: var(--accent); font-size: 10px; }
.rail-divider { height: 1px; margin: 15px 0; background: var(--line); }
.difficulty-summary, .rail-best { display: flex; align-items: center; gap: 9px; }
.summary-icon, .best-star { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; background: rgba(var(--accent-rgb),.09); color: var(--accent); font-size: 13px; }
.difficulty-summary > span:last-child, .rail-best > span:last-child { display: grid; gap: 3px; }
.difficulty-summary small, .rail-best small { color: #81867a; font-size: 7px; letter-spacing: .1em; }
.difficulty-summary b, .rail-best b { color: #dadcd4; font-size: 10px; }
.daily-badge { margin-top: 12px; padding: 8px; border: 1px solid rgba(var(--second-rgb),.22); border-radius: 6px; color: var(--second); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.daily-badge b { float: right; color: #a9a497; font-weight: 600; }
.team-quote { position: relative; margin: 20px 0; padding: 12px 10px 11px; border-radius: 8px; background: rgba(var(--second-rgb),.055); }
.quote-mark { position: absolute; top: 2px; left: 8px; color: var(--second); font-family: Georgia,serif; font-size: 25px; line-height: 1; opacity: .72; }
.team-quote p { margin: 13px 0 10px; color: #c5c7be; font-size: 10px; line-height: 1.55; }
.quote-credit { color: var(--second); font-size: 7px; font-weight: 820; letter-spacing: .1em; }
.rail-best { padding: 10px 0 1px; }
.best-star { background: rgba(255,210,104,.1); color: #ffd268; }

.board-column { min-width: 0; }
.board-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 9px; }
.board-heading > div { display: grid; gap: 5px; }
.board-overline { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .17em; }
.selected-hint { color: #92978c; font-size: 9px; }
.board-mini-mark { color: #70766a; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.board-mini-mark span { padding: 0 2px; color: var(--second); }
.waiting-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 11px; border: 1px solid rgba(var(--second-rgb),.3); border-radius: 8px; background: rgba(var(--second-rgb),.07); }
.waiting-orbit { color: var(--second); font-size: 21px; animation: orbit 5s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.waiting-banner > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.waiting-banner b { font-size: 10px; }
.waiting-banner small { color: var(--muted); font-size: 8px; }
.waiting-copy { border: 0; background: none; color: var(--second); font-size: 9px; font-weight: 800; cursor: pointer; }
.sudoku-board { display: grid; width: 100%; aspect-ratio: 1; grid-template-columns: repeat(9,minmax(0,1fr)); grid-template-rows: repeat(9,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid rgba(var(--accent-rgb),.28); border-radius: 5px; background: #42463d; box-shadow: 0 14px 36px rgba(0,0,0,.17), 0 0 30px rgba(var(--accent-rgb),.035); }
.cell { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; padding: 0; border: 0; border-radius: 0; background: #171a16; color: var(--accent); font-size: clamp(13px, 2.35vw, 23px); font-weight: 660; cursor: pointer; transition: background .12s, color .12s; }
.cell:nth-child(9n+3), .cell:nth-child(9n+6) { border-right: 2px solid #62675b; }
.cell:nth-child(n+19):nth-child(-n+27), .cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid #62675b; }
.cell.is-fixed { color: #e4e4da; font-weight: 750; }
.cell.is-peer-entry { color: var(--second); }
.cell.is-self-entry { color: var(--accent); }
.cell.is-related { background: #20251c; }
.cell.is-same-number { background: rgba(var(--accent-rgb),.10); }
.cell.is-selected { z-index: 1; background: rgba(var(--accent-rgb),.18); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.cell.is-conflict { background: rgba(255,94,103,.2); color: #ff8e94; }
.cell.is-last-error { animation: wrong-cell .65s ease; }
@keyframes wrong-cell { 25%,75% { background: rgba(255,74,88,.38); } }
.cell.is-cursor-self::after, .cell.is-cursor-peer::after { position: absolute; top: 1px; right: 2px; z-index: 2; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); content: ""; box-shadow: 0 0 7px rgba(var(--accent-rgb),.7); }
.cell.is-cursor-peer::after { background: var(--second); box-shadow: 0 0 7px rgba(var(--second-rgb),.7); }
.cell.is-ping { animation: ping-cell 1.1s ease-in-out 2; }
@keyframes ping-cell { 50% { background: rgba(var(--second-rgb),.27); box-shadow: inset 0 0 0 2px var(--second); } }
.cell-note-grid { display: grid; width: 100%; height: 100%; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); align-items: center; justify-items: center; color: #a8aca1; font-size: clamp(5px, .88vw, 9px); font-weight: 550; line-height: 1; }
.cell-note-grid span.is-candidate { color: var(--second); }
.hint-banner { display: flex; align-items: center; gap: 9px; margin-top: 9px; padding: 9px 10px; border: 1px solid rgba(var(--accent-rgb),.23); border-radius: 7px; background: rgba(var(--accent-rgb),.055); color: #cbd2bf; font-size: 9px; line-height: 1.45; }
.hint-bulb { color: var(--accent); font-size: 16px; }
.hint-banner > span:nth-child(2) { flex: 1; }
.hint-banner button { border: 0; background: none; color: var(--muted); font-size: 17px; cursor: pointer; }
.board-tools { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 12px 0 9px; }
.tool-button { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 51px; padding: 7px 3px 5px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: #a8ada0; font-size: 8px; cursor: pointer; }
.tool-button:hover { border-color: rgba(var(--accent-rgb),.35); color: var(--ink); }
.tool-button.is-active { border-color: rgba(var(--second-rgb),.5); background: rgba(var(--second-rgb),.08); color: var(--second); }
.tool-button--hint .tool-icon { color: var(--accent); }
.tool-icon { color: #aeb3a5; font-size: 17px; line-height: 1; }
.tool-button kbd { position: absolute; top: 3px; right: 4px; color: #6c7167; font-family: inherit; font-size: 7px; }
.number-pad { display: grid; grid-template-columns: repeat(9,1fr); gap: 5px; }
.number-button { display: grid; min-width: 0; min-height: 43px; place-items: center; border: 1px solid rgba(var(--accent-rgb),.16); border-radius: 7px; background: rgba(var(--accent-rgb),.055); color: var(--accent); font-size: 18px; font-weight: 700; cursor: pointer; transition: background .12s, transform .12s; }
.number-button:hover { background: rgba(var(--accent-rgb),.14); transform: translateY(-1px); }
.number-button.is-complete { opacity: .3; }
.number-button:disabled { cursor: default; }

.duo-rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; color: #a8ada0; font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.pulse-dot { background: #70e6a8; box-shadow: 0 0 10px rgba(112,230,168,.7); }
.duo-status { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; color: #b7bcb0; font-size: 9px; }
.duo-status-icon { color: var(--second); font-size: 17px; }
.duo-score { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 11px; }
.duo-score > span:first-child { display: grid; gap: 5px; }
.duo-score small { color: #84897e; font-size: 7px; letter-spacing: .1em; }
.duo-score b { font-size: 18px; }
.duo-score i { color: #7e8378; font-size: 10px; font-style: normal; font-weight: 500; }
.progress-ring { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid rgba(var(--accent-rgb),.45); border-radius: 50%; color: var(--accent); font-size: 8px; font-weight: 850; }
.progress-track { height: 4px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: 10px; background: var(--accent); box-shadow: 0 0 9px rgba(var(--accent-rgb),.5); transition: width .3s ease; }
.progress-track span[data-progress="10"] { width: 10%; }
.progress-track span[data-progress="20"] { width: 20%; }
.progress-track span[data-progress="30"] { width: 30%; }
.progress-track span[data-progress="40"] { width: 40%; }
.progress-track span[data-progress="50"] { width: 50%; }
.progress-track span[data-progress="60"] { width: 60%; }
.progress-track span[data-progress="70"] { width: 70%; }
.progress-track span[data-progress="80"] { width: 80%; }
.progress-track span[data-progress="90"] { width: 90%; }
.progress-track span[data-progress="100"] { width: 100%; }
.quick-pings { display: grid; gap: 5px; }
.quick-pings .rail-label { margin-bottom: 4px; }
.ping-button { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: rgba(255,255,255,.026); color: #b8bcb2; text-align: left; font-size: 8px; cursor: pointer; }
.ping-button:hover { border-color: rgba(var(--second-rgb),.25); background: rgba(var(--second-rgb),.06); }
.ping-button span:first-child { width: 16px; color: var(--second); text-align: center; font-size: 11px; }
.quick-reactions { display: flex; justify-content: space-between; gap: 5px; margin-top: 12px; }
.quick-reactions button { display: grid; flex: 1; place-items: center; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.025); font-size: 13px; cursor: pointer; transition: background .12s, transform .12s; }
.quick-reactions button:hover { transform: translateY(-2px); background: rgba(var(--accent-rgb),.09); }
.keyboard-hint { display: flex; gap: 7px; margin-top: 17px; color: #83887c; font-size: 8px; line-height: 1.5; }
.keyboard-hint b { color: #bfc3b9; }
.keyboard-icon { color: var(--accent); font-size: 17px; }

/* Style Studio */
.style-dialog { width: min(880px, calc(100% - 28px)); max-width: none; max-height: min(88vh, 880px); padding: 0; overflow: auto; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: #171915; color: var(--ink); box-shadow: 0 24px 100px rgba(0,0,0,.65); }
.style-dialog::backdrop { background: rgba(5,6,5,.76); backdrop-filter: blur(6px); }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.dialog-header .eyebrow { margin-bottom: 7px; font-size: 8px; }
.dialog-header h2 { margin: 0; font-size: 29px; letter-spacing: -.06em; }
.dialog-header h2 span { margin-left: 6px; color: var(--second); font-size: 14px; vertical-align: top; }
.dialog-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.dialog-close { flex: 0 0 31px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 20px; cursor: pointer; }
.dialog-close:hover { color: var(--ink); }
.studio-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; padding: 14px 26px; border-bottom: 1px solid var(--line); }
.theme-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #9ba093; font-size: 9px; cursor: pointer; }
.filter-chip.is-active { border-color: rgba(var(--accent-rgb),.34); background: rgba(var(--accent-rgb),.09); color: var(--accent); }
.personalize-row { display: flex; align-items: center; gap: 14px; }
.toggle-row { display: flex; align-items: center; gap: 7px; color: #adb1a7; font-size: 9px; cursor: pointer; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { position: relative; width: 27px; height: 15px; border: 1px solid #555b50; border-radius: 9px; background: #2c3029; transition: background .15s; }
.toggle-track::after { position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #90968a; content: ""; transition: transform .15s, background .15s; }
.toggle-row input:checked + .toggle-track { border-color: rgba(var(--accent-rgb),.48); background: rgba(var(--accent-rgb),.25); }
.toggle-row input:checked + .toggle-track::after { background: var(--accent); transform: translateX(11px); }
.toggle-row input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 18px 26px 23px; }
.theme-grid .theme-card { border-radius: 9px; }
.theme-grid .theme-preview { height: 88px; }
.theme-grid .theme-copy { padding: 9px; }
.theme-grid .theme-copy b { font-size: 9px; }
.theme-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(var(--accent-rgb),.22); }
.theme-card.is-selected .theme-open-mark { color: var(--accent); }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 26px; border-top: 1px solid var(--line); color: #858a7e; font-size: 8px; }
.dialog-footer b { color: var(--ink); }
.license-note { color: #73786d; text-align: right; }

/* Finish states */
.finish-overlay { position: fixed; z-index: 15; inset: 0; display: grid; place-items: center; padding: 18px; overflow: auto; background: rgba(6,7,6,.83); backdrop-filter: blur(8px); }
.finish-shape { position: fixed; width: 38vw; height: 38vw; border: 1px solid rgba(var(--accent-rgb),.16); border-radius: 50%; pointer-events: none; }
.finish-shape--one { animation: finish-orbit 14s linear infinite; }
.finish-shape--two { border-color: rgba(var(--second-rgb),.13); transform: rotate(38deg) scaleY(.57); animation: finish-orbit 18s linear infinite reverse; }
@keyframes finish-orbit { to { transform: rotate(360deg) scaleY(.7); } }
.finish-card { position: relative; width: min(490px,100%); padding: 32px 30px 25px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: linear-gradient(145deg,#1c2019,#151712 72%); box-shadow: 0 24px 90px rgba(0,0,0,.55); text-align: center; animation: finish-arrive .44s cubic-bezier(.2,.8,.2,1) both; }
@keyframes finish-arrive { from { opacity: 0; transform: translateY(17px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.finish-card--loss { border-color: rgba(255,94,103,.27); }
.finish-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.finish-confetti span { position: absolute; top: -16px; width: 5px; height: 10px; border-radius: 1px; background: var(--accent); animation: confetti-fall 2.8s linear infinite; }
.finish-confetti span:nth-child(6n+1) { left: 7%; animation-delay: -.4s; background: var(--second); }
.finish-confetti span:nth-child(6n+2) { left: 19%; animation-delay: -1.8s; }
.finish-confetti span:nth-child(6n+3) { left: 32%; animation-delay: -.9s; background: var(--third); }
.finish-confetti span:nth-child(6n+4) { left: 58%; animation-delay: -2.2s; background: var(--second); }
.finish-confetti span:nth-child(6n+5) { left: 76%; animation-delay: -1.1s; }
.finish-confetti span:nth-child(6n) { left: 91%; animation-delay: -.2s; background: var(--third); }
.finish-confetti span:nth-child(3n) { width: 3px; height: 7px; }
@keyframes confetti-fall { to { transform: translateY(390px) rotate(430deg); opacity: .1; } }
.finish-emblem { position: relative; display: grid; place-items: center; width: 59px; height: 59px; margin: 0 auto 16px; border: 1px solid rgba(var(--accent-rgb),.44); border-radius: 50%; background: rgba(var(--accent-rgb),.11); color: var(--accent); font-size: 25px; box-shadow: 0 0 42px rgba(var(--accent-rgb),.16); animation: emblem-pop .6s .12s cubic-bezier(.2,1.4,.5,1) both; }
.finish-card--loss .finish-emblem { border-color: rgba(255,94,103,.38); background: rgba(255,94,103,.09); color: #ff7b82; box-shadow: 0 0 38px rgba(255,94,103,.09); }
@keyframes emblem-pop { from { opacity: 0; transform: scale(.6) rotate(-18deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.finish-card .eyebrow { justify-content: center; margin-bottom: 9px; font-size: 8px; }
.finish-card h2 { position: relative; margin: 0; font-size: clamp(24px,5vw,34px); letter-spacing: -.055em; }
.finish-copy { position: relative; margin: 8px 0 20px; color: var(--muted); font-size: 11px; }
.mistake-review { position: relative; margin: -7px 0 12px; padding: 9px 10px; border: 1px solid rgba(255,94,103,.2); border-radius: 8px; background: rgba(255,94,103,.045); text-align: left; }
.mistake-review > span { color: #ff858b; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.mistake-review p { margin: 5px 0 0; color: #c7beb8; font-size: 8px; line-height: 1.55; }
.finish-results { position: relative; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 13px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.finish-results span { display: grid; gap: 5px; }
.finish-results span + span { border-left: 1px solid var(--line); }
.finish-results small { color: #858a7e; font-size: 7px; letter-spacing: .1em; }
.finish-results b { color: var(--accent); font-size: 13px; }
.finish-results span:nth-child(2) b { color: #ff7178; font-size: 11px; }
.finish-players { position: relative; display: flex; justify-content: center; gap: 7px; margin-bottom: 14px; }
.finish-player-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 20px; color: #c5c8bf; font-size: 8px; }
.finish-player-chip b { color: var(--accent); }
.finish-player-chip--peer b { color: var(--second); }
.finish-primary { position: relative; width: 100%; justify-content: center; }
.finish-secondary { position: relative; display: flex; justify-content: space-between; margin-top: 9px; }
.finish-secondary .text-button { font-size: 9px; }
.finish-overlay--loss .finish-confetti { display: none; }
.finish-overlay--loss .finish-shape { border-color: rgba(255,94,103,.13); }

.toast-region { position: fixed; right: 17px; bottom: 17px; z-index: 30; display: grid; gap: 7px; width: min(330px,calc(100vw - 34px)); pointer-events: none; }
.toast { padding: 11px 13px; border: 1px solid rgba(var(--accent-rgb),.25); border-radius: 8px; background: #20231e; color: #e3e5dc; font-size: 10px; line-height: 1.45; box-shadow: 0 7px 25px rgba(0,0,0,.35); animation: toast-in .2s ease both; }
.toast--error { border-color: rgba(255,94,103,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.reaction-float { position: fixed; z-index: 20; color: var(--second); font-size: 28px; pointer-events: none; animation: reaction-float 1.1s ease-out forwards; }
@keyframes reaction-float { from { opacity: 0; transform: translateY(14px) scale(.65); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-70px) scale(1.2) rotate(12deg); } }

html[data-theme="pixel-arcade"] .button, html[data-theme="pixel-arcade"] .setup-card, html[data-theme="pixel-arcade"] .room-card { border-radius: 3px; }
html[data-theme="haunted"] .ambient--two { opacity: .16; }
html[data-theme="tet-lanterns"] .hero-art::after { position: absolute; top: 10%; left: 14%; z-index: -1; color: rgba(var(--second-rgb),.45); font-size: 20px; content: "✦"; }
html[data-theme="lofi"] .hero-art { filter: saturate(.83); }
html[data-theme="monochrome"] .hero-board { filter: grayscale(1); }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

@media (max-width: 1030px) {
  .game-view { width: min(930px, calc(100% - 42px)); }
  .game-layout { grid-template-columns: 170px minmax(390px,1fr); gap: 16px; }
  .duo-rail { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.35fr 1fr 1.2fr; align-items: center; gap: 12px; padding: 12px 14px; }
  .duo-rail-head { margin: 0; }
  .duo-score { margin: 0; }
  .duo-rail > .rail-divider { display: none; }
  .quick-pings { grid-template-columns: repeat(3,1fr); }
  .quick-pings .rail-label { grid-column: 1/-1; }
  .ping-button { justify-content: center; padding: 0 5px; }
  .quick-reactions, .keyboard-hint { display: none; }
  .progress-track { display: none; }
  .duo-score .progress-ring { width: 34px; height: 34px; }
  .team-quote { margin: 17px 0; }
}

@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 18px; }
  .wordmark { gap: 8px; font-size: 12px; }
  .wordmark-mark { width: 21px; height: 21px; }
  .topbar-right { gap: 11px; }
  .live-pill { font-size: 0; }
  .live-dot { width: 8px; height: 8px; }
  .topbar-style { padding: 7px 9px; font-size: 9px; }
  .home-view { width: calc(100% - 36px); }
  .hero-section { min-height: 0; grid-template-columns: 1fr; padding: 41px 0 29px; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { font-size: clamp(49px, 12vw, 78px); }
  .hero-lede { max-width: 470px; margin: 16px 0 21px; font-size: 13px; }
  .hero-actions .button { min-height: 43px; }
  .hero-footnote { margin-top: 17px; font-size: 9px; }
  .hero-art { min-height: 333px; margin: 4px -7px 0; }
  .hero-board { width: min(270px,66vw); }
  .art-orbit { width: 330px; height: 330px; }
  .art-orbit--inner { width: 275px; height: 275px; }
  .art-sticker--top { top: 25px; right: 12%; }
  .art-sticker--side { bottom: 22px; left: 9%; }
  .cursor-tag--one { top: 29%; left: 0; }
  .cursor-tag--two { right: 0; bottom: 25%; }
  .art-caption { display: none; }
  .play-section, .style-section { padding: 29px 0 32px; }
  .section-heading { align-items: start; margin-bottom: 14px; }
  .section-heading h2 { font-size: 25px; }
  .streak-mini { min-width: 0; gap: 7px; padding: 8px; }
  .streak-flame { font-size: 16px; }
  .streak-mini b { font-size: 12px; }
  .streak-mini small { font-size: 7px; }
  .streak-divider { height: 22px; margin: 0 1px; }
  .play-grid { grid-template-columns: 1fr; gap: 10px; }
  .setup-card, .room-card { padding: 16px; }
  .theme-strip { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .theme-preview { height: 87px; }
  .site-footer { flex-direction: column; gap: 7px; padding-bottom: 22px; font-size: 8px; }
  .section-heading--styles .text-button { margin-top: 14px; white-space: nowrap; }

  .game-view { width: calc(100% - 24px); padding-bottom: 20px; }
  .game-topline { height: 54px; }
  .back-button { gap: 4px; font-size: 8px; }
  .back-button span:first-child { font-size: 16px; }
  .room-meta { gap: 5px; }
  .room-mode-chip { padding: 4px 5px; font-size: 7px; }
  .room-code-label { font-size: 7px; }
  .room-code-label b { margin-left: 2px; font-size: 9px; }
  .copy-button { padding: 4px; font-size: 14px; }
  .game-style-button { gap: 5px; padding: 6px 7px; font-size: 8px; }
  .match-stats { grid-template-columns: 1fr 1.1fr 1.45fr 1fr; max-width: 500px; margin: 14px auto 12px; padding: 0 3px; }
  .stat-label { font-size: 6px; }
  .match-stat b { font-size: 14px; }
  .match-stat--timer b { font-size: 12px; }
  .heart-counter { gap: 4px; }
  .heart { font-size: 21px; }
  .game-layout { display: flex; flex-direction: column; gap: 11px; }
  .board-column { order: 1; width: 100%; }
  .team-rail { order: 2; display: grid; width: 100%; grid-template-columns: 1fr auto; align-items: center; padding: 9px 10px; }
  .team-rail > .rail-label { grid-column: 1/-1; margin-bottom: 7px; }
  .players-list { display: flex; gap: 5px; margin: 0; }
  .player-card { gap: 6px; padding: 5px 6px; }
  .player-avatar { flex-basis: 25px; width: 25px; height: 25px; border-radius: 7px; font-size: 10px; }
  .player-info b { max-width: 60px; font-size: 8px; }
  .player-info small { font-size: 7px; }
  .player-player-mark { display: none; }
  .team-rail > .rail-divider, .difficulty-summary, .team-quote, .rail-best { display: none; }
  .daily-badge { grid-column: 1/-1; margin-top: 8px; }
  .duo-rail { order: 3; display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 7px 10px; padding: 10px; }
  .duo-rail-head { margin: 0; }
  .duo-status { min-height: 30px; font-size: 8px; }
  .duo-score { grid-column: 1; margin: 0; }
  .duo-score b { font-size: 14px; }
  .duo-score .progress-ring { width: 31px; height: 31px; font-size: 7px; }
  .quick-pings { grid-column: 1/-1; grid-template-columns: repeat(3,1fr); gap: 4px; }
  .quick-pings .rail-label { grid-column: 1/-1; font-size: 7px; }
  .ping-button { display: grid; justify-items: center; gap: 3px; min-height: 44px; font-size: 7px; }
  .ping-button span:first-child { font-size: 12px; }
  .quick-reactions { display: flex; grid-column: 1/-1; margin-top: 0; }
  .quick-reactions button { min-height: 27px; }
  .keyboard-hint { display: none; }
  .board-heading { margin-bottom: 7px; }
  .board-overline { font-size: 7px; }
  .selected-hint { font-size: 8px; }
  .cell { font-size: clamp(12px, 4.2vw, 22px); }
  .cell-note-grid { font-size: clamp(5px, 1.7vw, 9px); }
  .board-tools { margin: 8px 0 6px; gap: 4px; }
  .tool-button { min-height: 43px; grid-template-columns: auto auto; grid-template-rows: 1fr; align-content: center; justify-content: center; gap: 5px; font-size: 8px; }
  .tool-icon { font-size: 15px; }
  .tool-button kbd { display: none; }
  .number-pad { gap: 3px; }
  .number-button { min-height: 39px; border-radius: 5px; font-size: 16px; }
  .waiting-banner { gap: 7px; padding: 8px; }
  .waiting-banner b { font-size: 9px; }
  .waiting-banner small { font-size: 7px; }
  .waiting-copy { font-size: 8px; }
  .style-dialog { max-height: 92vh; }
  .dialog-header { padding: 19px 16px 14px; }
  .dialog-header h2 { font-size: 24px; }
  .studio-controls { padding: 11px 16px; }
  .theme-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 12px 16px 17px; }
  .theme-grid .theme-preview { height: 73px; }
  .dialog-footer { align-items: start; flex-direction: column; padding: 10px 16px; }
  .license-note { text-align: left; }
  .finish-card { padding: 26px 17px 18px; }
  .finish-results { padding: 10px 3px; }
  .finish-results small { font-size: 6px; }
  .finish-results b { font-size: 12px; }
  .finish-secondary { gap: 10px; }
  .finish-secondary .text-button { font-size: 8px; }
  .toast-region { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: min(310px,calc(100vw - 20px)); }
}

@media (max-width: 370px) {
  .topbar { padding: 0 11px; }
  .topbar-right { gap: 7px; }
  .topbar-style { padding: 6px; }
  .home-view { width: calc(100% - 24px); }
  .hero-copy h1 { font-size: 47px; }
  .hero-actions { gap: 7px; }
  .hero-actions .button { gap: 9px; padding: 0 10px; font-size: 10px; }
  .streak-mini { gap: 5px; }
  .streak-mini small { font-size: 6px; }
  .game-view { width: calc(100% - 16px); }
  .room-code-label { letter-spacing: .06em; }
  .room-code-label b { letter-spacing: .1em; }
  .game-style-button span:last-child { display: none; }
  .cell { font-size: 12px; }
  .number-button { min-height: 35px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
