/* ============================================================================
   末世求生·学霸养成 — pixel-art wasteland theme
   Self-contained (no external fonts/CDN required). The pixel feel comes from
   hard edges, layered box-shadow borders, offset shadows and a rust/toxic
   palette. Latin/numeric accents use a pixel webfont if available, else a
   blocky monospace fallback.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --bg: #14100c;
  --bg2: #1d1710;
  --panel: #271f16;
  --panel2: #2f261a;
  --ink: #f1e7cf;
  --ink-dim: #c6b088;
  --ink-faint: #9d8b64;

  --line-hi: #5c4a30;
  --line-lo: #0c0907;

  --rust: #d2702f;
  --rust-hi: #f08a3c;
  --toxic: #9bd03a;
  --toxic-dim: #6f9c2a;
  --danger: #d2452f;
  --danger-hi: #ef6a4f;

  --scrap: #b6a586;
  --energy: #46c0d6;
  --parts: #d6b13a;
  --core: #c074e6;
  --hp: #e0463a;
  --exp: #e0b53a;

  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

/* dithered + scanline backdrop */
.app-bg {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(210,112,47,0.08), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(155,208,58,0.06), transparent 40%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 2px, transparent 2px, transparent 4px);
}

img { image-rendering: pixelated; }
h1, h2, h3, .pixel { font-family: var(--pixel); letter-spacing: 1px; line-height: 1.4; }
a { color: var(--rust-hi); }

/* ---- layout ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px 16px 96px; position: relative; z-index: 1; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.col { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: 14px; }
.center { text-align: center; }
.hide { display: none !important; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border-bottom: 4px solid var(--line-lo);
  box-shadow: 0 4px 0 rgba(0,0,0,0.4);
  position: sticky; top: 0; z-index: 30;
}
.brand { font-family: var(--pixel); font-size: 13px; color: var(--rust-hi); text-shadow: 2px 2px 0 #000; }
.brand small { color: var(--ink-dim); display: block; font-size: 8px; margin-top: 4px; }

/* ---- panel (pixel box) ---- */
.panel {
  background: var(--panel);
  border: 3px solid var(--line-lo);
  box-shadow:
    inset 2px 2px 0 var(--line-hi),
    inset -2px -2px 0 var(--line-lo),
    4px 4px 0 rgba(0,0,0,0.45);
  padding: 16px;
}
.panel + .panel { margin-top: 14px; }
.panel-title {
  font-family: var(--pixel); font-size: 11px; color: var(--toxic);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px dashed var(--line-hi);
  display: flex; align-items: center; gap: 8px; text-transform: uppercase;
}
.panel-title .sub { color: var(--ink-dim); font-size: 9px; margin-left: auto; text-transform: none; letter-spacing: 0; }

/* ---- buttons ---- */
.btn {
  font-family: var(--pixel); font-size: 10px; color: var(--ink);
  background: var(--panel2);
  border: 3px solid var(--line-lo);
  box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 3px 3px 0 rgba(0,0,0,0.5);
  padding: 11px 14px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
  transition: transform .03s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translate(2px, 2px); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 1px 1px 0 rgba(0,0,0,0.5); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn-primary { background: linear-gradient(180deg, var(--rust-hi), var(--rust)); color: #1a0f06; border-color: #5a2c10; }
.btn-toxic { background: linear-gradient(180deg, var(--toxic), var(--toxic-dim)); color: #11200a; border-color: #2f4a12; }
.btn-danger { background: linear-gradient(180deg, var(--danger-hi), var(--danger)); color: #1a0606; border-color: #5a1810; }
.btn-ghost { background: transparent; }
.btn-sm { font-size: 8px; padding: 7px 9px; }
.btn-block { display: block; width: 100%; }

/* ---- resource chips ---- */
.res-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.res-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2); border: 2px solid var(--line-lo);
  box-shadow: inset 1px 1px 0 var(--line-hi);
  padding: 7px 11px; font-family: var(--pixel); font-size: 10px;
}
.res-chip:hover { filter: brightness(1.12); }
.res-chip .ico { font-size: 16px; }
.res-chip .val { color: var(--ink); min-width: 1ch; }
.res-chip.scrap .val { color: var(--scrap); }
.res-chip.energy .val { color: var(--energy); }
.res-chip.parts .val { color: var(--parts); }
.res-chip.core .val { color: var(--core); }
.res-chip .delta { font-size: 9px; margin-left: 2px; }
.delta-up { color: var(--toxic); } .delta-down { color: var(--danger-hi); }

/* ---- stat bars ---- */
.stat-line { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.stat-line .lbl { font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); width: 64px; }
.stat-line .num { font-family: var(--pixel); font-size: 9px; color: var(--ink); margin-left: auto; }
.bar { flex: 1; height: 16px; background: #0b0805; border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 #000; position: relative; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; transition: width .5s steps(12); background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.12) 0 4px, transparent 4px 8px); }
.bar-hp .bar-fill { background-color: var(--hp); }
.bar-exp .bar-fill { background-color: var(--exp); }
.bar-energy .bar-fill { background-color: var(--energy); }

/* ---- hero / character ---- */
.hero-card { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 96px; height: 96px; flex: none; display: grid; place-items: center;
  font-size: 56px;
  background: radial-gradient(circle at 50% 35%, #3a2e1f, #1a130c);
  border: 3px solid var(--hero-ring, var(--line-lo)); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000;
  transition: border-color .4s, box-shadow .4s;
}
.hero-rank { color: var(--rust-hi); }
.hero-name { font-family: var(--pixel); font-size: 14px; color: var(--rust-hi); text-shadow: 2px 2px 0 #000; }
.hero-lvl { font-family: var(--pixel); font-size: 9px; color: var(--toxic); margin-top: 6px; }
.combat-stats { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.cstat { font-family: var(--pixel); font-size: 10px; }
.cstat b { color: var(--rust-hi); }

/* ---- equipment grid ---- */
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.equip-card { background: var(--panel2); border: 3px solid var(--line-lo); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000; padding: 12px; }
.equip-head { display: flex; align-items: center; gap: 10px; }
.equip-icon { font-size: 26px; }
.equip-name { font-family: var(--pixel); font-size: 10px; }
.equip-slot { font-size: 11px; color: var(--ink-dim); }
.equip-lvl { margin-left: auto; font-family: var(--pixel); font-size: 9px; color: var(--toxic); }
.equip-bonus { font-size: 12px; color: var(--ink-dim); margin: 8px 0; }
.equip-bonus b { color: var(--ink); }
.cost-line { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cost-item { font-family: var(--pixel); font-size: 9px; display: flex; align-items: center; gap: 3px; color: var(--ink); }
.cost-item.lack { color: var(--danger-hi); }
.maxed-tag { font-family: var(--pixel); font-size: 9px; color: var(--parts); }

/* ---- zones ---- */
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.zone-card { position: relative; background: var(--panel2); border: 3px solid var(--line-lo); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000; padding: 14px; overflow: hidden; }
.zone-card .zone-name { font-family: var(--pixel); font-size: 11px; color: var(--rust-hi); }
.zone-card .zone-desc { font-size: 12px; color: var(--ink-dim); margin: 8px 0; min-height: 40px; }
.zone-card .zone-meta { font-family: var(--pixel); font-size: 8px; color: var(--energy); }
.zone-locked { filter: grayscale(.8) brightness(.6); }
.zone-lock-tag { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pixel); font-size: 10px; color: var(--danger-hi); background: rgba(0,0,0,0.55); }

/* ---- bottom nav ---- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: linear-gradient(0deg, var(--panel2), var(--panel)); border-top: 4px solid var(--line-lo); box-shadow: 0 -4px 0 rgba(0,0,0,0.4); }
.nav-item { flex: 1; text-align: center; padding: 10px 4px; font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-right: 2px solid var(--line-lo); }
.nav-item:last-child { border-right: none; }
.nav-item .ni { font-size: 18px; display: block; margin-bottom: 5px; }
.nav-item.active { color: var(--rust-hi); background: rgba(210,112,47,0.12); }

/* ---- login ---- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { font-family: var(--pixel); font-size: 18px; color: var(--rust-hi); text-shadow: 3px 3px 0 #000; text-align: center; margin-bottom: 6px; }
.login-tag { text-align: center; color: var(--ink-dim); font-size: 12px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: #0d0a06; border: 3px solid var(--line-lo);
  box-shadow: inset 2px 2px 0 #000; padding: 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--rust); }
.hint { font-size: 12px; line-height: 1.5; color: var(--ink-dim); margin-top: 8px; text-align: center; }

/* ---- flash / toast ---- */
.flash { font-family: var(--pixel); font-size: 9px; padding: 10px 12px; border: 2px solid var(--line-lo); margin-bottom: 12px; }
.flash-err { color: var(--danger-hi); background: rgba(210,69,47,0.12); border-color: var(--danger); }
.flash-ok { color: var(--toxic); background: rgba(155,208,58,0.1); border-color: var(--toxic-dim); }
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { font-family: var(--pixel); font-size: 10px; padding: 10px 16px; background: var(--panel2); border: 3px solid var(--line-lo); box-shadow: 3px 3px 0 rgba(0,0,0,0.5); animation: pop .25s, fadeout .4s 2.1s forwards; }
.toast.good { color: var(--toxic); } .toast.bad { color: var(--danger-hi); } .toast.info { color: var(--energy); }

/* ---- battle modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.78); z-index: 80; display: grid; place-items: center; padding: 16px; }
.battle-modal { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; position: relative; }
.combatants { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.combatant { flex: 1; text-align: center; position: relative; }
.combatant .sprite { font-size: 52px; margin-bottom: 8px; display: inline-block; will-change: transform, filter; }
.combatant .cname { font-family: var(--pixel); font-size: 9px; }
.vs { font-family: var(--pixel); font-size: 14px; color: var(--danger-hi); }
.battle-log { margin: 14px 0; max-height: 200px; overflow: auto; background: #0b0805; border: 2px solid var(--line-lo); padding: 10px; font-size: 12px; }
.log-line { margin: 3px 0; font-family: var(--sans); }
.log-line.player { color: var(--toxic); }
.log-line.monster { color: var(--danger-hi); }
.battle-result { font-family: var(--pixel); font-size: 16px; text-align: center; margin: 10px 0; }
.battle-result.win { color: var(--toxic); } .battle-result.lose { color: var(--danger-hi); }
.loot-line { text-align: center; font-family: var(--pixel); font-size: 10px; color: var(--parts); }

/* exploration run (gauntlet) */
.run-route { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.run-route.in-battle { margin: 6px 0 10px; }
.run-node { width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); opacity: .5; }
.run-node.upcoming { opacity: .5; }
.run-node.current { opacity: 1; border-color: var(--rust-hi); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 10px rgba(240,138,60,0.6); }
.run-node.done { opacity: 1; color: var(--toxic); border-color: var(--toxic-dim); }
.run-arrow { color: var(--ink-faint); font-family: var(--pixel); font-size: 12px; }
.run-hp { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.run-hp .lbl { font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); }
.run-hp .num { font-family: var(--pixel); font-size: 9px; color: var(--ink); }
.run-outcome { text-align: center; font-size: 13px; color: var(--ink); margin: 8px 0; }
.run-pending { text-align: center; font-family: var(--pixel); font-size: 10px; color: var(--parts); margin: 6px 0; }
.run-pending.small { font-size: 8px; opacity: .9; }
.run-buff { text-align: center; font-family: var(--pixel); font-size: 9px; color: var(--rust-hi); margin: 6px 0; text-shadow: 0 0 8px rgba(240,138,60,0.5); }
.run-buff.small { font-size: 8px; margin: 2px 0; }
.run-panel .hint { margin-top: 10px; }

/* ---- battle effects ---- */
/* attacker wind-up lunge */
.sprite.lunge-r { animation: lungeR .3s ease; }
.sprite.lunge-l { animation: lungeL .3s ease; }
@keyframes lungeR { 0% { transform: translateX(0); } 45% { transform: translateX(34px) scale(1.12); } 100% { transform: translateX(0); } }
@keyframes lungeL { 0% { transform: translateX(0); } 45% { transform: translateX(-34px) scale(1.12); } 100% { transform: translateX(0); } }

/* target recoil flash */
.sprite.hit { animation: recoil .26s; }
.sprite.hit-crit { animation: recoilCrit .34s; }
@keyframes recoil { 0% { filter: brightness(2.2); } 30% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 100% { transform: none; filter: none; } }
@keyframes recoilCrit { 0% { filter: brightness(3) drop-shadow(0 0 8px #ffcf3a); transform: scale(1.18); } 25% { transform: translateX(-10px) rotate(-6deg); } 55% { transform: translateX(8px) rotate(5deg); } 100% { transform: none; filter: none; } }

/* floating damage numbers */
.dmg-num { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); font-family: var(--pixel); font-weight: bold; font-size: 16px; pointer-events: none; z-index: 6; text-shadow: 2px 2px 0 #000; animation: floatDmg .95s ease-out forwards; }
.dmg-num.by-player { color: #ffe9a8; }
.dmg-num.by-monster { color: var(--danger-hi); }
.dmg-num.crit { font-size: 28px; color: #ffd23a; text-shadow: 2px 2px 0 #000, 0 0 12px #ff8a00; }
@keyframes floatDmg { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.5); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }

/* impact spark */
.spark { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-size: 30px; pointer-events: none; z-index: 5; animation: sparkPop .46s ease-out forwards; }
.spark.crit { font-size: 48px; }
@keyframes sparkPop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.3) rotate(0deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.7) rotate(45deg); } }

/* crit banner + screen flash */
.crit-banner { position: absolute; top: 9%; left: 50%; transform: translateX(-50%); font-family: var(--pixel); font-size: 22px; color: #ffd23a; text-shadow: 3px 3px 0 #000, 0 0 14px #ff8a00; pointer-events: none; z-index: 8; animation: critPop .65s ease-out forwards; }
@keyframes critPop { 0% { opacity: 0; transform: translateX(-50%) scale(.3) rotate(-8deg); } 30% { opacity: 1; transform: translateX(-50%) scale(1.25) rotate(3deg); } 70% { transform: translateX(-50%) scale(1) rotate(0deg); } 100% { opacity: 0; transform: translateX(-50%) scale(1.05); } }
.crit-flash { position: absolute; inset: 0; pointer-events: none; z-index: 7; background: radial-gradient(circle at 50% 40%, rgba(255,200,60,0.55), transparent 65%); opacity: 0; }
.crit-flash.go { animation: critFlash .32s ease-out; }
@keyframes critFlash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* per-monster attack effects (projectile fly-in + hero flash + impact particle) */
.fx-proj { position: absolute; transform: translate(-50%, -50%); font-size: 24px; pointer-events: none; z-index: 9; text-shadow: 0 0 8px currentColor; animation: fxProj .34s ease-in forwards; }
@keyframes fxProj { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 1; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.35); } }
.fx-flash { position: absolute; inset: -8%; pointer-events: none; z-index: 4; animation: fxFlash .38s ease-out forwards; }
@keyframes fxFlash { 0% { opacity: 0; transform: scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
.fx-impact { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); font-size: 34px; pointer-events: none; z-index: 6; text-shadow: 0 0 10px rgba(255,255,255,0.45); animation: fxImpact .5s ease-out forwards; }
.fx-impact.crit { font-size: 46px; }
@keyframes fxImpact { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) rotate(-12deg); } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.3) rotate(4deg); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.05) rotate(16deg); } }
/* colour the monochrome glyphs per style */
.fx-proj.fx-shoot { color: var(--parts); font-size: 18px; }
.fx-proj.fx-laser, .fx-impact.fx-laser { color: #46f0ff; }
.fx-proj.fx-shock, .fx-impact.fx-shock { color: #9ec8ff; }
.fx-impact.fx-shoot { color: var(--parts); }
.fx-impact.fx-slash { color: #fff; }
.fx-proj.fx-frost, .fx-impact.fx-frost { color: #aee4ff; }
.fx-proj.fx-acid, .fx-impact.fx-acid { color: #9ad02a; }
.fx-proj.fx-drain, .fx-impact.fx-drain { color: #c074e6; }
.fx-proj.fx-beam, .fx-impact.fx-beam { color: #e06ae6; }
.fx-proj.fx-swarm { font-size: 15px; }
.fx-impact.fx-sonic { color: #b4c8ff; }
/* sonic shock ring */
.fx-ring { position: absolute; width: 18px; height: 18px; border: 3px solid #b4c8ff; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 8; box-shadow: 0 0 10px #b4c8ff; animation: fxRing .44s ease-out forwards; }
@keyframes fxRing { 0% { opacity: .9; width: 14px; height: 14px; } 100% { opacity: 0; width: 130px; height: 130px; } }

/* low-HP bar pulse */
.bar.bar-hp.low .bar-fill { animation: hpLow .5s steps(2) infinite; }
@keyframes hpLow { 50% { filter: brightness(2.2) saturate(1.4); } }

/* end-of-battle sprite states */
.sprite.victory { animation: victoryBounce .55s ease infinite; }
@keyframes victoryBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px) scale(1.12); } }
.sprite.defeated { filter: grayscale(1) brightness(.45); transform: rotate(14deg) translateY(6px); opacity: .55; transition: all .5s ease; }

/* victory confetti (anchored to the full-screen backdrop) */
.confetti { position: absolute; top: -6%; pointer-events: none; z-index: 90; animation: confettiFall 1.6s ease-in forwards; }
.confetti.page { position: fixed; top: -4%; z-index: 200; animation: confettiFall 2s ease-in forwards; }
@keyframes confettiFall { 0% { opacity: 0; transform: translateY(0) rotate(0deg); } 12% { opacity: 1; } 100% { opacity: 0; transform: translateY(86vh) rotate(420deg); } }

@media (prefers-reduced-motion: reduce) {
  .sprite.lunge-r, .sprite.lunge-l, .sprite.hit, .sprite.hit-crit, .sprite.victory,
  .dmg-num, .spark, .crit-banner, .crit-flash.go, .confetti, .bar.bar-hp.low .bar-fill,
  .fx-proj, .fx-flash, .fx-impact, .fx-ring {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  }
}

/* ---- skills (battle skill bar + dashboard list) ---- */
.skill-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.skill-btn { display: inline-flex; align-items: center; gap: 5px; border-left-width: 5px; }
.skill-btn.sk-atk { border-left-color: var(--danger); }
.skill-btn.sk-heal { border-left-color: var(--toxic); }
.skill-btn.sk-block { border-left-color: var(--energy); }
.skill-btn .sk-ico { font-size: 14px; }
.sk-cd { background: #000; color: var(--danger-hi); padding: 0 5px; font-size: 9px; margin-left: 2px; }
.skill-list { display: flex; flex-direction: column; gap: 8px; }
.skill-chip { display: flex; gap: 10px; align-items: center; padding: 7px 9px; background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); }
.skill-chip.locked { opacity: .42; filter: grayscale(.6); }
.skill-chip .sk-ico { font-size: 22px; }
.skill-chip .sk-name { font-family: var(--pixel); font-size: 9px; color: var(--ink); }
.skill-chip .sk-sub { font-size: 11px; color: var(--ink-dim); }

/* shield indicator + heal/shield effects */
.shield-tag { font-family: var(--pixel); font-size: 8px; color: var(--energy); margin-top: 5px; }
.pet-tag { font-family: var(--pixel); font-size: 8px; color: var(--parts); margin-top: 5px; }
.dmg-num.heal-num { color: var(--toxic); text-shadow: 2px 2px 0 #000, 0 0 8px var(--toxic-dim); }
.sprite.heal-glow { animation: healGlow .55s ease; }
@keyframes healGlow { 0% { filter: none; } 50% { filter: brightness(1.5) drop-shadow(0 0 10px var(--toxic)); } 100% { filter: none; } }
.spark.shield-fx { font-size: 40px; }

/* ---- bosses ---- */
.boss-row { margin-top: 8px; }
.boss-meta { font-size: 10px; color: var(--ink-faint); margin-top: 5px; text-align: center; }
.battle-modal.boss-battle { border-color: var(--danger); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 0 0 24px rgba(210,69,47,0.5), 4px 4px 0 rgba(0,0,0,0.45); }
.battle-modal.boss-battle .panel-title { color: var(--danger-hi); }

/* ---- equipment rarity & affixes ---- */
.equip-card.rarity-rare { border-color: #3a6ea5; box-shadow: inset 2px 2px 0 #4d86c4, inset -2px -2px 0 #000; }
.equip-card.rarity-epic { border-color: #7a3fb0; box-shadow: inset 2px 2px 0 #a05cd6, inset -2px -2px 0 #000; }
.equip-card.rarity-legendary { border-color: #c8862a; box-shadow: inset 2px 2px 0 #f0a83c, inset -2px -2px 0 #000, 0 0 12px rgba(240,168,60,0.4); }
.rarity-tag { font-family: var(--pixel); font-size: 7px; padding: 2px 4px; margin-left: 4px; border: 1px solid currentColor; }
.rarity-tag.rarity-rare { color: #6fa8dc; }
.rarity-tag.rarity-epic { color: #c08be0; }
.rarity-tag.rarity-legendary { color: #f0a83c; }
.affix-line { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.affix { font-family: var(--pixel); font-size: 8px; color: var(--toxic); background: rgba(155,208,58,0.1); border: 1px solid var(--toxic-dim); padding: 2px 5px; }

/* ---- trinkets (圣物) ---- */
.trinket-card.equipped { border-color: var(--toxic); box-shadow: inset 2px 2px 0 var(--toxic-dim), inset -2px -2px 0 #000; }
.loot-line.trinket-drop { color: var(--core); font-size: 13px; text-shadow: 0 0 10px var(--core); animation: critPop .6s ease-out; }

/* ---- tables (admin) ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line-lo); }
table.tbl th { font-family: var(--pixel); font-size: 8px; color: var(--toxic); text-transform: uppercase; }
table.tbl tr:hover td { background: rgba(210,112,47,0.06); }

/* ---- tabs (admin) ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); padding: 10px 14px; cursor: pointer; appearance: none; -webkit-appearance: none; border: 3px solid var(--line-lo); background: var(--panel); }
.tab.active { color: #1a0f06; background: linear-gradient(180deg, var(--rust-hi), var(--rust)); border-color: #5a2c10; }

/* keyboard focus visibility for all interactive controls */
.btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--toxic); outline-offset: 2px;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.badge { font-family: var(--pixel); font-size: 8px; padding: 3px 6px; border: 2px solid var(--line-lo); }
.badge.done { color: var(--toxic); } .badge.partial { color: var(--parts); } .badge.missed { color: var(--danger-hi); }

/* onboarding tour */
.tour-overlay { position: fixed; inset: 0; z-index: 100; }
.tour-ring { position: absolute; border: 3px solid var(--toxic); box-shadow: 0 0 0 9999px rgba(0,0,0,0.72), 0 0 16px var(--toxic); pointer-events: none; transition: all .2s; }
.tour-tip { position: absolute; width: 280px; max-width: calc(100vw - 20px); background: var(--panel2); border: 3px solid var(--line-lo); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000, 4px 4px 0 rgba(0,0,0,0.5); padding: 14px; z-index: 101; }
.tour-text { font-size: 13px; color: var(--ink); line-height: 1.65; margin-bottom: 12px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-progress { font-family: var(--pixel); font-size: 9px; color: var(--ink-faint); }

/* daily/weekly event banner */
.event-banner { border-color: var(--rust); box-shadow: inset 2px 2px 0 var(--rust-hi), inset -2px -2px 0 #000; }
.event-name { font-family: var(--pixel); font-size: 10px; color: var(--rust-hi); }

/* streak indicator */
.streak-line { font-family: var(--pixel); font-size: 9px; color: var(--rust-hi); margin-top: 10px; }
.streak-line b { color: var(--parts); font-size: 12px; }
.streak-line.cold { color: var(--ink-dim); }

/* homework card — the core daily loop, given hero treatment */
.hw-panel { border-left: 5px solid var(--toxic); }
.hw-panel.todo { border-left-color: var(--rust-hi); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 4px 4px 0 rgba(0,0,0,0.45), 0 0 0 1px rgba(240,138,60,0.18); }
.hw-status { display: flex; align-items: center; gap: 12px; margin: 4px 0 2px; }
.hw-status .hw-emoji { font-size: 34px; line-height: 1; }
.hw-status .hw-head { font-family: var(--pixel); font-size: 12px; color: var(--ink); }
.hw-status.done .hw-head { color: var(--toxic); }
.hw-status.todo .hw-head { color: var(--rust-hi); }
.hw-sub { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.hw-rewards { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--line-hi); }
.hw-reward { font-family: var(--pixel); font-size: 10px; display: flex; align-items: center; gap: 4px; color: var(--ink); }
.hw-reward .ico { font-size: 14px; }

/* friendlier empty states */
.empty-state { text-align: center; color: var(--ink-dim); font-size: 13px; padding: 14px 8px; }
.empty-state .es-emoji { font-size: 30px; display: block; margin-bottom: 6px; filter: grayscale(.3); opacity: .85; }

/* goals */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.goal-card { background: var(--panel2); border: 3px solid var(--line-lo); box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000; padding: 12px; }
.goal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.goal-head b { font-family: var(--pixel); font-size: 10px; color: var(--rust-hi); }

/* analytics charts */
.an-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; background: #0b0805; border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 #000; padding: 6px; margin-top: 8px; }
.an-bar { flex: 1 1 0; min-width: 3px; min-height: 3px; align-self: flex-end; }
.an-legend { font-size: 11px; color: var(--ink-dim); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }

/* achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.ach-badge { display: flex; align-items: center; gap: 9px; background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 9px 10px; opacity: .55; filter: grayscale(.5); }
.ach-badge.on { opacity: 1; filter: none; border-color: var(--exp); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 8px rgba(224,181,58,0.25); }
.ach-ico { font-size: 24px; flex: none; }
.ach-meta { display: flex; flex-direction: column; min-width: 0; }
.ach-name { font-family: var(--pixel); font-size: 9px; color: var(--ink); }
.ach-sub { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.ach-badge.on .ach-sub { color: var(--exp); }
.ach-reward { font-size: 10px; color: var(--rust-hi); margin-top: 2px; }
.ach-badge .claim-ach-btn { flex: none; margin-left: auto; }
.ach-badge.ready { border-color: var(--toxic); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 10px rgba(143,209,79,0.35); }
.ach-sub.claimed { color: var(--ink-faint); }

/* daily game-time cap */
.time-pill { font-family: var(--pixel); font-size: 9px; color: #1a0f06; background: linear-gradient(180deg, var(--toxic), var(--toxic-dim)); padding: 5px 8px; border-radius: 3px; white-space: nowrap; flex: none; align-self: center; }
.time-pill.low { background: linear-gradient(180deg, var(--parts), #b8862a); }
.time-pill.locked { background: linear-gradient(180deg, var(--danger-hi), var(--danger)); color: #fff; }
.lock-banner { display: flex; align-items: center; gap: 12px; border-color: var(--danger); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 12px rgba(180,60,40,0.3); }
.lock-banner .lock-ico { font-size: 28px; flex: none; }
.lock-banner .lock-text { flex: 1; min-width: 0; }
.lock-banner .lock-title { font-family: var(--pixel); font-size: 11px; color: var(--danger-hi); margin-bottom: 4px; }

/* daily quests */
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); }
.quest-row.ready { border-color: var(--toxic); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 8px rgba(143,209,79,0.25); }
.quest-row.claimed { opacity: 0.6; }
.q-ico { font-size: 20px; flex: none; }
.q-main { flex: 1; min-width: 0; }
.q-name { font-size: 13px; color: var(--ink); margin-bottom: 5px; }
.q-reward { font-size: 11px; color: var(--rust-hi); margin-left: 4px; }
.q-prog { font-family: var(--pixel); font-size: 11px; color: var(--ink-dim); flex: none; }

/* mastery-granted skills */
.skill-chip.mastery { border-color: var(--toxic-dim); }
.skill-chip.mastery.locked { border-color: var(--line-lo); }
.sk-mas { font-size: 9px; font-family: var(--pixel); color: #11200a; background: var(--toxic); padding: 1px 4px; border-radius: 2px; vertical-align: middle; }

/* parent weekly digest */
.digest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.digest-stat { background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 12px 10px; text-align: center; }
.dg-num { display: block; font-family: var(--pixel); font-size: 18px; color: var(--rust-hi); text-shadow: 1px 1px 0 #000; }
.dg-num small { font-size: 11px; color: var(--ink-faint); }
.dg-lbl { font-size: 12px; color: var(--ink-dim); margin-top: 4px; display: block; }

/* workshop sub-tabs */
.shop-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.shop-tab { flex: 1 1 0; min-width: 56px; font-family: var(--pixel); font-size: 9px; color: var(--ink-dim); background: var(--panel2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 9px 6px; cursor: pointer; }
.shop-tab:hover { filter: brightness(1.12); }
.shop-tab.active { color: #1a0f06; background: linear-gradient(180deg, var(--rust-hi), var(--rust)); border-color: #5a2c10; }

/* knowledge quiz */
.quiz-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quiz-left { font-size: 13px; color: var(--ink-dim); }
.quiz-left b { color: var(--toxic); font-family: var(--pixel); font-size: 13px; }
.quiz-modal { max-width: 520px; }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.quiz-meta-left { display: inline-flex; align-items: center; gap: 8px; }
.quiz-meta-right { display: inline-flex; align-items: center; gap: 8px; }
.quiz-review { font-family: var(--pixel); font-size: 9px; color: #1a0f06; background: var(--energy); padding: 2px 5px; border-radius: 2px; }
.quiz-review-line { text-align: center; font-size: 12px; color: var(--energy); margin: 4px 0; }
.quiz-combo { font-family: var(--pixel); font-size: 10px; color: #1a0f06; background: linear-gradient(180deg, var(--rust-hi), var(--rust)); padding: 2px 6px; border-radius: 2px; }
.quiz-combo-line { text-align: center; font-family: var(--pixel); font-size: 12px; color: var(--rust-hi); margin: 4px 0; animation: combo-pop 0.4s ease; }
@keyframes combo-pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .quiz-combo-line { animation: none; } }
.quiz-cat { font-family: var(--pixel); font-size: 11px; }
.quiz-diff { font-size: 12px; letter-spacing: 1px; }
.quiz-q { font-size: 15px; line-height: 1.6; color: var(--ink); margin-bottom: 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { text-align: left; font-family: var(--sans); font-size: 14px; text-transform: none; letter-spacing: 0; }
.quiz-opt.correct { background: linear-gradient(180deg, var(--toxic), var(--toxic-dim)); color: #11200a; border-color: #2f4a12; }
.quiz-opt.wrong { background: linear-gradient(180deg, var(--danger-hi), var(--danger)); color: #1a0606; border-color: #5a1810; }
.quiz-result { font-family: var(--pixel); font-size: 15px; text-align: center; margin: 14px 0 8px; }
.quiz-result.win { color: var(--toxic); } .quiz-result.lose { color: var(--danger-hi); }
.quiz-explain { font-size: 13px; line-height: 1.6; color: var(--ink-dim); background: var(--bg2); border-left: 4px solid var(--energy); padding: 10px 12px; margin-top: 6px; }

/* character monologue speech bubble */
.hero-speech { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 8px 10px; margin-bottom: 10px; position: relative; }
.hero-speech::after { content: ''; position: absolute; left: 22px; bottom: -8px; width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--bg2); }
.hero-speech .speech-ico { font-size: 18px; flex: none; }
.hero-speech .speech-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--toxic); }
.hero-speech .speech-refresh { flex: none; background: none; border: none; color: var(--ink-dim); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.hero-speech .speech-refresh:hover { color: var(--toxic); }

/* companion chat */
.chat-modal { max-width: 460px; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 48vh; overflow-y: auto; padding: 6px 2px; margin: 6px 0; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.bot { align-self: flex-start; }
.chat-avatar { font-size: 22px; flex: none; filter: drop-shadow(0 0 4px rgba(0,0,0,0.5)); }
.chat-bubble { font-size: 14px; line-height: 1.5; padding: 8px 11px; border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); white-space: pre-wrap; word-break: break-word; }
.chat-msg.me .chat-bubble { background: linear-gradient(180deg, var(--toxic), var(--toxic-dim)); color: #11200a; border-color: #2f4a12; }
.chat-msg.bot .chat-bubble { background: var(--bg2); color: var(--ink); }
.chat-bubble.typing { letter-spacing: 2px; animation: chat-typing 1s infinite; }
@keyframes chat-typing { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.chat-quick-btn { font-size: 12px; color: var(--ink-dim); background: var(--panel2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 5px 9px; cursor: pointer; }
.chat-quick-btn:hover { filter: brightness(1.15); color: var(--toxic); }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .chat-bubble.typing { animation: none; } }

/* 错题本 / mistakes review */
.mistakes-modal { max-width: 560px; }
.mistakes-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.mistake-card { background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 10px 12px; }
.mistake-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mistake-head .quiz-cat { font-family: var(--pixel); font-size: 10px; }
.mistake-q { font-size: 14px; line-height: 1.5; color: var(--ink); margin-bottom: 6px; }
.mistake-ans { font-size: 13px; color: var(--toxic); margin-bottom: 6px; }

/* subject mastery */
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mastery-card { background: var(--bg2); border: 2px solid var(--line-lo); box-shadow: inset 1px 1px 0 var(--line-hi); padding: 9px 10px; opacity: .72; }
.mastery-card.has-lvl { opacity: 1; border-color: var(--line-hi); }
.m-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.m-ico { font-size: 18px; }
.m-name { font-family: var(--pixel); font-size: 10px; color: var(--ink); }
.m-lvl { margin-left: auto; font-family: var(--pixel); font-size: 9px; color: var(--exp); }
.bar.bar-mastery { display: block; flex: none; width: 100%; height: 12px; }
.bar-mastery .bar-fill { background-color: var(--exp); }
.m-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.m-bonus { font-family: var(--pixel); font-size: 9px; color: var(--toxic); }
.m-next { font-size: 10px; color: var(--ink-faint); }
.m-milestones { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line-hi); }
.m-ms { font-size: 10px; padding: 2px 5px; border: 1px solid var(--line-lo); background: var(--bg2); color: var(--ink-faint); opacity: .7; }
.m-ms.on { color: var(--exp); border-color: var(--exp); opacity: 1; text-shadow: 0 0 6px rgba(224,181,58,0.5); }

/* ---- animations ---- */
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-8px); } }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-6px);} 75%{transform:translateX(6px);} }
@keyframes blink { 50% { opacity: .35; } }
@keyframes flash-hit { 0%{ filter: brightness(2.4); } 100%{ filter: none; } }
.shake { animation: shake .25s; }
.hit { animation: flash-hit .25s; }
.blink { animation: blink 1s steps(2) infinite; }

/* ---- ambient + UI juice (v2.24) ---- */
/* drifting radiation motes — a subtle overlay drifting over the UI (below the
   topbar/nav/modals), for wasteland atmosphere */
#fx-ambient { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.mote { position: absolute; bottom: -6%; color: var(--toxic); opacity: 0; text-shadow: 0 0 6px var(--toxic-dim); animation-name: drift; animation-timing-function: linear; animation-iteration-count: infinite; }
@keyframes drift {
  0% { opacity: 0; transform: translate(0, 0); }
  12% { opacity: .4; }
  88% { opacity: .4; }
  100% { opacity: 0; transform: translate(var(--sway, 16px), -108vh); }
}

/* resource gain/loss feedback */
.res-chip.gain { animation: chipGain .5s ease; }
.res-chip.loss { animation: chipLoss .45s ease; }
@keyframes chipGain { 30% { transform: scale(1.18); filter: brightness(1.4); box-shadow: inset 1px 1px 0 var(--line-hi), 0 0 14px var(--toxic); } }
@keyframes chipLoss { 30% { transform: scale(.9); filter: brightness(.65) saturate(1.4); } }
.res-float { position: fixed; transform: translateX(-50%); font-family: var(--pixel); font-size: 11px; z-index: 210; pointer-events: none; text-shadow: 1px 1px 0 #000; animation: resFloat 1.05s ease-out forwards; }
.res-float.up { color: var(--toxic); } .res-float.down { color: var(--danger-hi); }
@keyframes resFloat { 0% { opacity: 0; transform: translate(-50%, 4px) scale(.8); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -26px) scale(1); } }

/* level-up burst */
.levelup-burst { position: fixed; top: 32%; left: 50%; transform: translateX(-50%); z-index: 220; pointer-events: none; text-align: center; animation: lvlBurst 1.7s ease-out forwards; }
.levelup-burst span { display: block; font-family: var(--pixel); font-size: 30px; color: var(--exp); text-shadow: 3px 3px 0 #000, 0 0 20px var(--rust-hi); }
.levelup-burst small { font-family: var(--pixel); font-size: 11px; color: var(--rust-hi); }
@keyframes lvlBurst { 0% { opacity: 0; transform: translateX(-50%) scale(.4); } 18% { opacity: 1; transform: translateX(-50%) scale(1.2); } 35% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(1); } }

/* idle hero bob + glow */
.avatar { animation: avatarBob 3.4s ease-in-out infinite; }
@keyframes avatarBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hero-card .avatar { animation: avatarBob 3.4s ease-in-out infinite, avatarGlow 4s ease-in-out infinite; }
@keyframes avatarGlow { 0%, 100% { box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000, 0 0 7px var(--hero-glow, rgba(240,138,60,0.25)); } 50% { box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 #000, 0 0 22px var(--hero-glow, rgba(240,138,60,0.5)); } }
/* appearance evolution burst (every 5 levels) */
.levelup-burst.evolve span { font-size: 38px; color: var(--exp); text-shadow: 3px 3px 0 #000, 0 0 26px var(--rust-hi); }
.levelup-burst.evolve small { font-size: 13px; color: var(--exp); }
.levelup-burst.evolve { animation: lvlBurst 2.3s ease-out forwards; }

/* attention pulse for the main CTA + claimable buttons */
#goExplore { animation: ctaPulse 2.2s ease-in-out infinite; }
@keyframes ctaPulse { 0%, 100% { box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 3px 3px 0 rgba(0,0,0,0.5); } 50% { box-shadow: inset 2px 2px 0 var(--line-hi), inset -2px -2px 0 var(--line-lo), 3px 3px 0 rgba(0,0,0,0.5), 0 0 16px var(--rust-hi); } }
.daily-btn { animation: claimPulse 1.4s ease-in-out infinite; }
@keyframes claimPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); transform: scale(1.03); } }

/* exp bar shimmer */
.bar-exp .bar-fill { position: relative; overflow: hidden; }
.bar-exp .bar-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%); transform: translateX(-120%); animation: shimmer 2.6s ease-in-out infinite; }
@keyframes shimmer { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(220%); } }

@media (prefers-reduced-motion: reduce) {
  .mote, .avatar, .hero-card .avatar, #goExplore, .daily-btn, .bar-exp .bar-fill::after { animation: none !important; }
}

/* responsive */
@media (max-width: 560px) {
  .hero-card { flex-direction: column; text-align: center; }
  .combat-stats { justify-content: center; }
  .brand small { display: none; }
}

/* phone (portrait) */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .wrap { padding: 10px 10px 92px; }
  .row { flex-direction: column; }

  /* topbar wraps: brand + buttons on row 1, resource chips full-width below */
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .brand { font-size: 11px; }
  .res-bar { order: 3; width: 100%; justify-content: space-between; gap: 6px; }
  .res-chip { font-size: 9px; padding: 5px 7px; gap: 5px; }
  .res-chip .ico { font-size: 13px; }

  /* single-column card grids */
  .equip-grid, .zone-grid, .goal-grid { grid-template-columns: 1fr; }
  .panel { padding: 13px; }

  /* battle modal fits the screen */
  .modal-backdrop { padding: 8px; }
  .battle-modal { max-width: 100%; }
  .combatant .sprite { font-size: 40px; }
  .vs { font-size: 12px; }
  .battle-log { max-height: 150px; font-size: 11px; }
  .skill-bar { gap: 6px; }
  .skill-bar .btn { font-size: 8px; padding: 8px 8px; }

  /* admin tabs scroll instead of wrapping awkwardly */
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { white-space: nowrap; flex: 0 0 auto; }

  /* bottom nav + tables tighten up */
  .nav-item { font-size: 8px; padding: 9px 2px; }
  .nav-item .ni { font-size: 16px; }
  table.tbl { font-size: 11px; }
  table.tbl th, table.tbl td { padding: 6px 5px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
