/* Adapted from shrimply@63e004d2 src/styles.css on 2026-10-09. Shellennium's own from here on; not synced. */
/* Shellennium's page (SPEC 8.1, 7.1). The scene is a canvas scaled up with
   pixelated rendering; everything else is plain DOM in the UI palette, in
   the system monospace stack with smoothing off, as Shrimply's is. One
   column at every size: the timeline is wide, so it gets the whole width. */
:root {
  color-scheme: dark;
  --sea-900: #0d1b2a;
  --sea-800: #13283d;
  --sea-700: #1a3552;
  --line: #2c4a66;
  --cream: #f6ead6;
  --cream-dim: #b9c3cc;
  --crab: #ff9a6b;
  --crab-deep: #e0704a;
  --amber: #ffb648;
  --link: #7ec8ff;
  /* The heat bands (3.9). */
  --far: #9fb4c7;
  --off: #ffd75e;
  --warm: #ffa94d;
  --close: #ff5a4a;
  --correct: #ffd23f;
  --loss: #a9b2bd;
  --font: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--sea-900);
  color: var(--cream);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button {
  background: var(--sea-800);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--cream-dim); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--crab); border-color: var(--crab); color: var(--sea-900); font-weight: bold; }
button.primary:hover:not(:disabled) { background: #ffb48f; border-color: #ffb48f; }
button.big { font-size: 1.25em; padding: 10px 18px; width: 100%; }
a { color: var(--link); }
[hidden] { display: none !important; }
.dim { color: var(--cream-dim); }
.warn { color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
h3 { margin: 6px 0 0; font-size: 14px; color: var(--cream-dim); }

/* ---- the shell (8.1) ---- */
.app { height: 100dvh; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
/* With the phone keyboard up the shell is the visible part (ui.js). */
body.keyboard .app { position: fixed; left: 0; right: 0; top: var(--app-top, 0); height: var(--app-h, 100dvh); }
.topbar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
/* How to play, folded under the header (Statameleon's and Histortoise's). */
.howto { background: var(--sea-800); border-bottom: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
.howto summary { cursor: pointer; color: var(--crab); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: bold; }
.howto ol { margin: 6px 0 4px; padding-left: 1.4em; }
.howto li { margin: 3px 0; }
.wordmark { margin: 0; font-size: 18px; letter-spacing: 0.25em; color: var(--crab); }
button.icon { width: 36px; height: 32px; padding: 0; font-weight: bold; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.bars i { display: block; width: 4px; background: var(--cream); }
.bars i:nth-child(1) { height: 7px; }
.bars i:nth-child(2) { height: 14px; }
.bars i:nth-child(3) { height: 10px; }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 55dvh) minmax(0, 1fr); }
.scene { position: relative; overflow: hidden; background: #0a1522; min-height: 160px; }
#scene { display: block; image-rendering: pixelated; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
.panel { overflow: auto; padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; scroll-padding-bottom: 100px; }
@media (max-width: 860px) {
  .app { border: 0; }
  /* While typing on a phone the scene gives way to the newest clue and the
     box, which is all that fits above the keyboard (ui.js). */
  body.keyboard .stage { grid-template-rows: 0 minmax(0, 1fr); }
  body.keyboard .scene { min-height: 0; }
}
.view { display: flex; flex-direction: column; gap: 10px; }
.view h2 { margin: 0; font-size: 16px; }
#view-play:not([hidden]), #view-results:not([hidden]) { animation: rise 0.35s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.notice { margin: auto 0 0; padding-top: 10px; font-size: 12px; color: var(--cream-dim); }
.footer { font-size: 12px; color: var(--cream-dim); }

/* ---- the title over the beach (3.20) ---- */
.title-mark { position: absolute; left: 0; right: 0; top: 10%; display: flex; justify-content: center; pointer-events: none; transition: transform 0.5s ease-in, opacity 0.5s ease-in; transform: translateY(-160%); opacity: 0; }
body.titled .title-mark { transform: none; opacity: 1; transition-timing-function: ease-out; }
#wordmark-art { image-rendering: pixelated; width: min(86%, 400px); height: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); }
.tagline { margin: 0; color: var(--cream-dim); text-align: center; }
.howto { margin: 0; padding-left: 1.4em; }
.howto li { margin: 2px 0; }
.countdown { margin: 0; color: var(--cream-dim); }

/* ---- hop and recenter (3.16) ---- */
.hops { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.hops button { width: 36px; height: 34px; padding: 0; background: rgba(13, 27, 42, 0.82); }

/* ---- playing (8.3) ---- */
.play-head { display: flex; align-items: center; gap: 10px; }
.pips { display: inline-flex; gap: 3px; }
.pips canvas { width: 22px; height: auto; image-rendering: pixelated; }
.clue-count { font-weight: bold; }
.clue-count.last { color: var(--amber); }
.clues { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.clues li { background: var(--sea-800); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.clues li .n { color: var(--cream-dim); margin-right: 6px; }
.clues li.fresh { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--sea-700); border-color: var(--amber); } }
.clues li.last-shot { border-color: var(--amber); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.last-shot .lead { color: var(--amber); font-weight: bold; }
.last-shot .place { font-weight: bold; }
.last-shell, .lineup-shell { image-rendering: pixelated; height: auto; }
.note { margin: 0; padding: 6px 10px; border-left: 3px solid var(--amber); color: var(--cream); }
.guess { position: relative; display: flex; gap: 8px; }
/* Small and quiet under the box: the way out for a blank mind, not the main act. */
button.skip { align-self: flex-end; padding: 2px 8px; font-size: 12px; background: transparent; border-color: var(--line); color: var(--cream); opacity: 0.8; }
button.skip:hover:not(:disabled) { opacity: 1; }
.guess input { flex: 1; min-width: 0; background: #0a1522; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 16px; }
.guess input:focus { outline: 2px solid var(--crab); outline-offset: 0; }
.dropdown { position: absolute; left: 0; right: 0; bottom: 100%; margin: 0 0 4px; padding: 4px; list-style: none; background: var(--sea-800); border: 1px solid var(--line); border-radius: 6px; z-index: 5; overflow-y: auto; overscroll-behavior: contain; }
.dropdown li { padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.dropdown li small { color: var(--cream-dim); font-size: 12px; }
.dropdown li[aria-selected="true"], .dropdown li:hover { background: var(--line); }
.message { margin: 0; min-height: 1.45em; color: var(--amber); }
.dock { position: sticky; bottom: -12px; margin: 0 -14px -12px; padding: 8px 14px 10px; background: var(--sea-900); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; z-index: 4; }

/* ---- results (8.4) and stats (8.5) ---- */
.view .headline { margin: 0; font-size: 20px; }
.band-correct { color: var(--correct); }
.band-close { color: var(--close); }
.band-warm { color: var(--warm); }
.band-off { color: var(--off); }
.band-far { color: var(--far); }
.band-loss { color: var(--loss); }
.answer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: 18px; font-weight: bold; }
.answer .span { color: var(--cream-dim); font-weight: normal; font-size: 15px; }
.place-line { margin: -6px 0 0; }
.summary { margin: 0; }
.lineup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
.lineup .arrow { color: var(--cream-dim); padding-bottom: 6px; }
.lineup-shell.today { outline: 1px dashed var(--correct); outline-offset: 3px; }
.clues.all li a { white-space: nowrap; }
.compare { margin: 0; }
.compare-rank { margin: 0; font-weight: bold; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.stat-grid b { display: block; font-size: 20px; }
.stat-grid span { font-size: 12px; color: var(--cream-dim); }
.dist { display: grid; grid-template-columns: 1.6em 1fr; gap: 3px 6px; align-items: center; margin-top: 8px; }
.dist-track { display: block; }
.dist .dist-bar { display: block; background: var(--line); color: var(--cream); text-align: right; padding: 0 6px; border-radius: 3px; min-width: 1.6em; }
.dist .dist-bar.you { background: var(--crab); color: var(--sea-900); }
.manual-copy { width: 100%; background: #0a1522; color: var(--cream); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; resize: none; }
.back { align-self: flex-start; }

/* ---- the legend (3.20) ---- */
.legend h3 { margin: 12px 0 6px; font-size: 14px; color: var(--cream); }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.3; }
.legend-mark { width: 48px; height: auto; image-rendering: pixelated; flex: none; }
.legend-device { width: 64px; height: auto; image-rendering: pixelated; flex: none; background: rgba(255, 255, 255, 0.04); border-radius: 4px; }
.legend-note { font-size: 12px; margin: 6px 0 0; }
@media (min-width: 560px) {
  .legend-list.launchers { grid-template-columns: 1fr 1fr; }
}
.view .headline:focus { outline: none; }
