/* Name That Moan — dark stage, orange spotlight */

:root{
  --bg:        #0a0806;
  --bg-2:      #141110;
  --surface:   #1b1715;
  --surface-2: #262120;
  --line:      #322b28;
  --text:      #f6f1ec;
  --muted:     #9a8f88;
  --dim:       #6b615c;
  --accent:    #ff9d17;
  --accent-2:  #ffb845;
  --accent-ink:#1a1005;
  --good:      #35c26b;
  --bad:       #e0503f;
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-pill: 999px;
  --shadow: 0 18px 44px rgba(0,0,0,.55);
  --ease: cubic-bezier(.2,.8,.2,1);
}

*{ box-sizing:border-box; }
/* several components below set `display`, which would otherwise beat [hidden] */
[hidden]{ display:none !important; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Poppins,"Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif;
  font-weight:600;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button{ font:inherit; color:inherit; cursor:pointer; }
code{ font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace; font-size:.92em; color:var(--accent-2); }

/* warm spotlight behind everything */
.glow{
  position:fixed; inset:-30% -10% auto -10%; height:80vh; pointer-events:none; z-index:0;
  background:
    radial-gradient(60% 55% at 50% 30%, rgba(255,157,23,.20), transparent 70%),
    radial-gradient(90% 60% at 50% 0%,  rgba(255,110,0,.10),  transparent 75%);
  filter:blur(6px);
}

/* ---------- top bar ---------- */
.topbar{
  position:relative; z-index:3;
  display:flex; align-items:center; gap:12px;
  padding:18px clamp(14px,3vw,26px);
}
.icon-btn{
  display:grid; place-items:center;
  width:42px; height:42px; border:0; border-radius:var(--r-sm);
  background:transparent; color:var(--text);
  transition:background .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover{ background:var(--surface); }
.icon-btn:active{ transform:scale(.94); }

.pill{
  border-radius:var(--r-pill);
  background:var(--surface);
  border:1px solid var(--line);
  padding:10px 20px;
  font-size:13px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--muted); white-space:nowrap;
}
.pill b{ color:var(--accent); font-weight:800; }
.pill .slash{ color:var(--dim); margin:0 2px; }
#setPill{ margin-inline:auto; }
#streakPill{ margin-left:auto; }
.pill.bump{ animation:bump .45s var(--ease); }
@keyframes bump{ 40%{ transform:scale(1.14); } 100%{ transform:scale(1); } }

/* ---------- stage ---------- */
.stage{
  position:relative; z-index:2;
  max-width:760px; margin:0 auto;
  padding:clamp(8px,2vh,28px) clamp(16px,4vw,24px) 64px;
  display:flex; flex-direction:column; align-items:center;
}

.logo{
  margin:clamp(10px,3vh,34px) 0 clamp(18px,3vh,30px);
  font-size:clamp(38px,9vw,74px);
  font-weight:800; letter-spacing:-.03em; line-height:1;
  text-align:center;
}
.logo .hl{
  display:inline-block;
  background:var(--accent); color:var(--accent-ink);
  padding:.03em .16em .09em; border-radius:12px;
  transform:rotate(-.6deg);
}

/* difficulty tiers */
.tiers{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-bottom:clamp(16px,3vh,26px); }
.tier{
  border:1px solid var(--line); background:var(--surface); color:var(--muted);
  border-radius:var(--r-pill); padding:9px 20px;
  font-size:14px; font-weight:600;
  transition:background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.tier:hover:not(:disabled){ color:var(--text); border-color:#4a403b; }
.tier:disabled{ opacity:.4; cursor:not-allowed; }
.tier .lock{ width:12px; height:12px; margin-left:7px; vertical-align:-1px; fill:currentColor; }
.tier.cleared::after{ content:"✓"; margin-left:7px; color:var(--good); font-weight:800; }
.tier[aria-pressed="true"].cleared::after{ color:var(--accent-ink); }
.tier[aria-pressed="true"]{
  background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:700;
  box-shadow:0 6px 18px rgba(255,157,23,.28);
}
.tier:active{ transform:scale(.96); }

/* play button */
.player{ display:flex; flex-direction:column; align-items:center; gap:16px; margin-bottom:clamp(22px,4vh,40px); }
.play{
  position:relative; display:grid; place-items:center;
  width:clamp(96px,22vw,124px); aspect-ratio:1;
  border:0; border-radius:50%;
  background:var(--accent); color:var(--accent-ink);
  box-shadow:0 14px 40px rgba(255,157,23,.30);
  transition:transform .18s var(--ease), box-shadow .18s var(--ease);
}
.play:hover{ transform:scale(1.04); box-shadow:0 18px 52px rgba(255,157,23,.42); }
.play:active{ transform:scale(.97); }
.play .ring{ position:absolute; inset:-9px; width:auto; height:auto; transform:rotate(-90deg); }
.ring circle{ fill:none; stroke-width:3; }
.ring-bg{ stroke:rgba(255,157,23,.16); }
.ring-fg{
  stroke:var(--accent-2); stroke-linecap:round;
  stroke-dasharray:345.6; stroke-dashoffset:345.6;
}
.play .glyph{ width:44%; height:44%; fill:currentColor; margin-left:4%; }
.play .pause-glyph{ display:none; margin-left:0; }
.play.playing .play-glyph{ display:none; }
.play.playing .pause-glyph{ display:block; }
/* the clock — it is the whole game, so it is big and it moves */
.timer{
  margin:0; font-variant-numeric:tabular-nums;
  font-size:clamp(30px,7vw,42px); font-weight:800; letter-spacing:-.02em;
  color:var(--dim); transition:color .3s var(--ease);
}
.timer span{ font-size:.5em; font-weight:700; margin-left:2px; }
.timer.running{ color:var(--accent); }
.timer.stopped{ color:var(--good); }

/* guessed faces — the picture is the point, so these are tiles not chips */
.guesses{
  list-style:none; width:100%; max-width:640px; margin:0 0 20px; padding:0;
  display:flex; flex-wrap:wrap; justify-content:center; gap:14px;
}
.guesses:empty{ display:none; margin:0; }
.guesses li{
  position:relative; display:grid; justify-items:center; gap:8px;
  width:96px; animation:slide .26s var(--ease);
}
.guesses li .av{ width:76px; height:76px; opacity:.72; }
.guesses li.wrong .av{ border:2px solid rgba(224,80,63,.75); }
.guesses li .who-name{
  font-size:12px; font-weight:600; line-height:1.3; color:var(--muted);
  text-align:center; overflow-wrap:anywhere;
}
.guesses li .mark{
  position:absolute; top:-4px; right:8px;
  display:grid; place-items:center; width:22px; height:22px; border-radius:50%;
  background:var(--bad); color:#fff; font-size:12px; font-weight:800;
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}
.guesses li.skip .av{ opacity:.35; }
.guesses li.skip .mark{ background:var(--surface-2); color:var(--dim); }
@keyframes slide{ from{ opacity:0; transform:translateY(-8px) scale(.94);} }

/* guess row */
.guessrow{ display:flex; gap:12px; width:100%; max-width:700px; align-items:stretch; }
.ac-wrap{ position:relative; flex:1; min-width:0; }
.input-wrap{
  display:flex; align-items:center; gap:12px;
  height:100%; min-height:60px; padding:0 18px;
  background:var(--bg-2); border:2px solid var(--accent); border-radius:var(--r-lg);
  transition:box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.ac-wrap:focus-within .input-wrap{ box-shadow:0 0 0 4px rgba(255,157,23,.16); }
.search-ico{ width:19px; height:19px; color:var(--dim); flex:none; }
#guessInput{
  flex:1; min-width:0; border:0; outline:0; background:transparent;
  color:var(--text); font-size:17px; font-weight:600; padding:0;
}
#guessInput::placeholder{ color:var(--dim); font-weight:500; }
.clear{ border:0; background:transparent; color:var(--dim); font-size:24px; line-height:1; padding:0 2px; }
.clear:hover{ color:var(--text); }

/* faces — a picture when the roster has one, a monogram when it doesn't */
.av{
  flex:none; display:block; overflow:hidden;
  border-radius:50%; background:var(--surface-2);
  border:1px solid rgba(255,255,255,.07);
}
.av.square{ border-radius:22px; }
.av img{ width:100%; height:100%; object-fit:cover; display:block; }
.av.mono{
  display:grid; place-items:center;
  font-weight:800; letter-spacing:.02em;
  line-height:1; user-select:none;
}

/* autocomplete opens upward, like the mock */
.ac{
  position:absolute; left:0; right:0; bottom:calc(100% + 10px);
  margin:0; padding:8px; list-style:none;
  max-height:min(46vh,320px); overflow-y:auto; overscroll-behavior:contain;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--shadow); z-index:6;
  animation:pop .16s var(--ease);
}
@keyframes pop{ from{ opacity:0; transform:translateY(8px);} }
.ac li{
  display:flex; align-items:center;
  padding:13px 16px; border-radius:12px;
  font-size:16px; font-weight:600; color:var(--text); cursor:pointer;
}
.ac-name{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ac li:hover{ background:var(--surface-2); }
/* Enter submits this row, so it has to be obvious which one it is */
.ac li[aria-selected="true"]{ background:#332b27; box-shadow:inset 3px 0 0 var(--accent); }
.ac li mark{ background:transparent; color:var(--accent); font-weight:800; }
.ac li.empty{ color:var(--dim); font-weight:500; cursor:default; }
.ac li.empty:hover{ background:transparent; }

.skip{
  display:flex; align-items:center; gap:9px;
  padding:0 26px; min-height:60px; flex:none;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  font-size:17px; font-weight:700;
  transition:background .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}
.skip svg{ fill:currentColor; }
.skip:hover{ background:var(--surface-2); border-color:#4a403b; }
.skip:active{ transform:scale(.97); }
.skip.submit{ background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }

.link{ border:0; background:none; color:var(--accent); text-decoration:underline; padding:0 2px; font-size:inherit; font-weight:600; }

/* token + disclaimer in the menu */
.token{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:14px; }
.token-head{ display:flex; align-items:baseline; gap:8px; margin-bottom:10px; }
.token-head b{ font-size:17px; color:var(--accent); }
.token-head span{ font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--dim); }
.token-addr{
  display:block; margin-bottom:12px; padding:10px;
  background:var(--bg); border-radius:8px;
  font-size:11px; line-height:1.5; color:var(--muted);
  overflow-wrap:anywhere;
}
.token-actions{ display:flex; gap:8px; margin-bottom:10px; }
.token-actions .ghost{ flex:1; text-align:center; text-decoration:none; }
.disclaimer{ display:grid; gap:11px; }
.disclaimer p{
  margin:0; font-size:12.5px; font-weight:500; line-height:1.6; color:var(--dim);
}
.disclaimer p:first-child{ color:var(--muted); }

/* ------------------------------------------------- between-clips wipe */
.nextwipe{
  position:fixed; inset:0; z-index:7; pointer-events:none;
  display:grid; place-items:center; overflow:hidden;
}
.nextwipe .band{
  width:100%; padding:22px 0;
  background:linear-gradient(90deg, transparent, var(--accent) 12%, var(--accent) 88%, transparent);
  color:var(--accent-ink); text-align:center;
  font-size:clamp(20px,5vw,34px); font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  animation:wipe .78s var(--ease) both;
}
@keyframes wipe{
  0%   { transform:translateX(-104%); }
  30%  { transform:translateX(0); }
  62%  { transform:translateX(0); }
  100% { transform:translateX(104%); }
}
/* the new clip settles in behind the band */
.stage.arriving .player,
.stage.arriving .guesses{ animation:arrive .5s var(--ease) both; }
@keyframes arrive{ from{ opacity:0; transform:translateY(10px); } }

@media (prefers-reduced-motion:reduce){
  .nextwipe .band{ animation:fade .5s steps(2,end) both; }
}

/* ---------- drawer ---------- */
.scrim{ position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:8; animation:fade .2s var(--ease); }
@keyframes fade{ from{ opacity:0; } }
.drawer{
  position:fixed; inset:0 auto 0 0; width:min(380px,88vw); z-index:9;
  background:var(--bg-2); border-right:1px solid var(--line);
  padding:18px 22px 40px; overflow-y:auto;
  transform:translateX(-102%); transition:transform .28s var(--ease);
  box-shadow:var(--shadow);
}
.drawer.open{ transform:none; }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.drawer-head h2{ font-size:19px; margin:0; letter-spacing:-.01em; }
.drawer section{ padding:20px 0; border-bottom:1px solid var(--line); }
.drawer section:last-child{ border:0; }
.drawer h3{ margin:0 0 12px; font-size:12px; letter-spacing:.16em; text-transform:uppercase; color:var(--dim); }
.how{ margin:0; padding-left:20px; display:grid; gap:8px; font-size:14px; font-weight:500; color:var(--muted); line-height:1.5; }
.stats-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:14px; }
.stats-grid div{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:12px 14px; }
.stats-grid b{ display:block; font-size:22px; color:var(--accent); }
.stats-grid span{ font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--dim); }
.row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 0; font-size:14px; font-weight:500; color:var(--muted); }
.row input[type=range]{ accent-color:var(--accent); width:150px; }
.row input[type=checkbox]{ accent-color:var(--accent); width:18px; height:18px; }
.muted{ color:var(--muted); } .small{ font-size:13px; font-weight:500; line-height:1.6; }
.ghost{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:10px 16px; font-size:14px; font-weight:600; color:var(--text); }
a.ghost{ display:block; text-decoration:none; }
.ghost:hover{ background:var(--surface-2); }
.ghost.danger{ color:var(--bad); border-color:rgba(224,80,63,.35); }

/* ---------- results ---------- */
.modal{ position:fixed; inset:0; z-index:10; display:grid; place-items:center; padding:20px; background:rgba(6,4,3,.78); animation:fade .2s var(--ease); }
.sheet{
  width:min(420px,100%); background:var(--bg-2);
  border:1px solid var(--line); border-radius:var(--r-lg);
  padding:28px; text-align:center; box-shadow:var(--shadow);
  animation:rise .3s var(--ease);
}
@keyframes rise{ from{ opacity:0; transform:translateY(18px) scale(.97); } }
.eyebrow{ margin:0 0 6px; font-size:12px; letter-spacing:.18em; text-transform:uppercase; color:var(--accent); }
.sheet h2{ margin:0 0 22px; font-size:27px; letter-spacing:-.02em; }
.score-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:20px; }
.score-row div{ background:var(--surface); border-radius:var(--r-sm); padding:14px 8px; }
.score-row b{ display:block; font-size:23px; color:var(--accent); }
.score-row span{ font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--dim); }
.verdict{ margin:0 0 20px; font-size:14px; font-weight:600; line-height:1.55; color:var(--muted); }
.verdict b{ color:var(--accent); }
.verdict.pass b{ color:var(--good); }
.sheet-actions{ display:flex; gap:10px; }
.sheet-actions button{
  flex:1; padding:14px; border-radius:var(--r-sm);
  font-size:15px; font-weight:700;
}
.primary{ background:var(--accent); border:1px solid var(--accent); color:var(--accent-ink); }
.primary:hover{ background:var(--accent-2); border-color:var(--accent-2); }
.primary:active{ transform:scale(.98); }

/* one deliberate focus ring everywhere, instead of the browser's */
:focus-visible{ outline:2px solid var(--accent-2); outline-offset:3px; }
.primary:focus-visible{ outline-color:var(--text); }

/* the box answers back */
.input-wrap.right{ border-color:var(--good); box-shadow:0 0 0 4px rgba(53,194,107,.18); }
.input-wrap.wrong{
  border-color:var(--bad); box-shadow:0 0 0 4px rgba(224,80,63,.18);
  animation:shake .34s var(--ease);
}
@keyframes shake{
  20%{ transform:translateX(-6px); } 45%{ transform:translateX(5px); }
  70%{ transform:translateX(-3px); } 100%{ transform:none; }
}

/* --------------------------------------------------------- nailed it */
.win-sheet{ border-color:rgba(53,194,107,.3); }
.win-photo{ display:grid; place-items:center; margin-bottom:20px; }
.win-photo .av{
  width:clamp(190px,52vw,256px); height:clamp(190px,52vw,256px);
  border:1px solid rgba(255,255,255,.09);
  box-shadow:0 20px 50px rgba(0,0,0,.6);
  animation:portrait .42s var(--ease) both;
}
@keyframes portrait{ from{ opacity:0; transform:scale(.9); } }
.win-name{
  margin:0 0 6px; font-size:clamp(28px,7vw,38px);
  font-weight:800; letter-spacing:-.025em; line-height:1.1;
}
.win-meta{
  margin:0 0 22px; font-size:13px; font-weight:600;
  letter-spacing:.1em; text-transform:uppercase; color:var(--dim);
}

/* the stamp lands hard, then settles */
.stamp.fast{ box-shadow:0 0 26px rgba(53,194,107,.35); }
.stamp{
  display:inline-block; margin:0 0 24px;
  padding:13px 28px; border-radius:14px;
  border:2px solid var(--good); color:var(--good);
  background:rgba(53,194,107,.08);
  font-size:clamp(16px,4.4vw,20px); font-weight:800;
  letter-spacing:.06em; text-transform:uppercase;
  animation:stamp .52s cubic-bezier(.2,1.5,.35,1) both,
            stampGlow .9s var(--ease) .3s both;
}
@keyframes stamp{
  0%   { opacity:0; transform:scale(2.7) rotate(-13deg); filter:blur(4px); }
  55%  { opacity:1; transform:scale(.9)  rotate(3deg);   filter:blur(0); }
  75%  { transform:scale(1.06) rotate(-1.5deg); }
  100% { opacity:1; transform:scale(1) rotate(0deg); }
}
@keyframes stampGlow{
  0%   { box-shadow:0 0 0 0 rgba(53,194,107,.55); }
  100% { box-shadow:0 0 0 22px rgba(53,194,107,0); }
}
@media (prefers-reduced-motion:reduce){
  .stamp{ animation:pop .2s var(--ease) both; }
}

/* ------------------------------------------------------- out of tries */
.fail-sheet{ border-color:rgba(224,80,63,.35); }
.wilt{ margin:0 0 6px; font-size:40px; line-height:1; letter-spacing:6px; }
.fail-sheet h2{ margin:0 0 24px; color:var(--bad); font-size:25px; }
.fail-who{ display:grid; justify-items:center; gap:12px; margin-bottom:26px; }
.fail-who .av{ width:132px; height:132px; border:3px solid var(--bad); }
.fail-who .label{ font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:var(--dim); }
.fail-who .who-name{ font-size:26px; font-weight:800; letter-spacing:-.02em; }

/* ---------------------------------------------------- the gooner award */
.award{ overflow-y:auto; align-items:start; padding:clamp(12px,3vh,40px) 16px; }
.award-sheet{
  display:grid; gap:26px; align-items:start;
  grid-template-columns:minmax(0,1fr) minmax(260px,320px);
  width:min(1020px,100%); margin:auto;
  animation:rise .34s var(--ease);
}
.card-hold{ min-width:0; }
.card-hold svg{
  display:block; width:100%; height:auto;
  border-radius:26px; box-shadow:0 30px 80px rgba(0,0,0,.65);
}
.award-controls{
  background:var(--bg-2); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:22px; display:grid; gap:18px; box-shadow:var(--shadow);
}
.award-field{ display:grid; gap:9px; }
.award-field > span{
  font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--dim); font-weight:700;
}
#awardName{
  border:1px solid var(--line); background:var(--surface); color:var(--text);
  border-radius:var(--r-sm); padding:12px 14px; font-size:16px; font-weight:600; outline:0;
}
#awardName:focus{ border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,157,23,.16); }
.frames{ display:flex; flex-wrap:wrap; gap:7px; }
.frame-chip{
  border:1px solid var(--line); background:var(--surface); color:var(--muted);
  border-radius:var(--r-pill); padding:8px 15px; font-size:13px; font-weight:600;
  transition:background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.frame-chip:hover{ color:var(--text); border-color:#4a403b; }
.frame-chip[aria-pressed="true"]{
  background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:700;
}
.cam{ display:grid; gap:10px; }
.cam video{
  width:100%; aspect-ratio:1; object-fit:cover;
  border-radius:var(--r-md); background:#000;
  border:1px solid var(--line);
  transform:scaleX(-1);            /* a selfie should mirror you */
}
.cam .primary{ padding:13px; border-radius:var(--r-sm); font-size:15px; font-weight:700; }
.photo-row{ display:flex; gap:8px; flex-wrap:wrap; }
.photo-row .ghost{ flex:1; min-width:120px; }
.privacy{
  display:flex; gap:9px; align-items:flex-start; margin:0;
  padding:12px 14px; border-radius:var(--r-sm);
  background:rgba(53,194,107,.07); border:1px solid rgba(53,194,107,.25);
  font-size:12px; font-weight:500; line-height:1.55; color:#8fceaa;
}
.privacy svg{ flex:none; margin-top:2px; }
@media (max-width:860px){
  .award-sheet{ grid-template-columns:minmax(0,1fr); }
  .card-hold{ max-width:460px; margin:0 auto; }
}

/* toast */
.toast{
  position:fixed; left:50%; bottom:28px; transform:translateX(-50%);
  z-index:11; padding:13px 22px; border-radius:var(--r-pill);
  background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow);
  font-size:14px; font-weight:600; animation:toastIn .24s var(--ease);
}
.toast.good{ border-color:rgba(53,194,107,.5); color:var(--good); }
.toast.bad{ border-color:rgba(224,80,63,.5); color:var(--bad); }
@keyframes toastIn{ from{ opacity:0; transform:translate(-50%,12px);} }

@media (max-width:560px){
  .pill{ padding:9px 14px; font-size:11px; }
  .guessrow{ flex-wrap:wrap; }
  .skip{ width:100%; justify-content:center; min-height:52px; }
  .input-wrap{ min-height:54px; }
  .tier{ padding:8px 15px; font-size:13px; }
}
@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
