/* ═══════════════════════════════════════════════════════════════
   Starving the Gods · the games
   Sits on top of styles.css and uses its tokens, so every game
   follows the film crossing for free.
   ═══════════════════════════════════════════════════════════════ */

.gm { padding: 7rem 0 3rem; }
.gm .wrap { width: min(100% - (var(--gutter) * 2), 60rem); }
.gm--narrow .wrap { width: min(100% - (var(--gutter) * 2), 42rem); }

.gm__head { display: grid; gap: .8rem; justify-items: start; margin-bottom: 1.6rem; }
.gm__title { font-size: 1.9rem; font-weight: 600; line-height: 1.1; letter-spacing: -.018em; margin: 0; text-wrap: balance; }
.gm__sub { font-size: 1rem; color: var(--dim); margin: 0; max-width: 50ch; line-height: 1.65; }

.gm__panel { border: 1px solid var(--edge); background: color-mix(in srgb, var(--panel) 70%, transparent);
             padding: 1.1rem; display: grid; gap: 1rem; }
.gm__panel + .gm__panel { margin-top: .8rem; }

/* ── Toolbar: stats on the left, switches on the right ─────────── */

.gm__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.gm__stats { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.gm__stat { font-family: var(--mono); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.gm__stat b { color: var(--text); font-weight: 500; }
.gm__stat b.is-warn { color: var(--rust); }
.gm__stat b.is-cool { color: var(--violet); }
.gm__tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.gm__ctl span { display: inline; }
.gm__ctl svg { width: 18px; height: 13px; }
.gm__ctl[data-sound][aria-pressed="false"] { color: var(--dim); border-color: var(--edge); }
.gm__ctl[data-sound][aria-pressed="true"] { color: var(--text); border-color: var(--edge); }

/* ── The playfield. Canvas games keep a fixed shape. ───────────── */

.gm__field { position: relative; border: 1px solid var(--edge); background: var(--ground);
             overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
             -webkit-tap-highlight-color: transparent; }
.gm__field canvas { display: block; width: 100%; height: 100%; }
.gm__field:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.gm__field--wide { aspect-ratio: 16 / 10; max-height: calc(100svh - 12rem); }
.gm__field--tall { aspect-ratio: 3 / 4; max-height: calc(100svh - 11rem); margin-inline: auto; }
@media (min-width: 48rem) { .gm__field--tall { aspect-ratio: 4 / 3; } }

.gm__over { position: absolute; inset: 0; display: grid; place-items: safe center; padding: 1.2rem; overflow-y: auto; overscroll-behavior: contain;
            background: color-mix(in srgb, var(--ground) 78%, transparent); backdrop-filter: blur(2px);
            text-align: center; z-index: 2; }
.gm__over[hidden] { display: none; }
.gm__card { display: grid; gap: .9rem; justify-items: center; max-width: 30rem; }
.gm__card h2 { font-size: 1.5rem; }
.gm__card p { margin: 0; color: var(--dim); line-height: 1.6; font-size: 1rem; }
.gm__card .label { color: var(--rust); }
.gm__big { font-family: var(--mono); font-size: 2.4rem; line-height: 1; color: var(--text); letter-spacing: .02em; }
@media (max-width: 40rem) {
  .gm__over { padding: .9rem; }
  .gm__card { gap: .6rem; }
  .gm__card h2 { font-size: 1.2rem; }
  .gm__card p { font-size: .9rem; line-height: 1.5; }
  .gm__big { font-size: 1.8rem; }
}

.gm__acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; }
.gm__acts--start { justify-content: flex-start; }
.btn--sm { padding: .6rem 1rem; font-size: .6875rem; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

/* ── Touch pads for the action games ───────────────────────────── */

.gm__pad { display: grid; gap: .5rem; margin-top: .7rem; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.gm__key { font-family: var(--mono); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase;
           padding: 1rem .5rem; background: var(--panel); color: var(--text); border: 1px solid var(--edge);
           cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
           transition: border-color 120ms ease, color 120ms ease, transform 80ms ease; }
.gm__key:hover { border-color: var(--dim); }
.gm__key.is-down, .gm__key:active { border-color: var(--rust); color: var(--rust); transform: translateY(1px); }
.gm__key small { display: block; color: var(--dim); font-size: .5rem; letter-spacing: .12em; margin-top: .25rem; }
@media (pointer: fine) and (min-width: 52rem) { .gm__pad--touch { display: none; } }

/* ── Notes, the how-to, the next game ──────────────────────────── */

.hint { font-family: var(--mono); font-size: .625rem; letter-spacing: .1em; color: var(--dim); margin: 0; line-height: 1.9; }
.hint b { color: var(--rust); font-weight: 500; }
.hint em { color: var(--violet); font-style: normal; }

.gm__how { margin-top: 2.6rem; display: grid; gap: 1rem; max-width: 40rem; }
.gm__how h2 { font-family: var(--mono); font-size: .6875rem; font-weight: 500; letter-spacing: .2em;
              text-transform: uppercase; color: var(--dim); }
.gm__how p, .gm__how li { font-size: 1rem; line-height: 1.7; margin: 0; }
.gm__how ul { margin: 0; padding-left: 1.2em; display: grid; gap: .4rem; }
.gm__how b { font-weight: 600; }
.gm__how kbd { font-family: var(--mono); font-size: .75rem; border: 1px solid var(--edge); padding: 0 .35em; }

.gm__join { font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; color: var(--dim); margin: 0; line-height: 1.8; }
.gm__join a { color: var(--rust); text-decoration: none; border-bottom: 1px solid var(--rust); }

.gm__floor { margin-top: 3.5rem; display: grid; gap: 2.5rem; justify-items: start; }
.gm .foot { margin-top: 3.5rem; }

.tiles { display: grid; gap: .8rem; }
@media (min-width: 40rem) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tiles--more { width: 100%; }
.tile { border: 1px solid var(--edge); background: color-mix(in srgb, var(--panel) 75%, transparent);
        padding: 1.1rem; display: grid; gap: .6rem; align-content: start; text-decoration: none; color: inherit;
        transition: border-color 200ms ease, transform 200ms ease; }
.tile:hover { border-color: var(--rust); transform: translateY(-2px); }
.tile__top { display: flex; align-items: center; gap: .8rem; }
.tile__mark { width: 2.4rem; height: 2.4rem; flex: none; color: var(--rust); }
.tile__name { font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.tile__who { font-family: var(--mono); font-size: .5625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.tile__pitch { font-size: .9375rem; line-height: 1.55; color: var(--dim); margin: 0; }
.tile__meta { font-family: var(--mono); font-size: .5625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tile--feature { border-color: color-mix(in srgb, var(--rust) 55%, var(--edge)); }
@media (min-width: 40rem) and (max-width: 59.99rem) { .tile--feature { grid-column: span 2; } }

.gm__toast { position: fixed; left: 50%; bottom: 4.4rem; transform: translate(-50%, 1rem); z-index: 80;
             font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase;
             background: var(--text); color: var(--ground); padding: .6rem 1rem; opacity: 0; pointer-events: none;
             transition: opacity 200ms ease, transform 200ms ease; }
.gm__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 52rem) { .gm { padding-top: 5.5rem; } }
@media (min-width: 60rem) { .gm__title { font-size: 2.4rem; } }
@media (prefers-reduced-motion: reduce) { .tile, .gm__key, .gm__toast { transition: none; } }
