/* Constellationdle (SPEC 11): one column, mobile first, after Somebodle's 12.1. */
:root {
  --night: #070b1d;
  --panel: #0f1530;
  --panel-2: #161e40;
  --brass: #c9a24a;
  --brass-dark: #8a6a2a;
  --cream: #f6ead6;
  --muted: #c3bfd4;
  --ink: #0b0f22;
  --far: #9fb4c7;
  --off: #ffd75e;
  --warm: #ffa94d;
  --close: #ff5a4a;
  --correct: #ffd23f;
  --loss: #f6ead6;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--night); color: var(--cream); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top {
  width: 100%;
  max-width: 560px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 10px;
}
.brand { margin: 0; line-height: 0; }
.tools { display: flex; gap: 2px; }
.tools button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.tools button:hover { background: var(--panel-2); }
canvas { image-rendering: pixelated; }

main { width: 100%; max-width: 560px; flex: 1; }

#scene-box {
  position: relative;
  width: 100%;
  height: clamp(200px, 46dvh, 420px);
  background: var(--night);
  display: grid;
  place-items: center;
  overflow: hidden;
}
@media (min-width: 860px) {
  #scene-box { height: clamp(260px, 52dvh, 480px); }
}
#scene { display: block; }
.scene-home {
  background: var(--brass);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

#panel { padding: 12px 14px 16px; background: var(--panel); min-height: 200px; }

h2, h3 { margin: 0.4em 0 0.3em; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; color: var(--brass); }
p { margin: 0.4em 0; }
a { color: var(--brass); }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
/* Chrome's default placeholder grey is 3.9:1 on the cream box; this is 5.1:1 (SPEC 15). */
input::placeholder { color: #6b6250; opacity: 1; }

.btn {
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  padding: 0 18px;
  background: var(--brass);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 0 3px 0 var(--brass-dark);
  cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brass-dark); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.secondary { background: transparent; color: var(--cream); border-color: var(--brass); box-shadow: none; font-weight: 600; }
.btn.wide { width: 100%; }
.small { font-size: 0.9rem; color: var(--muted); }

/* ---- the title view (SPEC 11.3) -------------------------------------------- */
.title { text-align: center; transition: transform 300ms ease-in, opacity 300ms ease-in; }
.title.leaving { transform: translateY(-40px); opacity: 0; }
.title .big-mark { margin: 6px auto 0; display: block; }
.title .tagline { color: var(--muted); margin-top: 6px; }
.title .btn { margin: 10px 0 14px; min-width: 200px; }
.howto { text-align: left; padding-left: 1.2em; margin: 0.6em 0; }
.howto li { margin: 0.3em 0; }
.legend { list-style: none; padding: 0; margin: 0.8em 0; text-align: left; }
.legend li { padding: 6px 10px; border-left: 4px solid; margin: 4px 0; background: var(--panel-2); }
.legend b { font-weight: 700; }
.legend .far { border-color: var(--far); } .legend .far b { color: var(--far); }
.legend .off { border-color: var(--off); } .legend .off b { color: var(--off); }
.legend .warm { border-color: var(--warm); } .legend .warm b { color: var(--warm); }
.legend .close { border-color: var(--close); } .legend .close b { color: var(--close); }
.legend .correct { border-color: var(--correct); } .legend .correct b { color: var(--correct); }

/* ---- the playing view (SPEC 11.4) ------------------------------------------- */
.pips { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; flex-wrap: wrap; }
.pip { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.pip.unused { border: 2px solid #3a4470; color: #8a94c4; /* 4.5:1 on the panel (SPEC 15) */ font-size: 16px; line-height: 1; }
.pip canvas { display: block; }
.pips .label { margin-left: auto; font-weight: 700; }
.clues { list-style: none; padding: 0; margin: 0.3em 0 0.8em; counter-reset: clue; }
.clues li {
  counter-increment: clue;
  position: relative;
  padding: 8px 10px 8px 38px;
  margin: 6px 0;
  background: var(--panel-2);
  border-left: 3px solid var(--brass-dark);
}
.clues li::before {
  content: counter(clue);
  position: absolute;
  left: 10px;
  top: 8px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}
.clues li.fresh { animation: fresh 600ms ease-out; }
@keyframes fresh { from { background: var(--cream); color: var(--ink); } to { background: var(--panel-2); } }
.no-clue { color: var(--muted); margin: 0.3em 0 0.8em; }

.inrow { position: relative; display: flex; gap: 8px; margin-top: 8px; }
.inrow input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  font: inherit;
  padding: 0 12px;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0;
}
.dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--ink);
  z-index: 5;
  max-height: 60vh;
  overflow: auto;
}
.dropdown.below { bottom: auto; top: calc(100% + 4px); }
.dropdown li { padding: 10px 12px; min-height: 44px; cursor: pointer; border-bottom: 1px solid #d8d0c2; }
.dropdown li[aria-selected="true"], .dropdown li:hover { background: var(--brass); }
.dropdown .ep { color: #4a4660; font-size: 0.9rem; }
.dropdown .al { color: #4a4660; font-size: 0.85rem; margin-right: 4px; }
.msg { min-height: 1.4em; color: var(--off); margin: 6px 0; }
.skip { margin-top: 4px; }

.rows { list-style: none; padding: 0; margin: 14px 0 0; }
.rows li {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 6px 0;
  background: var(--panel-2);
  border-left: 4px solid;
}
.rows .mini { display: flex; align-items: center; justify-content: center; }
.rows .who b { margin-right: 6px; }
.rows .who .meaning { color: var(--muted); font-size: 0.85rem; }
.rows .phrase { font-weight: 700; }
.rows .dir { color: var(--muted); font-size: 0.9rem; }
.band-far { border-color: var(--far) !important; } .band-far .phrase { color: var(--far); }
.band-off { border-color: var(--off) !important; } .band-off .phrase { color: var(--off); }
.band-warm { border-color: var(--warm) !important; } .band-warm .phrase { color: var(--warm); }
.band-close { border-color: var(--close) !important; } .band-close .phrase { color: var(--close); }
.band-correct { border-color: var(--correct) !important; background: #2e2a18 !important; } .band-correct .phrase { color: var(--correct); }

/* ---- results (SPEC 11.6) ---------------------------------------------------------- */
.results .headline { font-size: 28px; font-weight: 700; letter-spacing: 0.08em; margin: 0.2em 0 0; color: var(--correct); }
.results .headline.loss { color: var(--loss); }
.answer { display: flex; gap: 12px; align-items: flex-start; padding: 10px; margin: 10px 0; background: var(--panel-2); }
.answer canvas { flex: none; }
.answer h2 { margin: 0; }
.answer .meaning { color: var(--muted); margin: 0; }
.answer .line { font-size: 0.9rem; }
.tonight canvas { display: block; margin: 6px auto; max-width: 100%; }
.myclues { padding-left: 1.4em; }
.myclues li { margin: 0.4em 0; }
.myclues a { font-size: 0.85rem; margin-left: 4px; }
.hist { display: grid; gap: 4px; margin: 8px 0; }
.hist .bar { display: grid; grid-template-columns: 20px 1fr; gap: 6px; align-items: center; font-size: 0.9rem; }
.hist .fill { background: var(--panel-2); color: var(--cream); padding: 2px 6px; min-width: max-content; text-align: right; white-space: nowrap; }
.hist .me .fill { background: var(--correct); color: var(--ink); font-weight: 700; }
/* The link to the owner's other games (the andromeda-game-page skill). */
.more-games { margin: 12px 0; padding: 8px 10px; border: 1px dashed var(--brass); font-size: 13px; color: var(--muted); text-align: center; }
.more-games a { color: var(--brass); font-weight: bold; }
.share { margin: 12px 0; }
.toast { color: var(--correct); margin-left: 8px; }
.countdown { font-variant-numeric: tabular-nums; }

/* ---- panels (SPEC 11.7) ------------------------------------------------------------ */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 10px 0; }
.stat-grid div { background: var(--panel-2); padding: 8px 4px; }
.stat-grid b { display: block; font-size: 1.4rem; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--panel-2); }
.setting select { font: inherit; min-height: 44px; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.err { padding: 12px; background: var(--panel-2); border-left: 4px solid var(--brass); }

.foot { padding: 12px 14px 24px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.foot .studio { color: inherit; }
.foot .btn { font-size: 0.9rem; }
.noscript { padding: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .clues li.fresh { animation: none; }
  .title { transition: none; }
}
.reduced .clues li.fresh { animation: none; }
.reduced .title { transition: none; }

.results .headline:focus, .panel-head h2:focus { outline: none; }

/* ---- the holo look (SPEC 8.11) ------------------------------------------------------
   The page as a Mass Effect style HUD round the star map: deep navy glass
   panels, thin cyan edges, chamfered corners, amber for actions, Rajdhani
   capitals. Scoped to html.holo, so the pixel art keeps its own page. */
html.holo {
  --night: #02050d;
  --panel: rgba(6, 16, 36, 0.92);
  --panel-2: rgba(14, 34, 66, 0.55);
  --brass: #ffb347;
  --brass-dark: #a8661c;
  --cream: #d8ecff;
  --muted: #8fb0cf;
  --ink: #02050d;
  --holo: #78d2ff;
  --holo-dim: rgba(120, 210, 255, 0.35);
  --cut: 10px;
}
html.holo body {
  font-family: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 500;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40, 90, 180, 0.22), transparent 60%),
    linear-gradient(180deg, #030817, #02050d 40%);
  background-attachment: fixed;
}
html.holo canvas#scene { image-rendering: auto; }
html.holo .top { border-bottom: 1px solid var(--holo-dim); }
html.holo .brand canvas { display: none; }
html.holo .brand .sr {
  position: static; width: auto; height: auto; overflow: visible; clip: auto;
  font-size: clamp(14px, 4.4vw, 22px); font-weight: 700; letter-spacing: 0.16em; line-height: 48px; white-space: nowrap;
  color: var(--cream); text-shadow: 0 0 10px rgba(120, 210, 255, 0.7);
}
html.holo .tools button:hover { background: rgba(120, 210, 255, 0.12); }
html.holo .tools canvas { filter: drop-shadow(0 0 3px rgba(120, 210, 255, 0.7)) hue-rotate(160deg) saturate(1.4); }
html.holo #scene-box { background: var(--night); border-bottom: 1px solid var(--holo-dim); }
html.holo .scene-home {
  background: rgba(6, 16, 36, 0.85); color: var(--brass);
  border: 1px solid var(--brass); box-shadow: 0 0 8px rgba(255, 179, 71, 0.5);
}
html.holo #panel {
  background: linear-gradient(180deg, rgba(8, 22, 48, 0.94), rgba(4, 10, 24, 0.96));
  border-left: 1px solid var(--holo-dim);
  border-right: 1px solid var(--holo-dim);
}
html.holo h2, html.holo h3 { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
html.holo h3 { color: var(--holo); }
html.holo a { color: var(--holo); }
html.holo :focus-visible { outline: 2px solid var(--holo); }
html.holo input::placeholder { color: #6f8fb0; }
html.holo .btn {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  background: linear-gradient(180deg, #ffc56a, #f2972e); color: #1a0c00;
  border: 0; box-shadow: 0 0 14px rgba(255, 179, 71, 0.35);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
html.holo .btn:active { transform: translateY(1px); box-shadow: 0 0 6px rgba(255, 179, 71, 0.35); }
html.holo .btn.secondary {
  background: rgba(120, 210, 255, 0.06); color: var(--holo);
  border: 1px solid var(--holo-dim); box-shadow: none;
}
html.holo .legend li, html.holo .clues li, html.holo .rows li, html.holo .answer,
html.holo .stat-grid div, html.holo .err {
  background: var(--panel-2);
  border-top: 1px solid rgba(120, 210, 255, 0.14);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
html.holo .clues li { border-left: 2px solid var(--holo); }
html.holo .clues li::before {
  background: transparent; color: var(--holo); border: 1px solid var(--holo);
  box-shadow: 0 0 6px rgba(120, 210, 255, 0.5);
}
@keyframes holo-fresh { from { background: rgba(120, 210, 255, 0.35); } to { background: var(--panel-2); } }
html.holo .clues li.fresh { animation-name: holo-fresh; }
html.holo .pip.unused { border-color: var(--holo-dim); color: var(--muted); }
html.holo .inrow input, html.holo .setting select {
  background: rgba(2, 8, 20, 0.85); color: var(--cream);
  border: 1px solid var(--holo-dim); font-weight: 600; letter-spacing: 0.04em;
}
html.holo .inrow input:focus { border-color: var(--holo); box-shadow: 0 0 10px rgba(120, 210, 255, 0.35); outline: none; }
html.holo .dropdown {
  background: rgba(4, 12, 28, 0.97); color: var(--cream); border: 1px solid var(--holo-dim);
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
}
html.holo .dropdown li { border-bottom: 1px solid rgba(120, 210, 255, 0.1); }
html.holo .dropdown li[aria-selected="true"], html.holo .dropdown li:hover { background: rgba(120, 210, 255, 0.16); }
html.holo .dropdown .ep, html.holo .dropdown .al { color: var(--muted); }
html.holo .band-correct { background: rgba(255, 210, 63, 0.12) !important; }
html.holo .results .headline { text-transform: uppercase; letter-spacing: 0.2em; text-shadow: 0 0 14px currentColor; }
html.holo .hist .fill { background: rgba(120, 210, 255, 0.14); }
html.holo .hist .me .fill { background: var(--brass); color: #1a0c00; }
html.holo .more-games { border-color: var(--holo-dim); }
html.holo .more-games a { color: var(--brass); }
html.holo .title .big-mark { display: none; }
html.holo .title .tagline { text-transform: uppercase; letter-spacing: 0.18em; color: var(--holo); }
html.holo .foot { color: var(--muted); }
