/* the Emberbound page. Site shell from style.css, article layout from devlog/post.css,
   and everything inside the "screens" uses the game's own palette and pixel style (theme.ts in the game) */

.game-page {
  --g-bg: #111012; --g-card: #1d1917; --g-raised: #2b251e; --g-edge: #3b342f; --g-depth: #09090a;
  --g-text: #f8efe1; --g-muted: #c8b8a1; --g-off: #302d29; --g-off-text: #8e8375; --g-off-edge: #4a3d2e;
}
.game-page [hidden] { display: none !important; }
.px { font-family: "Tiny5", "JetBrains Mono", ui-monospace, monospace; font-weight: 400; letter-spacing: 0; word-spacing: .2em; }

/* ---------- hero ---------- */
.game-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; margin-bottom: 72px; }
.game-hero h1 { font-size: clamp(48px, 9.5vw, 120px); line-height: .9; margin: 22px 0 24px; text-transform: uppercase; }
.game-hero .dek { max-width: 26em; }
.game-hero .px-row { margin-top: 32px; }
.hero-icon img {
  display: block; width: clamp(160px, 22vw, 256px); height: auto; border-radius: 22%;
  border: 2px solid var(--line); box-shadow: 8px 8px 0 var(--line); image-rendering: pixelated;
  background: var(--line);   /* fills the seam between the border and the clipped corner, or the page shows through */
}

/* ---------- pixel buttons: square, 2px edge, hard 2px drop that snaps away on press ---------- */
.px-row { display: flex; flex-wrap: wrap; gap: 12px; }
.px-btn {
  --face: var(--g-raised); --edge: var(--g-edge); --depth: var(--g-depth); --ink: var(--g-text);
  display: inline-block; text-align: center; min-height: 44px; padding: 12px 14px;
  font: 400 16px/1 "Tiny5", ui-monospace, monospace; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--face); border: 2px solid var(--edge); border-radius: 0;
  box-shadow: 2px 2px 0 var(--depth); margin: 0 2px 2px 0; cursor: pointer; word-spacing: .2em;
}
.px-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.px-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.px-btn.px-btn:disabled { --face: var(--g-off); --edge: var(--g-off-edge); --ink: var(--g-off-text); --depth: transparent; cursor: not-allowed; }
.px-btn.flame  { --face: #ff784f; --edge: #b84f38; --depth: #743126; --ink: #111012; }
.px-btn.arcana { --face: #9f7de0; --edge: #755da8; --depth: #4d3b70; --ink: #111012; }
.px-btn.gold   { --face: #372d1f; --edge: #b29046; --ink: #f4c95d; }
.px-btn.big { width: 100%; min-height: 52px; padding-block: 14px; font-size: 20px; }
/* the hero buttons sit on the site background, so their drop follows the theme */
.game-hero .px-btn { --depth: var(--line); box-shadow: 4px 4px 0 var(--depth); margin: 0 4px 4px 0; }
.game-hero .px-btn:active { transform: translate(4px, 4px); }

/* ---------- game "screens" inside the site's demo frames ---------- */
.demo-body.screen { background: var(--g-bg); color: var(--g-text); }
/* the dark screen sits inset on the card, so the card's border and shadow always have a light rim
   between them and the dark (otherwise black border + black screen + black shadow melt into one slab) */
.demo > .demo-body.screen { margin: 12px; border: 2px solid var(--line); border-radius: 10px; }
@media (max-width: 720px) { .demo > .demo-body.screen { margin: 8px; border-radius: 8px; } }
.demo > .screen + figcaption { padding-top: 12px; }
.prose .screen :is(h3, p, dl) { margin: 0; }
.px-card { background: var(--g-card); border: 2px solid var(--g-edge); padding: 12px; display: grid; gap: 8px; align-content: start; }
.px-card h3 { font-size: 18px; text-transform: uppercase; color: var(--g-text); }
.px-card.gold { border-color: #b29046; }
.px-card.flame { border-color: #b84f38; }
.px-card .value { font-size: 30px; color: #f4c95d; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.px-card .detail { font-size: 13px; line-height: 1.4; color: var(--g-muted); }

/* the sped-up run */
.run-body { display: grid; gap: 14px; }
.run-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.run-phx { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.run-form { font-size: 16px; text-transform: uppercase; line-height: 1.2; margin-top: 6px !important; }
.bird-box { position: relative; width: 72px; height: 78px; flex: none; background: var(--g-bg); border: 2px solid var(--g-edge); }
.bird-box svg, .bird-stage svg { display: block; width: 100%; height: 100%; }
.bird-box .t, .bird-stage .t { fill: var(--tint); }
.bird-box.empty svg { visibility: hidden; }
.bird-box .empty-note { display: none; position: absolute; inset: 0; place-content: center; padding: 4px; text-align: center; font-size: 10px; line-height: 1.2; color: var(--g-off-text); }
.bird-box.empty .empty-note { display: grid; }
.run-tabs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; text-transform: uppercase; }
.run-tab { padding: 6px 10px; border: 2px solid var(--g-off-edge); color: var(--g-off-text); background: var(--g-off); }
.run-tab.on { border-color: #b29046; color: #f4c95d; background: #372d1f; }
.prose .unlock-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.prose .unlock-grid li { margin: 0; }
.prose .unlock-grid li::marker { content: none; }
.unlock {
  display: block; width: 100%; min-height: 52px; padding: 6px 7px; text-align: left; cursor: pointer;
  font: 400 12px/1.15 "Tiny5", ui-monospace, monospace; text-transform: uppercase; word-spacing: .15em;
  color: var(--g-off-text); background: var(--g-off); border: 2px solid var(--g-off-edge); border-radius: 0;
}
.unlock .n { display: block; font-size: 10px; opacity: .7; margin-bottom: 3px; }
.unlock.on { color: var(--ink); background: var(--c); border-color: color-mix(in srgb, var(--c) 60%, #000); box-shadow: 2px 2px 0 var(--g-depth); }
.unlock[aria-current="step"] { outline: 2px solid var(--g-text); outline-offset: 2px; }
.unlock:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.unlock.pop { animation: pop .24s steps(3) both; }
@keyframes pop { 0% { transform: scale(.7); } 66% { transform: scale(1.12); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .unlock.pop { animation: none; } }
.run-detail { font-size: 15px; line-height: 1.4; min-height: 2.8em; color: var(--g-text); }

/* forms */
.forms-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; }
.bird-stage { position: relative; width: 216px; height: 232px; padding: 12px; background: var(--g-bg); border: 2px solid var(--g-edge); }
.bird-stage .empty-note { display: none; position: absolute; inset: 0; place-content: center; padding: 16px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--g-off-text); }
.bird-stage.empty svg { visibility: hidden; }
.bird-stage.empty .empty-note { display: grid; }
.form-info { display: grid; gap: 14px; justify-items: start; }
.eyebrow { font-size: 13px; color: var(--g-muted); text-transform: uppercase; }
.form-name { font-size: clamp(24px, 3.4vw, 36px); text-transform: uppercase; line-height: 1; }
.form-stats { display: grid; gap: 6px; font-size: 16px; }
.form-stats div { display: flex; gap: 12px; }
.form-stats dt { color: var(--g-muted); width: 4.5em; text-transform: uppercase; }
.form-stats dd { color: #f4c95d; overflow-wrap: anywhere; }
.pips { display: flex; flex-wrap: wrap; gap: 6px; }
.pip {
  width: 44px; height: 44px; border: 2px solid var(--g-edge); border-radius: 0; cursor: pointer;
  background: var(--sw, repeating-linear-gradient(45deg, transparent 0 5px, #4a3d2e 5px 6px));
  font: 400 13px "Tiny5", ui-monospace, monospace; color: #111012;
}
.pip.none { color: var(--g-off-text); }
.pip[aria-pressed="true"] { outline: 2px solid var(--g-text); outline-offset: 2px; }
.pip:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* numbers */
.nums-body { position: relative; }
.num-big { font-size: clamp(36px, 7vw, 76px); line-height: 1.05; color: #f4c95d; min-height: 1.1em; overflow-wrap: anywhere; }
.num-digits { font-size: 13px; color: var(--g-muted); margin-top: 8px; min-height: 1.5em; }
.num-slider { display: block; margin-top: 20px; }
.num-slider span { display: block; font-size: 12px; color: #8a847c; margin-bottom: 4px; }
.num-slider input { width: 100%; min-height: 44px; accent-color: #ff784f; }
.num-afford { font-size: 13px; color: var(--g-text); margin-top: 6px; }
.num-afford b { color: var(--tint, #ff784f); font-weight: 600; }
.nums-loading { position: absolute; inset: 0; display: grid; place-content: center; background: var(--g-bg); color: var(--g-muted); font-size: 13px; }
.nums-ready .nums-loading { display: none; }

/* forms: the in-game text */
.form-desc { font-size: 14px; line-height: 1.45; color: var(--g-muted); max-width: 34em; min-height: 4.4em; }
.form-desc:empty { display: none; }

/* leave the app */
.away-body { position: relative; display: grid; gap: 14px; }
.away-slider { display: grid; gap: 4px; }
.away-slider span { font-size: 16px; color: var(--g-muted); text-transform: uppercase; }
.away-slider b { color: #f4c95d; font-weight: 400; }
.away-slider input { width: 100%; min-height: 44px; accent-color: #ff784f; }
.away-presets .px-btn { min-height: 40px; padding: 10px 12px; font-size: 14px; }
.away-bar { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; height: 18px; }
.away-bar i { background: var(--g-off); border: 2px solid var(--g-off-edge); }
.away-bar i.on { background: #ff784f; border-color: #b84f38; }
.away-status { font-size: 14px; line-height: 1.45; color: var(--g-text); min-height: 2.9em; }
.away-modal { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 16px; background: rgb(9 9 10 / .82); }
.away-card { width: min(380px, 100%); gap: 10px; border-color: #b29046; box-shadow: 4px 4px 0 var(--g-depth); }
.away-card .eyebrow { color: #f4c95d; }
.away-card .detail { font-size: 14px; }
.away-card .px-row { margin-top: 4px; }
.away-card .px-btn { flex: 1 1 auto; }
.not-ad { display: grid; place-content: center; gap: 8px; min-height: 160px; text-align: center; font-size: 16px; line-height: 1.6; color: var(--g-off-text); text-transform: uppercase; background: repeating-linear-gradient(45deg, #302d29 0 8px, #2b2824 8px 16px); border: 2px dashed var(--g-off-edge); }
.not-ad span { font-size: 36px; color: var(--g-text); }

/* stats */
.prose .stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.prose .stats li { margin: 0; background: #111012; color: var(--g-muted); font-size: 14px; line-height: 1.35; box-shadow: 4px 4px 0 var(--orange); }
.prose .stats li::marker { content: none; }
.stats b { display: block; font-size: 30px; color: #f4c95d; line-height: 1; }

/* timeline */
.prose .log { list-style: none; padding: 0; border: 2px solid var(--line); background: #111012; color: var(--g-text); box-shadow: 6px 6px 0 var(--orange); }
.prose .log li { margin: 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 12px 16px; font-size: 16px; line-height: 1.4; }
.prose .log li + li { border-top: 2px solid var(--g-edge); }
.prose .log li::marker { content: none; }
.prose .log b { color: #ff784f; font-weight: 400; text-transform: uppercase; }

/* end */
.game-end { max-width: var(--col); margin-top: 96px; padding-top: 22px; border-top: 2px solid var(--line); }
.game-end .mono { font-size: 13px; color: var(--muted); }
.game-end .back { display: inline-block; font-size: clamp(34px, 6vw, 64px); font-weight: 700; letter-spacing: -.045em; line-height: 1; text-decoration: none; margin-top: 14px; }
.game-end .back:hover { color: var(--orange); }
.game-end .also { margin-top: 18px; font-size: 17px; }
.game-end .also a { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.game-end .also a:hover { background: var(--orange); color: #0d0d0d; text-decoration: none; }

@media (max-width: 860px) {
  .game-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-icon { order: -1; justify-self: center; }
  .forms-body { grid-template-columns: minmax(0, 1fr); }
  .bird-stage { justify-self: center; }
}
@media (max-width: 520px) {
  .prose .log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .px-card .value { font-size: 26px; }
  /* the sped-up run, compacted: one short gold row, a slimmer phoenix card, and numbered squares
     instead of 37 named tiles (the name still shows in the line under the grid and in each square's label) */
  .run-body { gap: 10px; }
  .run-top { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .run-top .gold { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; }
  .run-top .gold h3 { font-size: 14px; }
  .run-top .gold .value { font-size: 22px; }
  .run-phx { padding: 8px; gap: 10px; }
  .run-phx .bird-box { width: 52px; height: 56px; }
  .run-phx .eyebrow { font-size: 11px; }
  .run-form { font-size: 13px; margin-top: 2px !important; }
  .run-tabs { font-size: 11px; gap: 4px; }
  .run-tab { padding: 4px 7px; }
  .prose .unlock-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .unlock { min-height: 0; aspect-ratio: 1; padding: 0; font-size: 0; display: grid; place-items: center; }
  .unlock .n { font-size: 11px; opacity: 1; margin: 0; }
  .run-detail { font-size: 13px; }
}
