/* ==========================================================================
   $CARD · styles
   handheld monster-battle UI + original trading-card frames
   ========================================================================== */

:root {
  --navy: #0b0f3a;
  --blue: #2a5bd7;
  --cyan: #5ff3ff;
  --pink: #ff6ad5;
  --yellow: #ffd23f;
  --ink: #f4f8ff;
  --deep: #05071f;
  --indigo: #1b1f6b;

  --t-paw: #f2a65a;
  --t-yarn: #ff6ad5;
  --t-fish: #5ff3ff;
  --t-moon: #a98bff;
  --t-bolt: #ffd23f;

  --f-head: "Press Start 2P", ui-monospace, monospace;
  --f-body: "VT323", ui-monospace, monospace;
  --f-logo: "Bungee", Impact, "Arial Black", sans-serif;

  --tb-h: 48px;
  --glow: 0 0 8px rgba(255, 255, 255, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-body);
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  background: var(--deep);
  text-shadow: var(--glow);
  padding-bottom: calc(var(--tb-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
p { margin: 0 0 .6em; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.dim { opacity: .7; }

.skip-link {
  position: fixed; left: 8px; top: -80px; z-index: 3000;
  background: var(--yellow); color: var(--navy); text-shadow: none;
  font-family: var(--f-head); font-size: 11px; padding: 10px 12px; border-radius: 6px;
}
.skip-link:focus { top: 8px; }

/* sparkle cursor trail */
.trail {
  position: fixed; z-index: 1200; pointer-events: none; font-size: 14px; line-height: 1;
  transform: translate(-50%, -50%); text-shadow: 0 0 6px currentColor;
  animation: trail .7s ease-out forwards;
}
@keyframes trail { to { transform: translate(-50%, 6px) scale(.2) rotate(120deg); opacity: 0; } }

/* fade in from black on page load */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 3000; background: #000; pointer-events: none;
  animation: fadeFromBlack 1.1s .15s ease-out forwards;
}
@keyframes fadeFromBlack { to { opacity: 0; visibility: hidden; } }

/* shared keyframes */
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes panelIn { from { transform: scale(.85) translateY(20px); opacity: 0; } }
@keyframes blink { 50% { opacity: .15; } }

/* ==========================================================================
   SHARED UI
   ========================================================================== */
.site { position: relative; z-index: 1; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.sec { padding: 56px 0; scroll-margin-top: 12px; }
.sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }

/* holographic foil + tilt (applied by JS) */
.holo-fx {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .35s ease-out;
}
.holo-fx.is-active { transition: transform .08s linear; }
.foil {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 45%),
    linear-gradient(115deg, transparent 18%, #ff6ad5 32%, #ffd23f 42%, #5ff3ff 52%, #a98bff 62%, #ff6ad5 72%, transparent 86%);
  background-size: 100% 100%, 260% 260%;
  background-position: center, var(--mx) var(--my);
}
.holo-fx.is-active > .foil { opacity: .7; }

/* under construction */
.construction {
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 18px, #111 18px 36px);
  padding: 8px 0; border-block: 2px solid #000;
}
.construction p {
  margin: 0 auto; width: fit-content; max-width: calc(100% - 24px);
  font-family: var(--f-head); font-size: 10px; line-height: 1.7; text-align: center;
  color: var(--yellow); background: #0b0f3a; text-shadow: none;
  padding: 8px 12px; border: 2px solid var(--yellow);
}

/* ==========================================================================
   CHART
   ========================================================================== */
.chart-body { position: relative; aspect-ratio: 16 / 9; min-height: 420px; max-height: 640px; width: 100%; background: #000; }
.chart-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chart-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; padding: 20px;
  overflow: hidden;
}
.chart-fallback p { position: relative; margin: 0; }
.cf-big { font-family: var(--f-head); font-size: clamp(18px, 4vw, 34px); color: var(--cyan); margin-bottom: 12px !important; animation: arrowBlink 1.4s steps(2, jump-none) infinite; }
.static {
  position: absolute; inset: 0; opacity: .14;
  background:
    repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 73% 61%, #fff 0 1px, transparent 1px 4px);
  animation: staticShift .25s steps(3) infinite;
}
@keyframes staticShift { 33% { background-position: 3px 2px, -2px 1px; } 66% { background-position: -1px -3px, 2px -2px; } }
.live-dot {
  font-family: var(--f-head); font-size: 8px; color: #fff; background: #e0245e; padding: 4px 6px; border-radius: 4px;
  animation: arrowBlink 1.2s steps(2, jump-none) infinite;
}

/* ==========================================================================
   TRADING CARD FRAME (original design)
   ========================================================================== */
.t-paw { --tc: var(--t-paw); }
.t-yarn { --tc: var(--t-yarn); }
.t-fish { --tc: var(--t-fish); }
.t-moon { --tc: var(--t-moon); }
.t-bolt { --tc: var(--t-bolt); }

.tc-type, .tc-cost {
  flex: none; width: 1.5em; height: 1.5em; padding: .2em;
  border-radius: .35em; fill: var(--navy); color: var(--navy);
  background: var(--tc, var(--t-paw)); box-shadow: inset 0 0 0 .08em rgba(255, 255, 255, .7), 0 0 .5em var(--tc);
  --icon-cut: var(--tc);
}

.tcard {
  --w: 240px; --tc: var(--t-paw);
  position: relative; width: var(--w); aspect-ratio: 63 / 88;
  font-size: calc(var(--w) / 20);
  display: flex; flex-direction: column; gap: .35em;
  padding: .55em; border-radius: .9em;
  border: .34em solid transparent;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--tc) 26%, #0b0f3a), #0b0f3a 58%, #10155a) padding-box,
    linear-gradient(135deg, #eef6ff, #7d8bb5 28%, var(--tc) 52%, #eef6ff 74%, #5a6690) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 .7em 1.6em rgba(0, 0, 0, .55), 0 0 1.2em color-mix(in srgb, var(--tc) 45%, transparent);
  color: #fff; text-shadow: none; overflow: hidden;
}
.tc-head {
  display: flex; align-items: center; gap: .4em; padding: .3em .35em .3em .55em; border-radius: .5em;
  background: linear-gradient(90deg, var(--tc), color-mix(in srgb, var(--tc) 35%, #0b0f3a));
  color: var(--navy);
}
.tc-name { flex: 1; min-width: 0; font-family: var(--f-head); font-weight: 400; font-size: .68em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-hp { font-family: var(--f-body); font-size: 1.45em; line-height: 1; color: #fff; text-shadow: 0 1px 0 var(--navy), 0 0 .3em rgba(0, 0, 0, .6); white-space: nowrap; }
.tc-hp small { font-size: .55em; margin-right: .1em; }
.tc-head .tc-type { width: 1.35em; height: 1.35em; background: var(--navy); fill: var(--tc); box-shadow: inset 0 0 0 .08em var(--tc); --icon-cut: var(--navy); }

.tc-art {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  border-radius: .55em; border: .14em solid rgba(255, 255, 255, .75);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .45), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 .5em, transparent .5em 1em),
    linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 30%, #0b0f3a));
  box-shadow: inset 0 0 1.2em rgba(0, 0, 0, .45);
  display: grid; place-items: center;
}
.tc-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 .3em .4em rgba(0, 0, 0, .45)); }
.tc-emo { font-size: 4.4em; line-height: 1; filter: drop-shadow(0 .1em .15em rgba(0, 0, 0, .45)); }
.tc-acc { position: absolute; right: .35em; top: .3em; font-size: 1.7em; line-height: 1; filter: drop-shadow(0 0 .2em #fff); }
.tc-meta {
  font-size: .82em; line-height: 1.1; text-align: center; padding: .15em .3em;
  border-radius: .3em; background: rgba(255, 255, 255, .08); color: #cfe0ff; letter-spacing: .03em;
}
.tc-moves { list-style: none; margin: 0; padding: 0; display: grid; gap: .25em; }
.tc-moves li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .45em;
  padding: .2em .1em .25em; border-bottom: .06em dashed rgba(255, 255, 255, .3);
}
.tc-moves .tc-cost { width: 1.15em; height: 1.15em; padding: .12em; }
.tc-moves b { font-weight: 400; font-size: 1.2em; line-height: 1; }
.tc-moves em { font-style: normal; font-family: var(--f-head); font-size: .66em; color: var(--yellow); }
.tc-flavor { margin: 0; font-size: .82em; line-height: 1.05; color: #c9d6ff; font-style: italic; opacity: .9; }
.tc-foot {
  display: flex; justify-content: space-between; align-items: center; gap: .4em;
  font-size: .78em; line-height: 1; color: #b9c6f2; padding-top: .1em;
}
.tc-stars { color: var(--yellow); text-shadow: 0 0 .3em rgba(255, 210, 63, .8); letter-spacing: .05em; }

/* rarities */
.r-R {
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--tc) 26%, #0b0f3a), #0b0f3a 58%, #10155a) padding-box,
    linear-gradient(135deg, #ffffff, #b8c6ea 20%, #6f7fae 40%, #ffffff 55%, var(--tc) 75%, #ffffff) border-box;
}
.r-H .tc-art::after, .r-S .tc-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 106, 213, .55) 36%, rgba(255, 210, 63, .5) 46%, rgba(95, 243, 255, .55) 56%, rgba(169, 139, 255, .45) 66%, transparent 80%);
  background-size: 300% 300%; mix-blend-mode: color-dodge;
  animation: foilSweep 3.2s linear infinite;
}
@keyframes foilSweep { from { background-position: 100% 100%; } to { background-position: 0% 0%; } }
.r-S {
  background:
    linear-gradient(165deg, #3a2a05, #0b0f3a 55%, #2a1d52) padding-box,
    linear-gradient(135deg, #fff7c2, #ffd23f 22%, #b07d0e 44%, #fff7c2 60%, #ffd23f 80%, #8a5e00) border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 .7em 1.6em rgba(0, 0, 0, .55), 0 0 1.8em rgba(255, 210, 63, .65);
}
.r-S .tc-head { background: linear-gradient(90deg, #fff1a8, #ffd23f 45%, #c48a00); }
.r-S::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4; mix-blend-mode: overlay; opacity: .55;
  background:
    repeating-conic-gradient(from 0deg at 30% 30%, rgba(255, 255, 255, .5) 0 4deg, transparent 4deg 14deg),
    linear-gradient(115deg, transparent 20%, #ff6ad5 40%, #5ff3ff 60%, transparent 80%);
  background-size: auto, 300% 300%;
  animation: foilSweep 4s linear infinite;
}

/* ==========================================================================
   HOW TO BUY (flip cards)
   ========================================================================== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.flip { position: relative; display: block; height: 330px; cursor: pointer; perspective: 1100px; border-radius: 18px; outline-offset: 5px; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.3, 1.3, .5, 1); }
@media (hover: hover) { .flip:hover .flip-inner { transform: rotateY(180deg); } }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); }
.face-card {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 18px; border: 5px solid transparent; text-shadow: none;
  background:
    linear-gradient(170deg, color-mix(in srgb, var(--tc) 28%, #0b0f3a), #0b0f3a 62%) padding-box,
    linear-gradient(135deg, #eef6ff, #7d8bb5 28%, var(--tc) 52%, #eef6ff 74%, #5a6690) border-box;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 18px color-mix(in srgb, var(--tc) 40%, transparent);
  font-size: 20px;
}
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-step { font-family: var(--f-head); font-size: 10px; color: var(--navy); background: var(--tc); padding: 6px 8px; border-radius: 6px; }
.fc-art {
  flex: 1; display: grid; place-items: center; font-size: 68px; border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .6);
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .45), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 25%, #0b0f3a));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, .4);
}
.fc-title { margin: 0; font-family: var(--f-head); font-size: 12px; line-height: 1.5; color: #fff; text-align: center; }
.fc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.fc-hint { opacity: .7; }
.fc-text { margin: 0; font-size: 21px; line-height: 1.2; color: #e8eeff; }
.fc-text b { color: var(--yellow); font-weight: 400; }
.is-back { justify-content: flex-start; }

/* ==========================================================================
   TOKENOMICS
   ========================================================================== */
.tok-wrap { display: grid; justify-items: center; }
.tcard-xl { --w: min(440px, calc(100vw - 40px)); aspect-ratio: auto; gap: .45em; }
.tcard-xl .tc-art { flex: none; aspect-ratio: 16 / 10; }
.tcard-xl .tc-art img { padding-top: .3em; }
.tok-stats { list-style: none; margin: 0; padding: 0; display: grid; gap: .1em; }
.tok-stats li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5em;
  padding: .3em .1em; border-bottom: .06em dashed rgba(255, 255, 255, .3);
}
.tok-stats .tc-cost { width: 1.4em; height: 1.4em; }
.ts-label { display: grid; line-height: 1; }
.ts-label b { font-weight: 400; font-family: var(--f-head); font-size: .62em; line-height: 1.4; }
.ts-label small { font-size: .78em; color: #aebde8; }
.tok-stats em { font-style: normal; font-size: 1.3em; white-space: nowrap; line-height: 1; color: var(--yellow); text-shadow: 0 0 .35em rgba(255, 210, 63, .6); text-align: right; }
.tc-weak {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .3em; text-align: center;
  font-size: .72em; line-height: 1.05; color: #aebde8;
}
.tc-weak span { padding: .3em .2em; border-radius: .35em; background: rgba(255, 255, 255, .06); }
.tc-weak b { display: block; font-weight: 400; font-size: 1.15em; color: #fff; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-foot { margin-top: 30px; padding-bottom: 28px; background: linear-gradient(180deg, transparent, rgba(0, 0, 10, .55) 30%); }
.checker { height: 16px; background: conic-gradient(#e8eeff 25%, #0b0f3a 0 50%, #e8eeff 0 75%, #0b0f3a 0) 0 0 / 16px 16px; opacity: .8; }
.marquee {
  overflow: hidden; white-space: nowrap; padding: 10px 0;
  background: #000; border-block: 2px solid var(--cyan);
  font-family: var(--f-head); font-size: 12px; color: var(--yellow); text-shadow: 0 0 8px rgba(255, 210, 63, .7);
}
.marquee-track { display: inline-flex; animation: marq 30s linear infinite; }
.marquee-track span { padding-right: 2.5ch; }
@keyframes marq { to { transform: translateX(-50%); } }

.foot-grid { display: grid; justify-items: center; gap: 26px; padding-top: 34px; text-align: center; }
.counter p { margin: 0 0 8px; font-family: var(--f-head); font-size: 10px; }
.counter .dim { font-family: var(--f-body); font-size: 18px; margin-top: 8px; }
.odo {
  display: inline-flex; gap: 3px; padding: 6px; border-radius: 6px;
  background: #000; border: 2px solid #8fb0ff; box-shadow: inset 0 0 0 2px #1b2a9a, 0 0 16px rgba(42, 91, 215, .6);
  font-size: 40px; text-shadow: none;
}
.odo-d {
  display: block; width: .72em; height: 1.1em; overflow: hidden; border-radius: 3px;
  background: linear-gradient(180deg, #2a2a2a, #050505 45%, #050505 55%, #2a2a2a);
  color: #7dff7d; box-shadow: inset 0 0 6px rgba(125, 255, 125, .25);
}
.odo-s { display: flex; flex-direction: column; transition: transform 1.8s cubic-bezier(.2, .9, .2, 1); }
.odo-s b { display: block; height: 1.1em; line-height: 1.1em; font-weight: 400; text-align: center; }
.odo.roll .odo-s { transform: translateY(calc(var(--d) * -1.1em)); }
.odo-d:nth-child(2) .odo-s { transition-delay: .08s; }
.odo-d:nth-child(3) .odo-s { transition-delay: .16s; }
.odo-d:nth-child(4) .odo-s { transition-delay: .24s; }
.odo-d:nth-child(5) .odo-s { transition-delay: .32s; }
.odo-d:nth-child(6) .odo-s { transition-delay: .4s; }
.odo-d:nth-child(7) .odo-s { transition-delay: .48s; }
.odo-d:nth-child(n+8) .odo-s { transition-delay: .56s; }

.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 680px; }
.b88 {
  width: 88px; height: 31px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1px 2px; overflow: hidden; white-space: nowrap; text-align: center;
  border: 1px solid #000; text-decoration: none; text-shadow: none;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), inset -1px -1px 0 rgba(0, 0, 0, .6);
}
.b88 small { font-family: var(--f-head); font-size: 6px; line-height: 1.5; letter-spacing: -.02em; }
.b88 b { font-family: var(--f-body); font-weight: 400; font-size: 14px; line-height: .95; }
.b-grey { background: linear-gradient(#e2e2e2, #a9a9a9); color: #000; }
.b-paper { background: #fff; color: #1b2a9a; }
.b-ring { background: linear-gradient(90deg, #ff6ad5, #a98bff); color: #fff; }
.b-ring:hover, .b-ring:focus-visible { filter: brightness(1.15); }
.b-gold { background: var(--yellow); color: var(--navy); }
.b-sol { background: linear-gradient(90deg, #7a3cff, #18d8c4); color: #fff; }
.b-cat { background: var(--navy); color: var(--cyan); }
.b-y2k { background: #000; color: #39ff14; }
.copy { margin: 0; font-size: 20px; opacity: .85; }

/* ==========================================================================
   CORNER TOGGLES, CRT, TOAST
   ========================================================================== */
.corner { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 1100; display: flex; gap: 6px; }
.corner-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 44px; padding: 0 12px; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(160, 210, 255, .6);
  background: rgba(11, 15, 58, .72); color: #fff;
  box-shadow: 0 0 12px rgba(42, 91, 215, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.corner-btn .ico { font-size: 16px; line-height: 1; }
.corner-btn .lbl { font-family: var(--f-head); font-size: 8px; }
.corner-btn[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 16px rgba(95, 243, 255, .7); }
.corner-btn:hover { background: rgba(42, 91, 215, .6); }

.crt {
  position: fixed; inset: 0; z-index: 1050; pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .2) 2px 3px, rgba(0, 0, 0, 0) 3px 4px),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, .38) 100%);
}
.crt::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(160, 200, 255, .05) 50%, transparent);
  background-size: 100% 220px; animation: roll 7s linear infinite;
}
@keyframes roll { from { background-position: 0 -220px; } to { background-position: 0 100vh; } }
.crt-off .crt { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tb-h) + 18px + env(safe-area-inset-bottom)); z-index: 1120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px;
  background: rgba(11, 15, 58, .95); border: 1px solid var(--cyan); box-shadow: 0 0 20px rgba(95, 243, 255, .5);
  font-size: 21px; text-align: center; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   BATTLE THEME · tokens
   Tweak the look from here: plates, HP bars, text boxes and the forest.
   ========================================================================== */
:root {
  /* nameplates (buttons + info plates) */
  --plate-hi: #f4f6ee;
  --plate-lo: #dfe6d6;
  --plate-edge: #3d4a4f;
  --plate-shadow: #2b5d63;
  --plate-ink: #2f3a3e;
  --plate-bevel: 14px;
  --plate-offset: 4px;

  /* HP bar */
  --hp-tag: #f8b030;
  --hp-tag-ink: #3a2600;
  --hp-track: #3a3a3a;
  --hp-green: #48d048;
  --hp-yellow: #f8d030;
  --hp-red: #f85838;
  --hp-max: 350;

  /* battle text boxes */
  --box-bg: #fbfdf8;
  --box-ink: #26302f;
  --box-edge: #3d4a4f;
  --box-inner: #8aa3a8;
  --box-accent: #b33a1c;
  --focus: #5ff3ff;

  /* forest scene */
  --sky-top: #6fbef5;
  --sky-bottom: #d9f2ff;
  --leaf-dark: #1f5a2a;
  --leaf: #2f7d32;
  --leaf-mid: #4caf50;
  --leaf-hi: #8bd448;
  --grass-hi: #6cc24a;
  --grass-lo: #4f9e34;
  --pad-center: #c9a46a;
  --pad-edge: #8b6a3e;
  --horizon: 40vh;

  --f-pixel: "Pixelify Sans", "Press Start 2P", ui-monospace, monospace;
}

@property --hp { syntax: "<number>"; inherits: true; initial-value: 60; }
@property --num { syntax: "<integer>"; inherits: true; initial-value: 210; }

body { background: var(--leaf-dark); }

/* ==========================================================================
   FOREST BACKGROUND (fixed, layered, parallax via JS)
   ========================================================================== */
.forest { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--leaf-dark); }

.fx-sky {
  position: absolute; inset: 0 0 50% 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 0%, rgba(255, 255, 230, .65), transparent 60%),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
.fx-clouds { position: absolute; inset: 0 0 60% 0; will-change: transform; }
.fx-clouds i {
  position: absolute; display: block; width: 260px; height: 70px; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 60%, #fff 0 30%, transparent 31%),
    radial-gradient(circle at 55% 40%, #fff 0 34%, transparent 35%),
    radial-gradient(circle at 75% 62%, #fff 0 26%, transparent 27%),
    radial-gradient(ellipse at 50% 80%, #f2f9ff 0 45%, transparent 46%);
  filter: blur(2px); opacity: .9;
  animation: cloud 110s linear infinite;
}
.fx-clouds i:nth-child(1) { top: 6%; animation-delay: -10s; }
.fx-clouds i:nth-child(2) { top: 18%; transform: scale(.7); animation-duration: 140s; animation-delay: -70s; }
.fx-clouds i:nth-child(3) { top: 2%; transform: scale(1.2); animation-duration: 160s; animation-delay: -120s; }
.fx-clouds i:nth-child(4) { top: 26%; transform: scale(.55); animation-duration: 95s; animation-delay: -40s; }
@keyframes cloud { from { left: -300px; } to { left: 110%; } }

.fx-layer {
  position: absolute; top: -8vh; left: -5vw; width: 110vw; height: 116vh; display: block;
  will-change: transform;
}
.fx-far { filter: blur(1.4px) saturate(.95); }
.fx-mid { filter: blur(.4px); }

.fx-ground {
  position: absolute; top: var(--horizon); bottom: -12vh; left: -5vw; right: -5vw; will-change: transform;
  background:
    repeating-conic-gradient(from 172deg at 50% -90%, rgba(30, 80, 20, .13) 0 2.2deg, rgba(255, 255, 255, 0) 2.2deg 4.4deg),
    linear-gradient(180deg, #3f8a2c 0%, var(--grass-lo) 6%, var(--grass-hi) 34%, #5fb23f 70%, var(--grass-lo) 100%);
}
.fx-shadows {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 24% 7% at 18% 9%, rgba(14, 50, 14, .45), transparent 70%),
    radial-gradient(ellipse 20% 6% at 64% 7%, rgba(14, 50, 14, .38), transparent 70%),
    radial-gradient(ellipse 30% 10% at 86% 30%, rgba(14, 50, 14, .3), transparent 70%),
    radial-gradient(ellipse 26% 9% at 8% 48%, rgba(14, 50, 14, .28), transparent 70%),
    radial-gradient(ellipse 34% 11% at 58% 62%, rgba(14, 50, 14, .22), transparent 70%);
  filter: blur(6px);
  animation: shadeDrift 14s ease-in-out infinite alternate;
}
@keyframes shadeDrift { to { transform: translateX(2%) skewX(-3deg); } }
.fx-dapple {
  position: absolute; inset: 0; mix-blend-mode: soft-light;
  background:
    radial-gradient(ellipse 6% 2.4% at 30% 22%, rgba(255, 255, 200, .9), transparent 70%),
    radial-gradient(ellipse 8% 3% at 46% 38%, rgba(255, 255, 200, .8), transparent 70%),
    radial-gradient(ellipse 5% 2% at 72% 18%, rgba(255, 255, 200, .9), transparent 70%),
    radial-gradient(ellipse 9% 3% at 80% 54%, rgba(255, 255, 200, .7), transparent 70%),
    radial-gradient(ellipse 7% 2.6% at 14% 66%, rgba(255, 255, 200, .7), transparent 70%);
  animation: dapple 6s ease-in-out infinite alternate;
}
@keyframes dapple { to { opacity: .45; transform: translateX(1%); } }

.fx-grass { position: absolute; left: -2%; right: -2%; transform-origin: bottom center; background-repeat: repeat-x; }
.fx-grass-back {
  top: -2.6vh; height: 3.4vh;
  background-size: auto 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='30' viewBox='0 0 80 30'%3E%3Cpath fill='%233c8a2c' d='M0 30 3 12 6 30Zm6 0 4-22 4 22Zm9 0 2-14 3 14Zm6 0 5-26 4 26Zm10 0 2-12 3 12Zm5 0 4-20 4 20Zm10 0 3-16 3 16Zm6 0 5-24 4 24Zm9 0 2-10 3 10Zm5 0 4-18 4 18Zm8 0 2-12 2 12Z'/%3E%3C/svg%3E");
  animation: sway 5s ease-in-out infinite alternate;
}
.fx-grass-front {
  bottom: -1vh; height: 12vh; z-index: 2;
  background-size: auto 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60' viewBox='0 0 160 60'%3E%3Cpath fill='%23357d27' d='M0 60 6 22 12 60Zm10 0 10-50 8 50Zm16 0 4-28 6 28Zm12 0 9-44 8 44Zm18 0 5-26 6 26Zm10 0 8-40 8 40Zm16 0 4-22 5 22Zm10 0 10-54 8 54Zm18 0 5-30 6 30Zm12 0 8-38 7 38Zm14 0 5-24 5 24Z'/%3E%3Cpath fill='%2357ad3a' d='M4 60 9 34 14 60Zm20 0 6-30 6 30Zm22 0 6-34 6 34Zm26 0 5-24 5 24Zm24 0 7-36 6 36Zm24 0 5-28 5 28Zm22 0 5-22 5 22Z'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(to top, #000 40%, rgba(0, 0, 0, .6));
  mask-image: linear-gradient(to top, #000 40%, rgba(0, 0, 0, .6));
  animation: sway 4s ease-in-out infinite alternate;
}
@keyframes sway { from { transform: skewX(-2.5deg); } to { transform: skewX(2.5deg); } }

.fx-rays {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 70% 40% at 55% -8%, rgba(255, 252, 210, .5), transparent 65%),
    repeating-linear-gradient(104deg, rgba(255, 250, 200, 0) 0 5%, rgba(255, 250, 200, .13) 6% 8%, rgba(255, 250, 200, 0) 9.5% 15%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  animation: rays 9s ease-in-out infinite alternate;
}
@keyframes rays { to { opacity: .55; transform: translateX(-2%); } }
.fx-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 55%, rgba(5, 30, 10, .5) 100%);
}

/* optional photo backdrop (config.forestImage) */
.forest.has-photo { background: var(--photo) center / cover no-repeat; }
.forest.has-photo .fx-sky, .forest.has-photo .fx-clouds, .forest.has-photo .fx-layer,
.forest.has-photo .fx-ground, .forest.has-photo .fx-grass-front { display: none; }

/* drifting leaves */
.leaves { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.leaves i {
  position: absolute; top: -20px; left: var(--x); width: var(--s); height: calc(var(--s) * .6);
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, var(--leaf-hi), var(--leaf-mid) 60%, var(--leaf));
  box-shadow: inset 0 0 0 1px rgba(20, 60, 20, .25);
  opacity: 0;
  animation: leafFall var(--d) linear var(--dl) infinite;
}
@keyframes leafFall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  8% { opacity: .95; }
  25% { transform: translate(calc(var(--dx) * .5), 28vh) rotate(160deg); }
  50% { transform: translate(calc(var(--dx) * -.2), 55vh) rotate(320deg); }
  75% { transform: translate(var(--dx), 82vh) rotate(480deg); }
  92% { opacity: .9; }
  100% { transform: translate(calc(var(--dx) * .3), 110vh) rotate(640deg); opacity: 0; }
}

/* ==========================================================================
   NAMEPLATES (buttons + info plates)
   ========================================================================== */
.plate {
  --bevel: var(--plate-bevel);
  --hp: var(--hp-idle, 60);
  --num: var(--num-idle, 210);
  position: relative; isolation: isolate;
  display: inline-flex; flex-direction: column; gap: 6px;
  min-width: 190px; padding: 10px 16px 11px 13px; margin: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--plate-ink); text-decoration: none; text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .95);
  font-family: var(--f-pixel); line-height: 1.1;
  filter: drop-shadow(var(--plate-offset) var(--plate-offset) 0 var(--plate-shadow));
  transition: transform .15s ease-out, filter .15s ease-out, --hp .3s ease-out, --num .3s ease-out;
}
.plate::before, .plate::after { content: ""; position: absolute; pointer-events: none; }
.plate::before {
  inset: 0; z-index: -2; border-radius: 9px; background: var(--plate-edge);
  clip-path: polygon(0 0, calc(100% - var(--bevel)) 0, 100% var(--bevel), 100% 100%, 0 100%);
}
.plate::after {
  inset: 3px; z-index: -1; border-radius: 6px;
  background: linear-gradient(180deg, var(--plate-hi) 0%, var(--plate-hi) 45%, var(--plate-lo) 100%);
  clip-path: polygon(0 0, calc(100% - var(--bevel) + 1px) 0, 100% calc(var(--bevel) - 1px), 100% 100%, 0 100%);
}
a.plate:hover, button.plate:hover, a.plate:focus-visible, button.plate:focus-visible {
  --hp: 100; --num: var(--hp-max);
  transform: translateY(-2px);
  filter: drop-shadow(calc(var(--plate-offset) + 2px) calc(var(--plate-offset) + 3px) 0 var(--plate-shadow));
}
.plate:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: 10px; }
.plate:disabled { cursor: default; opacity: .55; transform: none; }
.plate[aria-disabled="true"] { cursor: help; }
.plate.info { cursor: default; }

.pl-top { display: flex; align-items: center; gap: 8px; }
.pl-paw { flex: none; width: 15px; height: 15px; fill: var(--plate-ink); image-rendering: pixelated; filter: drop-shadow(0 1px 0 #fff); }
.pl-name {
  flex: 1; min-width: 0; font-size: 15px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-lv { flex: none; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.pl-hp { display: flex; align-items: center; gap: 6px; }
.pl-tag {
  flex: none; font-family: var(--f-head); font-size: 8px; line-height: 1; letter-spacing: .04em;
  padding: 3px 5px 2px; border-radius: 999px; background: var(--hp-tag); color: var(--hp-tag-ink);
  text-shadow: none; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
}
.pl-track {
  flex: 1; display: block; height: 10px; padding: 2px; border-radius: 999px; background: var(--hp-track);
  box-shadow: inset 0 0 0 1px #1a1a1a, inset 0 2px 0 rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .8);
}
.pl-fill {
  display: block; height: 100%; width: calc(var(--hp) * 1%); max-width: 100%; border-radius: 999px;
  background-color: var(--hp-green);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .55) 0 38%, rgba(255, 255, 255, 0) 38%);
}
.pl-num {
  align-self: flex-end; font-family: var(--f-body); font-size: 21px; line-height: .8; letter-spacing: .04em;
  counter-reset: hpn var(--num);
}
.pl-num::before { content: counter(hpn) "/350"; }
.pl-sub { font-family: var(--f-body); font-size: 17px; line-height: 1; letter-spacing: .02em; opacity: .9; }
.pl-flash {
  position: absolute; inset: 3px; z-index: 3; border-radius: 6px; background: #fff; opacity: 0; pointer-events: none;
  clip-path: polygon(0 0, calc(100% - var(--bevel) + 1px) 0, 100% calc(var(--bevel) - 1px), 100% 100%, 0 100%);
}

/* speech-bubble tail (big plates) */
.pl-tail { position: absolute; left: 26px; bottom: -12px; width: 24px; height: 14px; z-index: 0; pointer-events: none; }
.pl-tail::before, .pl-tail::after { content: ""; position: absolute; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.pl-tail::before { inset: 0; background: var(--plate-edge); }
.pl-tail::after { left: 5px; right: 5px; top: -2px; height: 10px; background: var(--plate-lo); }
.pl-tail.tail-right { left: auto; right: 34px; }

/* hit: drain the bar, flash, shake */
.plate.hit .pl-fill { animation: hpHit .52s ease-in; }
.plate.hit .pl-flash { animation: plFlash .28s ease-out; }
@keyframes hpHit {
  0% { width: 100%; background-color: var(--hp-green); }
  30% { width: 52%; background-color: var(--hp-yellow); }
  70% { width: 9%; background-color: var(--hp-red); }
  100% { width: 9%; background-color: var(--hp-red); }
}
@keyframes plFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
.site.shake { animation: screenShake .3s linear; }
@keyframes screenShake {
  20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); } 80% { transform: translate(2px, 1px); }
}

/* variants */
.plate--big { min-width: 240px; padding: 12px 18px 12px 14px; gap: 7px; }
.plate--big .pl-name { font-size: 16px; }
.plate--sm { --bevel: 10px; min-width: 0; padding: 7px 12px 8px 10px; gap: 4px; }
.plate--sm .pl-name { font-size: 12px; }
.plate--sm .pl-lv { font-size: 11px; }
.plate--sm .pl-paw { width: 12px; height: 12px; }
.plate--sm .pl-track { height: 6px; padding: 1px; }
.plate--sm .pl-tag { display: none; }

.plate-row { display: flex; flex-wrap: wrap; gap: 18px 22px; }
.plate-row.center { justify-content: center; margin-top: 30px; }
.plate-row > .plate:nth-child(even) { transform: translateY(8px); }
.plate-row > .plate:nth-child(even):hover, .plate-row > .plate:nth-child(even):focus-visible { transform: translateY(6px); }

/* ==========================================================================
   BATTLE TEXT BOXES (panels, windows)
   ========================================================================== */
.textbox, .panel {
  position: relative; color: var(--box-ink); text-shadow: none;
  background: var(--box-bg);
  border: 4px solid var(--box-edge); border-radius: 16px;
  box-shadow: inset 0 0 0 3px var(--box-bg), inset 0 0 0 5px var(--box-inner), 5px 6px 0 var(--plate-shadow);
  font-family: var(--f-pixel);
}
.textbox { padding: 16px 22px; }
.textbox.more::after, .panel .more::after {
  content: "▼"; position: absolute; right: 14px; bottom: 8px; font-size: 13px; line-height: 1;
  color: var(--box-accent); animation: blink 1s steps(2, jump-none) infinite;
}
.panel .more { position: relative; }
.win { overflow: hidden; }
.win-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 9px 16px;
  background: linear-gradient(180deg, var(--plate-hi), var(--plate-lo));
  border-bottom: 3px solid var(--box-edge); color: var(--plate-ink);
  font-family: var(--f-head); font-size: 10px; line-height: 1.4; text-shadow: 0 1px 0 #fff;
}
.win-ico { color: var(--leaf); }
.wt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btns { display: flex; gap: 4px; }
.win-btns i {
  width: 20px; height: 18px; display: grid; place-items: center; font-style: normal; font-family: var(--f-body); font-size: 16px; line-height: 1;
  border: 2px solid var(--box-edge); border-radius: 4px; background: #fff; color: var(--box-edge); text-shadow: none;
}
.win-body { padding: 20px 22px 24px; }
.win-status {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 12px 16px 14px; border-top: 3px solid var(--box-edge); font-size: 18px;
}
.sec-lead { display: inline-block; margin: 0 0 22px; padding-right: 40px; font-size: 18px; }

/* section headers as nameplates */
.sec-head { margin-bottom: 24px; }
.sec-plate { min-width: min(320px, 100%); padding: 12px 20px 13px 14px; }
.sec-plate .pl-name { font-family: var(--f-head); font-weight: 400; font-size: clamp(11px, 2vw, 15px); line-height: 1.4; }
.sec-plate .pl-lv { font-size: 15px; }
.sec-plate .pl-paw { width: 17px; height: 17px; }

/* ==========================================================================
   HERO · battle arena
   ========================================================================== */
.hero { padding: 66px 0 30px; }
.arena {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "top aside" "ally aside";
  gap: 18px 48px; align-items: end;
}
.hero-top { grid-area: top; display: grid; justify-items: start; gap: 12px; align-self: start; }
.kicker {
  margin: 0; font-family: var(--f-head); font-size: 9px; letter-spacing: .06em; color: var(--box-ink); text-shadow: none;
  background: var(--box-bg); border: 3px solid var(--box-edge); border-radius: 999px; padding: 7px 12px;
  box-shadow: 3px 3px 0 var(--plate-shadow);
}
.logo {
  margin: 0; font-family: var(--f-logo); font-weight: 400;
  font-size: clamp(76px, 10vw, 128px); line-height: .9; letter-spacing: .02em;
  background: linear-gradient(100deg, #5ff3ff 0%, #ffffff 16%, #ff6ad5 32%, #ffd23f 48%, #5ff3ff 64%, #a98bff 80%, #5ff3ff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(3px 0 0 #1d3b40) drop-shadow(-3px 0 0 #1d3b40) drop-shadow(0 3px 0 #1d3b40) drop-shadow(0 -3px 0 #1d3b40) drop-shadow(5px 6px 0 var(--plate-shadow));
  animation: shimmer 7s linear infinite;
}
.ally { grid-area: ally; display: grid; justify-items: center; padding-bottom: 10px; }
.ally-sprite {
  position: relative; z-index: 1; width: min(250px, 72vw); height: auto; margin-bottom: -46px;
  filter: drop-shadow(0 6px 0 rgba(20, 50, 10, .25));
  animation: idle 3.2s ease-in-out infinite;
}
.ally-sprite.is-pixel { image-rendering: pixelated; }
@keyframes idle { 50% { transform: translateY(-4px) scaleY(1.01); } }
.ally-side { grid-area: aside; display: grid; gap: 28px; align-self: center; }

.pad {
  --pad-w: 360px; position: relative;
  width: min(var(--pad-w), 92vw); aspect-ratio: 4 / 1; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, #dcbf86 0%, var(--pad-center) 32%, #a8834f 62%, var(--pad-edge) 80%, #6f5230 100%);
  box-shadow: 0 12px 16px -6px rgba(20, 50, 10, .45), inset 0 -6px 10px rgba(70, 45, 15, .35);
}
.pad::before {
  content: ""; position: absolute; inset: -9px -14px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #3c8a2c 0 3deg, #6cc24a 3deg 5deg, rgba(0, 0, 0, 0) 5deg 8deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 80%, #000 83%, #000 96%, transparent 100%);
  mask-image: radial-gradient(closest-side, transparent 80%, #000 83%, #000 96%, transparent 100%);
}

.bb-text { width: min(460px, 100%); padding: 14px 44px 16px 20px; }
.tagline { margin: 0 0 6px; font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; line-height: 1.15; }
.sub { margin: 0; font-size: 19px; color: #4a5a58; }
.hero-menu { list-style: none; margin: 0; padding: 0 28px 12px 0; display: grid; grid-template-columns: minmax(0, 360px); gap: 22px; }
.hero-menu li:nth-child(even) { transform: translateX(28px); }
.hero-menu .plate { width: 100%; min-width: 0; }

/* ==========================================================================
   CONTRACT (battle message)
   ========================================================================== */
.term-line { font-size: 18px; margin: 0 0 10px; color: #4a5a58; }
.prompt { color: var(--plate-shadow); font-weight: 700; }
.ca-row {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 12px 14px;
  border-radius: 10px; background: #eef4e6; border: 3px solid var(--box-edge);
}
.ca-text {
  flex: 1; min-width: 0; font-family: var(--f-body); font-size: clamp(22px, 3.2vw, 32px); line-height: 1.15;
  color: #1d5e33; word-break: break-all; user-select: all;
}
.copy-btn { flex: none; min-width: 150px; }
.caret { display: inline-block; width: .55em; height: 1em; margin-left: 4px; vertical-align: -2px; background: var(--box-edge); animation: blink 1s steps(2, jump-none) infinite; }
.ca-msg { margin: 0; min-height: 1.3em; font-size: 22px; font-weight: 600; color: var(--box-accent); }

/* ==========================================================================
   SECTION RECOLORS ON LIGHT BOXES
   ========================================================================== */
.chart-body { border-block: 0; }
.site-foot { background: linear-gradient(180deg, transparent, rgba(10, 35, 15, .65) 40%); }
.foot-grid.textbox { margin-top: 28px; padding: 26px 18px 22px; }
.counter p { color: var(--box-ink); }
.copy { color: var(--box-ink); opacity: 1; font-size: 18px; }
.construction p { font-family: var(--f-head); }

/* ==========================================================================
   TASKBAR + START MENU (small plates)
   ========================================================================== */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 700;
  height: calc(var(--tb-h) + env(safe-area-inset-bottom));
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #4b5c61, #2e3a3e);
  border-top: 3px solid #1f292c; box-shadow: 0 -4px 18px rgba(0, 0, 0, .4);
  font-size: 18px;
}
.taskbar .plate { --plate-offset: 2px; flex: none; padding: 5px 11px 6px 9px; gap: 3px; }
.start-btn .pl-name { font-family: var(--f-head); font-weight: 400; font-size: 9px; }
.tb-tasks { display: flex; gap: 10px; min-width: 0; overflow: hidden; padding: 4px 4px 6px 2px; }
.tb-task .pl-name { font-size: 11px; text-transform: none; }
.tb-tray {
  flex: none; margin-left: auto; height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: 6px; background: #1f292c; border: 2px solid #5f7378; color: #e9f0e4; text-shadow: none;
}
.tray-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hp-green); box-shadow: 0 0 6px var(--hp-green); }

.start-menu {
  position: absolute; left: 8px; bottom: calc(100% + 8px); width: 270px; display: flex; overflow: hidden;
  background: var(--box-bg); border: 4px solid var(--box-edge); border-radius: 14px;
  box-shadow: inset 0 0 0 3px var(--box-bg), inset 0 0 0 5px var(--box-inner), 5px 6px 0 var(--plate-shadow);
  animation: panelIn .2s ease-out;
}
.sm-side {
  writing-mode: vertical-rl; transform: rotate(180deg); padding: 12px 8px;
  font-family: var(--f-head); font-size: 10px; letter-spacing: .1em; color: #fff; text-shadow: 0 1px 0 #1d3b40;
  background: linear-gradient(0deg, var(--leaf), var(--leaf-hi));
}
.sm-list { list-style: none; margin: 0; padding: 10px 14px 12px 10px; flex: 1; display: grid; gap: 9px; }
.sm-link { width: 100%; }
.sm-link .pl-name { text-transform: none; font-size: 13px; }

/* corner toggles on the bright scene */
.corner-btn { background: var(--box-bg); color: var(--box-ink); border: 3px solid var(--box-edge); box-shadow: 3px 3px 0 var(--plate-shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.corner-btn[aria-pressed="true"] { border-color: var(--box-edge); box-shadow: 3px 3px 0 var(--plate-shadow), 0 0 0 3px var(--hp-green); }
.corner-btn:hover { background: #fff; }
.crt { background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .1) 2px 3px, rgba(0, 0, 0, 0) 3px 4px); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-tasks { display: none; }
}
@media (max-width: 760px) {
  .arena { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "ally" "aside"; gap: 18px; }
  .hero-top { justify-items: center; text-align: center; }
  .bb-text { text-align: left; }
  .ally { justify-self: start; }
  .hero-menu { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-right: 22px; }
  .hero-menu li:nth-child(even) { transform: translateX(22px); }
}
@media (max-width: 560px) {
  body { font-size: 20px; }
  .sec { padding: 44px 0; }
  .win-body { padding: 16px; }
  .steps { gap: 12px; }
  .flip { height: 286px; }
  .face-card { padding: 10px; gap: 8px; border-width: 4px; }
  .fc-art { font-size: 50px; }
  .fc-title { font-size: 10px; }
  .fc-step { font-size: 8px; padding: 5px 6px; }
  .fc-text { font-size: 18px; }
  .face-card .tc-type { font-size: 15px; }
  .fc-hint { font-size: 0; }
  .fc-hint::after { content: "↻"; font-size: 20px; }
  .ca-row { flex-direction: column; align-items: stretch; }
  .copy-btn { width: 100%; }
  .chart-body { aspect-ratio: auto; height: 460px; min-height: 0; }
  .odo { font-size: 32px; }
  .start-menu { width: min(280px, calc(100vw - 16px)); }
  .corner-btn .lbl { display: none; }
  .plate { min-width: 0; }
  .ally-sprite { width: min(240px, 66vw); margin-bottom: -38px; }
  .pad-ally { --pad-w: 300px; }
  .hero { padding-top: 62px; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
  .leaves, .trail, .crt::after, .fx-clouds, .fx-dapple { display: none; }
  .fx-layer, .fx-ground, .fx-clouds, .fx-grass { transform: none !important; }
  .marquee-track { animation: none !important; }
  .holo-fx { transform: none !important; }
}

/* keep the foil sweep subtle over the mascot photo */
.tc-art:has(img)::after { opacity: .4; }

/* toast as a battle message */
.toast { background: var(--box-bg); color: var(--box-ink); border: 3px solid var(--box-edge); box-shadow: 4px 4px 0 var(--plate-shadow); text-shadow: none; font-family: var(--f-pixel); font-size: 18px; }
