/* Findle — deep-water palette. Dark only; this is a game you play at night on
   a phone as often as anywhere else. */

:root{
  --bg:#08131c;
  --panel:#0f1f2b;
  --panel-2:#152a38;
  --line:#1f3a4c;
  --fg:#e6f0f4;
  --muted:#8ba6b6;
  --accent:#38bdb0;        /* the fish teal */
  --accent-dim:#1e6f68;
  --gold:#e0a83c;
  --win:#3fa34d;
  --lose:#c9453a;
}

*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}

body{
  background:
    radial-gradient(1200px 500px at 50% -140px, #10293a 0%, transparent 70%),
    var(--bg);
  color:var(--fg);
  font:400 16px/1.55 ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-text-size-adjust:100%;
  display:flex; flex-direction:column; min-height:100dvh;
}

/* ---------- header ---------- */
header{
  border-bottom:1px solid var(--line); padding:10px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.brand{display:flex; align-items:baseline; gap:10px; min-width:0}
h1{
  margin:0; font-size:26px; font-weight:800; letter-spacing:.14em;
  text-transform:uppercase; white-space:nowrap;
}
h1 .accent{color:var(--accent)}
.puzzno{color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; white-space:nowrap}
.tools{display:flex; gap:6px; flex:none}
.iconbtn{
  background:transparent; border:1px solid var(--line); color:var(--muted);
  width:34px; height:34px; border-radius:8px; cursor:pointer; font-size:15px; line-height:1;
}
.iconbtn:hover{color:var(--fg); border-color:var(--accent)}

/* ---------- layout ---------- */
main{
  flex:1; width:100%; max-width:560px; margin:0 auto; padding:16px;
  display:flex; flex-direction:column; gap:14px;
}
.prompt{
  margin:0; font-size:15px; font-weight:600; color:var(--muted);
  text-align:center; letter-spacing:.02em;
}
.archive{
  margin:0; text-align:center; font-size:13px; color:var(--gold);
  border:1px solid var(--line); border-radius:10px; padding:8px 12px;
}

/* ---------- hints ---------- */
.hints{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.hint{
  display:grid; grid-template-columns:auto 1fr; gap:12px; align-items:start;
  background:var(--panel); border:1px solid var(--line); border-radius:12px;
  padding:12px 14px;
}
.hint-n{
  width:24px; height:24px; border-radius:50%; flex:none;
  display:grid; place-items:center;
  font-size:12px; font-weight:800; font-variant-numeric:tabular-nums;
}
.hint.revealed{border-left:3px solid var(--accent)}
.hint.revealed .hint-n{background:var(--accent); color:#07161a}
.hint.locked{opacity:.45; border-style:dashed}
.hint.locked .hint-n{background:var(--panel-2); color:var(--muted)}
.hint-body{display:flex; flex-direction:column; gap:2px; min-width:0}
.hint-label{
  font-size:11px; text-transform:uppercase; letter-spacing:.09em;
  color:var(--accent); font-weight:700;
}
.hint-text{font-size:14.5px}
.hint.locked .hint-text{font-style:italic; color:var(--muted)}

/* ---------- input ---------- */
.inputwrap{display:flex; flex-direction:column; gap:8px}
.guessrow{display:flex; gap:8px}
.field{position:relative; flex:1; min-width:0}
#guess{
  width:100%; background:var(--panel-2); border:1px solid var(--line); color:var(--fg);
  font-size:17px; padding:13px 14px; border-radius:10px; font-family:inherit;
}
#guess::placeholder{color:var(--muted)}
#guess:focus{outline:2px solid var(--accent); outline-offset:1px}
button.primary{
  background:var(--accent); color:#06171a; border:0; border-radius:10px;
  font-size:16px; font-weight:800; padding:13px 22px; cursor:pointer;
  letter-spacing:.03em; font-family:inherit; flex:none;
}
button.primary:hover{filter:brightness(1.08)}

/* The dropdown floats over the hints below it rather than pushing them down —
   the list changes size on every keystroke and a jumping page is unusable. */
.suggestions{
  position:absolute; top:calc(100% + 5px); left:0; right:0; z-index:20;
  background:var(--panel-2); border:1px solid var(--accent-dim); border-radius:10px;
  overflow:hidden; box-shadow:0 12px 30px rgba(0,0,0,.5);
}
.suggestions .sg{
  display:block; width:100%; text-align:left; background:transparent; border:0;
  color:var(--fg); font:inherit; font-size:15px; padding:10px 14px; cursor:pointer;
  border-bottom:1px solid var(--line);
}
.suggestions .sg:last-child{border-bottom:0}
.suggestions .sg:hover,.suggestions .sg.active{background:var(--accent-dim); color:#fff}

.belowinput{display:flex; align-items:center; justify-content:space-between; gap:10px}
.remaining{font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums}
.linkbtn{
  background:none; border:0; color:var(--muted); font:inherit; font-size:13px;
  cursor:pointer; text-decoration:underline; text-underline-offset:3px; padding:2px 0;
}
.linkbtn:hover{color:var(--accent)}

.msg{margin:0; text-align:center; font-size:14px; min-height:20px; color:var(--gold)}

/* ---------- guesses ---------- */
.guesses{display:flex; flex-direction:column; gap:6px}
.guess{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center;
  background:var(--panel); border:1px solid var(--line); border-left-width:4px;
  border-radius:10px; padding:9px 12px; font-size:15px;
}
.guess .mark{font-weight:800}
.guess .gnum{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums}
.guess.wrong{border-left-color:var(--lose)}
.guess.wrong .mark{color:var(--lose)}
.guess.correct{border-left-color:var(--win)}
.guess.correct .mark{color:var(--win)}
.guess.skipped{border-left-color:var(--gold)}
.guess.skipped .mark{color:var(--gold)}
.guess.skipped .gname{color:var(--muted); font-style:italic}

/* ---------- finished ---------- */
.done{
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  padding:18px 16px; display:flex; flex-direction:column; gap:14px;
  align-items:center; text-align:center;
}
.verdict{margin:0; font-size:16px; font-weight:700}
.verdict.win{color:var(--win)}
.verdict.lose{color:var(--lose)}
.answer{display:flex; flex-direction:column; gap:6px}
.answerlabel{
  font-size:11px; text-transform:uppercase; letter-spacing:.09em; color:var(--muted);
}
.answer strong{font-size:27px; line-height:1.2; color:var(--accent)}
.answernote{font-size:14px; color:var(--muted); max-width:42ch}
.stats{display:flex; gap:22px; justify-content:center; flex-wrap:wrap}
.stat{text-align:center}
.stat .n{font-size:22px; font-weight:800; font-variant-numeric:tabular-nums}
.stat .l{font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em}
.next,.archivenote{margin:0; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums}

/* ---------- dialogs ---------- */
dialog{
  background:var(--panel); color:var(--fg); border:1px solid var(--line);
  border-radius:14px; padding:20px; max-width:460px; width:calc(100% - 32px);
}
dialog::backdrop{background:rgba(0,0,0,.65)}
dialog h2{margin:0 0 12px; font-size:19px}
dialog p{margin:0 0 10px; font-size:14px; color:var(--muted)}
dialog b{color:var(--fg)}
.howlist{margin:0 0 12px; padding-left:20px; font-size:14px; color:var(--muted)}
.howlist li{margin-bottom:5px}
.howlist b{color:var(--accent)}
dialog .primary{margin-top:6px; width:100%}
/* ---------- guppy mode ----------
   A deliberately loud, brighter, rounder skin. The two modes should never be
   mistaken for each other at a glance — a parent glancing at a phone should be
   able to tell instantly which one is on screen. */
body.guppy{
  --accent:#ffc73d;
  --accent-dim:#8a5f00;
  background:
    radial-gradient(1100px 480px at 50% -130px, #17384e 0%, transparent 70%),
    #0a1722;
}
body.guppy h1{letter-spacing:.1em}

.guppybanner{
  display:flex; align-items:center; gap:12px;
  background:linear-gradient(135deg,#ffc73d,#ff8b3d);
  color:#2b1a00; border-radius:16px; padding:12px 14px;
}
.gbfish{font-size:30px; line-height:1; flex:none}
.gbtext{display:flex; flex-direction:column; gap:2px; min-width:0; flex:1}
.gbtext strong{font-size:16px; letter-spacing:.01em}
.gbtext span{font-size:12.5px; opacity:.85}
.gbswitch{
  flex:none; font-size:11.5px; font-weight:800; text-align:center; line-height:1.3;
  color:#2b1a00; text-decoration:none; background:rgba(255,255,255,.55);
  border-radius:10px; padding:7px 10px;
}
.gbswitch:hover{background:#fff}

/* Big, thumb-sized, high-contrast targets — this is the mode a six-year-old
   uses on a phone. */
.options{display:flex; flex-direction:column; gap:9px}
.opt{
  width:100%; text-align:left; font:inherit; font-size:17px; font-weight:700;
  background:var(--panel-2); color:var(--fg);
  border:2px solid var(--line); border-radius:14px; padding:15px 17px; cursor:pointer;
}
.opt:hover:not(:disabled){border-color:var(--accent); background:#1b3244}
.opt:disabled{cursor:default}
.opt.gone{opacity:.42; text-decoration:line-through; border-style:dashed}
.opt.right{
  background:var(--win); border-color:var(--win); color:#04210a;
  text-decoration:none; opacity:1;
}

.guppypitch{margin:0; text-align:center; font-size:13px; color:var(--muted)}
.guppypitch a{color:var(--accent); font-weight:700; text-decoration:none}
.guppypitch a:hover{text-decoration:underline}

.guppyhow{
  border:1px solid var(--line); border-left:4px solid #ffc73d;
  border-radius:12px; padding:13px 14px; margin:14px 0 4px;
}
.guppyhow strong{display:block; font-size:14.5px; margin-bottom:7px; color:#ffc73d}
.guppyhow p{font-size:13.5px; margin-bottom:8px}
.guppyhow .gbswitch{display:inline-block; background:#ffc73d}

@media (max-width:430px){
  .guppybanner{flex-wrap:wrap}
  .gbswitch{width:100%}
}

/* ---------- archive picker ---------- */
/* Capped and scrollable: the list grows by one row a day forever, and past a
   screenful the Close button would otherwise walk off the bottom. */
.alist{
  display:flex; flex-direction:column; gap:5px;
  max-height:52vh; overflow-y:auto; margin-bottom:6px;
}
.arow{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center;
  background:var(--panel-2); border:1px solid var(--line); border-left-width:4px;
  border-radius:9px; padding:9px 12px; text-decoration:none; color:var(--fg);
  font-size:14px;
}
.arow:hover{border-color:var(--accent)}
.arow .anum{
  font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; min-width:34px;
}
.arow .ascore{font-size:12px; font-variant-numeric:tabular-nums; color:var(--muted)}
.arow.won{border-left-color:var(--win)}
.arow.won .ascore{color:var(--win); font-weight:700}
.arow.lost{border-left-color:var(--lose)}
.arow.lost .ascore{color:var(--lose); font-weight:700}
.arow.started{border-left-color:var(--gold)}
.arow.started .ascore{color:var(--gold)}
.arow.unplayed{border-left-color:var(--line)}
.aempty{text-align:center; color:var(--muted); font-size:14px; padding:16px}

.archive .linkbtn{color:var(--gold); margin-left:8px}
.archive .linkbtn:hover{color:var(--accent)}

.disthead{margin-top:16px !important}
.dist{display:flex; flex-direction:column; gap:5px}
.distrow{display:flex; align-items:center; gap:8px; font-size:13px}
.disti{width:12px; color:var(--muted); flex:none; font-variant-numeric:tabular-nums}
.distbar{
  background:var(--accent-dim); border-radius:4px; padding:2px 7px;
  font-weight:700; text-align:right; font-variant-numeric:tabular-nums;
}

/* ---------- footer ---------- */
footer{
  text-align:center; color:var(--muted); font-size:12px; padding:16px 16px 24px;
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
footer p{margin:0}
footer a{color:var(--muted)}
a.kofi{
  display:inline-flex; align-items:center; gap:6px; text-decoration:none;
  border:1px solid var(--line); border-radius:999px; padding:7px 15px;
  font-size:13px; font-weight:600; color:var(--fg);
}
a.kofi:hover{border-color:var(--accent); color:var(--accent)}

@media (max-width:400px){
  h1{font-size:22px}
  main{padding:12px}
  button.primary{padding:13px 16px}
}
