/* ==========================================================================
   THE DIVINE ARCHIVES — Mini-Games Layer (shared styles)
   Reuses the site's existing tokens/fonts from archive.css. No new palette.
   Covers: the dormant→activated symbol trigger, the expand overlay/dialog,
   the first-visit hint, the symbols gallery, and shared game chrome.
   ========================================================================== */

/* ---------- the hidden-symbol trigger (dormant → hover shimmer → activated) ---------- */
.symbol-trigger {
  position: relative;
  cursor: pointer;
  display: inline-block;
  border-radius: 8px;
  outline: none;
  transition: box-shadow .35s ease, transform .35s ease;
}
.symbol-trigger svg { display: block; }

/* subtle glow/shimmer so people notice it responds to a touch */
.symbol-trigger::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px 2px rgba(199,154,84,.35);
  transition: opacity .35s ease;
}
.symbol-trigger:hover::after,
.symbol-trigger:focus-visible::after { opacity: 1; }
.symbol-trigger:hover, .symbol-trigger:focus-visible { transform: translateY(-1px); }
.symbol-trigger:focus-visible { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--gold-bright); }

/* animated shimmer sweep on hover/focus — disabled for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .symbol-trigger::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: 8px;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(231,198,128,.22) 50%, transparent 70%);
    background-size: 260% 100%;
    background-position: 140% 0;
    opacity: 0;
    transition: opacity .3s ease;
  }
  .symbol-trigger:hover::before, .symbol-trigger:focus-visible::before {
    opacity: 1;
    animation: sigil-shimmer 2.4s ease-in-out infinite;
  }
}
@keyframes sigil-shimmer { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }

/* a small "playable" mark in the corner of a live symbol */
.symbol-trigger .sigil-spark {
  position: absolute; top: -6px; right: -6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright) 0%, var(--gold) 45%, transparent 70%);
  opacity: .0; transition: opacity .35s ease; pointer-events: none;
}
.symbol-trigger:hover .sigil-spark, .symbol-trigger:focus-visible .sigil-spark { opacity: .9; }

/* ---------- first-visit hint ---------- */
.games-hint {
  /* pinned to both edges and centred: "left: 50%" + translate let the box use only half the
     screen's width, which squeezed it into a narrow column on phones */
  position: fixed; left: 1rem; right: 1rem; bottom: 1.1rem; margin: 0 auto;
  z-index: 61; max-width: 30rem; box-sizing: border-box;
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem .9rem .8rem 1rem;
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
  font-family: var(--font-body); font-size: .92rem; line-height: 1.4;
}
.games-hint .sigil { color: var(--gold); font-size: 1.1rem; line-height: 1; margin-top: .05rem; }
.games-hint strong { color: var(--parchment); font-family: var(--font-display); font-weight: 500; letter-spacing: .03em; }
.games-hint button {
  flex: none; background: none; border: 1px solid var(--line);
  color: var(--ink-dim); border-radius: 6px; cursor: pointer;
  font-size: .78rem; padding: .25rem .5rem; margin-left: .25rem;
  font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.games-hint button:hover { color: var(--parchment); border-color: var(--gold); }

/* ---------- the expand overlay (activated state) ---------- */
.game-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(.5rem, 3vw, 2rem);
  background: rgba(10,7,3,.78);
  backdrop-filter: blur(2px);
}
/* phones: no blur behind the game window (a full-screen blur every frame costs frame rate; speed fix #7) */
@media (pointer: coarse) { .game-overlay { backdrop-filter: none; background: rgba(10,7,3,.9); } }
@media (prefers-reduced-motion: no-preference) {
  .game-overlay { animation: game-fade .25s ease both; }
  .game-dialog  { animation: game-rise .3s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes game-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes game-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.game-dialog {
  position: relative;
  width: min(46rem, 100%); max-height: calc(100dvh - 1.5rem);
  overflow: auto; -webkit-overflow-scrolling: touch;
  color: var(--ink);
  /* illuminated leaf: candle-glow at the head, deep parchment ground */
  background:
    radial-gradient(120% 70% at 50% -8%, rgba(199,154,84,.14), transparent 58%),
    radial-gradient(100% 60% at 50% 112%, rgba(120,86,40,.08), transparent 62%),
    linear-gradient(180deg, var(--panel-2), var(--panel) 42%, var(--ground-2));
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(231,198,128,.06);
  padding: clamp(1.1rem, 3vw, 2rem);
}
/* aged-paper grain over the leaf (generated, matches the site body grain) */
.game-dialog::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: 14px; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* engraved inner rule + manuscript corner brackets */
.game-dialog::after {
  content: ""; position: absolute; inset: 7px; z-index: 0; pointer-events: none;
  border: 1px solid var(--line-soft); border-radius: 9px;
  background-repeat: no-repeat;
  background-position: 6px 6px, calc(100% - 6px) 6px, calc(100% - 6px) calc(100% - 6px), 6px calc(100% - 6px);
  background-size: 26px 26px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='%23c79a54' stroke-width='1'%3E%3Cpath d='M4 16 L4 4 L16 4'/%3E%3Cpath d='M4 1 L7 4 L4 7 L1 4 Z' stroke-width='.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='%23c79a54' stroke-width='1'%3E%3Cpath d='M22 16 L22 4 L10 4'/%3E%3Cpath d='M22 1 L25 4 L22 7 L19 4 Z' stroke-width='.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='%23c79a54' stroke-width='1'%3E%3Cpath d='M22 10 L22 22 L10 22'/%3E%3Cpath d='M22 19 L25 22 L22 25 L19 22 Z' stroke-width='.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26' fill='none' stroke='%23c79a54' stroke-width='1'%3E%3Cpath d='M4 10 L4 22 L16 22'/%3E%3Cpath d='M4 19 L7 22 L4 25 L1 22 Z' stroke-width='.7'/%3E%3C/svg%3E");
}
.game-dialog > * { position: relative; z-index: 1; }
.game-dialog .game-close {
  position: absolute; top: .55rem; right: .55rem;
  width: 2.1rem; height: 2.1rem; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim);
  font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.game-dialog .game-close:hover { color: var(--parchment); border-color: var(--gold); }
.game-dialog .game-close:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
/* full screen */
.game-dialog .game-fs { position:absolute; top:.55rem; left:.55rem; z-index:3; height:2.1rem; padding:0 .7rem; border-radius:8px; cursor:pointer;
  background:var(--panel-2); border:1px solid var(--line); color:var(--ink-dim); font-family:var(--font-display); font-size:.62rem; letter-spacing:.1em; text-transform:uppercase; }
.game-dialog .game-fs span[aria-hidden] { font-size:.95rem; vertical-align:-1px; }
.game-dialog .game-fs:hover, .game-dialog .game-fs[aria-pressed="true"] { color:var(--gold-bright); border-color:var(--gold); }
.game-dialog .game-close { z-index:3; }
@media (max-width:520px) { .game-dialog .game-fs .game-fs-l { display:none; } .game-dialog .game-fs { padding:0 .55rem; } }
.game-overlay.is-full { padding:0 !important; background:#070503; }
.game-dialog.is-full { width:100vw !important; max-width:none !important; height:100dvh; max-height:100dvh !important; border-radius:0; border:0;
  padding:2.9rem .6rem .5rem !important; display:flex; flex-direction:column; justify-content:center; }
.game-dialog.is-full::after { display:none; }
.game-dialog.is-full .game-head p, .game-dialog.is-full .game-rule, .game-dialog.is-full .rq-note { display:none; }
.game-dialog.is-full .game-head { margin:0 0 .3rem; }
.game-dialog.is-full .game-head h2 { font-size:1rem !important; margin:0; }
.game-dialog.is-full .game-head .eyebrow { display:none; }
.game-dialog.is-full .ap-pad { max-width:640px; }
/* with a keyboard and mouse, full screen is for the picture: the deck steps aside and the key legend stays */
@media (hover:hover) and (pointer:fine) {
  .game-dialog.is-full .ap-body, .game-dialog.is-full .ap-shoulders { display:none; }
  .game-dialog.is-full .ap-legend { display:block !important; margin-top:.4rem; }
}
@media (orientation:landscape) and (max-height:540px) and (pointer:coarse) {
  .game-dialog.is-full { padding:.4rem .5rem .3rem !important; }
  .game-dialog.is-full .game-fs, .game-dialog.is-full .game-close { top:.3rem; opacity:.75; }
  .game-dialog.is-full .ap-host { column-gap:1.2rem; grid-template-areas:"sl stage sr" "dp stage fc" "dp stage mid"; }
  .game-dialog.is-full .ap-host .ap-mid { align-self:center; flex-direction:row; }
  .game-dialog.is-full .game-fs .game-fs-l { display:none; }
  .game-dialog.is-full .game-fs { padding:0 .55rem; }
}
/* in full screen the controller's Select button already toggles sound, and the key hints are for computers */
.game-dialog.is-full .tr-snd, .game-dialog.is-full .tr-keys { display:none !important; }

.game-head { text-align: center; margin: 0 2rem 1rem; }
.game-head .eyebrow {
  color: var(--gold); font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .3em; font-size: .62rem; margin: 0 0 .5rem;
  display: inline-flex; align-items: center; gap: .8rem;
}
.game-head .eyebrow::before, .game-head .eyebrow::after {
  content: ""; height: 1px; width: min(14vw, 3.4rem);
  background: linear-gradient(90deg, transparent, var(--line), var(--gold) 85%);
}
.game-head .eyebrow::after { transform: scaleX(-1); }
.game-head h2 { font-family: var(--font-display); color: var(--parchment); font-weight: 500; letter-spacing: .05em; font-size: 1.55rem; margin: 0; text-shadow: 0 0 22px rgba(231,198,128,.14); }
.game-head p { color: var(--ink-dim); font-family: var(--font-body); font-size: .98rem; font-style: italic; margin: .45rem 0 0; }

/* ---------- illumination atoms (shared across games) ---------- */
/* the site's lozenge-and-rules section mark, as a standalone divider */
.game-rule { height: 16px; margin: .9rem auto 1rem; background:
  url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2060%2018'%3E%3Cpath%20d='M4%209h18M38%209h18'%20stroke='%23c79a54'%20stroke-width='1'/%3E%3Cpath%20d='M30%203l3.4%206L30%2015l-3.4-6z'%20fill='%23c79a54'/%3E%3C/svg%3E") center / 68px 16px no-repeat; opacity: .85; }
/* illuminated versal — the gold drop-capital treatment used on chapter openings */
.game-versal::first-letter {
  font-family: var(--font-head); font-weight: 600; float: left;
  font-size: 3.1rem; line-height: .62; padding: .05em .1em 0 0; margin: .04em .08em 0 0;
  color: var(--gold-bright); text-shadow: 0 0 16px rgba(231,198,128,.35);
}
/* wax-seal / cartouche medallion for era & category tags */
.game-seal {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .16em; font-size: .56rem;
  color: var(--gold); background: radial-gradient(120% 120% at 50% 20%, rgba(199,154,84,.14), transparent 70%);
  border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem;
}
.game-seal::before { content: ""; width: 5px; height: 5px; transform: rotate(45deg); background: var(--gold); }
.game-seal.is-open { color: var(--warn); border-color: rgba(194,149,78,.5); }
.game-seal.is-open::before { background: var(--warn); }

.game-symbol-large { width: 128px; height: 128px; margin: .2rem auto .6rem; color: var(--gold); }
.game-symbol-large svg { width: 100%; height: 100%; display: block; }

/* source-link chip: every fact/answer links back to its chapter */
.game-source {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem;
  color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; text-decoration: none;
}
.game-source:hover { color: var(--gold-bright); border-color: var(--gold); }

/* score strip shared by games — engraved cartouche tablets */
.game-scorebar { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin: .3rem 0 1rem; }
.game-scorebar .stat {
  text-align: center; min-width: 6.5rem; padding: .5rem .8rem .45rem;
  background: linear-gradient(180deg, rgba(199,154,84,.05), transparent);
  border: 1px solid var(--line-soft); border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), inset 0 1px 0 rgba(231,198,128,.05);
}
.game-scorebar .stat b { display: block; font-family: var(--font-display); color: var(--gold-bright); font-size: 1.3rem; line-height: 1.1; text-shadow: 0 0 14px rgba(231,198,128,.2); }
.game-scorebar .stat span { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .16em; font-size: .54rem; color: var(--ink-faint); }

.game-placeholder { text-align: center; border: 1px dashed var(--line); border-radius: 10px; padding: 1.1rem; color: var(--ink-dim); font-family: var(--font-body); }
.game-placeholder .phase { color: var(--warn); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; }

/* ---------- symbols gallery page ---------- */
.symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.symbol-cell { text-align: center; }
.symbol-cell .art { width: 100%; aspect-ratio: 1 / 1; color: var(--gold); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; display: grid; place-items: center; padding: 12px; }
.symbol-cell .art svg { width: 84%; height: 84%; }
.symbol-cell .name { display: block; margin-top: .5rem; font-family: var(--font-display); color: var(--parchment); font-size: .82rem; letter-spacing: .03em; }
.symbol-cell .era { display: block; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .54rem; color: var(--ink-faint); margin-top: .1rem; }
.symbol-cell .playtag { display: inline-block; margin-top: .35rem; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: .54rem; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: .12rem .5rem; }
.symbol-era-head { font-family: var(--font-display); color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; margin: 2rem 0 .9rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line-soft); }

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

/* ---------- The Reliquary (trivia) ---------- */
.rq-loading { text-align:center; color:var(--ink-dim); font-family:var(--font-body); padding:2rem 0; }
.rq-form { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; margin:.4rem 0 .8rem; }
.rq-form label { display:flex; flex-direction:column; gap:.25rem; font-family:var(--font-display); text-transform:uppercase; letter-spacing:.12em; font-size:.58rem; color:var(--ink-faint); }
.rq-form select { font-family:var(--font-body); font-size:.95rem; color:var(--ink); background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:.5rem .6rem; }
.rq-form select:focus-visible { outline:2px solid var(--gold-bright); outline-offset:1px; }
.rq-avail { text-align:center; color:var(--ink-dim); font-family:var(--font-body); font-size:.9rem; margin:.2rem 0 .6rem; }
.rq-actions { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:.5rem; margin-top:.4rem; }
.rq-eyebrow { font-family:var(--font-display); text-transform:uppercase; letter-spacing:.14em; font-size:.58rem; color:var(--ink-faint); }
.rq-btn { font-family:var(--font-display); letter-spacing:.1em; text-transform:uppercase; font-size:.72rem; color:var(--ink); background:var(--panel-2); border:1px solid var(--line); border-radius:999px; padding:.6rem 1.2rem; cursor:pointer; }
.rq-btn:hover { color:var(--parchment); border-color:var(--gold); }
.rq-btn:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.rq-btn[disabled] { opacity:.45; cursor:not-allowed; }
.rq-primary { color:var(--ground); background:linear-gradient(var(--gold-bright),var(--gold)); border-color:var(--gold); font-weight:600; }
.rq-primary:hover { color:var(--ground); filter:brightness(1.06); }
.rq-note { text-align:center; color:var(--ink-faint); font-family:var(--font-body); font-size:.82rem; margin:.6rem 0 0; }
.rq-choices { display:grid; gap:.5rem; margin:.3rem 0 .2rem; }
.rq-choice { display:flex; align-items:center; gap:.7rem; text-align:left; width:100%; font-family:var(--font-body); font-size:1rem; color:var(--ink); background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:.7rem .8rem; cursor:pointer; transition:border-color .15s ease, background .15s ease; }
.rq-choice:hover:not([disabled]) { border-color:var(--gold); color:var(--parchment); }
.rq-choice:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.rq-choice[disabled] { cursor:default; }
.rq-seals { display:flex; justify-content:center; flex-wrap:wrap; gap:.4rem; margin:.1rem 0 .5rem; }
.rq-choice .rq-key { flex:none; width:1.9rem; height:1.9rem; border-radius:50%; display:grid; place-items:center; font-family:var(--font-display); font-size:.82rem; color:var(--gold); border:1px solid var(--line);
  background: radial-gradient(120% 120% at 50% 22%, rgba(199,154,84,.12), var(--panel) 68%);
  box-shadow: inset 0 1px 0 rgba(231,198,128,.08); }
.rq-choice:hover:not([disabled]) .rq-key { border-color:var(--gold); color:var(--gold-bright); }
.rq-choice.is-correct { border-color:var(--good); background:rgba(126,158,92,.16); color:var(--parchment); }
.rq-choice.is-correct .rq-key { color:var(--good); border-color:var(--good); }
.rq-choice.is-wrong { border-color:var(--ember); background:rgba(178,106,52,.14); }
.rq-choice.is-wrong .rq-key { color:var(--ember); border-color:var(--ember); }
.rq-feedback { text-align:center; font-family:var(--font-body); font-size:.92rem; margin:.7rem 0 .2rem; min-height:1.2rem; }
.rq-verdict { font-family:var(--font-display); letter-spacing:.06em; }
.rq-verdict.ok { color:var(--good); } .rq-verdict.no { color:var(--ember); }
.rq-bot { color:var(--ink-dim); }
@media (max-width:460px){ .rq-form { grid-template-columns:1fr; } }

/* ---------- Ouroboros (snake) ---------- */
.ouro-stage { position:relative; display:flex; justify-content:center; margin:.5rem auto .6rem; width:min(460px,86vw); padding:10px; }
/* engraved corner brackets around the board, echoing the dialog frame */
.ouro-stage::before, .ouro-stage::after {
  content:""; position:absolute; width:22px; height:22px; pointer-events:none;
  border:1px solid var(--gold); opacity:.6;
}
.ouro-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.ouro-stage::after  { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.ouro-canvas { width:min(440px, 100%, 56dvh); height:auto; aspect-ratio:1/1; border:1px solid var(--line); border-radius:10px; background:var(--panel); touch-action:none; image-rendering:auto; box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 8px 26px -14px #000; }
.ouro-toast { min-height:2.4rem; text-align:center; font-family:var(--font-body); font-size:.9rem; color:var(--ink); margin:.3rem auto .2rem; max-width:34rem; line-height:1.4; }
.ouro-toast .ouro-sym { color:var(--gold); }
.ouro-toast strong { color:var(--parchment); }
.ouro-toast .ouro-level-up { display:inline-block; color:var(--gold-bright); font-family:var(--font-display,var(--font-body)); font-weight:600; letter-spacing:.02em; animation:ouroLevel 1.1s ease-out; }
@keyframes ouroLevel { 0%{ transform:scale(.7); opacity:0; } 30%{ transform:scale(1.08); opacity:1; } 100%{ transform:scale(1); opacity:1; } }
.ouro-controls { display:flex; flex-direction:column; align-items:center; gap:.4rem; }
.ouro-dpad { display:grid; grid-template-columns:repeat(3,3rem); grid-template-rows:repeat(3,3rem); gap:.3rem; }
.ouro-key { display:grid; place-items:center; border-radius:50%; border:1px solid var(--line); color:var(--gold); font-size:1rem; cursor:pointer;
  background: radial-gradient(120% 120% at 50% 22%, rgba(199,154,84,.12), var(--panel-2) 68%);
  box-shadow: inset 0 1px 0 rgba(231,198,128,.08), 0 4px 12px -8px #000; }
.ouro-key:hover { color:var(--gold-bright); border-color:var(--gold); }
.ouro-key:active { transform: translateY(1px); }
.ouro-key:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.ouro-key.up { grid-column:2; grid-row:1; } .ouro-key.left { grid-column:1; grid-row:2; }
.ouro-key.pause { grid-column:2; grid-row:2; color:var(--ink-dim); font-size:.8rem; } .ouro-key.right { grid-column:3; grid-row:2; }
.ouro-key.down { grid-column:2; grid-row:3; }
.ouro-facts { list-style:none; margin:.2rem auto 0; padding:0; max-width:34rem; display:flex; flex-direction:column; gap:.5rem; }
.ouro-facts li { font-family:var(--font-body); font-size:.9rem; color:var(--ink); border-left:2px solid var(--line); padding-left:.7rem; line-height:1.45; }
.ouro-facts strong { color:var(--parchment); }

/* ---------- Ziggurat Builder (falling clay-tablet blocks) ---------- */
.zig-stage { display:flex; justify-content:center; align-items:flex-start; gap:1rem; margin:.3rem auto .5rem; flex-wrap:wrap; }
.zig-well-wrap { position:relative; padding:10px; }
.zig-well-wrap::before, .zig-well-wrap::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.zig-well-wrap::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.zig-well-wrap::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.zig-well { width:min(250px, 44vw, 42dvh); height:auto; aspect-ratio:10/20; background:var(--panel); border:1px solid var(--line); border-radius:8px; touch-action:none; box-shadow: inset 0 0 40px rgba(0,0,0,.5); }
.zig-side { display:flex; flex-direction:column; align-items:center; gap:.7rem; }
.zig-next { text-align:center; }
.zig-next-label { display:block; font-family:var(--font-display); text-transform:uppercase; letter-spacing:.16em; font-size:.54rem; color:var(--ink-faint); margin-bottom:.2rem; }
.zig-next-cv { width:64px; height:160px; background:var(--panel); border:1px solid var(--line-soft); border-radius:6px; }
.zig-hold-cv { width:64px; height:64px; background:var(--panel); border:1px solid var(--line-soft); border-radius:6px; }
.zig-queues { display:flex; gap:.5rem; align-items:flex-start; }
.zig-mon-wrap { position:relative; }
.zig-mon { width:min(150px, 26vw, 26dvh); border-radius:8px; border:1px solid var(--line); height:auto; aspect-ratio:1/2; }
.zig-toast .zig-sym { color:var(--gold); }
.zig-pad { display:grid; grid-template-columns:repeat(4,3rem); grid-template-rows:repeat(2,3rem); gap:.3rem; }
.zig-pad .zig-ccw { grid-column:4; grid-row:1; } .zig-pad .zig-hold-btn { grid-column:4; grid-row:2; font-size:.62rem; font-family:var(--font-display); letter-spacing:.06em; }
.zig-pad .zig-rot { grid-column:1; grid-row:1; } .zig-pad .zig-left { grid-column:1; grid-row:2; }
.zig-pad .zig-pause { grid-column:2; grid-row:1; color:var(--ink-dim); font-size:.8rem; } .zig-pad .zig-down { grid-column:2; grid-row:2; }
.zig-pad .zig-right { grid-column:3; grid-row:2; } .zig-pad .zig-drop { grid-column:3; grid-row:1; }
/* keep board + monument side by side, tighten the chrome, so the whole game
   fits on a phone without scrolling past the controls */
@media (max-width:520px){
  .zig-stage { gap:.4rem; margin:.15rem auto .3rem; flex-wrap:nowrap; align-items:center; justify-content:center; }
  .zig-well { width:42vw; max-width:190px; }
  .zig-mon { width:22vw; max-width:120px; }
  .zig-side { flex-direction:column; gap:.35rem; }
  .zig-next-cv { width:40px; height:100px; } .zig-hold-cv { width:40px; height:40px; }
  .zig-pad { grid-template-columns:repeat(4,2.5rem); grid-template-rows:repeat(2,2.5rem); }
  .game-scorebar { gap:.3rem; flex-wrap:nowrap; }
  .game-scorebar .stat { min-width:0; flex:1; padding:.28rem .3rem; }
  .game-scorebar .stat b { font-size:1rem; }
  .game-scorebar .stat span { font-size:.5rem; letter-spacing:.1em; }
  .zig-toast { min-height:1.8rem; font-size:.82rem; margin:.2rem auto; }
  /* trim the header so the board and controls both stay on-screen */
  .game-head { margin:0 1.4rem .5rem; }
  .game-head h2 { font-size:1.05rem !important; }
  .game-head p { display:none; } /* drop the flavor line on phones so the board + controls both fit */
  .game-rule { margin:.4rem auto .5rem; }
  .game-dialog { padding:.9rem .8rem; }
  .ms-grid { width:min(100%, 30rem, 62dvh); }
}
/* very short viewports: shrink the board + pad a touch more, trim spacing */
@media (max-width:520px) and (max-height:680px){
  .zig-well { width:33vw; } .zig-mon { width:17vw; }
  .zig-pad { grid-template-columns:repeat(4,2.2rem); grid-template-rows:repeat(2,2.2rem); }
  .ouro-controls .rq-note { font-size:.7rem; margin:.2rem 0 0; }
  .game-head p { display:none; }
}

/* ---------- Divine Casualties (1v1 fighter) ---------- */
.fg-hud { display:flex; align-items:flex-start; gap:.6rem; margin:.2rem auto .5rem; max-width:640px; }
.fg-side { flex:1; min-width:0; }
.fg-side.fg-r { text-align:right; }
.fg-name { font-family:var(--font-display); color:var(--parchment); font-size:.74rem; letter-spacing:.06em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fg-name span { display:block; font-size:.54rem; text-transform:uppercase; letter-spacing:.14em; color:var(--ink-faint); }
.fg-hp, .fg-en { height:11px; background:rgba(0,0,0,.4); border:1px solid var(--line); border-radius:6px; overflow:hidden; margin-top:.25rem; }
.fg-en { height:6px; }
.fg-hp i { display:block; height:100%; background:linear-gradient(90deg, var(--ember), var(--gold-bright)); transition:width .18s ease; }
.fg-r .fg-hp i, .fg-r .fg-en i, .fg-r .fg-gd i { margin-left:auto; }
.fg-en i { display:block; height:100%; background:linear-gradient(90deg, #6f86c9, #bfe3ff); transition:width .18s ease; }
/* full meter: the bar glows and pulses to signal a SUPER is ready */
.fg-en[data-full] { border-color:#ffe08a; box-shadow:0 0 7px rgba(255,224,138,.85); animation:fg-meter-full .8s ease-in-out infinite; }
.fg-en[data-full] i { background:linear-gradient(90deg, #ffd873, #fff4c8); }
@keyframes fg-meter-full { 0%,100% { box-shadow:0 0 5px rgba(255,224,138,.6); } 50% { box-shadow:0 0 11px rgba(255,224,138,1); } }
@media (prefers-reduced-motion: reduce) { .fg-en[data-full] { animation:none; } }
.fg-gd { height:5px; background:rgba(0,0,0,.4); border:1px solid var(--line); border-radius:6px; overflow:hidden; margin-top:.25rem; }
.fg-gd i { display:block; height:100%; background:linear-gradient(90deg, #7a5a2a, #e2b04a); transition:width .12s ease; }
.fg-gd[data-low] i { background:linear-gradient(90deg, #a33, #e2b04a); }
.fg-mid { flex:none; align-self:center; display:flex; flex-direction:column; align-items:center; gap:2px; }
.fg-vs { color:var(--gold); font-size:1rem; }
.fg-weather { font-family:var(--font-display,Georgia,serif); font-size:.52rem; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-dim,#9c8f70); white-space:nowrap; }
.fg-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.fg-stage::before, .fg-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.fg-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.fg-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.fg-canvas { width:min(640px, 100%, 84dvh); height:auto; aspect-ratio:2/1; border:1px solid var(--line); border-radius:8px; background:#241a2e; touch-action:none; box-shadow: inset 0 0 50px rgba(0,0,0,.5), 0 10px 30px -16px #000; }
/* two thumb-reachable clusters at the corners: a d-pad (left) and action buttons (right).
   Buttons are widely spaced so neighbours can't be fat-fingered at once. */

/* ---- Antithesis (Pong) ---- */
.pg-hud { display:flex; align-items:center; justify-content:center; gap:1.4rem; margin:.2rem auto .3rem; }
.pg-score { display:flex; flex-direction:column; align-items:center; min-width:4.5rem; }
.pg-score b { font-family:var(--font-display,Georgia,serif); font-size:1.7rem; line-height:1; }
.pg-score span { font-family:var(--font-display,Georgia,serif); font-size:.56rem; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-dim,#9c8f70); margin-top:.2rem; }
.pg-l b { color:var(--gold-bright,#e7c680); } .pg-r b { color:#b98cff; }
.pg-mid { color:var(--gold); font-size:.9rem; }
.pg-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.pg-stage::before, .pg-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.pg-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.pg-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.pg-canvas { width:min(640px, 100%, 58dvh); height:auto; aspect-ratio:8/5; border:1px solid var(--line); border-radius:8px; background:#171019; touch-action:none; box-shadow: inset 0 0 46px rgba(0,0,0,.55), 0 10px 30px -16px #000; }
.pg-toast { min-height:2.4rem; }
.pg-controls { display:flex; align-items:center; justify-content:center; gap:1rem; flex-wrap:wrap; margin:.5rem auto .2rem; }
.pg-pad { display:flex; flex-direction:column; gap:.4rem; }
.pg-pad .ouro-key { width:3rem; height:2.5rem; }
.pg-mode { white-space:nowrap; }
@media (max-width:520px){ .pg-controls { gap:.6rem; } .pg-pad { flex-direction:row; } .pg-pad .ouro-key { width:2.7rem; height:2.7rem; } }

/* ---- The Excavation (Minesweeper) ---- */
.ms-bar { display:flex; align-items:center; justify-content:center; gap:1.1rem; margin:.2rem auto .5rem; }
.ms-stat { display:flex; flex-direction:column; align-items:center; min-width:4.4rem; }
.ms-stat b { font-family:var(--font-display,Georgia,serif); font-size:1.4rem; color:var(--gold-bright,#e7c680); line-height:1; }
.ms-stat span { font-size:.54rem; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-dim,#9c8f70); margin-top:.2rem; }
.ms-flag { display:block; margin:0 auto .6rem; }
.ms-flag.is-on { background:linear-gradient(180deg,var(--gold-bright),var(--gold)); color:var(--ground,#160f08); }
.ms-grid-wrap { overflow:auto; max-width:100%; display:flex; justify-content:center; }
.ms-grid { display:grid; grid-template-columns:repeat(var(--cols,9),1fr); gap:3px; width:min(100%,30rem); padding:8px; background:linear-gradient(160deg,#241a10,#14100a); border:1px solid var(--line,#2a2013); border-radius:8px; box-shadow:inset 0 0 40px rgba(0,0,0,.5); touch-action:manipulation; }
.ms-cell { -webkit-appearance:none; appearance:none; aspect-ratio:1; width:100%; min-width:1.4rem; border:1px solid #3a2c18; border-radius:3px; cursor:pointer; font-family:var(--font-display,Georgia,serif); font-weight:700; font-size:min(3.6vw,1rem); line-height:1; display:grid; place-items:center; color:var(--gold-bright); padding:0;
  background:linear-gradient(160deg,#5a4326,#3c2c17); box-shadow:inset 0 1px 0 rgba(255,220,150,.14), inset 0 -2px 3px rgba(0,0,0,.35); transition:background .12s, transform .06s; }
.ms-cell:hover:not(.is-open) { background:linear-gradient(160deg,#6a5030,#48351b); }
.ms-cell:active:not(.is-open) { transform:scale(.94); }
.ms-cell.is-open { background:linear-gradient(160deg,#231a10,#1a130b); border-color:#2a2013; box-shadow:inset 0 0 6px rgba(0,0,0,.5); cursor:default; }
.ms-cell.is-flag { color:#e0b24a; }
.ms-cell.is-mine { color:#e5643a; background:radial-gradient(circle at 50% 45%, #5a1f14, #1a130b); }
.ms-cell.is-blast { background:radial-gradient(circle at 50% 45%, #b23a1e, #3a140a); color:#ffd; animation:msBlast .4s ease-out; }
@keyframes msBlast { 0%{ transform:scale(1.3); } 100%{ transform:scale(1); } }
.ms-cell[data-n="1"]{ color:#7fb0e6; } .ms-cell[data-n="2"]{ color:#7fc9a0; } .ms-cell[data-n="3"]{ color:#e29a6a; }
.ms-cell[data-n="4"]{ color:#b98cff; } .ms-cell[data-n="5"]{ color:#e2b04a; } .ms-cell[data-n="6"]{ color:#66c9c9; }
.ms-cell[data-n="7"]{ color:#d98aa8; } .ms-cell[data-n="8"]{ color:#cdbb96; }
.ms-toast { min-height:2.4rem; }

/* ---- The Labyrinth (Pac-Man) ---- */
.pm-hud { display:flex; align-items:center; justify-content:center; gap:1.3rem; margin:.2rem auto .35rem; }
.pm-stat { display:flex; flex-direction:column; align-items:center; min-width:4.4rem; }
.pm-stat b { font-family:var(--font-display,Georgia,serif); font-size:1.2rem; color:var(--gold-bright,#e7c680); line-height:1; letter-spacing:.06em; }
.pm-stat span { font-size:.54rem; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-dim,#9c8f70); margin-top:.22rem; }
.pm-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.pm-stage::before, .pm-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.pm-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.pm-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.pm-canvas { width:min(460px, 100%, 58dvh); height:auto; aspect-ratio:19/21; border:1px solid var(--line); border-radius:8px; background:#0d0906; touch-action:none; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 10px 30px -16px #000; }
.pm-toast { min-height:2.4rem; }

/* ---- The Firmament (Pinball) ---- */
.pb-hud { display:flex; align-items:center; justify-content:center; gap:1.3rem; margin:.2rem auto .35rem; }
.pb-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.pb-stage::before, .pb-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.pb-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.pb-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.pb-canvas { width:min(320px, 100%, 44dvh); height:auto; aspect-ratio:320/460; border:1px solid var(--line); border-radius:8px; background:#0d0906; touch-action:none; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 10px 30px -16px #000; }
.pb-toast { min-height:2.4rem; }
.pb-controls { display:flex; align-items:center; justify-content:center; gap:1rem; margin:.5rem auto .2rem; }
.pb-flip { width:3.6rem; height:3.2rem; font-size:1.3rem; }
.pb-launch { white-space:nowrap; }
@media (max-width:520px){ .pb-flip { width:4.2rem; height:3.4rem; } }

/* ---- Dominion of the Ancients (Risk) ---- */
.rk-hud { display:flex; align-items:center; justify-content:space-between; gap:.4rem; max-width:360px; margin:.2rem auto .35rem; }
.rk-side { display:flex; flex-direction:column; align-items:center; min-width:3.2rem; }
.rk-side b { font-family:var(--font-display,Georgia,serif); font-size:1.25rem; line-height:1; }
.rk-side span { font-size:.5rem; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-dim,#9c8f70); margin-top:.2rem; }
.rk-cards { text-align:center; min-height:1.5rem; margin:.1rem auto .15rem; font-size:.8rem; color:var(--ink-dim,#9c8f70); display:flex; align-items:center; justify-content:center; gap:.5rem; flex-wrap:wrap; }
.rk-cards b { color:var(--gold-bright,#e7c680); letter-spacing:.14em; font-size:1rem; }
.rk-trade { font-size:.72rem !important; padding:.2rem .6rem !important; }
.rk-log { list-style:none; padding:0; margin:.1rem auto .2rem; max-width:34rem; font-size:.72rem; line-height:1.45; color:var(--ink-dim,#9c8f70); text-align:center; min-height:2.2rem; }
.rk-log li { margin:0; }
.rk-phase { font-family:var(--font-display,Georgia,serif); font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold-bright,#e7c680); text-align:center; }
.rk-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.rk-stage::before, .rk-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.rk-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.rk-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.rk-canvas { width:min(400px, 100%, 62dvh); height:auto; aspect-ratio:344/300; border:1px solid var(--line); border-radius:8px; background:#120d10; touch-action:manipulation; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 10px 30px -16px #000; }
.rk-msg { text-align:center; min-height:1.6rem; margin:.35rem auto .1rem; font-family:var(--font-body); font-size:.86rem; color:var(--ink); max-width:34rem; }
.rk-toast { min-height:2rem; }
.rk-controls { display:flex; justify-content:center; margin:.2rem auto; }
.rk-next { white-space:nowrap; }

/* ---- The Tomb Robber (treasure-hunt platformer) ---- */
.tr-hudrow { display:flex; align-items:center; justify-content:center; gap:1rem; flex-wrap:wrap; }
.tr-snd { background:none; border:1px solid var(--line); border-radius:999px; color:var(--ink-faint, #a89878); font:inherit; font-size:.72rem; padding:.2rem .7rem; cursor:pointer; }
.tr-snd[aria-pressed="true"] { color:var(--gold-bright); border-color:var(--gold); }
.tr-snd:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.tr-hud { display:flex; align-items:center; justify-content:center; gap:1.3rem; margin:.2rem auto .35rem; }
.tr-stage { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.tr-stage::before, .tr-stage::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.tr-stage::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.tr-stage::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.tr-canvas { width:min(680px, 100%, calc((100dvh - 260px) * 1.6667)); min-width:min(300px, 100%); height:auto; aspect-ratio:480/288; border:1px solid var(--line); border-radius:8px; background:#140d08; touch-action:none; image-rendering:auto; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 10px 30px -16px #000; }
.tr-toast { min-height:2.4rem; }
.tr-hearts { color:#e0584a; letter-spacing:.08em; }
.tr-lost { color:rgba(224,88,74,.25); }
.tr-keys { text-align:center; }
@media (max-width:520px){ .tr-keys { display:none; } }
/* narrative story cards between the four expedition sites */
.tr-card { max-width:38rem; margin:.2rem auto; padding:.7rem .9rem; border:1px solid var(--line); border-radius:10px;
  background:linear-gradient(180deg, rgba(199,154,84,.06), rgba(0,0,0,.14)); font-size:.96rem; line-height:1.6; color:var(--ink, #cdbb96); }
.tr-card p { margin:.2rem 0 .5rem; }
.tr-card::after { content:""; display:block; clear:both; }
.tr-portrait { float:left; width:88px; height:auto; margin:0 .85rem .3rem 0; filter:drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
@media (max-width:480px) { .tr-portrait { width:64px; margin-right:.6rem; } }
.tr-card p:last-child { margin-bottom:0; }
.tr-route { text-align:center; font-family:Cinzel, Georgia, serif; color:var(--gold-bright); letter-spacing:.02em; margin-top:.4rem !important; }

/* character select + result */
.fg-sel-row-label { text-align:center; font-family:var(--font-display); text-transform:uppercase; letter-spacing:.16em; font-size:.6rem; color:var(--gold); margin:.6rem 0 .4rem; }
.fg-cards { display:flex; gap:.5rem; justify-content:center; flex-wrap:wrap; }
.fg-card { width:100px; background:linear-gradient(180deg,var(--panel-2),var(--panel)); border:1px solid var(--line); border-radius:10px; padding:.45rem .35rem; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:.12rem; transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.fg-card:hover { border-color:var(--gold); transform:translateY(-1px); }
.fg-card:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.fg-card.is-sel { border-color:var(--gold); box-shadow:inset 0 0 0 1px var(--gold), 0 0 16px -4px var(--gold-bright); }
.fg-portrait { width:74px; height:88px; background:radial-gradient(120% 100% at 50% 26%, #241a2e, #100c14); border:1px solid var(--line-soft); border-radius:8px; display:block; }
.fg-card-name { font-family:var(--font-display); color:var(--parchment); font-size:.82rem; letter-spacing:.02em; }
.fg-card-ep { font-family:var(--font-body); color:var(--ink-faint); font-size:.58rem; text-align:center; line-height:1.2; }
.fg-sel-mode { text-align:center; margin:.6rem 0; }
.fg-result { text-align:center; }
.fg-portrait-lg { width:120px; height:140px; margin:.2rem auto .5rem; }

/* ---------- Archive Chess ---------- */
.ch-status { text-align:center; font-family:var(--font-display); letter-spacing:.04em; font-size:.82rem; color:var(--ink); margin:.2rem 0 .5rem; min-height:1.1rem; }
.ch-boardwrap { position:relative; display:flex; justify-content:center; padding:8px; margin:0 auto; }
.ch-boardwrap::before, .ch-boardwrap::after { content:""; position:absolute; width:20px; height:20px; pointer-events:none; border:1px solid var(--gold); opacity:.6; }
.ch-boardwrap::before { top:0; left:0; border-right:0; border-bottom:0; border-top-left-radius:6px; }
.ch-boardwrap::after { bottom:0; right:0; border-left:0; border-top:0; border-bottom-right-radius:6px; }
.ch-board { width:min(420px, 100%, calc(100dvh - 300px)); height:auto; aspect-ratio:1/1; border-radius:6px; background:#150c05; box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 8px 26px -14px #000; cursor:pointer; touch-action:manipulation; }
.ch-fact { min-height:2.4rem; }
.ch-fact .ch-sym { color:var(--gold); }
.ch-fact strong { color:var(--parchment); }
.ch-cards { display:flex; gap:.5rem; justify-content:center; flex-wrap:wrap; }
.ch-card { width:130px; background:linear-gradient(180deg,var(--panel-2),var(--panel)); border:1px solid var(--line); border-radius:10px; padding:.6rem .4rem; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:.15rem; transition:border-color .15s ease, box-shadow .15s ease; }
.ch-card:hover { border-color:var(--gold); }
.ch-card:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
.ch-card.is-sel { border-color:var(--gold); box-shadow:inset 0 0 0 1px var(--gold), 0 0 16px -4px var(--gold-bright); }
.ch-card-art { width:84px; height:48px; display:block; margin:0 auto .15rem; }
.ch-card-name { font-family:var(--font-display); color:var(--parchment); font-size:.86rem; letter-spacing:.02em; }
.ch-card-ep { font-family:var(--font-body); color:var(--ink-faint); font-size:.62rem; font-style:italic; }

/* ---------- The Seeker's Path ---------- */
.sk-intro { max-width:36rem; margin:.4rem auto .6rem; text-align:center; color:var(--ink); font-family:var(--font-body); font-size:1rem; line-height:1.6; }
.sk-path { display:flex; align-items:center; justify-content:center; gap:.15rem; margin:.4rem 0 .3rem; flex-wrap:wrap; }
.sk-dot { width:11px; height:11px; transform:rotate(45deg); border:1px solid var(--line); background:var(--panel-2); }
.sk-dot.done { background:var(--gold); border-color:var(--gold); box-shadow:0 0 8px -1px var(--gold-bright); }
.sk-dot.here { border-color:var(--gold-bright); background:var(--panel); box-shadow:0 0 0 2px rgba(231,198,128,.3); }
.sk-link { width:14px; height:1px; background:var(--line); }
.sk-count { text-align:center; font-family:var(--font-display); text-transform:uppercase; letter-spacing:.16em; font-size:.58rem; color:var(--gold); margin:.2rem 0 .5rem; }
.sk-clue { max-width:38rem; margin:0 auto; background:linear-gradient(180deg, rgba(199,154,84,.05), transparent); border:1px solid var(--line-soft); border-radius:12px; padding:1rem 1.1rem; }
.sk-riddle { font-family:var(--font-head); color:var(--parchment); font-size:1.15rem; line-height:1.5; margin:0 0 .6rem; }
.sk-where { text-align:center; margin:.3rem 0 0; }
.sk-open { border-color:var(--good); box-shadow:0 0 20px -6px var(--good); }
@media (prefers-reduced-motion: no-preference){ .sk-shake { animation:sk-shake .4s ease; } }
@keyframes sk-shake { 0%,100%{transform:translateX(0);} 20%{transform:translateX(-6px);} 40%{transform:translateX(6px);} 60%{transform:translateX(-4px);} 80%{transform:translateX(4px);} }
.sk-form { display:flex; gap:.5rem; justify-content:center; max-width:38rem; margin:.7rem auto .2rem; }
.sk-input { flex:1; min-width:0; font-family:var(--font-body); font-size:1.05rem; color:var(--parchment); background:var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:.6rem .8rem; }
.sk-input:focus-visible { outline:2px solid var(--gold-bright); outline-offset:1px; }
.sk-feedback { text-align:center; min-height:1.2rem; font-family:var(--font-body); font-size:.92rem; margin:.5rem 0 .3rem; }
.sk-feedback.ok { color:var(--good); font-family:var(--font-display); letter-spacing:.04em; }
.sk-feedback.no { color:var(--ember); }
.sk-hint { color:var(--warn); font-style:italic; }

/* ---- The Excavation: visual pass (a strung dig grid over topsoil) ---- */
.ms-grid { gap:2px; padding:10px; width:min(100%,34rem);
  background:
    linear-gradient(0deg, rgba(0,0,0,.25), rgba(0,0,0,.25)),
    #b89a64; /* the gaps between squares read as the taut survey strings */
  border:1px solid #6b5230; border-radius:6px;
  box-shadow: 0 0 0 6px #2a1d10, 0 0 0 7px #4a3620, inset 0 0 30px rgba(0,0,0,.35), 0 14px 34px -12px #000; }
.ms-cell { border:0; border-radius:1px; font-size:min(3.8vw,1.08rem);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.17 0 0 0 0 0.08 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(155deg,#8a6a3e,#6b4f2c 60%,#5a4124);
  box-shadow: inset 1px 1px 0 rgba(255,225,160,.22), inset -1px -2px 2px rgba(0,0,0,.35); }
.ms-cell:nth-child(3n) { filter:hue-rotate(-4deg) brightness(.96); }
.ms-cell:nth-child(7n+2) { filter:brightness(1.05); }
.ms-cell:hover:not(.is-open) { background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.17 0 0 0 0 0.08 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(155deg,#a07c48,#7d5c34 60%,#654a2a); }
.ms-cell.is-open { filter:none;
  background: radial-gradient(120% 120% at 50% 35%, #2c2014 0%, #1a120a 70%, #120c06 100%);
  box-shadow: inset 0 3px 7px rgba(0,0,0,.7), inset 0 -1px 0 rgba(255,220,150,.06); }
.ms-cell.is-open[data-n] { text-shadow: 0 0 8px currentColor, 0 1px 0 #000; }
.ms-cell.is-flag { color:#d6452c; text-shadow: 0 1px 0 #000, 0 0 6px rgba(214,69,44,.6); }
.ms-cell.is-mine { background: radial-gradient(circle at 50% 45%, #6a2616, #1a0f08); text-shadow:0 0 10px #ff7a4a; }

/* ---- visual pass: on large screens the games get a wider leaf and bigger boards ---- */
@media (min-width: 1100px) and (min-height: 820px) {
  .game-dialog { width:min(58rem, 100%); }
  .ch-board { width:min(520px, 100%, calc(100dvh - 300px)); }
  .pb-canvas { width:min(390px, 100%, 56dvh); }
  .rk-canvas { width:min(520px, 100%, 62dvh); }
  .tr-canvas { width:min(860px, 100%, calc((100dvh - 250px) * 1.6667)); }
  .pg-canvas { width:min(720px, 100%, 62dvh); }
  .fg-canvas { width:min(820px, 100%, 84dvh); }
}

/* ---- visual pass: the quiz games (Reliquary, Seeker's Path) ----
   Illuminated answer tablets: a gilt rule down the leading edge, a soft lift and
   glow on hover, a staggered reveal, and a pulse on the verdict. */
.rq-choice { position:relative; overflow:hidden;
  background:linear-gradient(100deg, rgba(199,154,84,.07), rgba(0,0,0,0) 38%), var(--panel-2);
  box-shadow: inset 3px 0 0 rgba(199,154,84,.35), 0 6px 16px -14px #000;
  transition:border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease; }
.rq-choice::after { content:""; position:absolute; inset:0; pointer-events:none; opacity:0;
  background:linear-gradient(115deg, transparent 30%, rgba(255,236,196,.10) 48%, transparent 66%); transform:translateX(-60%); }
.rq-choice:hover:not([disabled]) { transform:translateY(-1px); box-shadow: inset 3px 0 0 var(--gold), 0 10px 22px -14px rgba(231,198,128,.45); }
.rq-choice.is-correct { box-shadow: inset 3px 0 0 var(--good), 0 0 22px -8px rgba(126,158,92,.7); }
.rq-choice.is-wrong { box-shadow: inset 3px 0 0 var(--ember); }
@media (prefers-reduced-motion: no-preference) {
  .rq-choices .rq-choice { animation: rq-rise .35s cubic-bezier(.2,.8,.2,1) both; }
  .rq-choices .rq-choice:nth-child(2) { animation-delay:.05s; } .rq-choices .rq-choice:nth-child(3) { animation-delay:.1s; } .rq-choices .rq-choice:nth-child(4) { animation-delay:.15s; }
  .rq-choice:hover:not([disabled])::after { opacity:1; transform:translateX(60%); transition:transform .6s ease, opacity .2s ease; }
  .rq-choice.is-correct { animation: rq-glow .6s ease; }
  .rq-choice.is-wrong { animation: sk-shake .4s ease; }
}
@keyframes rq-rise { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@keyframes rq-glow { 0% { box-shadow: inset 3px 0 0 var(--good), 0 0 0 0 rgba(126,158,92,.7); } 100% { box-shadow: inset 3px 0 0 var(--good), 0 0 22px -8px rgba(126,158,92,.7); } }
.rq-feedback .rq-verdict { font-size:1.02rem; }
/* the Seeker's riddle reads as a gilded tablet */
.sk-clue { position:relative; background:
    radial-gradient(120% 90% at 50% 0%, rgba(231,198,128,.09), transparent 60%),
    linear-gradient(180deg, rgba(199,154,84,.06), rgba(0,0,0,.12));
  border:1px solid var(--line); box-shadow: inset 0 0 0 4px rgba(20,13,7,.45), inset 0 0 0 5px rgba(199,154,84,.18), 0 14px 30px -22px #000; }
.sk-clue::before, .sk-clue::after { content:"✦"; position:absolute; top:.35rem; color:var(--gold); font-size:.6rem; opacity:.7; }
.sk-clue::before { left:.55rem; } .sk-clue::after { right:.55rem; }
.sk-dot.here { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .sk-dot.here { animation: sk-beacon 1.8s ease-in-out infinite; }
  .sk-clue { animation: rq-rise .4s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes sk-beacon { 0%,100% { box-shadow:0 0 0 2px rgba(231,198,128,.25); } 50% { box-shadow:0 0 0 4px rgba(231,198,128,.45), 0 0 12px rgba(231,198,128,.35); } }
.sk-input { box-shadow: inset 0 2px 6px rgba(0,0,0,.35); }
.sk-input:focus { border-color:var(--gold); }

/* =====================================================================
   ArchivePad — the on-screen controller (pad.js): a flat handheld deck.
   D-pad on the left, face buttons on the right (A/B on a diagonal, or a
   four-button diamond), Select/Start as small pills in between. No key
   badges on the buttons: on a computer one legend line lists the keys.
   ===================================================================== */
.ap-pad { --dp:138px; --btn:64px; position:relative; max-width:540px; margin:.55rem auto .1rem; touch-action:none;
  user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
.ap-body { display:grid; grid-template-columns:auto 1fr auto; grid-template-areas:"dp mid fc"; align-items:center; gap:.5rem; padding:.1rem .2rem; }

/* the cross-pad */
.ap-dwell { grid-area:dp; position:relative; width:var(--dp); height:var(--dp); border-radius:50%;
  background: radial-gradient(circle, rgba(0,0,0,.28) 0 58%, rgba(0,0,0,0) 72%); }
.ap-dpad { position:absolute; inset:6%; touch-action:none; cursor:pointer; }
.ap-arm, .ap-hub { position:absolute; background: linear-gradient(180deg, #34302c, #1d1a17); }
.ap-arm { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 #0a0908, 0 5px 10px rgba(0,0,0,.5); transition: transform .05s, background .05s; }
.ap-up, .ap-down { left:34%; width:32%; height:36%; } .ap-up { top:0; border-radius:9px 9px 2px 2px; } .ap-down { bottom:0; border-radius:2px 2px 9px 9px; }
.ap-left, .ap-right { top:34%; height:32%; width:36%; } .ap-left { left:0; border-radius:9px 2px 2px 9px; } .ap-right { right:0; border-radius:2px 9px 9px 2px; }
.ap-hub { left:33.5%; top:33.5%; width:33%; height:33%; box-shadow: 0 3px 0 #0a0908; background: radial-gradient(circle, #151311 0 28%, #2a2622 30% 100%); }
.ap-arm::after { content:""; position:absolute; left:50%; top:50%; width:0; height:0; border:7px solid transparent; transform:translate(-50%,-50%); opacity:.55; }
.ap-up::after { border-bottom-color:#e8dcc4; margin-top:-3px; } .ap-down::after { border-top-color:#e8dcc4; margin-top:3px; }
.ap-left::after { border-right-color:#e8dcc4; margin-left:-3px; } .ap-right::after { border-left-color:#e8dcc4; margin-left:3px; }
.ap-arm.on { background: linear-gradient(180deg, #4a3a24, #2a2015); box-shadow: inset 0 2px 5px rgba(0,0,0,.6), 0 1px 0 #0a0908, 0 0 14px rgba(231,198,128,.3); }
.ap-up.on { transform:translateY(2px); } .ap-down.on { transform:translateY(-1px); } .ap-left.on { transform:translateX(2px); } .ap-right.on { transform:translateX(-2px); }
.ap-arm.on::after { opacity:1; border-bottom-color:transparent; border-top-color:transparent; border-left-color:transparent; border-right-color:transparent; }
.ap-up.on::after { border-bottom-color:#f1d28c; } .ap-down.on::after { border-top-color:#f1d28c; } .ap-left.on::after { border-right-color:#f1d28c; } .ap-right.on::after { border-left-color:#f1d28c; }

/* Select / Start: two small pills */
.ap-mid { grid-area:mid; display:flex; justify-content:center; align-items:center; gap:.6rem; align-self:end; padding-bottom:.5rem; }
.ap-mid .ap-btn { display:grid; place-items:center; height:22px; min-width:52px; padding:0 .55rem; border-radius:11px; cursor:pointer; touch-action:none;
  background: linear-gradient(180deg, #2e2a26, #1a1715); box-shadow: 0 2px 0 #0a0908, inset 0 1px 0 rgba(255,255,255,.07); transform: rotate(-18deg); }
.ap-mid .ap-g { display:none; }
.ap-mid .ap-cap { font-family:var(--font-display); font-size:.5rem; letter-spacing:.12em; text-transform:uppercase; color:#b7ab94; white-space:nowrap; }
.ap-mid .ap-btn.on { box-shadow: 0 0 0 #0a0908, 0 0 10px rgba(231,198,128,.35); translate:0 2px; }
.ap-mid .ap-btn.on .ap-cap { color:var(--gold-bright); }

/* face buttons */
.ap-face { grid-area:fc; position:relative; touch-action:none; cursor:pointer; }
.ap-two .ap-face { width:calc(var(--btn) * 2.3); height:calc(var(--btn) * 1.95); }
.ap-four .ap-face { width:calc(var(--btn) * 2.6); height:calc(var(--btn) * 2.6); }
.ap-face .ap-btn { position:absolute; width:var(--btn); height:var(--btn); border-radius:50%; display:grid; place-items:center;
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 42%, var(--c2) 100%);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c2) 60%, #000), 0 7px 14px rgba(0,0,0,.5), inset 0 1px 1px rgba(255,255,255,.35);
  transition: transform .05s, box-shadow .05s; }
.ap-face .ap-g { font-family:var(--font-display); font-weight:700; font-size:1.2rem; color:rgba(20,12,4,.78); text-shadow:0 1px 0 rgba(255,240,210,.35); }
.ap-face .ap-cap { position:absolute; top:calc(100% + 7px); left:50%; transform:translateX(-50%); font-family:var(--font-display); font-size:.55rem; letter-spacing:.12em;
  text-transform:uppercase; color:#b7ab94; white-space:nowrap; pointer-events:none; }
.ap-face .ap-btn.on { transform:translateY(4px); box-shadow: 0 0 0 #000, 0 0 18px color-mix(in srgb, var(--c) 70%, transparent), inset 0 2px 5px rgba(0,0,0,.35); }
.ap-a { --c:#d9ae5c; --c2:#7a531f; } .ap-b { --c:#c55a3c; --c2:#5e2213; } .ap-x { --c:#5d8cb8; --c2:#1f3a57; } .ap-y { --c:#6fa87e; --c2:#224a31; }
.ap-two .ap-b { left:0; bottom:18%; } .ap-two .ap-a { right:0; top:0; }
.ap-four .ap-face .ap-btn { width:calc(var(--btn) * .86); height:calc(var(--btn) * .86); }
.ap-four .ap-y { left:calc(50% - var(--btn) * .43); top:0; }
.ap-four .ap-x { left:0; top:calc(50% - var(--btn) * .6); }
.ap-four .ap-b { right:0; top:calc(50% - var(--btn) * .6); }
.ap-four .ap-a { left:calc(50% - var(--btn) * .43); bottom:14%; }
.ap-four .ap-face .ap-cap { top:auto; bottom:calc(100% + 3px); }
.ap-four .ap-a .ap-cap { top:calc(100% + 4px); bottom:auto; }

/* shoulder buttons */
.ap-shoulders { display:flex; justify-content:space-between; gap:1rem; margin:0 .3rem .5rem; }
.ap-shoulders .ap-btn { display:flex; align-items:center; justify-content:center; gap:.45rem; width:38%; max-width:170px; height:30px; border-radius:15px 15px 6px 6px; cursor:pointer; touch-action:none;
  background: linear-gradient(180deg, #34302c, #1d1a17); box-shadow: 0 3px 0 #0a0908, inset 0 1px 0 rgba(255,255,255,.08); }
.ap-shoulders .ap-g { font-family:var(--font-display); font-size:.78rem; color:#e8dcc4; letter-spacing:.1em; }
.ap-shoulders .ap-cap { font-family:var(--font-display); font-size:.52rem; letter-spacing:.1em; text-transform:uppercase; color:#b7ab94; white-space:nowrap; }
.ap-shoulders .ap-btn.on { background: linear-gradient(180deg, #4a3a24, #2a2015); box-shadow: 0 0 12px rgba(231,198,128,.35); transform:translateY(2px); }

/* the keyboard legend (computers only) and controller status */
.ap-legend { display:none; margin:.55rem 0 0; text-align:center; font-size:.72rem; color:var(--ink-faint); line-height:1.5; }
.ap-legend b { font-family:var(--font-display); font-weight:600; font-size:.58rem; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-dim); }
@media (hover:hover) and (pointer:fine) { .ap-legend { display:block; } }
.ap-has-gp .ap-legend { display:none; }
.ap-status { min-height:1em; margin:.6rem 0 0; text-align:center; font-size:.75rem; color:var(--gold); }
.ap-status:empty { margin:0; min-height:0; }
@media (max-width:420px){ .ap-pad { --dp:124px; --btn:58px; } .ap-mid { flex-direction:column; gap:.9rem; } .ap-mid .ap-btn { min-width:46px; } }
@media (max-width:360px){ .ap-pad { --dp:112px; --btn:52px; } }
/* desktop with a mouse: the pad is mostly a key map, so it can be a little smaller */
@media (hover:hover) and (pointer:fine) { .ap-pad { --dp:118px; --btn:52px; max-width:500px; } }
/* phones held sideways: D-pad and buttons flank the game screen */
@media (orientation:landscape) and (max-height:540px) and (pointer:coarse) {
  .ap-host { display:grid; grid-template-columns:auto minmax(0,1fr) auto; grid-template-rows:auto 1fr auto; grid-template-areas:"sl stage sr" "dp stage fc" "dp mid fc"; align-items:center; column-gap:.6rem; }
  .ap-host .ap-pad, .ap-host .ap-body, .ap-host .ap-shoulders { display:contents; }
  .ap-host .ap-stage { grid-area:stage; padding:2px; }
  .ap-host .ap-stage canvas { max-height:calc(100dvh - 8.6rem); width:auto !important; max-width:100%; }
  .ap-host .ap-mid .ap-cap { display:none; }
  .game-dialog:has(.ap-host) .ouro-toast { min-height:0; margin:.15rem auto 0; font-size:.78rem; }
  .game-dialog:has(.ap-host) .rq-note { display:none; }
  .ap-host .ap-shoulders .ap-btn { grid-auto-flow:column; gap:.4rem; }
  .ap-host .ap-shoulders .ap-cap { position:static; transform:none; font-size:.5rem; }
  .game-dialog:has(.fg-canvas) .ap-host .ap-stage canvas { max-height:calc(100dvh - 11.8rem); }
  .game-dialog:has(.fg-canvas) .rq-actions { margin-top:.2rem !important; }
  .ap-host .ap-dwell { grid-area:dp; } .ap-host .ap-face { grid-area:fc; } .ap-host .ap-mid { grid-area:mid; flex-wrap:nowrap; }
  .ap-host .ap-l { grid-area:sl; width:100%; } .ap-host .ap-r { grid-area:sr; width:100%; }
  .ap-host .ap-status, .ap-host .ap-legend { display:none; }
  .ap-host .ap-mid { align-self:start; padding:0; }
  .game-dialog:has(.ap-host) .game-head { display:none; }
  .game-dialog:has(.ap-host) { padding:.5rem .7rem; }
  .ap-host .ap-shoulders .ap-btn { width:100%; }
}

/* ---- laptop-height screens: the whole game (board + controls) fits without scrolling ---- */
@media (min-width:521px) and (max-height:940px) and (min-height:541px), (min-width:521px) and (max-height:940px) and (pointer:fine) {
  .game-dialog .game-head p { display:none; }
  .game-dialog .game-rule { display:none; }
  .game-dialog .game-head { margin-bottom:.35rem; }
  .game-scorebar .stat { padding:.3rem .5rem; }
  .ouro-canvas { width:min(440px, 100%, calc(100dvh - 330px)); }
  .zig-well { width:min(250px, 44vw, calc((100dvh - 250px) / 2)); }
  .ms-grid { width:min(100%, 34rem, calc(100dvh - 330px)); }
  .pm-canvas { width:min(460px, 100%, calc((100dvh - 290px) * 19 / 21)); }
  .pb-canvas { width:min(390px, 100%, calc((100dvh - 330px) * 320 / 460)); }
  .rk-canvas { width:min(520px, 100%, calc((100dvh - 385px) * 344 / 300)); }
  .tr-canvas { width:min(860px, 100%, calc((100dvh - 375px) * 1.6667)); }
}

/* wide but short screens: the on-screen pad of the arcade games moves beside the board */
@media (min-width:900px) and (max-height:940px) and (min-height:541px), (min-width:900px) and (max-height:940px) and (pointer:fine) {
  .game-dialog:has(.ouro-controls) { width:min(60rem, 100%); }
  .game-dialog > div:has(> .ouro-controls) { display:grid; grid-template-columns:minmax(0,1fr) minmax(200px, 250px); grid-template-areas:"head head" "bar bar" "stage ctrl" "toast ctrl" "rest rest"; column-gap:1.4rem; align-items:center; }
  .game-dialog > div:has(> .ouro-controls) > .game-head { grid-area:head; }
  .game-dialog > div:has(> .ouro-controls) > .game-scorebar, .game-dialog > div:has(> .ouro-controls) > .pm-hud { grid-area:bar; }
  .game-dialog > div:has(> .ouro-controls) > .ouro-stage, .game-dialog > div:has(> .ouro-controls) > .zig-stage, .game-dialog > div:has(> .ouro-controls) > .pm-stage { grid-area:stage; }
  .game-dialog > div:has(> .ouro-controls) > .ouro-toast { grid-area:toast; }
  .game-dialog > div:has(> .ouro-controls) > .ouro-controls { grid-area:ctrl; align-self:center; }
  .ouro-canvas { width:min(440px, 100%, calc(100dvh - 300px)); }
  .pm-canvas { width:min(460px, 100%, calc((100dvh - 262px) * 19 / 21)); }
  .zig-well { width:min(250px, 44vw, calc((100dvh - 320px) / 2)); }
}
@media (max-width:520px) { .pm-canvas { width:min(100%, calc((100dvh - 480px) * 19 / 21)); } .ouro-canvas { width:min(100%, calc(100dvh - 525px)); } }
/* the controller shows its own key map, so the key-help line can go where height is short */
@media (min-width:521px) and (max-height:940px) { .game-dialog:has(.ap-pad) .rq-note { display:none; } }

/* Archive Chess: the gods each side has taken */
.ch-tray { display:flex; flex-wrap:wrap; justify-content:center; gap:1px; min-height:26px; margin:.1rem auto; max-width:420px; }
.ch-cap { width:24px; height:24px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
