/* Statameleon. The prototype's look, made the real thing: dark, monospace,
   one warm accent, pixels kept crisp. */
:root {
  --bg: #12101c; --panel: #1d1a2c; --panel2: #24203a; --ink: #f1ead8; --dim: #9c94b4; --line: #2f2a44;
  --accent: #f9b234; --pink: #ff5a8a; --sea: #0d1222;
}
* { box-sizing: border-box; }
/* "hidden" must win over any display rule (the guess box is display:flex). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace; }
a { color: #7fb6d6; }
b { font-weight: bold; }
button { font: inherit; color: var(--ink); background: var(--panel); border: 2px solid var(--line); padding: 7px 11px; cursor: pointer; border-radius: 0; }
button:hover:not(:disabled) { border-color: #4a4268; }
button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.small, button.small[aria-pressed="true"] { font-size: 12px; padding: 4px 8px; color: var(--dim); border-color: var(--line); align-self: center; }
button.quiet { color: var(--dim); }
button.link { background: none; border: 0; padding: 0; color: #7fb6d6; text-decoration: underline; }
.grow { flex: 1; }
.muted { color: var(--dim); }

.app { max-width: 820px; margin: 0 auto; padding: 8px 16px 48px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 8px; }
.wordmark { margin: 0; font-size: 18px; letter-spacing: .14em; color: var(--accent); }
.daynum { color: var(--dim); font-size: 13px; }
.more-games { margin: 0 0 0 8px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.more-games a { color: var(--accent); font-weight: bold; text-decoration: none; }
.more-games a:hover { text-decoration: underline; }
/* No room beside the wordmark on a phone: the bar wraps, and the line takes a
   row of its own under the buttons (Capybaropolis's way). */
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; row-gap: 2px; }
  .more-games { order: 10; flex-basis: 100%; margin: 0; text-align: center; font-size: 11px; }
}
.icon { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; font-weight: bold; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { display: block; width: 4px; background: var(--ink); }
.bars i:nth-child(1) { height: 6px; } .bars i:nth-child(2) { height: 13px; } .bars i:nth-child(3) { height: 9px; }

.howto { background: var(--panel); border: 2px solid var(--line); padding: 6px 12px; margin: 0 0 10px; font-size: 13px; }
.howto summary { cursor: pointer; font-weight: bold; }
.howto ol { margin: 6px 0 4px; padding-left: 1.4em; }
.howto li { margin: 3px 0; }

/* The map. On a phone it stays pinned at the top while the page scrolls, so
   the guess box (just under it) and the map are always on screen together. */
.mapzone { background: var(--bg); }
.mapframe { position: relative; overflow: hidden; background: var(--sea); border: 2px solid var(--line); touch-action: pan-y; aspect-ratio: 800 / 374; }
.mapframe.zoomed { touch-action: none; cursor: grab; }
.maplayer { position: absolute; inset: 0; transform-origin: 0 0; }
.maplayer canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; transform-origin: 50% 50%; }
/* The chameleon's room: over the open sea in the corner, outside the zoom. */
.room { position: absolute; left: 0; bottom: 0; width: 16.5%; aspect-ratio: 92 / 76; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.stamp { position: absolute; right: 4%; bottom: 8%; transform: rotate(-7deg); border: 3px solid var(--pink); color: var(--pink); font-weight: bold; letter-spacing: .12em; padding: 2px 10px; font-size: clamp(12px, 2.6vw, 20px); pointer-events: none; }
.unzoom { position: absolute; right: 6px; top: 6px; padding: 4px 8px; font-size: 12px; background: #000c; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); margin: 6px 0; }
.legend .bar { display: flex; flex: 1; height: 10px; }
.legend .bar span { flex: 1; }

.views { display: flex; gap: 6px; margin: 6px 0; flex-wrap: wrap; align-items: center; }
.caption { font-size: 12px; color: var(--dim); margin: 4px 0 10px; min-height: 2.9em; }
.caption b { color: var(--ink); font-weight: normal; }
.message { background: var(--panel); border-left: 4px solid var(--pink); padding: 8px 12px; margin: 8px 0; }

.entry { display: flex; gap: 6px; margin: 4px 0; }
.field { position: relative; flex: 1; min-width: 0; }
.field input { width: 100%; font: inherit; font-size: 16px; padding: 10px; background: #0b0a12; color: var(--ink); border: 2px solid var(--line); border-radius: 0; }
.field input:focus { outline: none; border-color: var(--accent); }
.sugg { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #0b0a12; border: 2px solid var(--accent); border-top: 0; max-height: 300px; overflow-y: auto; }
.sugg div { padding: 9px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.sugg div.on, .sugg div:hover { background: var(--panel); }
.sugg small { color: var(--dim); white-space: nowrap; }
.nudge { font-size: 12px; color: var(--pink); margin: 2px 0 6px; }

.clues { display: grid; gap: 4px; margin: 10px 0 6px; }
.clue { background: var(--panel); border-left: 4px solid var(--accent); padding: 6px 10px; font-size: 13px; }
.clue.locked { border-left-color: var(--line); color: var(--dim); }
.clue.giveaway { border-left-color: var(--pink); }
.clue.giveaway button { display: block; margin-top: 6px; border-color: var(--pink); }
.giveaway-letters { letter-spacing: .08em; white-space: pre-wrap; }
.shortlist-btn { width: 100%; text-align: left; margin: 4px 0; }
.shortlist-btn:not(:disabled) { background: var(--accent); color: #1b1408; border-color: var(--accent); font-weight: bold; }
.shortlist-btn small { font-weight: normal; }
.shortlist { columns: 2 230px; font-size: 13px; background: var(--panel); padding: 8px 12px; }
.shortlist h3 { font-size: 12px; color: var(--accent); margin: 8px 0 2px; break-after: avoid; }
.shortlist div { cursor: pointer; padding: 2px 0; }
.shortlist div.used { color: var(--dim); text-decoration: line-through; cursor: default; }

.guesses { margin-top: 12px; display: grid; gap: 4px; }
.g { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--panel); padding: 6px 8px; cursor: pointer; border: 2px solid transparent; }
.g.sel { border-color: var(--accent); }
.g.latest { box-shadow: inset 0 0 0 1px var(--ink); }
.g .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g .meter { height: 8px; background: #0b0a12; margin-top: 3px; }
.g .meter i { display: block; height: 100%; }
.g .tags { font-size: 11px; color: var(--dim); }
.g .tags b { color: var(--accent); font-weight: normal; }
.g .pct { text-align: right; font-weight: bold; }
.g .pct small { display: block; font-weight: normal; color: var(--dim); font-size: 11px; }
.scorehelp { font-size: 12px; color: var(--dim); background: var(--panel); padding: 8px 10px; margin-top: 12px; }
.scorehelp b { color: var(--ink); font-weight: normal; }

#results { background: var(--panel); border: 2px solid var(--accent); padding: 12px; margin: 10px 0; }
.players { font-size: 17px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.players b { color: var(--accent); }
.chart { display: grid; grid-template-columns: 4.5em 1fr 3em; gap: 3px 8px; font-size: 12px; margin-top: 8px; align-items: center; }
.chart .b { height: 12px; background: #4a4268; min-width: 2px; }
.chart .me .b { background: var(--accent); }
.chart .me { color: var(--accent); }
#results h2 { margin: 4px 0 2px; font-size: 20px; color: var(--accent); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; margin-top: 8px; }
.cols ol { margin: 4px 0; padding-left: 1.6em; }
.why { margin: 10px 0; font-size: 14px; }
pre.share { background: #0b0a12; padding: 8px; white-space: pre-wrap; margin: 8px 0; font: inherit; font-size: 13px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.share-btn { background: var(--accent); color: #1b1408; border-color: var(--accent); font-weight: bold; }

.footer { margin-top: 28px; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 12px; color: var(--dim); }

dialog { background: var(--panel); color: var(--ink); border: 2px solid var(--accent); max-width: min(560px, 92vw); padding: 14px 16px; }
dialog::backdrop { background: #000a; }
dialog h2 { margin: 0 0 8px; font-size: 16px; color: var(--accent); }
dialog .close { margin-top: 12px; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin: 8px 0 12px; }
.statgrid b { display: block; font-size: 22px; }
.statgrid span { font-size: 11px; color: var(--dim); }

@media (max-width: 700px) {
  .app { padding: 4px 10px 40px; }
  .mapzone { position: sticky; top: 0; z-index: 10; padding-bottom: 2px; }
  .views button { padding: 6px 8px; font-size: 13px; }
  .entry { position: relative; }
}
