/* =====================================================================
   Batch #259 — THE STAGE (visual elevation pass)
   One presentation layer for the tavern's game pages. It does not load
   game logic, change layout geometry, or touch seasonal rules.

   Composition:
   1. Each game's own existing key art becomes a fixed page backdrop,
      under ember light, a vignette, and a deepening scrim.
   2. The principal play surface receives an iron-and-gold bezel, a
      deeper cast shadow, and a low floor glow.
   3. Display titles and shared panels receive the portal's lit-gold
      treatment and a visible top-light/depth treatment.

   Seasonal contract: this sheet is linked statically. seasonal.css is
   injected later by seasonal.js, and its body selector,
   html.<season>-season body, has specificity (0,1,2), above the
   backdrop selector body.s259 at (0,1,1). The guard near the end of
   this file restores background sizing/positioning defaults without
   setting a competing seasonal background image.

   #266 recalibration (browser-proven): the shipped scrims compounded
   into flat black — the #kg-app playmat sat under an .84/.93/.96
   scrim (art alpha .087, contrast retention 13.5%), the portal slab
   at .88/.965, and in season the body art yields to the seasonal
   skin by the contract above. The scrims below are lightened once,
   centrally, and the portal hero gains the element-level art plaque
   the battle-pass hero already had, so the title zone carries art in
   every season. Measured before/after: browser-fixes-266 notes.
   ===================================================================== */

body.s259 {
  --s259-art: radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, .22), transparent 58%);
  --s259-iron: #090604;
  --s259-iron-edge: rgba(23, 15, 7, .98);
  --s259-gold-line: rgba(201, 162, 39, .68);
  --s259-gold-soft: rgba(255, 233, 168, .20);
  --s259-bezel:
    0 0 0 2px var(--s259-iron),
    0 0 0 3px var(--s259-gold-line),
    0 0 0 6px var(--s259-iron-edge),
    0 30px 76px rgba(0, 0, 0, .82),
    0 12px 28px rgba(0, 0, 0, .62),
    inset 0 1px 0 var(--s259-gold-soft),
    inset 0 -20px 42px rgba(0, 0, 0, .34),
    0 24px 58px -18px rgba(255, 122, 26, .24);
  --s259-panel-depth:
    inset 0 1px 0 rgba(255, 233, 168, .16),
    inset 0 -18px 36px rgba(0, 0, 0, .30),
    0 18px 46px rgba(0, 0, 0, .54);

  background-color: #030206;
  background-image:
    radial-gradient(ellipse 72% 44% at 50% -10%, rgba(255, 122, 26, .20), rgba(184, 58, 13, .07) 42%, transparent 72%),
    radial-gradient(ellipse 118% 92% at 50% 42%, transparent 52%, rgba(0, 0, 0, .26) 80%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(to bottom, rgba(2, 1, 5, .26) 0%, rgba(2, 1, 5, .36) 30%, rgba(2, 1, 5, .66) 55%, rgba(2, 1, 5, .90) 80%, rgba(2, 1, 5, .98) 100%),
    var(--s259-art);
  background-position: 50% 0, 50% 0, 50% 0, 50% 16%;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 128% 64vh, 118% 112vh, 100% 100%, cover;
  background-attachment: fixed, fixed, fixed, fixed;
}

/* Each class names art already published on the site. No new art asset
   is introduced by this batch.
   #267: the portal hero art and the Karma playmat are intrinsically
   near-black (measured mean luminance 24–29/255); two rounds of scrim
   lightening reached the contrast floors and the backdrops still read
   flat black in a real browser. Those two paintings now ride as
   brightened BACKDROP-ONLY variants (gamma/exposure lift, same
   paintings — seg-games-backdrop.jpg, playmat-backdrop.jpg); every
   card/panel use of the originals is untouched. Measured composites:
   browser-fixes-267 notes. */
body.s259-art-portal { --s259-art: url("/art/seg-games-backdrop.webp"); }
body.s259-art-cards { --s259-art: url("/games/playmat-backdrop.jpg"); }
body.s259-art-isle { --s259-art: url("/covers/theisleofwitness.webp"); }
body.s259-art-crawler { --s259-art: url("/games/thumbs/crawler.webp"); }
body.s259-art-armies { --s259-art: url("/games/thumbs/armies.webp"); }
body.s259-art-siege { --s259-art: url("/games/thumbs/siege.webp"); }
body.s259-art-hall { --s259-art: url("/games/thumbs/hall.webp"); }
body.s259-art-ledger { --s259-art: url("/games/thumbs/ledger.webp"); }
body.s259-art-dice { --s259-art: url("/games/thumbs/dice.webp"); }
body.s259-art-ravens { --s259-art: url("/games/thumbs/ravens.webp"); }
body.s259-art-tavern { --s259-art: url("/games/thumbs/tavern.webp"); }
body.s259-art-crossword { --s259-art: url("/games/thumbs/crossword.webp"); }
body.s259-art-wordsearch { --s259-art: url("/games/thumbs/wordsearch.webp"); }
body.s259-art-paint { --s259-art: url("/games/thumbs/paint-by-number.webp"); }
body.s259-art-diamond { --s259-art: url("/games/thumbs/diamond-art.webp"); }
body.s259-art-pass { --s259-art: url("/games/playmat-backdrop.jpg"); }
body.s259-art-room { --s259-art: url("/art/seg-games.webp"); }

/* ---- title plaques: the portal hero's lit-gold gradient ------------ */
body.s259 .game-header h1,
body.s259 #wrap > h1,
body.s259 #ovTitle .panel h1,
body.s259 .game-title h1,
body.s259 .game-intro h1,
body.s259 .xw-title,
body.s259 .whead h1,
body.s259 .bp-hero h1,
body.s259 .cab-title {
  background-image: linear-gradient(175deg, #fff3c4 5%, #f6d67c 38%, #c9a227 68%, #8a5f14 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 14px rgba(201, 162, 39, .30));
}

body.s259 .cab-title { text-shadow: none; }
body.s259 .start-title {
  background-image: linear-gradient(175deg, #fff3c4 5%, #f6d67c 38%, #c9a227 68%, #8a5f14 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 14px rgba(201, 162, 39, .30));
}

/* ---- shared panel depth -------------------------------------------- */
body.s259 .panel,
body.s259 .hud-box,
body.s259 .wscreen,
body.s259 .oath-wrap {
  box-shadow: var(--s259-panel-depth);
}

/* ---- principal stages: iron band, gold pinstripe, floor glow ------- */
body.s259-art-cards #kg-app,
body.s259-art-isle .cabinet,
body.s259-art-armies #stage,
body.s259-art-siege #stage,
body.s259-art-ledger .ledger-frame,
body.s259-art-dice .dice-game-container,
body.s259-art-ravens #wotr,
body.s259-art-tavern .game-shell,
body.s259-art-crossword #xword,
body.s259-art-wordsearch #wshell,
body.s259-art-paint .ka-viewport,
body.s259-art-diamond .ka-viewport {
  box-shadow: var(--s259-bezel);
}

body.s259-art-cards #kg-app {
  background-image:
    linear-gradient(165deg, rgba(7, 4, 10, .50) 0%, rgba(5, 3, 7, .68) 54%, rgba(9, 5, 3, .85) 100%),
    url("/games/playmat-backdrop.jpg"),
    linear-gradient(165deg, #0d0a12 0%, #070509 60%, #0b0705 100%);
  background-position: center, 50% 22%, center;
  background-repeat: no-repeat;
  background-size: auto, cover, auto;
}

body.s259-art-tavern .game-shell {
  border: 1px solid rgba(201, 162, 39, .38);
  border-radius: 16px;
  background: linear-gradient(168deg, rgba(13, 10, 18, .88), rgba(5, 4, 9, .94));
}

/* Crawler's canvas border and shadow are owned by seasonal rules in
   the page. The Stage therefore adds only a non-competing outline. */
body.s259-art-crawler #game {
  outline: 2px solid rgba(232, 179, 75, .70);
  outline-offset: 4px;
}
body.s259-art-crawler #hud {
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, .16),
    inset 0 -16px 30px rgba(0, 0, 0, .28),
    0 12px 30px rgba(0, 0, 0, .52),
    0 0 0 1px rgba(0, 0, 0, .58);
}
body.s259-art-crawler .hud-chip {
  background: rgba(5, 3, 2, .44);
  box-shadow: inset 0 0 0 1px rgba(232, 179, 75, .18), inset 0 1px 0 rgba(255, 233, 168, .08);
  border-radius: 4px;
}

/* Hall is fullscreen by design: its bezel lands on the chrome that a
   visitor actually sees, rather than pretending the fixed stage has an
   outside edge. */
body.s259-art-hall #topbar {
  background: linear-gradient(180deg, rgba(31, 22, 10, .94), rgba(5, 3, 8, .94));
  box-shadow: inset 0 1px 0 rgba(255, 233, 168, .18), 0 10px 28px rgba(0, 0, 0, .58);
}
body.s259-art-hall #hud .hbar,
body.s259-art-hall #potions,
body.s259-art-hall .abtn {
  box-shadow: inset 0 1px 0 rgba(255, 233, 168, .14), 0 8px 20px rgba(0, 0, 0, .48);
}

/* ---- portal: let the fixed art breathe through the arcade slab ----- */
body.s259-art-portal .games-section {
  background: linear-gradient(180deg, rgba(9, 7, 14, .78), rgba(5, 4, 9, .92));
}

/* #266: the portal hero carries its own seg-games plaque — the same
   element-level treatment the battle-pass hero already had. The body
   backdrop yields to the seasonal skins in season (guard below), so
   without this the portal's title zone had no art at all for a third
   of the year. Measured: the key art holds ~47% mean strength behind
   the title and fades into the arcade slab. */
body.s259-art-portal .games-hero {
  background-image:
    linear-gradient(180deg, rgba(7, 4, 10, .34) 0%, rgba(5, 3, 7, .52) 62%, rgba(9, 5, 3, .88) 100%),
    url("/art/seg-games-backdrop.webp"),
    linear-gradient(180deg, #0d0a12, #070509);
  background-position: center, 50% 30%, center;
  background-repeat: no-repeat;
  background-size: auto, cover, auto;
  box-shadow: var(--s259-bezel);
}
body.s259-art-portal .game-card {
  border-color: rgba(201, 162, 39, .34);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, .13),
    inset 0 -18px 34px rgba(0, 0, 0, .28),
    0 20px 46px rgba(0, 0, 0, .62),
    0 18px 44px -20px rgba(255, 122, 26, .20);
}
body.s259-art-portal .thumbnail-wrapper {
  border-color: rgba(232, 195, 90, .46);
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, .20),
    inset 0 -28px 34px rgba(0, 0, 0, .26),
    0 12px 26px rgba(0, 0, 0, .52);
}
body.s259-art-portal .thumbnail-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 244, 204, .07), transparent 34%, transparent 68%, rgba(0, 0, 0, .36));
}
body.s259-art-portal .thumbnail-wrapper .badge { z-index: 2; }

/* ---- Battle Pass: the Long Hearth gets hearth art, not only an icon - */
body.s259-art-pass .bp-hero {
  background-image:
    linear-gradient(165deg, rgba(15, 9, 5, .55), rgba(7, 4, 9, .78) 68%, rgba(5, 3, 7, .90)),
    url("/games/playmat-backdrop.jpg"),
    linear-gradient(165deg, #17102a, #0a0616 70%);
  background-position: center, 50% 42%, center;
  background-repeat: no-repeat;
  background-size: auto, cover, auto;
  box-shadow: var(--s259-bezel);
}
body.s259-art-pass .bp-pet {
  box-shadow: var(--s259-panel-depth);
}

/* ---- Trophy Room: scene untouched; only its floating chrome gains
   depth, a top-light, and separation from the 3D view. ---------------- */
body.s259-art-room #hud-top .title,
body.s259-art-room .hbtn,
body.s259-art-room #hud-prompt,
body.s259-art-room #hud-help,
body.s259-art-room #hud-perf,
body.s259-art-room #joy,
body.s259-art-room #btn-interact,
body.s259-art-room #room-toast {
  background-image: linear-gradient(165deg, rgba(35, 24, 12, .88), rgba(7, 4, 12, .88));
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, .18),
    inset 0 -12px 24px rgba(0, 0, 0, .26),
    0 12px 28px rgba(0, 0, 0, .52);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
body.s259-art-room .sheet-card {
  box-shadow: var(--s259-bezel);
}

/* Heads-up displays in the smaller games inherit the same material
   language without changing their dimensions. */
body.s259-art-tavern #hud,
body.s259-art-ledger #hud,
body.s259-art-siege #hud,
body.s259-art-armies #topbar {
  box-shadow:
    inset 0 1px 0 rgba(255, 233, 168, .15),
    inset 0 -14px 28px rgba(0, 0, 0, .24),
    0 12px 28px rgba(0, 0, 0, .48);
}

/* Seasonal guard: seasonal.css owns the seasonal body image. Restore
   only the attachment/geometry defaults that the fixed Stage stack
   would otherwise leave behind; do not set background-image here. */
html.halloween-season body.s259,
html.christmas-season body.s259,
html.valentine-season body.s259 {
  background-attachment: scroll, scroll, scroll, scroll;
  background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  background-repeat: repeat, repeat, repeat, repeat;
  background-size: auto, auto, auto, auto;
}

@media (max-width: 700px) {
  body.s259 {
    background-position: 50% 0, 50% 0, 50% 0, 50% 12%;
    background-size: 160% 54vh, 150% 100vh, 100% 100%, cover;
  }
}
