/* The website's game pages (dunescholars.com/games/<gameId>/), written by export-site.js. Never part of dist/play.
   The game still fills the first screen exactly as before. Below it, an "About this game" strip in the website's own
   look (navy band, cream text, Scholar Gold; see DESIGN.md in the website repo) tells visitors and search engines
   what the game is. The shared core stops the page scrolling (html, body { overflow: hidden }); this file lets the
   page scroll down to the strip and keeps everything inside the game as it was. */

/* The website's fonts (served from dunescholars.com/assets/fonts/), under names of their own so they can never mix
   with a game's fonts (Robot Route bundles its own Readex Pro, for example). Only the strip uses them. */
@font-face { font-family: 'DS Site Cinzel'; font-weight: 700; font-display: swap; src: url(/assets/fonts/cinzel-latin.woff2) format('woff2'); }
@font-face { font-family: 'DS Site Plex Sans'; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin.woff2) format('woff2'); }
@font-face { font-family: 'DS Site Plex Mono'; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin.woff2) format('woff2'); }

/* The page scrolls, with its normal scrollbar. The game scales to its own box (about.js gives the core
   window.dsViewport), so the scrollbar and the bar below never cover any of it. */
html.ds-site { --peek: 44px; height: auto; overflow-x: hidden; overflow-y: auto; }
html.ds-site body { height: auto; min-height: 100%; overflow: visible; }

/* The game: the first screen less the "About this game" bar, so the bar always shows at the bottom of the first
   screen (svh: the screen with a phone's browser toolbars showing; vh for older browsers).
   A swipe or drag that starts in the game never scrolls the page (pinch-zoom still works); scrolling areas inside
   the game keep their own scrolling, and #stage stops it being handed on to the page. Only #stage and the print
   view get overscroll-behavior: on every element it changed how Chrome draws the game's text. */
.ds-site-game { position: relative; overflow: hidden; touch-action: pinch-zoom;
  height: calc(100vh - var(--peek) - env(safe-area-inset-bottom)); height: calc(100svh - var(--peek) - env(safe-area-inset-bottom)); }
#stage, #print-root { overscroll-behavior: contain; }
/* Games that fill the screen themselves (export-site.js FULL_SCREEN_PHONE): on a phone or small tablet the game gets
   the whole visible screen (dvh follows the browser's toolbars), and the bar and strip are reached by scrolling. */
@media (max-width: 900px), (max-height: 500px) {
  html.ds-site-full .ds-site-game { height: 100vh; height: 100dvh; }
}

/* The bar: one line under the game, the way down to the strip. A swipe or the mouse wheel on it scrolls the page. */
.ds-site-peek {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  height: calc(var(--peek) + env(safe-area-inset-bottom)); padding: 0 16px env(safe-area-inset-bottom);
  background: #0B1B3D; border-block-start: 2px solid #C9A24A; color: #F5ECD7; text-decoration: none;
  font: 500 0.78rem/1 'DS Site Plex Mono', ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase;
}
.ds-site-peek svg { width: 18px; height: 18px; flex: none; color: #C9A24A; }
.ds-site-peek:hover { background: #13264D; }
.ds-site-peek:focus-visible { outline: 3px solid #C9A24A; outline-offset: -5px; border-radius: 6px; }
/* The games' "turn sideways" notes sit on the bottom of the window: lift them above the bar. */
html.ds-site .ctc-turn { bottom: calc(var(--peek) + 12px + env(safe-area-inset-bottom)); }
html.ds-site .pl-turn { inset-block-end: calc(var(--peek) + 8px + env(safe-area-inset-bottom)); }

/* The strip */
.ds-site-about {
  --a-navy: #0B1B3D; --a-gold: #C9A24A; --a-cream: #F5ECD7; --a-sand: #D8CDB4;
  position: relative; background: var(--a-navy) url(/assets/img/pattern-stars.svg) right top / 360px;
  background-blend-mode: soft-light; border-block-start: 2px solid var(--a-gold); color: var(--a-cream);
  font: 400 17px/1.6 'DS Site Plex Sans', system-ui, sans-serif; text-align: start;
  padding: clamp(40px, 7vw, 72px) max(16px, env(safe-area-inset-right)) clamp(40px, 7vw, 72px) max(16px, env(safe-area-inset-left));
}
.ds-site-wrap { max-width: 1100px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; }
.ds-site-eyebrow { font: 500 0.78rem/1.4 'DS Site Plex Mono', ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-gold); }
.ds-site-about h1 { font: 700 clamp(2rem, 5vw, 3rem)/1.15 'DS Site Cinzel', Georgia, serif; color: var(--a-cream); overflow-wrap: break-word; }
.ds-site-intro { max-width: 66ch; font-size: 1.1rem; }
.ds-site-links { display: flex; flex-wrap: wrap; gap: 14px; margin-block-start: 8px; }
.ds-site-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px;
  border: 2px solid var(--a-cream); border-radius: 999px; color: var(--a-cream); background: transparent;
  font: 600 1rem/1.2 'DS Site Plex Sans', system-ui, sans-serif; text-decoration: none;
}
.ds-site-btn:hover { background: rgba(245, 236, 215, 0.12); }
.ds-site-btn.primary { background: var(--a-gold); border-color: var(--a-gold); color: var(--a-navy); }
.ds-site-btn.primary:hover { filter: brightness(1.06); }
.ds-site-foot { font-size: 0.88rem; color: var(--a-sand); margin-block-start: 8px; }
.ds-site-foot a { color: var(--a-gold); }
.ds-site-about :focus-visible { outline: 3px solid var(--a-gold); outline-offset: 3px; border-radius: 999px; }
@media (max-width: 480px) { .ds-site-btn { flex: 1 1 100%; } }
@media (forced-colors: active) { .ds-site-about, .ds-site-peek { border-block-start-color: CanvasText; } .ds-site-btn { border-color: ButtonText; } }

/* Printing (the games' own print views): the strip never prints, and the game box doesn't clip a printed page. */
@media print {
  html.ds-site, html.ds-site body { overflow: visible !important; height: auto !important; }
  .ds-site-game { height: auto !important; overflow: visible !important; }
  .ds-site-about, .ds-site-peek { display: none !important; }
}
