/* Depth Chart. Built from design/ (Tiers, RevealStates, the 390x844 boards and RepDesktop).
   One dark look on purpose: the board is a stadium at night. Mobile first; desktop gets the
   wide score bug and the centered rep from RepDesktop. */
:root {
  --ground: #0B0F14;
  --panel: #141A22;
  --panel-deep: #0F141B;
  --line: #2B3542;
  --line-soft: #232C38;
  --line-faint: #1C232D;
  --text: #F4F6F9;
  --text-2: #C9D0DA;
  --muted: #9AA3B2;
  --dim: #5E6878;
  --accent: #FFC72C;
  --accent-hi: #FFD65C;
  --red: #FF3B3B;
  --red-soft: #FF6B6B;
  --red-deep: #1A0F12;
  --red-track: #3A1A1E;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --vh: 100dvh;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); }
body { font: 16px/1.4 var(--body); -webkit-text-size-adjust: 100%; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.app {
  position: relative; width: 100%; max-width: 430px; margin: 0 auto;
  height: var(--vh); overflow: hidden;
  display: flex; flex-direction: column; background: var(--ground);
}
.deco { position: absolute; left: 50%; top: 0; width: 390px; height: 844px; transform: translateX(-50%); pointer-events: none; }
.screen { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cap { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 600; text-transform: uppercase; }

/* chip: "The Daily Roster | Week 1" */
.chip { position: relative; display: flex; align-items: stretch; height: 36px; }
.chip > span { display: flex; align-items: center; font-family: var(--cond); letter-spacing: .1em; text-transform: uppercase; font-size: 16px; }
.chip .a { padding: 0 12px; background: var(--accent); color: var(--ground); font-weight: 800; }
.chip .b { padding: 0 14px; background: var(--panel); border: 1px solid var(--line); border-left: 0; color: var(--text); font-weight: 700; }
.chip.sm { height: 32px; }
.chip.sm > span { font-size: 14px; }
.chip.sm .a { padding: 0 10px; }
.chip.sm .b { padding: 0 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 60px;
  background: var(--accent); color: var(--ground); border: 0; border-radius: 6px;
  font-family: var(--cond); font-weight: 800; font-size: 24px; letter-spacing: .08em; text-transform: uppercase;
}
.btn:hover { background: var(--accent-hi); }
.btn:focus-visible { outline: 2px solid rgba(255, 199, 44, .45); outline-offset: 3px; }
.btn svg { flex: none; }

/* ---------- home ---------- */
.home { justify-content: space-between; padding: calc(64px + var(--top)) 24px calc(44px + var(--bottom)); }
.home .top { position: relative; display: flex; flex-direction: column; gap: 32px; margin-top: clamp(16px, 14.3vh, 120px); }
.brand { display: flex; align-items: center; gap: 16px; }
.bars { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bars i { display: block; height: 7px; }
.brand h1 { margin: 0; font: 800 60px/.9 var(--cond); letter-spacing: -.01em; text-transform: uppercase; }
.pitch { margin: 0; max-width: 300px; font-size: 19px; line-height: 1.35; font-weight: 500; color: var(--text-2); }
.pitch b { color: var(--text); font-weight: 700; }
.home .go { position: relative; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.home .go .btn { height: 64px; font-size: 26px; }
.link { background: none; border: 0; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; padding: 10px 16px; }

/* how to play sheet */
.scrim { position: absolute; inset: 0; background: rgba(11, 15, 20, .72); z-index: 5; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--panel);
  border-top: 2px solid var(--accent); border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(36px + var(--bottom)); display: flex; flex-direction: column; gap: 20px;
  max-height: 100%; overflow-y: auto; animation: rise .22s ease-out both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font: 800 32px/1 var(--cond); letter-spacing: .02em; text-transform: uppercase; }
.x { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 6px; background: var(--ground); border: 1px solid var(--line); color: var(--text); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--panel-deep); border: 1px solid var(--line-soft); border-radius: 6px; }
.steps .n { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--ground); font: 800 22px/1 var(--cond); border-radius: 4px; }
.steps .body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.steps .h { font: 700 20px/1.1 var(--cond); letter-spacing: .04em; text-transform: uppercase; }
.steps p { margin: 0; font-size: 15px; line-height: 1.4; color: var(--text-2); }
.steps p b { color: var(--red-soft); font-weight: 700; }
.steps .hrow { display: flex; align-items: center; gap: 10px; }
.legend { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; font: 700 13px/1.15 var(--cond); letter-spacing: .1em; text-transform: uppercase; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { display: block; height: 14px; }

/* ---------- score bug ---------- */
.bug { position: relative; z-index: 2; flex: none; display: flex; align-items: stretch; height: 64px; margin-top: max(12px, var(--top)); background: var(--panel); border-bottom: 2px solid var(--accent); }
.bug.red { border-bottom-color: var(--red); }
.bug .inner { display: flex; align-items: stretch; width: 100%; }
.bug .side { display: flex; flex-direction: column; justify-content: center; padding: 0 16px; min-width: 96px; }
.bug .side.r { align-items: flex-end; }
.bug .v { font: 800 30px/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--text); transition: color 300ms; }
.bug .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.segs { display: flex; gap: 5px; }
.segs i { display: block; width: 22px; height: 8px; background: var(--line-soft); transition: background 200ms; }
.segs i.cur { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.segs i.cur.late { box-shadow: inset 0 0 0 2px var(--red); }
.segs i.dead { background: var(--red-track); box-shadow: inset 0 0 0 2px var(--red); }
.bug .lbl { font: 700 13px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
.bug .logo { display: none; }

/* ---------- rep ---------- */
.rep-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.rep-main { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 20px; min-height: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--panel-deep); border-bottom: 1px solid var(--line-soft); }
.card-head .k { font: 800 14px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.card-head .c { font: 700 13px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .q { margin: 0; padding: 22px 16px 26px; font: 700 34px/1.06 var(--cond); }
.hint { margin: 0; text-align: center; font-size: 14px; line-height: 1.4; color: var(--muted); }
.misses { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow: hidden; }
.misses:empty { display: none; }
.miss { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: rgba(255, 59, 59, .1); border: 1px solid rgba(255, 59, 59, .4); border-radius: 6px; }
.miss.old { opacity: .55; }
.miss .w { display: flex; align-items: center; gap: 10px; min-width: 0; }
.miss .w svg { flex: none; }
.miss .w span { font-size: 16px; font-weight: 700; text-decoration: line-through; text-decoration-color: var(--red-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miss .tag { font: 700 13px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--red-soft); white-space: nowrap; }

.dock { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(16px + max(24px, var(--bottom))); background: var(--panel-deep); border-top: 1px solid var(--line-soft); transition: opacity 150ms ease-out; }
.dock.locked { opacity: .5; }
.clock { position: relative; flex: none; width: 56px; height: 56px; }
.clock svg { display: block; width: 100%; height: 100%; }
.clock .arc { transition: stroke-dasharray 100ms linear; }
.clock.late svg { filter: drop-shadow(0 0 10px rgba(255, 59, 59, .75)); animation: pulse .6s ease-in-out infinite; }
.pen { position: absolute; left: 36px; top: -22px; padding: 2px 7px; background: var(--red); color: var(--ground); border-radius: 4px; font: 800 15px/1.2 var(--cond); letter-spacing: .04em; white-space: nowrap; animation: rise .22s ease-out both; }
.guess {
  flex: 1; min-width: 0; height: 56px; padding: 0 14px; background: var(--panel); border: 2px solid var(--accent); border-radius: 6px;
  color: var(--text); font-size: 19px; font-weight: 600; outline: none; -webkit-appearance: none; appearance: none;
}
.guess::placeholder { color: var(--dim); }
.guess.bad { border-color: var(--red); animation: shake .4s ease; }
.guess:disabled { border-color: var(--line); color: var(--dim); opacity: 1; -webkit-text-fill-color: var(--dim); }
.send { flex: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); border: 0; border-radius: 6px; color: var(--ground); }
.send:disabled { background: var(--line); color: var(--dim); cursor: default; }
.send .t { display: none; }
.deskhint { display: none; }

/* ---------- reveal ---------- */
.rv { position: relative; flex: 1; padding: 28px 20px 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: hidden; }
.rv.compact { padding-top: 20px; gap: 16px; }
.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-head .k { font: 800 14px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.rv-head .c { font: 700 13px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv.compact .rv-head, .rv.compact .rv-sub { display: none; }
.rv-sub { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.board { position: relative; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel-deep); }
.row { position: relative; display: flex; align-items: center; height: 72px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); transition: height 200ms ease-out, padding 200ms ease-out, opacity 300ms, background 150ms, box-shadow 150ms; }
.row:last-child { border-bottom: 0; }
.row .l { width: 150px; flex: none; font: 800 17px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; transition: font-size 200ms, width 200ms, filter 120ms; }
.row .dash { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px); }
.row.passed { opacity: .45; }
.row.flash { opacity: 1; }
.row.flash .l { filter: brightness(1.5) drop-shadow(0 0 6px currentColor); }
.board.compact .row { height: 40px; padding: 0 14px; }
.board.compact .row.hit { height: 48px; }
.board.compact .row .l { width: 140px; font-size: 14px; }
.board.compact .row.passed, .board.compact .row.after { opacity: .4; }
.tag-card {
  position: absolute; left: 160px; right: 14px; top: -48px; height: 40px; z-index: 3;
  display: flex; align-items: center; justify-content: center; padding: 0 8px;
  background: var(--text); color: var(--ground); border-radius: 4px;
  font: 800 18px/40px var(--cond); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
}
.tag-card span { overflow: hidden; text-overflow: ellipsis; }
.tag-card.ghost { box-shadow: none; z-index: 2; color: transparent; }
.tag-card.drop { transition: top 800ms cubic-bezier(.2, .7, .2, 1); }
.tag-card.lock { animation: settle 200ms cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 4px var(--ring); transition: background 150ms, box-shadow 120ms; }
.tag-card.set { box-shadow: none; transition: top 200ms ease-out, left 200ms ease-out, height 200ms ease-out, font-size 200ms, line-height 200ms, background 150ms; }
.board.compact .tag-card { left: 154px; height: 32px; font-size: 16px; line-height: 32px; }
.lift { position: absolute; left: 76px; right: 84px; bottom: calc(29px + max(24px, var(--bottom))); height: 30px; z-index: 4; display: flex; align-items: center; justify-content: center; background: var(--text); color: var(--ground); border-radius: 4px; font: 800 15px/30px var(--cond); letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); animation: lift 150ms ease-out both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; pointer-events: none; }

.stamp { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; transform-origin: left center; animation: stamp 180ms cubic-bezier(.34, 1.56, .64, 1) both; }
.stamp .lead { font: 700 14px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stamp h2 { margin: 0; font: 800 54px/.92 var(--cond); letter-spacing: -.01em; text-transform: uppercase; }
.stamp .who { font-size: 22px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.tiles { display: flex; gap: 10px; animation: stamp 180ms cubic-bezier(.34, 1.56, .64, 1) both; }
.tile { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.tile.wide { flex: 1.3; }
.tile .v { font: 800 34px/1 var(--cond); font-variant-numeric: tabular-nums; }
.talk { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 500; color: var(--text-2); animation: rise 200ms ease-out both; }
.talk.d2 { animation-delay: 80ms; }
.next-wrap { position: relative; z-index: 2; flex: none; padding: 12px 20px calc(16px + max(24px, var(--bottom))); }
.next-wrap.in { animation: rise 220ms ease-out both; }
.confetti { position: absolute; left: 0; right: 0; top: 0; height: 420px; pointer-events: none; z-index: 1; }
.confetti i { position: absolute; width: 7px; height: 11px; background: var(--accent); border-radius: 1px; opacity: 0; animation: burst 600ms ease-out forwards; }

/* ---------- time's up ---------- */
.glow-red { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, rgba(255, 59, 59, .22), rgba(11, 15, 20, 0) 60%); }
.tu { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 20px; text-align: center; min-height: 0; }
.horn { position: relative; width: 132px; height: 132px; flex: none; animation: horn .35s ease-in-out 3; }
.horn svg:first-child { filter: drop-shadow(0 0 18px rgba(255, 59, 59, .7)); }
.horn .mega { position: absolute; right: -14px; top: -8px; }
.tu-title { display: flex; flex-direction: column; gap: 6px; animation: stamp 180ms ease-out both; }
.tu h2 { margin: 0; font: 800 72px/.9 var(--cond); letter-spacing: -.01em; text-transform: uppercase; color: var(--red); }
.tu .sub { margin: 0; font: 700 18px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tu .card { width: 100%; opacity: .85; }
.tu .card-head { padding: 8px 14px; }
.tu .card-head .k { color: var(--muted); font-size: 13px; }
.tu .card-head .c { font-size: 12px; }
.tu .card .q { padding: 14px 14px 16px; font-size: 22px; line-height: 1.1; color: var(--text-2); text-align: left; }
.tu .tiles { width: 100%; animation: none; }
.tu .tile { align-items: center; padding: 10px 14px; }
.tu .tile .v { font-size: 30px; color: var(--red-soft); }
.tu .talk { animation: none; }

/* ---------- end ---------- */
.end { padding: calc(52px + var(--top)) 20px calc(36px + var(--bottom)); overflow-y: auto; }
.total { position: relative; display: flex; align-items: flex-end; justify-content: space-between; margin-top: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--accent); transform-origin: left bottom; animation: stamp 180ms ease-out both; }
.total .cap { font-size: 12px; }
.total .l, .total .r { display: flex; flex-direction: column; }
.total .r { align-items: flex-end; }
.total .yd { font: 800 84px/.88 var(--cond); font-variant-numeric: tabular-nums; }
.total .sc { font: 800 44px/.9 var(--cond); color: var(--accent); font-variant-numeric: tabular-nums; }
.recap { position: relative; list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel-deep); }
.recap li { display: flex; align-items: center; gap: 12px; height: 44px; flex: none; padding: 0 12px; border-bottom: 1px solid var(--line-faint); }
.recap li:last-child { border-bottom: 0; }
.recap .i { width: 22px; flex: none; font: 700 14px/1 var(--cond); color: var(--dim); font-variant-numeric: tabular-nums; }
.recap .sw { width: 10px; height: 22px; flex: none; }
.recap .a { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap .t { font: 800 13px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.recap .y { width: 44px; flex: none; text-align: right; font: 700 15px/1 var(--cond); color: var(--text-2); font-variant-numeric: tabular-nums; }
.share { position: relative; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.grid-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.grid-card .gl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.grid-card .g { font-size: 22px; line-height: 1; letter-spacing: .08em; }
.grid-card .m { font: 700 14px/1.1 var(--cond); letter-spacing: .06em; color: var(--muted); text-align: right; }
.share .btn { height: 56px; font-size: 22px; transition: background 200ms; }
.share .btn.ok { background: #27C28A; }
.next-roster { position: relative; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.next-roster .gl { display: flex; flex-direction: column; }
.next-roster .s { font-size: 14px; color: var(--text-2); }
.next-roster .cd { font: 800 32px/1 var(--cond); font-variant-numeric: tabular-nums; }
.end .spacer { flex: none; height: 18px; }

.loading { margin: auto; color: var(--muted); font-weight: 600; text-align: center; padding: 0 20px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--bottom)); transform: translateX(-50%); z-index: 20; background: var(--text); color: var(--ground); padding: 10px 16px; border-radius: 999px; font-weight: 700; }

/* ---------- motion ---------- */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes stamp { 0% { transform: scale(1.15); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes horn { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes settle { 0% { transform: translateY(0); } 45% { transform: translateY(4px); } 100% { transform: translateY(0); } }
@keyframes lift { from { transform: translateY(0) scale(1); opacity: .9; } to { transform: translateY(-12px) scale(1.04); opacity: 1; } }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stamp, .tiles, .talk, .next-wrap.in, .rv .board { animation: fade 200ms ease-out both !important; }
}

/* every screen can scroll if a phone is short or turned sideways */
.home, .tu, .rv, .end { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.end > *, .tu > *, .rv > * { flex-shrink: 0; }

/* narrow phones (360 wide): keep the score on screen */
@media (max-width: 380px) {
  .bug .side { min-width: 72px; padding: 0 12px; }
  .bug .v { font-size: 26px; }
  .segs { gap: 4px; }
  .segs i { width: 19px; }
  .card .q { font-size: 30px; }
  .total .yd { font-size: 72px; }
}

/* short phones: tighten the reveal and time's up so the buttons stay on screen */
@media (max-height: 700px) {
  .row { height: 56px; }
  .stamp h2 { font-size: 44px; }
  .tile .v { font-size: 28px; }
  .home .top { gap: 24px; }
  .tu { gap: 14px; padding-top: 12px; }
  .horn { width: 96px; height: 96px; }
  .horn svg:first-child { width: 96px; height: 96px; }
  .tu h2 { font-size: 56px; }
  .tu .card .q { font-size: 19px; padding: 10px 14px 12px; }
  .end { padding-top: calc(28px + var(--top)); }
  .recap li { height: 40px; }
}

/* phones turned sideways */
@media (max-height: 480px) {
  .home { padding-top: calc(20px + var(--top)); padding-bottom: calc(20px + var(--bottom)); gap: 20px; }
  .home .top { margin-top: 0; gap: 14px; }
  .brand h1 { font-size: 44px; }
  .row { height: 40px; }
}

/* sound toggle */
.snd { position: absolute; top: calc(12px + var(--top)); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 4; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.snd:hover { color: var(--text); border-color: var(--muted); }
.snd[aria-pressed="false"] { color: var(--dim); }
.end .snd { top: calc(12px + var(--top)); }

/* ---------- desktop (RepDesktop) ---------- */
@media (min-width: 900px) {
  .app { max-width: none; }
  .home, .end, .tu, .rv, .next-wrap { width: 100%; max-width: 460px; margin-left: auto; margin-right: auto; }
  .bug { height: 72px; margin-top: 0; }
  .bug .inner { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }
  .bug .logo { display: flex; align-items: center; gap: 12px; padding-right: 28px; border-right: 1px solid var(--line); }
  .bug .logo .bars { gap: 3px; }
  .bug .logo .bars i { height: 4px; }
  .bug .logo b { font: 800 22px/1 var(--cond); letter-spacing: .02em; text-transform: uppercase; }
  .bug .logo span { font: 700 14px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .bug .side { padding: 0 28px; min-width: 120px; }
  .bug .side.r { padding: 0 0 0 28px; }
  .bug .v { font-size: 32px; }
  .bug .mid { gap: 8px; }
  .segs { gap: 6px; }
  .segs i { width: 36px; height: 9px; }
  .bug .lbl { font-size: 14px; }
  .rep-wrap { align-items: center; justify-content: center; gap: 28px; padding: 24px; }
  .rep-main { flex: none; width: min(760px, 100%); padding: 0; }
  .rep-main .card { border-radius: 8px; }
  .rep-main .card-head { padding: 12px 24px; }
  .rep-main .card-head .k { font-size: 15px; }
  .rep-main .card-head .c { font-size: 14px; }
  .rep-main .card .q { padding: 36px 32px 40px; font-size: 48px; line-height: 1.04; text-align: center; }
  .rep-main .hint { display: none; }
  .rep-wrap .dock { width: min(760px, 100%); padding: 0; gap: 16px; background: none; border: 0; }
  .clock { width: 72px; height: 72px; }
  .pen { left: 50px; }
  .guess { height: 64px; padding: 0 20px; border-radius: 8px; font-size: 22px; }
  .send { width: auto; height: 64px; padding: 0 28px; border-radius: 8px; font: 800 22px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; }
  .send .t { display: inline; }
  .deskhint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 24px; font-size: 14px; color: var(--muted); }
  .deskhint span { display: flex; align-items: center; gap: 6px; }
  kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font: 12px/1 var(--body); color: var(--text-2); }
  .lift { display: none; }
  .deco { width: 1280px; height: 800px; }
}
