/* =====================================================================
   PLICA page styles (public/css/plica.css)
   Loaded after /css/site.css on /plica/ only. Reuses the shared tokens and
   nudges them toward Plica's own Endesga 32 palette (ink-night background,
   loading-bar gold, cream text) so the page feels like the game's title
   screen while staying on the studio brand.
   ===================================================================== */

body.page-plica {
  --bg: #181425;
  --bg-2: #262b44;
  --panel: #1e1a31;
  --panel-2: #3a4466;
  --edge: #0b0912;
  --muted: #c0cbdc;
  --gold: #feae34;
  --cream: #ead4aa;
  --ink-red: #e43b44;
  --grass: #63c74d;
  --grass-2: #3e8948;
  --c: var(--gold);
}

/* ---------- title screen hero ---------- */
.title-screen { position: relative; overflow: hidden; border-bottom: 4px solid var(--edge); isolation: isolate; }
.title-screen__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  image-rendering: pixelated;
}
.title-screen::before { /* night tint so text stays readable over the forest */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(24,20,37,.92) 0%, rgba(24,20,37,.72) 45%, rgba(24,20,37,.6) 85%, rgba(24,20,37,.3) 100%);
}
.title-screen__inner { padding-top: 24px; text-align: center; }
.title-screen .hud { margin-bottom: 36px; }
.title-screen .hud b { color: var(--gold); }
.title-logo { margin: 0 auto; max-width: 640px; }
.title-logo img {
  width: 100%; height: auto; image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 var(--edge));
}
.js .title-logo img { animation: logo-drop .7s steps(7) both; }
@keyframes logo-drop { from { transform: translateY(-80px); opacity: 0; } 70% { transform: translateY(6px); opacity: 1; } }
.title-screen .eyebrow { margin: 22px 0 0; color: var(--cream); text-shadow: 2px 2px 0 var(--edge); background: rgba(11,9,18,.75); padding: 6px 10px; }
.title-screen .lead { margin: 16px auto 0; color: var(--ink); text-shadow: 2px 2px 0 var(--edge); }
.title-actions { margin-top: 30px; justify-content: center; }
.title-actions .btn--gold { animation: plica-pulse 1.2s steps(2) infinite; }
.title-actions .btn--gold:hover, .title-actions .btn--gold:focus-visible { animation: none; }
@keyframes plica-pulse { 50% { box-shadow: inset -3px -3px 0 rgba(0,0,0,.25), inset 3px 3px 0 rgba(255,255,255,.35), 4px 4px 0 var(--edge), 0 0 0 6px rgba(254,174,52,.3); } }
.title-press { display: table; margin: 18px auto 0; background: rgba(11,9,18,.75); padding: 6px 10px; font-family: var(--font-pixel); font-size: 10px; letter-spacing: 1px; color: var(--cream); text-shadow: 2px 2px 0 var(--edge); }
.title-screen .btn--ghost { background: rgba(11,9,18,.7); }
.title-screen .btn--ghost:hover { background: rgba(11,9,18,.85); }
.title-perks { margin-top: 12px; justify-content: center; }

.title-party {
  list-style: none; margin-top: 36px;
  display: flex; justify-content: center; align-items: flex-end; gap: 8px 14px;
  padding: 0 0 6px; position: relative;
}
.title-party::after { /* grass strip */
  content: ""; position: absolute; left: -100vw; right: -100vw; bottom: 0; height: 10px;
  background: repeating-linear-gradient(90deg, var(--grass) 0 8px, var(--grass-2) 8px 16px);
  box-shadow: 0 4px 0 #124e2c;
}
.title-party li { position: relative; z-index: 1; display: flex; }
.title-party img { image-rendering: pixelated; }
.title-party .h { width: 64px; height: 64px; }
.title-party .p { width: 40px; height: 40px; display: none; }
.title-party li:nth-child(odd) img { animation: plica-hop .7s steps(2) infinite; }
.title-party li:nth-child(even) img { animation: plica-hop .7s steps(2) .35s infinite; }
@keyframes plica-hop { 50% { transform: translateY(-4px); } }
@media (min-width: 640px) {
  .title-party .h { width: 96px; height: 96px; }
  .title-party .p { display: block; width: 60px; height: 60px; }
  .title-screen__inner { padding-top: 28px; }
}

/* ---------- story / pitch ---------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
@media (max-width: 860px) { .story { grid-template-columns: 1fr; } }
.story__text p { font-size: 24px; }
.story__text .quote { font-family: var(--font-pixel); font-size: 12px; line-height: 1.9; color: var(--cream); border-left: 4px solid var(--c); padding-left: 14px; }
.story .shot img { aspect-ratio: 1200 / 630; }
.numbers { margin-top: 48px; grid-template-columns: repeat(2, minmax(0, 1fr)); } /* 10 stats: 2x5, then 5x2 */
@media (min-width: 640px) { .numbers { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- fold demo ---------- */
.fold-demo { margin-top: 48px; }
.fold-demo__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 760px) { .fold-demo__grid { grid-template-columns: 1fr; } }
.fold-demo h3 { font-family: var(--font-pixel); font-size: 14px; color: var(--c); margin-bottom: 12px; line-height: 1.6; }
.suit-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.suit-btn {
  display: flex; align-items: center; gap: 10px; justify-content: flex-start;
  font-family: var(--font-pixel); font-size: 11px; letter-spacing: 1px; color: var(--ink);
  background: var(--panel-2); border: 3px solid var(--edge); padding: 10px 12px; min-height: 52px;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.12), var(--shadow); cursor: pointer;
  transition: transform .08s steps(2);
}
.suit-btn img { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.suit-btn:hover { transform: translate(-2px, -2px); }
.suit-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.suit-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.fold-readout { background: var(--edge); border: 3px solid var(--panel-2); padding: 18px; text-align: center; }
.fold-readout__mult { display: block; font-family: var(--font-pixel); font-size: clamp(32px, 8vw, 56px); color: var(--gold); text-shadow: 4px 4px 0 var(--ink-red); line-height: 1.2; }
.fold-readout__mult.is-max { animation: plica-flash .4s steps(2) 3; }
@keyframes plica-flash { 50% { color: var(--ink); } }
.fold-readout__label { display: block; font-family: var(--font-pixel); font-size: 10px; color: var(--muted); margin-top: 10px; letter-spacing: 1px; min-height: 1.4em; }
.fold-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin-top: 16px; }
.fold-steps li { font-family: var(--font-pixel); font-size: 9px; padding: 6px 7px; background: var(--panel); color: var(--muted); border: 2px solid var(--panel-2); }
.fold-steps li.is-on { background: var(--gold); color: var(--edge); border-color: var(--edge); }
.fold-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin-top: 14px; min-height: 36px; }
.fold-hand li { width: 30px; height: 36px; background: var(--cream); border: 2px solid var(--edge); display: grid; place-items: center; box-shadow: 2px 2px 0 var(--edge); }
.fold-hand img { width: 24px; height: 24px; image-rendering: pixelated; }
.fold-demo .note { font-size: 19px; color: var(--muted); margin-top: 14px; }

/* ---------- feature tiles with sprite icons ---------- */
.feature__icon img { width: 48px; height: 48px; image-rendering: pixelated; }
/* Blot is near-black ink: give him a small parchment page so he shows on the dark panels */
.feature__icon--paper { background: var(--cream); border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--edge); display: grid; place-items: center; }
.features .feature:last-child:nth-child(3n+1) { grid-column: 1 / -1; }

/* ---------- character select ---------- */
.heroes { list-style: none; }
.hero-card { display: flex; flex-direction: column; background: var(--panel); border: 4px solid var(--edge); box-shadow: inset 0 0 0 3px var(--c), var(--shadow-lg); }
.hero-card:hover { box-shadow: inset 0 0 0 3px var(--ink), var(--shadow-lg); }
.hero-card__portrait {
  display: grid; place-items: end center; padding: 18px 0 14px; border-bottom: 4px solid var(--edge); min-height: 140px;
  background:
    linear-gradient(to bottom, transparent 70%, rgba(99,199,77,.35) 70% 74%, transparent 74%),
    repeating-conic-gradient(var(--bg-2) 0 25%, #2c2f4c 0 50%) 0 0 / 16px 16px;
}
.hero-card__portrait img { image-rendering: pixelated; }
.hero-card:hover .hero-card__portrait img { animation: plica-hop .6s steps(2) infinite; }
.hero-card__body { padding: 16px 18px 20px; flex: 1; }
.hero-card__name { font-family: var(--font-pixel); font-size: 13px; color: var(--c); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hp { font-family: var(--font-pixel); font-size: 9px; color: var(--ink); background: #a22633; border: 2px solid var(--edge); padding: 4px 6px; } /* 6.8:1 */
.hero-card__body p { color: var(--muted); margin-top: 10px; font-size: 20px; }
.passive { display: block; margin-top: 12px; font-size: 20px; color: var(--ink); border-top: 2px dashed var(--panel-2); padding-top: 10px; }
.passive b { font-family: var(--font-pixel); font-size: 10px; font-weight: normal; color: var(--c); letter-spacing: 1px; margin-right: 6px; }
.heroes > li:nth-child(1) { --c: var(--ink-red); }
.heroes > li:nth-child(2) { --c: #0099db; }
.heroes > li:nth-child(3) { --c: #b55088; }
.heroes > li:nth-child(4) { --c: var(--grass); }

.cast { margin-top: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .cast { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cast-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.cast-card__art { display: grid; place-items: center; background: var(--edge); border: 3px solid var(--panel-2); padding: 14px; min-width: 120px; min-height: 120px; }
.cast-card__art img { image-rendering: pixelated; }
.cast-card__art--paper { /* parchment page behind Blot's dark ink */
  background: radial-gradient(circle at 50% 45%, #f6e8c8, var(--cream) 70%); border-color: var(--edge);
}
.cast-card h3 { font-family: var(--font-pixel); font-size: 13px; color: var(--c); margin-bottom: 10px; line-height: 1.5; }
.cast-card p { color: var(--muted); }
@media (max-width: 520px) { .cast-card { grid-template-columns: 1fr; } .cast-card__art { justify-self: start; } }
/* sheet is 212x40: at least 1.5x on phones, then whole-number 2x and 4x */
.marginfolk-art img { width: 100%; max-width: 318px; height: auto; }
@media (min-width: 480px) { .marginfolk-art img { width: 424px; max-width: 100%; } }
@media (min-width: 900px) { .marginfolk-art img { width: 848px; } }
.marginfolk { grid-template-columns: 1fr; }
.marginfolk .cast-card__art { justify-self: stretch; }

/* 5 bosses: one row on desktop, centred wrapping rows (2+2+1, 3+2) below */
.bosses { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 28px; }
.bosses li { flex: 0 1 156px; }
@media (min-width: 900px) { .bosses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.bosses li { background: var(--edge); border: 3px solid var(--panel-2); text-align: center; padding: 14px 8px 12px; }
.bosses img { width: 128px; height: 128px; margin: 0 auto; image-rendering: pixelated; }
.bosses span { display: block; font-family: var(--font-pixel); font-size: 9px; color: var(--muted); margin-top: 10px; letter-spacing: 1px; line-height: 1.5; }

/* 18 pets: 3, 6 or 9 per row so every row is full */
.pets { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
@media (min-width: 600px) { .pets { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 960px) { .pets { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.pets li { background: var(--panel); border: 3px solid var(--edge); text-align: center; padding: 10px 4px 8px; }
.pets img { width: 60px; height: 60px; margin: 0 auto; image-rendering: pixelated; }
.pets li:hover img { animation: plica-hop .5s steps(2) infinite; }
.pets span { display: block; font-size: 18px; color: var(--muted); margin-top: 4px; line-height: 1.1; }

.sub-title { font-family: var(--font-pixel); font-size: 13px; color: var(--ink); text-align: center; margin-top: 56px; letter-spacing: 1px; line-height: 1.6; }
.sub-title + .muted { text-align: center; margin-top: 8px; }

/* ---------- how to play ---------- */
.steps { list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; background: var(--panel); border: 4px solid var(--edge); box-shadow: var(--shadow-lg); padding: 52px 20px 20px; }
.steps li::before {
  content: "STEP " counter(step); position: absolute; left: -4px; top: -4px;
  font-family: var(--font-pixel); font-size: 10px; letter-spacing: 1px;
  background: var(--c); color: var(--c-ink); border: 3px solid var(--edge); padding: 8px 10px;
}
.steps li:last-child::before { content: "STEP " counter(step) " \2605"; }
.steps p { color: var(--muted); }
.steps strong { color: var(--ink); font-weight: normal; }
.tip { margin-top: 32px; display: flex; gap: 16px; align-items: center; }
.tip img { width: 48px; height: 48px; image-rendering: pixelated; flex: none; }
.tip p { color: var(--muted); }
.tip b { font-family: var(--font-pixel); font-size: 10px; font-weight: normal; color: var(--c); margin-right: 6px; }

/* ---------- acts / stages ---------- */
.acts { list-style: none; }
.act { position: relative; }
.act img { aspect-ratio: 1640 / 656; object-fit: cover; }
.act figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.act figcaption b { font-family: var(--font-pixel); font-size: 9px; font-weight: normal; color: var(--c); letter-spacing: 1px; }
.act--final { --c: var(--ink-red); }

/* ---------- screenshot gallery ---------- */
.gallery { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.gallery a { display: block; height: 100%; color: inherit; text-decoration: none; }
.gallery .shot { transition: transform .1s steps(2), box-shadow .1s steps(2); height: 100%; }
.gallery a:hover .shot, .gallery a:focus-visible .shot { transform: translate(-3px, -3px); box-shadow: inset 0 0 0 3px var(--ink), 11px 11px 0 var(--edge); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; }
.gallery--phone img { aspect-ratio: 2796 / 1290; }
.gallery-note { text-align: center; color: var(--muted); font-size: 19px; margin-top: 18px; }

/* lightbox (plica.js) */
.lightbox { border: 4px solid var(--edge); box-shadow: inset 0 0 0 3px var(--c), var(--shadow-lg); background: var(--edge); color: var(--ink); padding: 3px; width: min(1280px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); margin: auto; }
.lightbox::backdrop { background: rgba(11, 9, 18, .88); }
.lightbox img { width: 100%; height: auto; max-height: calc(100vh - 140px); object-fit: contain; } /* smooth: big shots are shrunk to fit */
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 6px 4px; }
.lightbox__bar p { font-size: 20px; color: var(--muted); }

/* ---------- platforms / cartridge ---------- */
.platforms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .platforms { grid-template-columns: 1fr; } }
.cart dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; align-items: baseline; }
.cart dt { font-family: var(--font-pixel); font-size: 9px; color: var(--c); letter-spacing: 1px; }
.cart dd { color: var(--ink); }
.cart__head { font-family: var(--font-pixel); font-size: 12px; color: var(--ink); margin-bottom: 18px; text-align: center; line-height: 1.6; }
.controllers { margin-top: 14px; }

/* ---------- continue / links ---------- */
.continue { text-align: center; }
.continue__count { font-family: var(--font-pixel); font-size: clamp(22px, 6vw, 40px); color: var(--gold); text-shadow: 4px 4px 0 var(--ink-red), 7px 7px 0 var(--edge); line-height: 1.3; }
.continue .row { justify-content: center; margin-top: 28px; }
.extras { margin-top: 48px; text-align: left; }
.guide { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide img { width: 120px; height: auto; border: 3px solid var(--edge); box-shadow: var(--shadow); }
@media (max-width: 420px) { .guide { grid-template-columns: 1fr; } }

/* ---------- cross promo ---------- */
.promo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.promo .card__media img { aspect-ratio: 3 / 2; }
@media (max-width: 760px) { .promo { grid-template-columns: 1fr; } }
@media (min-width: 761px) { .promo .card__media { border-bottom: 0; border-right: 4px solid var(--edge); } }
.promo .card__body { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.promo .card__title { font-size: clamp(16px, 3vw, 22px); margin: 0; }
.promo .credit { font-size: 19px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .js .title-logo img { animation: none; }
}
