/* VN Quest: Legends of the Wild. Created by Viyan & Neel. */
:root {
  --green: #2e9e5b;
  --green-dark: #1d6b3d;
  --sky: #2f8fe0;
  --sky-light: #bfe8ff;
  --gold: #ffc531;
  --gold-dark: #b07d00;
  --ink: #163b2a;
  --ink-soft: #3c6b52;
  --card: #ffffffee;
  --red: #e2483d;
  --purple: #7a4fc9;
  --radius: 22px;
  --shadow: 0 10px 26px rgba(10, 40, 25, 0.18);
  --font-head: 'Fredoka', 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #cdeffd;
  font-size: 18px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, h4, .head { font-family: var(--font-head); font-weight: 700; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(30px, 4.4vw, 54px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: 24px; }
p { margin: 0 0 .8em; }
a { color: var(--sky); }
img { max-width: 100%; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
#bg svg.realm-bg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); }
#bg .layer { transition: transform .4s ease-out; }
#bg .layer.far { transform: translate(calc(var(--px, 0) * -8px), calc(var(--py, 0) * -4px)); }
#bg .layer.mid { transform: translate(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -8px)); }
#bg .layer.near { transform: translate(calc(var(--px, 0) * -30px), calc(var(--py, 0) * -12px)); }
#bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(255,255,255,0) 40%, rgba(255,255,255,.18)); pointer-events: none; }

.p { transform-box: fill-box; transform-origin: center; }
.p-fall { animation: fall linear infinite; }
.p-spin { animation-name: fallspin; }
.p-rise { animation: rise linear infinite; }
.p-glow { animation: glow ease-in-out infinite alternate; }
@keyframes fall { from { transform: translate(0, 0); } to { transform: translate(120px, 980px); } }
@keyframes fallspin { from { transform: translate(0, 0) rotate(0); } to { transform: translate(160px, 980px) rotate(540deg); } }
@keyframes rise { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } to { transform: translate(-40px, -980px); opacity: 0; } }
@keyframes glow { from { opacity: .1; transform: translate(0, 0); } to { opacity: 1; transform: translate(14px, -18px); } }
.sway { animation: sway 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom center; }
@keyframes sway { from { transform-origin: bottom; rotate: -1.5deg; } to { rotate: 1.5deg; } }
.shimmer { animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { transform: translateY(-40px); opacity: .2; } 50% { opacity: .8; } to { transform: translateY(40px); opacity: .2; } }
.glow-crystal { animation: crystal 3s ease-in-out infinite alternate; }
@keyframes crystal { from { opacity: .65; } to { opacity: 1; } }
.lantern { animation: crystal 1.4s ease-in-out infinite alternate; }
.mist { animation: mist 18s ease-in-out infinite alternate; }
@keyframes mist { from { transform: translateX(-80px); } to { transform: translateX(80px); } }
.soar { animation: mist 9s ease-in-out infinite alternate; }
.aurora { animation: crystal 5s ease-in-out infinite alternate; }
.ray { animation: raylight 4s ease-in-out infinite alternate; }
@keyframes raylight { from { opacity: .04; } to { opacity: .14; } }
.swim { animation: mist 20s ease-in-out infinite alternate; }
.lava { animation: crystal 1.2s ease-in-out infinite alternate; }
.smoke { animation: rise2 6s ease-in-out infinite; }
@keyframes rise2 { from { transform: translateY(0) scale(1); opacity: .5; } to { transform: translateY(-80px) scale(1.6); opacity: 0; } }
.wobble { animation: wob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
@keyframes wob { 0%, 100% { rotate: 0deg; } 25% { rotate: -6deg; } 75% { rotate: 6deg; } }

/* ---------- layout ---------- */
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.topbar .brand img { width: 40px; height: 44px; }
.topbar .spacer { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-family: var(--font-head); font-size: 18px; box-shadow: 0 2px 0 rgba(0,0,0,.08); border: 2px solid #e6efe8; white-space: nowrap; }
.chip.hero-chip { cursor: pointer; text-decoration: none; color: var(--ink); }
.chip small { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); background: #eef8f0; border-radius: 14px; padding: 8px 12px; font-family: var(--font-head); font-weight: 600; font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; }
.nav a.active { background: var(--green); color: #fff; }

main { flex: 1; width: min(1280px, 100% - 28px); margin: 18px auto 30px; }
.screen { animation: pop .35s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 2.4vw, 28px); margin-bottom: 18px; }
.panel.tight { padding: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.big { font-size: 22px; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font-head); font-weight: 700;
  font-size: 20px; padding: 12px 24px; min-height: 52px; border-radius: 18px;
  background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-dark); }
.btn:disabled, .btn[aria-disabled='true'] { filter: grayscale(.8) opacity(.6); cursor: not-allowed; }
.btn.big { font-size: 26px; padding: 16px 34px; min-height: 64px; border-radius: 22px; }
.btn.gold { background: var(--gold); color: #4a3300; box-shadow: 0 5px 0 var(--gold-dark); }
.btn.sky { background: var(--sky); box-shadow: 0 5px 0 #1d5f9e; }
.btn.purple { background: var(--purple); box-shadow: 0 5px 0 #4f2f8a; }
.btn.red { background: var(--red); box-shadow: 0 5px 0 #9e2a21; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #cfdcd3; border: 2px solid #dfe9e2; }
.btn.small { font-size: 16px; padding: 8px 14px; min-height: 44px; border-radius: 14px; }
:focus-visible { outline: 4px solid #ffb627; outline-offset: 3px; border-radius: 12px; }

input[type=text], input[type=email], input[type=number], select {
  font: inherit; font-size: 22px; padding: 12px 16px; border-radius: 16px; border: 3px solid #cfe3d6; background: #fff; min-height: 54px; width: 100%;
}
input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px #2e9e5b33; }
label.field { display: block; font-weight: 700; margin-bottom: 12px; }
label.field span { display: block; margin-bottom: 6px; }

/* ---------- title ---------- */
.title-screen { text-align: center; padding-top: 10px; }
.title-screen .logo { width: clamp(150px, 22vw, 240px); filter: drop-shadow(0 12px 20px rgba(0,0,0,.25)); animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.title-screen h1 { font-size: clamp(40px, 7vw, 86px); color: #fff; text-shadow: 0 4px 0 var(--green-dark), 0 8px 18px rgba(0,0,0,.25); margin: 8px 0 0; letter-spacing: 1px; }
.title-screen .tag { font-family: var(--font-head); font-weight: 700; font-size: clamp(22px, 3vw, 34px); color: #ffd23f; text-shadow: 0 3px 0 #7a5200, 0 6px 14px rgba(0,0,0,.3); margin-bottom: 6px; letter-spacing: 1px; }
.title-screen .made { font-family: var(--font-head); font-size: clamp(20px, 2.4vw, 28px); background: #fff; display: inline-block; padding: 8px 20px; border-radius: 999px; box-shadow: var(--shadow); margin: 10px 0 20px; }
.title-buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 10px 0 22px; }
.signin-banner { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; background: #fffbe6; border: 3px dashed #ffcf5a; border-radius: 20px; padding: 12px 18px; margin: 0 auto 16px; }
.signin-banner.signed { background: #eafaf0; border-color: #8fdcad; }
footer.site { position: relative; z-index: 1; text-align: center; padding: 12px; font-family: var(--font-head); color: var(--ink); background: rgba(255,255,255,.75); }
footer.site a { margin: 0 8px; }

/* ---------- hero cards ---------- */
.hero-card { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 20px; padding: 14px; border: 4px solid var(--hc, var(--green)); box-shadow: var(--shadow); position: relative; }
.hero-card.selectable { cursor: pointer; }
.hero-card .avatar { width: 84px; height: 84px; border-radius: 50%; background: color-mix(in srgb, var(--hc, #2e9e5b) 20%, white); display: grid; place-items: center; font-size: 46px; flex: none; position: relative; }
.hero-card .avatar .cos { position: absolute; font-size: 26px; }
.hero-card .avatar .cos.hat { top: -12px; } .hero-card .avatar .cos.gear { right: -8px; bottom: -4px; } .hero-card .avatar .cos.ride { left: -10px; bottom: -6px; }
.hero-card h3 { margin: 0; }
.hero-card .meta { color: var(--ink-soft); font-size: 16px; }
.statbars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 8px; width: 100%; }
.statbar { font-size: 14px; }
.statbar .bar { height: 10px; background: #e5efe8; border-radius: 99px; overflow: hidden; }
.statbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7bdc8e, var(--green)); border-radius: 99px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pick { appearance: none; border: 4px solid #e1ece4; background: #fff; border-radius: 20px; padding: 12px; cursor: pointer; text-align: center; font: inherit; color: inherit; min-height: 64px; transition: transform .1s, border-color .1s; }
.pick:hover { transform: translateY(-2px); }
.pick[aria-pressed='true'] { border-color: var(--green); background: #effbf2; box-shadow: 0 0 0 4px #2e9e5b33; }
.pick .t { font-family: var(--font-head); font-weight: 700; font-size: 19px; display: block; }
.pick .d { font-size: 14px; color: var(--ink-soft); display: block; margin-top: 4px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px #cfdcd3; cursor: pointer; }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 4px var(--ink); }
.emoji-pick { font-size: 34px; width: 64px; height: 64px; padding: 0; }

/* ---------- maps ---------- */
.world-map { width: 100%; height: auto; display: block; }
.world-wrap { position: relative; background: linear-gradient(#9fdcff, #bff0c8 60%, #f5e3a8); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; border: 6px solid #fff; }
.node { cursor: pointer; }
.node:focus-visible { outline: none; }
.node:focus-visible circle.ring { stroke: #ffb627; stroke-width: 8; }
.node.locked { cursor: not-allowed; }
.node .bob { animation: float 3s ease-in-out infinite; }
.hero-token { transition: transform .9s cubic-bezier(.5, 0, .3, 1); }
.realm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.realm-map-wrap { position: relative; border-radius: 28px; overflow: hidden; border: 6px solid #fff; box-shadow: var(--shadow); background: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.1)); }
.realm-map-wrap svg { display: block; width: 100%; height: auto; }
.stage-label { font-family: var(--font-head); font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 6px; }
.party-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff4d6; border-radius: 18px; padding: 10px 14px; margin-bottom: 12px; border: 3px solid #ffd36b; }
.pchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; color: #fff; font-family: var(--font-head); font-weight: 700; }

/* ---------- play ---------- */
.play-wrap { display: grid; gap: 16px; grid-template-columns: 1fr; }
.play-wrap.with-passage { grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.3fr); }
@media (max-width: 820px) { .play-wrap.with-passage { grid-template-columns: 1fr; } }
.passage { background: #fffdf3; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); font-size: 20px; line-height: 1.6; border: 3px solid #f3e2a8; }
.passage h3 { color: #8a5a00; }
.qcard { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 32px); position: relative; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.qcat { font-family: var(--font-head); font-weight: 700; background: #eef8f0; padding: 6px 14px; border-radius: 999px; }
.qnum { font-family: var(--font-head); color: var(--ink-soft); }
.diff-tag { font-size: 14px; padding: 3px 10px; border-radius: 99px; color: #fff; font-weight: 700; }
.diff-1 { background: #3fb26b; } .diff-2 { background: #f29d0a; } .diff-3 { background: #d6336c; }
.qtext { font-family: var(--font-head); font-size: clamp(24px, 3.2vw, 38px); font-weight: 600; margin: 10px 0 18px; }
.qimage { display: flex; justify-content: center; margin-bottom: 16px; }
.qimage img { height: clamp(120px, 20vw, 190px); width: auto; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.2); border: 4px solid #fff; background: #fff; }
.timer { height: 16px; background: #e5efe8; border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, #4fd17b, #2e9e5b); border-radius: 99px; transition: width .25s linear; }
.timer.low i { background: linear-gradient(90deg, #ff9f1c, #e2483d); }
.timer-text { font-family: var(--font-head); font-weight: 700; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice {
  appearance: none; border: 4px solid #d9e8de; background: #fff; border-radius: 22px; cursor: pointer; text-align: left;
  font-family: var(--font-head); font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; color: var(--ink);
  padding: 16px 18px; min-height: 78px; display: flex; align-items: center; gap: 14px; box-shadow: 0 5px 0 #cfdcd3; transition: transform .08s;
}
.choice:hover:not(:disabled) { border-color: var(--sky); transform: translateY(-2px); }
.choice .key { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #eef4ff; display: grid; place-items: center; font-size: 20px; color: var(--sky); }
.choice img { height: 84px; width: auto; border-radius: 8px; border: 2px solid #e1e1e1; }
.choice.flag { justify-content: center; }
.choice.right { border-color: #2e9e5b; background: #e8faee; }
.choice.wrong { border-color: #e2483d; background: #ffecea; }
.choice.dim { opacity: .45; }
.choice.removed { visibility: hidden; }
.choice .mark { margin-left: auto; font-size: 30px; }
.abilities { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.ability { appearance: none; border: 3px solid #e1ece4; background: #fff; border-radius: 16px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 700; min-height: 50px; display: inline-flex; align-items: center; gap: 6px; position: relative; color: var(--ink); }
.ability .em { font-size: 22px; }
.ability.charged { border-color: #ffc531; background: #fff8dc; }
.ability.active { border-color: var(--green); background: #e8faee; }
.ability .count { background: var(--ink); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 7px; }
.ability:disabled { opacity: .45; cursor: not-allowed; }
.hintbox { background: #fff8dc; border: 3px solid #ffd36b; border-radius: 18px; padding: 12px 16px; margin-top: 14px; font-size: 20px; }
.feedback { margin-top: 16px; border-radius: 22px; padding: 16px 20px; font-size: 20px; display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.feedback.good { background: #e3f8ea; border: 3px solid #8fdcad; }
.feedback.bad { background: #fff1e6; border: 3px solid #ffc49a; }
.feedback .big-icon { font-size: 42px; line-height: 1; }
.feedback .txt { flex: 1; min-width: 220px; }
.feedback .btn { margin-left: auto; }
.qcard .big { margin-top: 14px; }
.spell-box { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spell-box input { flex: 1; min-width: 220px; font-size: 30px; letter-spacing: 2px; font-family: var(--font-head); }
.coins-pop { position: fixed; z-index: 60; transform: translateX(-50%); font-family: var(--font-head); font-weight: 700; font-size: 30px; color: #7a5200; background: #ffe066; border: 3px solid #fff; border-radius: 999px; padding: 6px 18px; box-shadow: var(--shadow); pointer-events: none; animation: coinpop 1.1s ease-out forwards; }
.ability .count { font-size: 12px; }
@keyframes coinpop { from { opacity: 1; translate: 0 0; } 70% { opacity: 1; } to { opacity: 0; translate: 0 -70px; } }

/* boss */
.boss-zone { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, #2b1d4a, #4a2f7a); color: #fff; border-radius: 26px; padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow); flex-wrap: wrap; }
.boss-face { font-size: clamp(64px, 9vw, 110px); width: clamp(100px, 12vw, 150px); height: clamp(100px, 12vw, 150px); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, var(--bc, #c2361f) 0%, transparent 70%); animation: float 2.6s ease-in-out infinite; }
.boss-face.hit { animation: hit .4s; }
@keyframes hit { 0% { transform: translateX(0) scale(1); filter: brightness(2); } 30% { transform: translateX(-14px) scale(.94); } 60% { transform: translateX(10px); } 100% { transform: none; } }
.boss-info { flex: 1; min-width: 220px; }
.boss-info h2 { color: #fff; margin: 0 0 6px; }
.hpbar { height: 28px; background: #ffffff22; border-radius: 99px; overflow: hidden; border: 3px solid #fff; position: relative; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff6a3d, #ffd23f); transition: width .5s ease-out; }
.hpbar span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; text-shadow: 0 2px 2px #0008; }
.hpbar.shake { animation: shake .45s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.dmg { font-family: var(--font-head); font-size: 34px; color: #ffd23f; animation: coinpop 1s forwards; position: absolute; }

/* party turn banner */
.turn-banner { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(10, 30, 20, .55); animation: pop .25s; }
.turn-banner .inner { background: var(--tc, var(--green)); color: #fff; border-radius: 34px; padding: 34px 54px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); border: 8px solid #fff; animation: zoom .5s cubic-bezier(.2, 1.6, .4, 1); }
.turn-banner .inner .who { font-size: 80px; }
.turn-banner .inner h1 { color: #fff; margin: 0 0 12px; font-size: clamp(40px, 7vw, 76px); text-shadow: 0 4px 0 rgba(0,0,0,.25); }
@keyframes zoom { from { transform: scale(.5); } to { transform: scale(1); } }

/* results */
.stars { font-size: clamp(54px, 8vw, 84px); letter-spacing: 6px; }
.stars .off { filter: grayscale(1) opacity(.35); }
.stars .on { display: inline-block; animation: starpop .6s cubic-bezier(.2, 1.6, .4, 1) backwards; }
.stars .on:nth-child(2) { animation-delay: .2s; } .stars .on:nth-child(3) { animation-delay: .4s; }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
.reward-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.reward { background: #fff; border-radius: 18px; padding: 10px 18px; font-family: var(--font-head); font-weight: 700; font-size: 22px; box-shadow: 0 4px 0 #dfe9e2; border: 2px solid #e6efe8; }
table.score { width: 100%; border-collapse: collapse; font-size: 19px; }
table.score th, table.score td { padding: 10px 12px; text-align: left; border-bottom: 2px solid #eef4f0; }
table.score th { font-family: var(--font-head); background: #f3faf5; }
.mvp { background: #fff4c2; }

/* modal / power move */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(10, 30, 20, .55); display: flex; padding: 16px; animation: pop .2s; overflow-y: auto; }
.modal { margin: auto; background: #fff; border-radius: 30px; padding: clamp(20px, 3vw, 34px); width: min(640px, 100%); box-shadow: 0 30px 60px rgba(0,0,0,.35); text-align: center; border: 6px solid #fff; }
.modal.power { background: linear-gradient(160deg, #fff9dd, #e6ffe9); border-color: #ffd36b; }
.modal .pm-emoji { font-size: 90px; line-height: 1; animation: float 2.2s ease-in-out infinite; }
.modal .pm-title { font-size: clamp(28px, 4vw, 40px); }
.modal .pm-how { font-size: 21px; }
.safety { background: #fff; border: 3px dashed #ff9f1c; border-radius: 16px; padding: 10px 14px; font-weight: 700; margin: 12px 0; }
.countdown { width: 150px; height: 150px; margin: 8px auto; position: relative; }
.countdown svg { transform: rotate(-90deg); }
.countdown .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 50px; font-weight: 700; }
.pm-reward { font-family: var(--font-head); font-weight: 700; color: var(--green-dark); }

/* shop */
.shop-item { background: #fff; border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; border: 3px solid #e6efe8; }
.shop-item .ic { font-size: 54px; line-height: 1.1; }
.shop-item h3 { margin: 0; font-size: 21px; }
.shop-item .price { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.shop-item .btn { margin-top: auto; }
.shop-item.owned { border-color: #8fdcad; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { appearance: none; border: 3px solid #e1ece4; background: #fff; border-radius: 16px; padding: 10px 16px; font-family: var(--font-head); font-weight: 700; font-size: 18px; cursor: pointer; min-height: 50px; color: var(--ink); }
.tab[aria-selected='true'] { background: var(--green); color: #fff; border-color: var(--green); }

/* hatchery */
.egg-slot { background: #fff; border-radius: 24px; padding: 16px; text-align: center; box-shadow: var(--shadow); border: 3px solid #f1e6c8; }
.egg-slot .egg-svg { animation: wob 3s ease-in-out infinite; transform-origin: bottom center; }
.egg-slot.ready .egg-svg { animation: wob .6s ease-in-out infinite; }
.egg-slot.waiting { opacity: .7; }
.warm { height: 14px; background: #f3ead2; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.warm i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf5a, #ff7a1a); }
.hatch-stage { display: grid; place-items: center; min-height: 280px; position: relative; }
.hatch-stage .egg-svg.shake { animation: wob .25s ease-in-out infinite; }
.hatch-stage .flash { position: absolute; inset: 0; background: radial-gradient(circle, #fff 0%, #fff0 60%); animation: flash 1s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 0; } 30% { opacity: 1; } to { opacity: 0; } }
.reveal { animation: zoom .7s cubic-bezier(.2, 1.6, .4, 1); }
.creature-card { background: #fff; border-radius: 22px; padding: 12px; text-align: center; box-shadow: var(--shadow); border: 3px solid #e6efe8; }
.creature-card.unknown { filter: grayscale(1); opacity: .6; }
.creature-card.equipped { border-color: var(--gold); box-shadow: 0 0 0 4px #ffc53155, var(--shadow); }
.rarity { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 99px; color: #fff; }
.rarity.common { background: #3fb26b; } .rarity.rare { background: #2f8fe0; } .rarity.legendary { background: #e09a00; }
.aura { animation: crystal 1.5s ease-in-out infinite alternate; }

/* bank */
.bank-big { font-family: var(--font-head); font-size: clamp(34px, 5vw, 56px); font-weight: 700; color: var(--green-dark); }

/* toasts and live region */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, 92vw); }
.toast { background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 18px; font-weight: 700; box-shadow: var(--shadow); animation: pop .25s; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 85; }

.credits-names { font-family: var(--font-head); font-size: clamp(34px, 5vw, 60px); color: var(--green-dark); }
.parent table { width: 100%; border-collapse: collapse; }
.parent th, .parent td { padding: 8px 10px; border-bottom: 2px solid #eef4f0; text-align: left; font-size: 16px; }
.acc { display: inline-block; min-width: 54px; text-align: center; border-radius: 10px; padding: 2px 8px; font-weight: 700; }

@media (max-width: 700px) {
  body { font-size: 17px; }
  .topbar { padding: 8px 10px; }
  .topbar .brand span { display: none; }
  .nav a { padding: 6px 9px; font-size: 15px; }
  .btn.big { font-size: 22px; padding: 14px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  #bg .particles { display: none; }
  #bg .layer { transform: none !important; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
body.reduce-motion #bg .particles { display: none; }
