/* The demo scenes' own styles: one example of styling Honeytongue's result.parts (see docs/style.css for the shared ones). */

.game { max-width: 76ch; margin: 0 auto; padding: 1.5rem 1rem 2rem; }
@media (min-width: 700px) { .game { padding: 2.5rem 1.5rem 3rem; } }
.banner { margin: 0 0 1.5rem; }
.banner h1 { font-size: clamp(2.6rem, 11vw, 4rem); line-height: 0.85; margin: 0 0 0.5rem; }
.banner p { color: var(--dim); margin: 0; }
.banner .serial { color: var(--faint); margin-top: 0.3rem; }
.mode { border: 1px dashed var(--dim); color: var(--dim); padding: 0.5rem 0.8rem; margin: 0 0 1.5rem; font-size: 0.9rem; }
.mode strong { color: var(--bright); }

#log p { margin: 0 0 0.9rem; white-space: pre-wrap; }
#log .cmd { margin-top: 1.4rem; }
#log .debug { color: var(--dim); font-size: 0.85rem; margin: 0 0 0.6rem; }
#log .debug .readout { margin: 0.15rem 0; }
/* A scene's title card */
#log .card { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin: 1.6rem 0 1.4rem; font-weight: 400; }
#log .card-rule { color: var(--dim); font: 1rem/1 var(--mono); letter-spacing: 0.15em; text-shadow: none; }
#log .card-title { font: 400 2.3rem/1 var(--pixel); color: var(--bright); letter-spacing: 0.06em; text-transform: uppercase; text-shadow: var(--glow-strong); }

/* A judged reply (the label, colours, and rule are in style.css, shared with the docs and the playground). */
#log .reply { margin: 0 0 0.9rem; }
#log .reply p:last-child { margin-bottom: 0; }

/* The ending screen */
#log .end-screen { border: 3px double var(--line); background: var(--screen); padding: 1.25rem 1.1rem 1.1rem; margin: 1.5rem 0 0; text-align: center; }
#log .ending-mark { color: var(--dim); margin: 0; }
#log .ending-title { font: 400 2.2rem/1.05 var(--pixel); color: var(--bright); margin: 0.3rem 0 0.4rem; }
#log .ending-title:focus { outline: none; }
#log .ending-stats { color: var(--dim); margin: 0 0 1.1rem; }
#log .end-screen h3 { text-align: left; margin: 0 0 0.5rem; }
#log .end-screen ol { text-align: left; margin: 0 0 1.2rem; padding-left: 1.5rem; }
#log .end-screen li { margin: 0 0 0.5rem; white-space: normal; }
#log .end-screen li .dim { display: block; font-size: 0.85rem; }
#log .end-screen .again { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

/* Optional CRT mode, off by default, on this page only: stronger scanlines, glow, and a curved glass edge.
   Everything here is still. Nothing flickers or flashes, and it's dropped when the system asks for more contrast. */
body.crt { --glow: 0 0 6px rgb(255 168 48 / 0.55), 0 0 1px rgb(255 200 120 / 0.8); }
body.crt::after {
  background:
    repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.32) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 50%, rgb(0 0 0 / 0.6) 100%);
}
body.crt .game { border-radius: 18px; box-shadow: inset 0 0 60px rgb(0 0 0 / 0.5); }
@media (prefers-contrast: more) {
  body.crt { --glow: none; }
  body.crt .game { box-shadow: none; }
}
#log .error { color: var(--bright); border-left: 3px solid var(--dim); padding-left: 0.75rem; }
#log .thinking::after { content: "..."; }
@media (prefers-reduced-motion: no-preference) {
  #log .thinking::after { animation: dots 1.2s steps(4) infinite; display: inline-block; overflow: hidden; vertical-align: bottom; width: 3ch; }
  @keyframes dots { from { width: 0; } to { width: 4ch; } }
}

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.choices:empty { display: none; }
.key {
  font: 500 0.85rem var(--mono); color: var(--fg); text-shadow: inherit;
  background: none; border: 1px solid var(--dim); padding: 0.35rem 0.7rem; cursor: pointer; text-align: left;
}
.key:hover { background: var(--fg); color: var(--bg); text-shadow: none; }
.key b { color: var(--bright); font-weight: 600; }
.key:hover b { color: inherit; }

#prompt { display: flex; align-items: baseline; gap: 0.6ch; border-bottom: 1px dashed var(--line); padding: 0.4rem 0; margin-top: 0.5rem; }
#prompt span { color: var(--dim); font-weight: 500; }
#cmd {
  flex: 1; min-width: 0;
  font: 500 1rem/1.5 var(--mono); /* 16px or more stops phones zooming in */
  color: var(--bright); caret-color: var(--bright); text-shadow: inherit;
  background: transparent; border: 0; padding: 0; outline: none;
}
#prompt:focus-within { border-bottom-color: var(--dim); }
#prompt[hidden] { display: none; }
#cmd::placeholder { color: var(--dim); opacity: 0.8; }
/* A block cursor, like a real terminal, where the browser supports it. */
@supports (caret-shape: block) { #cmd { caret-shape: block; } }
#cmd[readonly] { opacity: 0.6; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.key.record { display: inline-flex; align-items: center; gap: 0.4rem; }
.key.record input { accent-color: var(--bright); margin: 0; }
.key.record:has(input:focus-visible) { outline: 2px solid var(--bright); outline-offset: 2px; }
.status .moves { white-space: nowrap; }
a.key { text-decoration: none; }
.share { margin: 0.75rem 0 0; font-size: 0.9rem; }

.scenes { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.scene { display: block; border: 1px solid var(--dim); padding: 0.8rem 1rem; text-decoration: none; color: var(--fg); }
.scene:hover, .scene:focus-visible { background: var(--fg); color: var(--bg); text-shadow: none; }
.scene b { display: block; color: var(--bright); font-weight: 600; }
.scene:hover b, .scene:focus-visible b, .scene:hover .dim, .scene:focus-visible .dim { color: inherit; }
.scene span { display: block; }
#picker > p { margin: 0 0 1rem; }
/* Difficulty tags: the word says it, and the colour repeats it (the verdict colours, which meet contrast in both themes). */
.scene .tag {
  display: inline-block; margin-left: 0.6rem; padding: 0 0.4em; border: 1px solid currentColor;
  font-size: 0.75em; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 0.15em;
}
.tag-easy { color: var(--good); }
.tag-normal { color: var(--warn); }
.tag-hard, .tag-very-hard { color: var(--bad); }
.scene:hover .tag, .scene:focus-visible .tag { color: inherit; }
@media (max-width: 420px) { .status .label { display: none; } }
@media (max-width: 340px) { .status .moves-label { display: none; } }
