/* ============================================================
   FAMOUS PIGEON — PLAÇA PUMP
   The story layer: opening, adventure map progress, entry card,
   episode results, the ending, the share card and the studio plate.

   Two identities, kept apart on purpose:
   - Game surfaces use the game's four colours, Archivo and Plex Mono
     (game.css).
   - The studio plate is a studio surface: Ink, Paper and Oxide from
     the Media Kit, Manrope, DM Mono, Bodoni Moda Italic, the official
     mark unchanged, and the oxide full stop in the lockup only.
   ============================================================ */

@font-face { font-family: 'Manrope'; src: url('../fonts/studio/manrope-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/studio/manrope-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../fonts/studio/dm-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url('../fonts/studio/bodoni-moda-italic-500.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --studio-ink: #0A0B0E;
  --studio-paper: #F3F0E9;
  --studio-oxide: #C94A38;
  --studio-body: 'Manrope', Arial, sans-serif;
  --studio-mono: 'DM Mono', monospace;
  --studio-display: 'Bodoni Moda', Georgia, serif;
}

.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; }

/* ---------- studio plate (studio surface) ---------- */
.studio-plate {
  display: flex; align-items: center; gap: 14px;
  background: var(--studio-paper); color: var(--studio-ink);
  padding: 12px 18px 12px 14px;
  max-width: 100%;
  width: max-content;
}
.studio-mark { width: auto; height: 46px; flex: 0 0 auto; }
.studio-copy { display: grid; gap: 2px; min-width: 0; }
.studio-made { font-family: var(--studio-body); font-size: 15px; line-height: 1.25; }
.studio-label { font-family: var(--studio-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-right: 4px; }
.studio-lockup { font-weight: 500; letter-spacing: -.02em; }
.studio-lockup em { font-style: normal; color: var(--studio-oxide); }
.studio-line { font-family: var(--studio-display); font-style: italic; font-weight: 500; font-size: 16px; line-height: 1.25; }
.studio-links { font-family: var(--studio-mono); font-size: 12px; letter-spacing: .04em; margin-top: 4px; }
.studio-links a { color: var(--studio-ink); text-underline-offset: 3px; }
.studio-links a:focus-visible { outline: 2px solid var(--studio-ink); outline-offset: 2px; }

/* quiet credit line on result screens: game surface, game type */
.result-credit { margin-top: 16px; color: var(--grey); text-transform: none; letter-spacing: .02em; }
.result-credit a { color: var(--ink); }

/* ---------- opening ---------- */
.intro-h { font-size: min(clamp(48px, 7vw, 120px), 10.5vh); margin-bottom: 20px; max-width: 9em; text-wrap: balance; }
#worldmap .display { font-size: min(var(--t-display), 9vh); margin-bottom: 16px; }
.intro-steps { list-style: none; display: grid; gap: 6px; margin-top: 22px; text-transform: none; letter-spacing: .02em; font-size: 13px; }
.intro-steps span { display: inline-block; min-width: 2.4em; font-weight: 500; }

/* ---------- adventure map ---------- */
.map-progress { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; margin-bottom: 10px; }
.map-progress strong { font-weight: 900; font-stretch: 112%; text-transform: uppercase; letter-spacing: -.01em; }
.marks { display: grid; grid-template-columns: repeat(15, minmax(0, 34px)); gap: 4px; margin-bottom: 14px; }
.marks canvas { width: 100%; height: auto; aspect-ratio: 1; display: block; border: 1.5px solid var(--ink); }
.marks-sm { grid-template-columns: repeat(15, minmax(0, 26px)); margin: 16px 0 0; }
.level .level-score { font-size: 10.5px; }
.level.next { border-width: 4px; }
.level.next .level-n::after { content: ' · next'; }

/* ---------- flight title: the episode framing ---------- */
.episode-line { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; margin-bottom: 12px; max-width: 30em; }
.episode-goal { margin-top: 16px; display: inline-flex; flex-wrap: wrap; gap: 4px 10px; background: var(--white); border: 2.5px solid var(--ink); padding: 8px 12px; text-transform: none; letter-spacing: .02em; max-width: 46em; }
.episode-goal span:first-child { text-transform: uppercase; letter-spacing: .08em; }

/* ---------- festes entry card ---------- */
.festes-hint {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  width: min(560px, calc(100% - 28px)); max-width: none;
  background: var(--white); color: var(--ink); border: 2.5px solid var(--ink);
  padding: 14px 18px; text-align: left; display: grid; gap: 6px;
}
.hint-line { font-weight: 700; font-size: 17px; line-height: 1.3; }
.hint-row { font-size: 14px; line-height: 1.4; }
.hint-k { font-size: 11px; margin-right: 6px; }
.hint-goal::before { content: 'Objective'; font-family: var(--font-m); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.hint-start { font-family: var(--font-m); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.festes-hint.playing { width: max-content; max-width: calc(100% - 28px); padding: 8px 14px; text-align: center; }
.festes-hint.playing .hint-k, .festes-hint.playing .hint-start { display: none; }

/* ---------- episode results ---------- */
.lc-meta { margin-top: 18px; }
.episode-status { margin-top: 4px; font-weight: 700; font-size: 16px; }
.episode-status .mono-label { display: block; font-weight: 500; margin-bottom: 2px; }
.fail-goal { margin-top: 10px; background: var(--pale); padding: 8px 10px; text-transform: none; letter-spacing: .02em; }
#failed .lead { margin-top: 14px; }
#failed .fail-goal + .grey { margin-top: 10px; }

/* ---------- ending ---------- */
.ending { background: var(--sky); }
.ending-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(16px, 4vw, 64px); align-items: center; }
.ending-h { font-size: min(clamp(48px, 7vw, 120px), 10.5vh); margin-bottom: 18px; max-width: 8em;  text-wrap: balance; }
.ending .res-meta { max-width: 560px; }
.ending-figure { width: min(100%, 34vh, 340px); }
.ending-stories h2 { margin: 12px 0 10px; }
.stories { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.stories li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; align-items: center; background: var(--white); border: 2.5px solid var(--ink); padding: 8px; }
.stories canvas { width: 52px; height: 52px; grid-row: span 3; border: 1.5px solid var(--ink); }
.stories .s-n { font-size: 10.5px; }
.stories .s-name { font-weight: 800; font-size: 15px; line-height: 1.1; }
.stories .s-done { font-size: 13px; line-height: 1.3; }
.stories .s-score { grid-column: 2; font-size: 10.5px; color: var(--grey); }

/* ---------- share card ---------- */
#sharecard { z-index: 30; }
.share-box { width: min(100%, 860px); }
.share-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; margin-top: 18px; align-items: start; }
.share-preview { width: 100%; height: auto; border: 2.5px solid var(--ink); display: block; background: var(--sky); }
.share-format { border: 0; display: grid; gap: 8px; }
.share-format legend { margin-bottom: 6px; }
.share-format label { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.share-format input { width: 18px; height: 18px; accent-color: var(--ink); }
.share-actions { margin-top: 18px; }
.share-privacy { margin-top: 8px; text-transform: none; letter-spacing: .02em; }

@media (max-width: 900px) {
  .ending-grid { grid-template-columns: 1fr; }
  .ending-figure { order: -1; width: min(36vw, 22vh); justify-self: end; }
  .share-grid { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .marks { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 320px; }
  .marks-sm { grid-template-columns: repeat(15, minmax(0, 1fr)); }
  .studio-plate { width: 100%; }
  .share-grid { grid-template-columns: 1fr; }
  .share-preview { max-width: 220px; justify-self: center; }
  .hint-line { font-size: 15px; }
  .festes-hint { padding: 12px 14px; }
  .intro-steps { font-size: 12.5px; }
}
a.btn { text-decoration: none; }
