/* ============================================================
   PokéSurvivor.games — main stylesheet
   Pixel-art / Poké Ball visual language, palette taken from the
   embedded game itself (see css/tokens.css).
   Owned by: Lead. Do not edit from other workstreams.
   ============================================================ */

@import url('tokens.css');

/* ------------------------------------------------------------
   1. Reset
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, iframe, video { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 16px;
  text-wrap: balance;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(22px, 4.6vw, 34px); }
h2 { font-size: clamp(16px, 2.6vw, 22px); }
h3 { font-size: clamp(14px, 2vw, 17px); }

h2, h3 { scroll-margin-top: 84px; }

p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

ul, ol { margin: 0 0 18px; padding-left: 1.35em; }
li { margin-bottom: 10px; }
li:last-child { margin-bottom: 0; }

strong { color: #fff; font-weight: 700; }
code, kbd {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.92em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  white-space: nowrap;
}

hr {
  border: 0;
  border-top: 3px solid var(--line);
  margin: 36px 0;
}

::selection { background: var(--accent); color: #2a1a00; }

/* ------------------------------------------------------------
   2. Layout
   ------------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}
.wrap--narrow { max-width: 820px; }

main { display: block; }

.section { padding: 52px 0; }
.section--tight { padding: 34px 0; }
.section--alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 12%, var(--bg-2) 88%, var(--bg) 100%); }

.section__lead {
  color: var(--dim);
  max-width: 72ch;
  margin-bottom: 30px;
}

/* ------------------------------------------------------------
   3. Header
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 9, 20, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 18px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}
.site-header__brand:hover { text-decoration: none; color: var(--text); }

.site-header__brand img,
.site-header__brand svg {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}

.site-header__title {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.site-header__title em {
  font-style: normal;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  color: var(--dim);
  font-size: 16px;
  font-weight: 600;
  border: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--accent);
  border-color: var(--line);
  background: var(--bg-2);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--ps-edge-in);
  background: var(--panel);
}

.site-nav .ps-btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }

/* skip link: standard visually-hidden-until-focused technique, avoids the
   -9999px offset that made layout scanners flag phantom overflow. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--accent);
  color: #2a1a00;
  padding: 10px 16px;
  font-weight: 700;
  transform: translateY(-120%);
}
.skip-link:focus {
  transform: translateY(0);
  clip-path: none;
}

/* ------------------------------------------------------------
   4. Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 34px 0 8px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto;
  height: 520px;
  background: radial-gradient(ellipse at center, rgba(79, 180, 255, 0.13), transparent 68%);
  pointer-events: none;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--accent);
  background: var(--bg-2);
  border: 2px solid var(--ps-edge-in);
  padding: 7px 12px;
  margin-bottom: 18px;
  letter-spacing: 0.06em;
}
.hero__eyebrow img { width: 16px; height: 16px; image-rendering: pixelated; }

.hero h1 { margin-bottom: 14px; }
.hero h1 .hl { color: var(--accent); }

.hero__sub {
  font-size: 19px;
  color: var(--dim);
  max-width: 62ch;
  margin-bottom: 22px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.hero__facts li {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--dim);
  background: var(--bg-2);
  border: 2px solid var(--line);
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero__facts li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  flex: 0 0 8px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ------------------------------------------------------------
   5. Player (iframe shell)
   ------------------------------------------------------------ */
.player {
  position: relative;
  padding: 0 0 10px;
}

/* flex centring wrapper: lets the 16/10 stage shrink to whichever
   axis actually runs out first, instead of overflowing the width. */
.player__wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.player__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: min(78vh, 780px);
  max-width: calc(min(78vh, 780px) * 1.6);
  margin: 0 auto;
  background: #000;
  border: 4px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in), 6px 6px 0 rgba(0, 0, 0, 0.6);
}

.player__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #050914;
  touch-action: manipulation;
}

/* loading veil, removed via JS on iframe load */
.player__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  z-index: 3;
  transition: opacity 260ms linear;
}
.player__loading[hidden] { display: none; }
.player__loading.is-gone { opacity: 0; pointer-events: none; }

.player__loading p {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--dim);
  margin: 0;
}

/* spinning pixel poké ball */
.ps-loader {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, var(--pokeball-red) 0 46%, var(--ps-edge-out) 46% 54%, var(--ps-edge) 54% 100%);
  border: 3px solid var(--ps-edge-out);
  position: relative;
  animation: ps-spin 1.4s steps(8, end) infinite;
  image-rendering: pixelated;
}
.ps-loader::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: var(--ps-edge);
  border: 3px solid var(--ps-edge-out);
  border-radius: 50%;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* HUD */
.player__hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  max-width: var(--maxw);
}
.player__hud .ps-btn { font-size: 16px; }
.player__hud-note {
  color: var(--dim);
  font-size: 15px;
  margin: 0;
  flex: 1 1 180px;
  min-width: 0;
}
.player__hud-note kbd { font-size: 13px; }

.player__mobile-hint {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  margin: 10px auto 0;
  max-width: var(--maxw);
}
.player__mobile-hint img,
.player__mobile-hint svg { width: 20px; height: 20px; }

/* rotate overlay, phones in portrait */
.player__rotate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
  border: 4px solid var(--ps-edge-out);
}
.player__rotate p { margin: 0; color: var(--dim); max-width: 34ch; }
.player__rotate strong {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  line-height: 1.5;
}
.player__rotate .ps-btn { margin-top: 4px; }

/* fullscreen state */
.player:fullscreen,
.player:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #000;
  padding: 0;
}

/* Fullscreen is a two-level flex chain:
     .player  -> column flex, 100vh
     .wrap    -> flex child that must absorb the free space
     .player__wrap -> column flex again, position:relative
     .player__stage -> absolutely fills it
   Every level needs explicit flex growth. A single missing link (the
   inner .wrap, in the original bug) resolves to height:0 and the game
   renders invisible. */
.player:fullscreen .wrap,
.player:-webkit-full-screen .wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
}

.player:fullscreen .player__wrap,
.player:-webkit-full-screen .player__wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
}

.player:fullscreen .player__stage,
.player:-webkit-full-screen .player__stage {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  max-height: none;
  max-width: none;
  aspect-ratio: auto;
  border-width: 0;
  box-shadow: none;
}

.player:fullscreen .player__hud,
.player:-webkit-full-screen .player__hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  background: rgba(5, 9, 20, 0.82);
  border-top: 2px solid var(--line);
  opacity: 0.22;
  transition: opacity 160ms linear;
  z-index: 6;
}
/* The bar floats over the bottom of the game, so it must not swallow
   clicks meant for the canvas. It becomes clickable once it is faded in. */
.player:fullscreen .player__hud:not(:hover):not(:focus-within),
.player:-webkit-full-screen .player__hud:not(:hover):not(:focus-within) {
  pointer-events: none;
}
.player:fullscreen .player__hud:hover,
.player:fullscreen .player__hud:focus-within,
.player:-webkit-full-screen .player__hud:hover,
.player:-webkit-full-screen .player__hud:focus-within { opacity: 1; }
.player:fullscreen .player__mobile-hint,
.player:-webkit-full-screen .player__mobile-hint { display: none !important; }

/* ------------------------------------------------------------
   6. Cards / feature grid
   ------------------------------------------------------------ */
/* min() keeps a track from forcing the grid wider than its container on
   very narrow phones (320px), which used to cause horizontal scroll. */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }

.card {
  background: var(--panel);
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in), var(--hard);
  padding: 20px;
}
.card h3 {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 10px;
}
.card p { color: var(--dim); font-size: 16px; margin: 0; }
.card__icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  image-rendering: pixelated;
  color: var(--accent-2);
}
.card__icon svg { width: 32px; height: 32px; }

/* stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats li {
  margin: 0;
  text-align: center;
  padding: 16px 10px;
  background: var(--bg-2);
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--line);
}
.stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 8px;
}
.stats span { font-size: 14px; color: var(--dim); }

/* ------------------------------------------------------------
   7. Tables
   ------------------------------------------------------------ */
.table-scroll {
  overflow-x: auto;
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in);
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 16px;
}
caption {
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  background: var(--bg-2);
  border-bottom: 3px solid var(--ps-edge-out);
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--line);
  vertical-align: top;
}
thead th {
  background: var(--bg-2);
  color: var(--accent-2);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.04em;
}
tbody tr:last-child td { border-bottom: 0; }
tbody th { color: #fff; font-weight: 700; white-space: nowrap; }
td.yes { color: var(--ps-green); font-weight: 700; }
td.no { color: var(--ps-red); font-weight: 700; }

/* ------------------------------------------------------------
   8. Steps (how to play)
   ------------------------------------------------------------ */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 18px 20px 18px 68px;
  background: var(--panel);
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in);
  color: var(--dim);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #2a1a00;
  background: var(--accent);
  border: 3px solid var(--ps-edge-out);
}
.steps strong { display: block; color: #fff; margin-bottom: 4px; font-size: 18px; }

/* ------------------------------------------------------------
   9. FAQ
   ------------------------------------------------------------ */
.faq { display: grid; gap: 12px; }

.faq details {
  background: var(--panel);
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 54px 16px 18px;
  position: relative;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  min-height: 56px;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: var(--accent);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transition: transform 140ms steps(2, end);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details[open] summary { color: var(--accent); border-bottom: 2px solid var(--line); }
.faq .faq__a { padding: 16px 18px; color: var(--dim); }
.faq .faq__a p { margin: 0 0 12px; }
.faq .faq__a p:last-child { margin: 0; }

/* ------------------------------------------------------------
   10. Callouts
   ------------------------------------------------------------ */
.note {
  border-left: 6px solid var(--accent-2);
  background: var(--bg-2);
  padding: 16px 18px;
  color: var(--dim);
  margin: 0 0 22px;
}
.note strong { color: var(--accent-2); }
.note--warn { border-left-color: var(--accent); }
.note--warn strong { color: var(--accent); }

/* ------------------------------------------------------------
   11. Prose blocks
   ------------------------------------------------------------ */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 38px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 26px; color: var(--accent); }
.prose p, .prose li { color: var(--dim); }
.prose ul { padding-left: 1.3em; }
.prose ul li::marker { color: var(--accent); }

/* definition box, snippet-bait */
.definition {
  border: 3px solid var(--ps-edge-out);
  box-shadow: inset 0 0 0 2px var(--ps-edge-in);
  background: var(--panel);
  padding: 22px;
  margin: 0 0 26px;
}
.definition p { font-size: 18px; color: var(--text); margin: 0; }
.definition strong { color: var(--accent); }

/* ------------------------------------------------------------
   12. Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 3px solid var(--line);
  background: var(--bg-2);
  padding: 40px 0 30px;
  margin-top: 20px;
  font-size: 15px;
  color: var(--dim);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 26px;
  margin-bottom: 26px;
}
.site-footer h2 {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--dim); }
.site-footer a:hover { color: var(--accent); }

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}
.site-footer__brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.site-footer__brand span { font-family: var(--font-display); font-size: 12px; color: var(--text); }

.site-footer__legal {
  border-top: 2px solid var(--line);
  padding-top: 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ps-r1);
}
.site-footer__legal p { margin: 0 0 10px; }
.site-footer__legal p:last-child { margin: 0; }

/* ------------------------------------------------------------
   13. Breadcrumbs
   ------------------------------------------------------------ */
.breadcrumbs {
  font-size: 15px;
  color: var(--ps-r1);
  padding: 14px 0 0;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--ps-r1); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ------------------------------------------------------------
   14. Utilities
   ------------------------------------------------------------ */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.hr-gold { border-top: 3px solid var(--ps-edge-in); }

.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #2a1a00;
  background: var(--accent);
  border: 2px solid var(--ps-edge-out);
  padding: 3px 8px;
  margin: 0 6px 6px 0;
}
.tag--alt { background: var(--accent-2); color: #04213a; }
.tag--ghost { background: transparent; color: var(--dim); border-color: var(--line); }

/* ------------------------------------------------------------
   15. 404
   ------------------------------------------------------------ */
.err-page {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 18px;
}
.err-page h1 { color: var(--accent); }
.err-page .ps-loader { margin: 0 auto 24px; }

/* ------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .player__stage { max-height: 70vh; }
  .section { padding: 40px 0; }
}

@media (max-width: 720px) {
  :root { --fs-body: 17px; --gap: 14px; }

  html { scroll-padding-top: 70px; }

  .site-header__inner { min-height: 56px; gap: 10px; padding: 6px 14px; flex-wrap: wrap; }
  .site-header__brand img, .site-header__brand svg { width: 26px; height: 26px; flex-basis: 26px; }
  .site-header__title { font-size: 11px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 6px 9px; font-size: 15px; }
  .site-nav .ps-btn { min-height: 38px; padding: 7px 11px; font-size: 14px; }

  h1 { font-size: clamp(20px, 6.4vw, 26px); }
  h2 { font-size: clamp(15px, 4.6vw, 18px); }

  .hero { padding: 22px 0 4px; }
  .hero__sub { font-size: 17px; }
  .hero__cta .ps-btn { width: 100%; }

  /* mobile: player goes edge to edge, no wasted border */
  .player__stage {
    aspect-ratio: 16 / 10;
    max-height: 62vh;
    border-width: 3px;
    box-shadow: inset 0 0 0 2px var(--ps-edge-in), 3px 3px 0 rgba(0, 0, 0, 0.6);
  }
  .player__hud { flex-direction: column; align-items: stretch; }
  .player__hud .ps-btn { width: 100%; }
  .player__mobile-hint { display: flex; }

  .steps li { padding: 16px 16px 16px 16px; padding-top: 60px; }
  .steps li::before { top: 12px; left: 14px; }
  .faq summary { font-size: 17px; padding: 15px 46px 15px 15px; }
  .faq .faq__a { padding: 15px; }
  .card { padding: 16px; }
  table { font-size: 15px; min-width: 480px; }
  th, td { padding: 10px 11px; }
}

/* phone in portrait: show rotate hint */
@media (orientation: portrait) and (max-width: 900px) {
  html.no-rotate-hint .player__rotate { display: none; }
  body:not(.rotate-dismissed) .player__rotate { display: flex; }
}

/* phone in portrait: taller stage so the game is still playable
   (the game canvas fills whatever box it is given, so extra vertical
   room reveals more of the field instead of letterboxing) */
@media (orientation: portrait) and (max-width: 720px) {
  .player__stage {
    aspect-ratio: 4 / 3;
    max-height: 58vh;
    max-width: none;
  }
}

/* phone in landscape: player takes the whole viewport, page chrome collapses */
@media (orientation: landscape) and (max-height: 560px) {
  html.is-immersive .site-header,
  html.is-immersive .hero,
  html.is-immersive .site-footer { display: none; }

  .player__hud-note { display: none; }

  .player__stage {
    max-height: calc(100svh - 76px);
    max-width: calc((100svh - 76px) * 1.6);
    border-width: 2px;
  }
  .hero { padding-top: 14px; }
}

/* modern-browser enhancement: exact dynamic viewport height */
@supports (height: 100dvh) {
  @media (orientation: landscape) and (max-height: 560px) {
    .player__stage {
      max-height: calc(100dvh - 76px);
      max-width: calc((100dvh - 76px) * 1.6);
    }
  }
}

@media print {
  .site-header, .player, .site-footer { display: none; }
  body { background: #fff; color: #000; }
}
