/* game.css: page layer for The Circle of Circles, on top of flat-warm.css.
   Everything outside the canvas follows flat-warm: tokens only, no borders, radius 0,
   teal for what can be pressed, rubric for titles, gold for section tags. */
:root { --stage: #0a0703; }            /* the window always hangs in the dark, in both themes */

html, body { height: 100%; }
body { overflow: hidden; }

.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem); grid-template-rows: auto minmax(0, 1fr); }
.fw-nav { grid-column: 1 / -1; }
.fw-brand { font-family: var(--font-heading); font-weight: 600; font-size: 1rem; }

.stage { position: relative; min-width: 0; min-height: 0; background: var(--stage); }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
canvas:focus-visible { outline-offset: -2px; }

.panel { min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg-high); padding: 1.5rem 1.5rem 2rem; }
.panel .fw-title { font-size: 0.8125rem; min-height: 1.3em; }
.panel h1 { margin: 0.3rem 0 0; font-family: var(--font-heading); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -0.01em; color: var(--fg-title); }
.g-en { margin: 0.3rem 0 0; font-family: var(--font-heading); font-size: 1rem; color: var(--fg-second); }
.g-sec { margin: 0.6rem 0 1.2rem; }
.g-tag { display: inline-block; padding: 0.15rem 0.45rem; background: var(--chip); font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.g-sec { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.g-tag#src { color: var(--nacht); }
.g-tag:empty { display: none; }

#lines p { margin: 0 0 0.75rem; max-width: 34rem; color: var(--fg); opacity: 0; transform: translateY(4px); transition: opacity 600ms, transform 600ms; }
#lines p.in { opacity: 1; transform: none; }
#lines p.fin { color: var(--fg-title); font-weight: 600; }
#lines p.act { margin: 1.3rem 0 0.5rem; font-family: var(--font-heading); font-weight: 600; font-size: 0.8125rem; color: var(--rubric); }
#lines p.act:first-child { margin-top: 0; }

.g-hint { margin: 1rem 0 0; padding: 0.55rem 0.75rem; max-width: 34rem; font-family: var(--font-heading); font-weight: 600; font-size: 0.875rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-high)); }
.g-actions { margin-top: 1rem; }
.g-actions .fw-btn { min-height: 2.4rem; padding: 0 1rem; font-size: 0.875rem; }

/* title */
.g-title { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 1.5rem 16px; overflow-y: auto; background: color-mix(in srgb, var(--stage) 78%, transparent); transition: opacity 160ms; }
.g-title.off { opacity: 0; pointer-events: none; }
.g-card { width: 100%; max-width: 34rem; padding: 2rem 2rem 2.2rem; background: var(--bg-high); }
.g-card .fw-title { font-size: 0.8125rem; }
.g-card h1 { margin: 0.5rem 0 0; font-family: var(--font-heading); font-weight: 600; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; color: var(--fg-title); }
.g-epi { margin: 0.9rem 0 0; font-family: var(--font-heading); font-size: 1.05rem; color: var(--fg-second); }
.g-epi span { color: var(--fg-title); font-weight: 600; }
.g-how { margin: 0.9rem 0 0; color: var(--fg-dim); }
.g-card .g-actions { margin-top: 1.4rem; }

@media (max-aspect-ratio: 1/1), (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 50vh minmax(0, 1fr); grid-template-rows: auto 50dvh minmax(0, 1fr); }
  .panel { padding: 0.9rem 16px 1.5rem; }
  .panel h1 { font-size: 1.5rem; }
  .g-sec { margin-bottom: 0.8rem; }
  .fw-nav { gap: 0.5rem; padding: 0.5rem 16px; }
  .fw-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fw-nav .fw-group { flex-wrap: nowrap; }
  .g-card { padding: 1.4rem 1.2rem 1.6rem; }
}
/* narrow phones: nav buttons keep their icon, the label stays for screen readers */
@media (max-width: 620px) {
  .g-nav { width: var(--hit); padding: 0; }
  .g-nav .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  #lines p { transition: none; }
}
