/* ============================================================
   PokéSquad — "Dusk Meadow" theme
   Warm sunset sky, rolling hills, cream trainer-card panels.
   ============================================================ */
:root {
  --ink: #2a2145;
  --ink-soft: #6b6288;
  --paper: #fff8ec;
  --paper-2: #f7eddc;
  --paper-3: #efe1c9;
  --line: #e6d6bb;
  --sun: #ffcf5c;
  --sun-deep: #f5a524;
  --coral: #ff7a59;
  --rose: #f2577a;
  --leaf: #4fb36b;
  --leaf-deep: #2f8a4c;
  --sea: #3d8bfd;
  --grape: #7b5cff;
  --atk: #ff8a3d;
  --hp: #f2577a;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(30, 18, 70, .28), 0 2px 0 rgba(255, 255, 255, .6) inset;
  --head: 'Fredoka', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: #1e1747;
  overflow-x: hidden;
}
img { image-rendering: pixelated; }
a { color: inherit; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); }

/* ---------------- scenery ---------------- */
#scenery { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #1e1747 0%, #3e2a86 28%, #8e4fa6 52%, #e5837f 72%, #ffcf8f 88%, #ffe3ad 100%); }
.stars { position: absolute; inset: 0 0 50% 0; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 46% 22%, #fff7d6 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 34%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 36%, #fff 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: .35; } }
.sundisc { position: absolute; left: 50%; bottom: 14%; width: 46vmin; height: 46vmin; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0%, #ffd27a 45%, rgba(255, 180, 110, 0) 70%); opacity: .85; }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; }
.hills .h1 { fill: #6b4a8f; } .hills .h2 { fill: #45306e; } .hills .h3 { fill: #2b1f4f; }

/* ---------------- top bar ---------------- */
#topbar { position: sticky; top: 12px; z-index: 30; margin: 12px auto 0; width: min(1180px, calc(100% - 24px));
  display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; border-radius: 999px;
  background: rgba(255, 248, 236, .9); backdrop-filter: blur(10px); box-shadow: 0 8px 24px rgba(20, 10, 50, .3); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 20px; white-space: nowrap; }
.brand b { color: var(--coral); font-weight: 700; }
.mini-ball, .ball { display: inline-block; border-radius: 50%; position: relative; flex: none;
  background: linear-gradient(180deg, var(--rose) 0 45%, var(--ink) 45% 55%, #fff 55%); border: 2px solid var(--ink); }
.mini-ball { width: 22px; height: 22px; }
.mini-ball::after, .ball::after { content: ''; position: absolute; left: 50%; top: 50%; width: 34%; height: 34%; transform: translate(-50%, -50%);
  background: #fff; border: 2px solid var(--ink); border-radius: 50%; }
.nav-links { display: flex; gap: 2px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { text-decoration: none; font-weight: 800; font-size: 14px; padding: 8px 14px; border-radius: 999px; color: var(--ink-soft); white-space: nowrap; transition: background .15s, color .15s; }
.nav-links a:hover { color: var(--ink); background: var(--paper-3); }
.nav-links a.active { background: var(--ink); color: var(--sun); }
.chip { font-family: var(--head); font-weight: 600; background: var(--ink); color: var(--sun); padding: 7px 14px; border-radius: 999px; white-space: nowrap; }

main#view { position: relative; z-index: 1; padding: 26px 20px 60px; max-width: 1180px; margin: 0 auto; }

/* ---------------- home ---------------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; padding: 40px 0 10px; color: #fff; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); padding: 6px 12px; border-radius: 999px; }
.logo { font-family: var(--head); font-weight: 700; line-height: .95; margin: 18px 0 14px; font-size: clamp(48px, 8vw, 96px); letter-spacing: -.02em;
  color: var(--sun); text-shadow: 0 4px 0 var(--sun-deep), 0 10px 0 var(--ink), 0 14px 26px rgba(0, 0, 0, .35); display: flex; align-items: center; flex-wrap: wrap; }
.logo .ball { width: .72em; height: .72em; border-width: .07em; margin: 0 .14em 0 0; box-shadow: 0 .1em 0 var(--ink); }
.logo .ball::after { border-width: .06em; }
.logo .squad { color: #fff; text-shadow: 0 4px 0 #d9c9ff, 0 10px 0 var(--ink), 0 14px 26px rgba(0, 0, 0, .35); }
.tagline { font-size: 19px; line-height: 1.55; max-width: 480px; color: #f5ecff; margin: 0 0 24px; }
.tagline b { color: var(--sun); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.showcase { position: relative; height: 360px; }
.plat { position: absolute; display: flex; flex-direction: column; align-items: center; }
.plat img { width: 96px; height: 96px; object-fit: contain; transform: scale(1.5); transform-origin: bottom; animation: bob 2.6s ease-in-out infinite; position: relative; z-index: 1; }
.plat::after { content: ''; width: 140px; height: 34px; margin-top: -14px; border-radius: 50%;
  background: radial-gradient(ellipse, #b7e39a 0 45%, #6fbf5e 46% 62%, #3f8f47 63% 70%, transparent 71%); }
.plat:nth-child(2) img { animation-delay: -.8s; } .plat:nth-child(3) img { animation-delay: -1.6s; } .plat:nth-child(4) img { animation-delay: -2.1s; }
@keyframes bob { 50% { translate: 0 -8px; } }
.bubble { position: absolute; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 13px; padding: 8px 12px; border-radius: 14px;
  box-shadow: var(--shadow); white-space: nowrap; z-index: 2; }
.bubble::after { content: ''; position: absolute; bottom: -8px; left: 22px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--paper); }

.section-title { color: #fff; font-family: var(--head); font-weight: 600; font-size: 26px; margin: 46px 0 16px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, .4), transparent); }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.mode-card { --c1: #5ccf7e; --c2: #2f8a4c; text-align: left; border: 0; padding: 0; cursor: pointer; border-radius: 24px; overflow: hidden;
  background: var(--paper); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; position: relative; display: flex; flex-direction: column; }
.mode-card:hover:not([disabled]) { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 18px 40px rgba(30, 18, 70, .4); }
.mode-card[disabled] { cursor: default; opacity: .8; }
.mode-card.blue { --c1: #6fb3ff; --c2: #3358d6; } .mode-card.red { --c1: #ff9a6b; --c2: #d63a4f; }
.mode-card.gold { --c1: #ffd36b; --c2: #9b5de5; }
.mode-art { height: 170px; position: relative; overflow: hidden; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.mode-art::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 20deg, rgba(255,255,255,.14) 20deg 40deg, transparent 40deg 60deg);
  background-size: 100% 100%; animation: spin 30s linear infinite; }
.mode-card:hover .mode-art::after { opacity: 1; }
.mode-art::after { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 45%, rgba(255,214,255,.3) 52%, transparent 65%); }
@keyframes spin { to { rotate: 360deg; } }
.mode-art img { position: absolute; bottom: 10px; width: 96px; height: 96px; object-fit: contain; transform: scale(1.35); transform-origin: bottom; z-index: 1;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .18)); }
.mode-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mode-body h3 { margin: 0; font-size: 24px; font-weight: 600; }
.mode-body p { margin: 0; color: var(--ink-soft); line-height: 1.5; font-weight: 700; font-size: 14px; flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 800; background: var(--paper-2); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
.mode-go { margin-top: 6px; align-self: flex-start; font-family: var(--head); font-weight: 600; color: #fff; background: var(--c2); padding: 9px 16px; border-radius: 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: rgba(255, 248, 236, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--radius); padding: 18px; color: #fff; backdrop-filter: blur(4px); }
.step .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: var(--ink); font-family: var(--head); font-weight: 700; margin-bottom: 10px; }
.step h4 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.step p { margin: 0; color: #eadff8; line-height: 1.5; font-size: 14px; }

.continue-card { margin-top: 26px; display: flex; align-items: center; gap: 18px; width: 100%; text-align: left; cursor: pointer; border: 0;
  background: var(--paper); border-radius: var(--radius); padding: 14px 20px; box-shadow: var(--shadow); transition: transform .15s; }
.continue-card:hover { transform: translateY(-3px); }
.cont-team { display: flex; }
.cont-team img { width: 56px; height: 56px; object-fit: contain; margin-right: -10px; }
.cont-text { flex: 1; }
.cont-title { font-family: var(--head); font-weight: 600; font-size: 20px; }
.cont-sub { color: var(--ink-soft); font-weight: 800; font-size: 13px; }
.foot { text-align: center; font-size: 12px; color: rgba(255, 255, 255, .65); margin-top: 60px; line-height: 1.6; }

/* ---------------- buttons ---------------- */
.btn { font-family: var(--head); font-weight: 600; font-size: 16px; padding: 11px 20px; border-radius: 14px; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; color: #fff; background: var(--grape); box-shadow: 0 5px 0 #4b33b8; transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #4b33b8; }
.btn.go { background: var(--leaf); box-shadow: 0 5px 0 var(--leaf-deep); }
.btn.go:active { box-shadow: 0 1px 0 var(--leaf-deep); }
.btn.warn { background: var(--rose); box-shadow: 0 5px 0 #b33152; }
.btn.ice { background: #33b6d8; box-shadow: 0 5px 0 #1f7e99; }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-deep); }
.btn.ghost { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.btn.sm { font-size: 13px; padding: 7px 12px; border-radius: 10px; box-shadow: 0 3px 0 #4b33b8; }
.btn.sm.warn { box-shadow: 0 3px 0 #b33152; }
.btn.on { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-deep); }
.btn.big { font-size: 20px; padding: 14px 28px; }
.flex1 { flex: 1; }

/* ---------------- panels / text ---------------- */
.panel { background: var(--paper); border-radius: 26px; box-shadow: var(--shadow); padding: 28px 30px; margin: 10px auto 30px; }
.panel.center { text-align: center; max-width: 520px; margin-top: 60px; }
.panel h2 { font-size: 34px; font-weight: 600; margin: 0 0 8px; }
.panel h3 { font-size: 20px; font-weight: 600; margin: 26px 0 10px; }
.prose p, .prose li { line-height: 1.7; }
.muted { color: var(--ink-soft); } .small { font-size: 13px; }
.type { display: inline-block; font-size: 11px; font-weight: 800; text-transform: capitalize; padding: 3px 9px; margin-right: 4px; border-radius: 999px;
  background: var(--tc); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.stat-a, .stat-h { font-family: var(--head); font-weight: 600; margin-right: 8px; }
.stat-a { color: #d9601a; } .stat-h { color: #d23a62; }

/* ---------------- game board ---------------- */
#game { position: relative; }
.hud { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.hud-item { font-family: var(--head); font-weight: 600; font-size: 15px; background: var(--paper); padding: 8px 14px; border-radius: 999px; box-shadow: 0 4px 12px rgba(20, 10, 50, .25); }
.hud-item.gold { background: var(--sun); font-size: 18px; box-shadow: 0 4px 0 var(--sun-deep); }
.hud-item.mode { background: var(--ink); color: var(--sun); }
.heart { color: var(--rose); } .heart.lost { color: #d8cbe6; }

.board { background: var(--paper); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); }
.row-label { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 10px; font-weight: 800; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.row-label b { font-family: var(--head); font-weight: 600; font-size: 20px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.team-row { display: flex; gap: 10px; justify-content: center; padding: 18px 14px 14px; border-radius: 22px; position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .18) 0 2px, transparent 3px) 0 0 / 34px 34px,
    linear-gradient(180deg, #9ee3a0, #5fbf6c 70%, #4aa95b); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08); }

.shop-label { margin-top: 22px; margin-bottom: 0; justify-content: flex-start; gap: 6px 14px; flex-wrap: wrap;
  background: repeating-linear-gradient(90deg, var(--rose) 0 34px, #fff 34px 68px); border-radius: 18px 18px 0 0; padding: 12px 16px 18px; position: relative; }
.shop-label::after { content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 14px;
  background: radial-gradient(circle at 17px 0, var(--rose) 16px, transparent 17px) 0 0 / 68px 14px repeat-x,
              radial-gradient(circle at 51px 0, #fff 16px, transparent 17px) 0 0 / 68px 14px repeat-x; }
.shop-label b { background: var(--paper); padding: 2px 12px; border-radius: 10px; }
.shop-label span { background: var(--paper); color: var(--ink); padding: 4px 10px; border-radius: 10px; font-size: 11px; }
.shop-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 22px 14px 14px; border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #e9c99a, #d9ae76); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08); }
.shop-divider { width: 3px; border-radius: 3px; background: rgba(120, 80, 30, .25); margin: 4px 6px; }

.slot { width: 132px; height: 172px; position: relative; cursor: pointer; border-radius: 18px; transition: background .15s, transform .15s, box-shadow .15s; }
.slot:hover { background: rgba(255, 255, 255, .2); }
.team-slot.empty { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.empty-mark { font-family: var(--head); font-size: 34px; color: rgba(255, 255, 255, .7); }
.slot.sel { background: rgba(255, 255, 255, .45); box-shadow: 0 0 0 3px var(--sun), 0 0 0 6px var(--ink); transform: translateY(-4px); }
.slot.over { background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 3px #fff; }
.slot.frozen { background: linear-gradient(180deg, rgba(190, 236, 255, .85), rgba(140, 210, 245, .7)); box-shadow: inset 0 0 0 3px #fff; }
.slot.frozen::before { content: '❄'; position: absolute; top: 6px; right: 8px; z-index: 3; color: #1f7e99; font-size: 18px; }
.slot.bonus::after { content: 'BONUS'; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-family: var(--head); font-weight: 600; font-size: 11px;
  background: var(--grape); color: #fff; padding: 2px 8px; border-radius: 999px; z-index: 4; }
.tier-tag { position: absolute; top: 6px; left: 8px; font-family: var(--head); font-weight: 600; font-size: 11px; background: rgba(42, 33, 69, .8); color: var(--sun); padding: 1px 7px; border-radius: 999px; z-index: 2; }
.item-slot { width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); box-shadow: 0 4px 0 rgba(120, 80, 30, .25); }
.item-slot:hover { background: #fff; }
.item-img { width: 52px; height: 52px; padding: 6px; border-radius: 50%; background: var(--paper-2); }
.item-name { font-weight: 800; font-size: 14px; text-align: center; margin-top: 8px; }
.item-kind { font-size: 11px; font-weight: 800; color: var(--ink-soft); margin-top: 2px; letter-spacing: .08em; }

/* ---------------- unit ---------------- */
.unit { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 8px; }
.sprite-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 100%; min-height: 0; position: relative; }
.sprite-wrap::after { content: ''; width: 84px; height: 18px; margin-top: -8px; border-radius: 50%; background: rgba(30, 50, 20, .25); }
.sprite { max-width: 96px; max-height: 96px; transform: scale(1.35); transform-origin: bottom center; position: relative; z-index: 1; }
.sprite.flip { transform: scale(-1.35, 1.35); }
.unit.ditto .sprite { filter: hue-rotate(250deg) saturate(1.4); }
.badges { display: flex; gap: 6px; margin-top: 4px; }
.b-atk, .b-hp { font-family: var(--head); font-weight: 600; font-size: 15px; min-width: 40px; height: 26px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  border-radius: 999px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.b-atk { background: var(--atk); } .b-hp { background: var(--hp); }
.b-atk::before { content: '⚔'; font-size: 11px; } .b-hp::before { content: '♥'; font-size: 12px; }
.uname { font-weight: 800; font-size: 12px; margin-top: 4px; white-space: nowrap; color: var(--ink); }
.team-row .uname { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.lv { position: absolute; top: 6px; right: 8px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  font-family: var(--head); font-weight: 600; font-size: 12px; }
.lv { color: var(--ink); background: rgba(255, 255, 255, .85); padding: 1px 7px 3px; border-radius: 10px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: #d8cbe6; }
.pips i.on { background: var(--sun-deep); }
.maxlv { color: var(--rose); font-size: 10px; }
.held { position: absolute; top: 34px; left: 6px; width: 30px; height: 30px; z-index: 2; background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.shield-badge { position: absolute; top: 42%; right: 6px; font-family: var(--head); font-weight: 600; font-size: 12px; background: #33b6d8; color: #fff; padding: 2px 7px; border-radius: 999px; z-index: 2; }
.hpbar { width: 78%; height: 7px; background: rgba(42, 33, 69, .25); border-radius: 999px; margin-top: 5px; overflow: hidden; }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #6fe08a, #3fbf5a); border-radius: 999px; transition: width .25s; }
.evo-flash .sprite { animation: evo 1.1s ease; }
@keyframes evo { 0%, 55% { filter: brightness(10) saturate(0); scale: 1.15; } 100% { filter: none; scale: 1; } }

.pop { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); font-family: var(--head); font-weight: 700; font-size: 16px; white-space: nowrap; z-index: 10;
  pointer-events: none; animation: pop 1.1s ease-out forwards; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.pop.dmg { color: #ff6b5b; font-size: 22px; } .pop.heal { color: #7af59a; } .pop.buff { color: var(--sun); } .pop.debuff { color: #c9a8ff; }
.pop.shield { color: #9eeaff; } .pop.se { color: #ffb347; font-size: 13px; top: 6%; } .pop.nve { color: #ddd; font-size: 12px; top: 6%; } .pop.info { color: #fff; font-size: 14px; top: 14%; }
@keyframes pop { 0% { opacity: 0; translate: 0 8px; scale: .7; } 15% { opacity: 1; scale: 1.1; } 30% { scale: 1; } 100% { opacity: 0; translate: 0 -40px; } }

.controls { display: flex; gap: 12px; margin: 18px 0; align-items: center; flex-wrap: wrap; }
.info { background: var(--paper); border-radius: 22px; padding: 16px 20px; min-height: 108px; box-shadow: var(--shadow); }
.info-empty { color: var(--ink-soft); line-height: 1.6; font-weight: 700; }
.info-unit, .info-item { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.info-sprite { width: 84px; height: 84px; object-fit: contain; background: var(--paper-2); border-radius: 18px; }
.info-item img { width: 60px; height: 60px; padding: 8px; background: var(--paper-2); border-radius: 18px; }
.info-main { flex: 1; min-width: 240px; }
.info h4 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.info h4 small { font-family: var(--body); font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-left: 8px; }
.info p { margin: 8px 0 0; line-height: 1.55; }
.held-txt { font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }
.held-txt img { width: 24px; height: 24px; }
.chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chain-mon { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); opacity: .7; }
.chain-mon img { width: 58px; height: 58px; object-fit: contain; }
.chain-mon.cur { opacity: 1; color: var(--coral); }
.arrow { color: var(--ink-soft); font-size: 10px; }

/* ---------------- battle ---------------- */
.speed { display: flex; gap: 6px; }
.arena { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 10px; min-height: 360px; padding: 70px 16px 84px; overflow: hidden;
  border-radius: 28px; box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 50% 46%, #fff3c4 0 60px, rgba(255, 210, 122, .6) 61px 90px, transparent 91px),
    linear-gradient(180deg, #ffb48a 0%, #ffd9a0 38%, #9fdc8f 56%, #66b96a 100%); }
.arena::before { content: ''; position: absolute; left: -5%; right: -5%; top: 40%; height: 70px; border-radius: 50%; background: #7ccb7a; opacity: .8; }
.side { display: flex; gap: 6px; flex: 1; align-items: flex-end; position: relative; z-index: 1; }
.side-p { justify-content: flex-end; } .side-e { justify-content: flex-start; }
.side .unit { width: 108px; height: 168px; flex: none; }
.side .sprite-wrap::after { width: 96px; height: 24px; background: radial-gradient(ellipse, #c6eaa8 0 45%, #7fc56c 46% 70%, transparent 71%); }
.vs { font-family: var(--head); font-weight: 700; font-size: 30px; color: #fff; align-self: center; position: relative; z-index: 1;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.arena-msg { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2; background: var(--paper); border-radius: 16px; padding: 12px 18px;
  font-weight: 800; font-size: 16px; min-height: 46px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.lunge-r .sprite-wrap { animation: lunge-r .35s ease; } .lunge-l .sprite-wrap { animation: lunge-l .35s ease; }
@keyframes lunge-r { 50% { transform: translateX(30px) rotate(6deg); } } @keyframes lunge-l { 50% { transform: translateX(-30px) rotate(-6deg); } }
.unit.hit .sprite { animation: hit .3s steps(2) 2; }
@keyframes hit { 50% { opacity: .25; } }
.battle-log { margin-top: 14px; max-height: 150px; overflow: auto; background: rgba(255, 248, 236, .9); border-radius: 18px; padding: 12px 18px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.battle-log div:first-child { color: var(--ink); }

.overlay { position: fixed; inset: 0; background: rgba(30, 18, 70, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 40; animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.ov-box { background: var(--paper); border-radius: 28px; padding: 30px 40px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); max-width: 92%; animation: rise .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes rise { from { transform: translateY(30px) scale(.9); opacity: 0; } }
.ov-box h2 { font-size: 46px; font-weight: 700; margin: 0 0 8px; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.ov-box.win h2 { color: var(--sun); } .ov-box.loss h2 { color: var(--rose); } .ov-box.draw h2 { color: #cfc6e0; }
.ov-box p { font-weight: 700; color: var(--ink-soft); }
.ov-box h3 { font-size: 22px; color: var(--coral); }
.ov-stats { font-family: var(--head); font-weight: 600; font-size: 18px; display: flex; gap: 20px; justify-content: center; margin: 14px 0 22px; }

/* ---------------- dex / items / hof ---------------- */
.tier-h { display: flex; align-items: baseline; gap: 10px; }
.tier-h small { color: var(--ink-soft); font-family: var(--body); font-size: 13px; font-weight: 800; }
.dex-grid, .item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dex-card, .item-card { background: var(--paper-2); border-radius: 18px; padding: 14px 16px; border: 1px solid var(--line); }
.dex-meta { margin: 8px 0; }
.dex-ab { font-size: 14px; line-height: 1.55; }
.dex-ab > b { font-family: var(--head); font-weight: 600; font-size: 16px; }
.lvtag { font-family: var(--head); font-weight: 600; font-size: 11px; background: var(--ink); color: var(--sun); padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
.item-card { display: flex; gap: 14px; align-items: flex-start; }
.item-card img { width: 52px; height: 52px; padding: 6px; background: #fff; border-radius: 14px; }
.item-card h4 { margin: 0 0 2px; font-size: 18px; font-weight: 600; }
.item-card p { margin: 6px 0 0; }
.stat-row { display: flex; gap: 12px; margin: 14px 0 20px; flex-wrap: wrap; }
.stat-row div { background: var(--paper-2); border-radius: 18px; padding: 14px 22px; display: flex; flex-direction: column; font-weight: 800; font-size: 13px; color: var(--ink-soft); }
.stat-row b { font-family: var(--head); font-size: 32px; font-weight: 600; color: var(--ink); }
.hof-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--paper-2); border-radius: 18px; margin-bottom: 10px; flex-wrap: wrap; border-left: 6px solid var(--grape); }
.hof-row.champ { border-left-color: var(--sun-deep); background: linear-gradient(90deg, #fff1c9, var(--paper-2)); }
.hof-meta { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.hof-meta b { font-family: var(--head); font-size: 18px; font-weight: 600; }
.hof-meta span { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.hof-team { display: flex; gap: 6px; }
.hof-team div { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 800; }
.hof-team img { width: 52px; height: 52px; object-fit: contain; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; font-weight: 700; }
.set-row div { display: flex; gap: 6px; }

#toasts { position: fixed; top: 80px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--paper); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 20px rgba(20, 10, 50, .3);
  border-left: 5px solid var(--grape); transition: opacity .4s, transform .4s; animation: slidein .25s ease; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.toast.bad { border-left-color: var(--rose); } .toast.evo { border-left-color: var(--sun-deep); background: #fff6d8; }
.toast.out { opacity: 0; transform: translateX(20px); }

/* ---------------- responsive ---------------- */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .showcase { height: 260px; }
  .modes, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  #topbar { flex-wrap: wrap; border-radius: 22px; gap: 6px; padding: 8px 10px; }
  .nav-links { order: 3; flex: 1 1 100%; justify-content: flex-start; }
  .continue-card { flex-wrap: wrap; gap: 10px; }
  .cont-text { flex: 1 1 100%; order: -1; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .brand { flex: 1; }
  main#view { padding: 18px 12px 40px; }
  .showcase { transform: scale(.7); transform-origin: top center; height: 200px; }
  .board { padding: 10px; border-radius: 22px; }
  .team-row { flex-wrap: nowrap; gap: 4px; padding: 12px 6px 8px; }
  .team-row .slot { flex: 1 1 0; min-width: 0; width: auto; }
  .slot { width: calc(25% - 8px); height: 128px; }
  .shop-row { gap: 6px; padding: 18px 8px 8px; }
  .item-slot { width: 90px; }
  .sprite { max-width: 100%; transform: scale(1); } .sprite.flip { transform: scale(-1, 1); }
  .sprite-wrap::after { width: 52px; }
  .b-atk, .b-hp { font-size: 11px; min-width: 0; height: 20px; padding: 0 5px; }
  .b-atk::before, .b-hp::before { display: none; }
  .badges { gap: 2px; }
  .lv { font-size: 10px; right: 2px; top: 2px; }
  .held { width: 22px; height: 22px; top: 24px; left: 2px; }
  .uname { display: none; }
  .arena { padding: 56px 4px 80px; gap: 2px; min-height: 280px; }
  .side { gap: 0; }
  .side .unit { flex: 1 1 0; min-width: 0; width: auto; height: 120px; }
  .side .sprite-wrap::after { width: 44px; }
  .vs { font-size: 16px; }
  .panel { padding: 20px 16px; }
  .dex-grid, .item-grid { grid-template-columns: 1fr; }
}

/* larger fighters on desktop */
@media (min-width: 701px) {
  .side .sprite { transform: scale(1.6); }
  .side .sprite.flip { transform: scale(-1.6, 1.6); }
  .arena { min-height: 400px; }
}

/* ---------------- sign in ---------------- */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-mons { display: flex; gap: 10px; margin-bottom: -18px; position: relative; z-index: 2; }
.auth-mons img { width: 80px; height: 80px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.auth-mons img:nth-child(2) { animation-delay: -.9s; } .auth-mons img:nth-child(3) { animation-delay: -1.7s; transform: scaleX(-1); }
.auth-card { width: min(420px, 100%); background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); padding: 30px 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.auth-logo { font-size: 44px; margin: 0; justify-content: center; text-shadow: 0 3px 0 var(--sun-deep), 0 7px 0 var(--ink); }
.auth-logo .squad { text-shadow: 0 3px 0 #d9c9ff, 0 7px 0 var(--ink); color: var(--grape); }
.auth-card p { margin: 0; text-align: center; font-weight: 700; }
.auth-card label, .form-row label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 13px; color: var(--ink-soft); }
.auth-card input, .form-row input, .field { font: inherit; font-weight: 700; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; }
.auth-card input:focus, .form-row input:focus, .field:focus { border-color: var(--grape); box-shadow: 0 0 0 4px rgba(123, 92, 255, .18); }
.auth-card .btn { justify-content: center; margin-top: 4px; }
.auth-card .btn:disabled { opacity: .6; cursor: wait; }
.auth-error { color: #c4264e; font-weight: 800; min-height: 1.2em; text-align: center; }

/* ---------------- account / admin ---------------- */
.user-chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.form-row label { flex: 1 1 180px; }
.form-msg { font-weight: 800; min-height: 1.2em; margin: 4px 0; }
.form-msg.ok { color: var(--leaf-deep); } .form-msg.err { color: #c4264e; }
.notice { background: #fff1c9; border-left: 6px solid var(--sun-deep); border-radius: 14px; padding: 12px 16px; font-weight: 800; margin-bottom: 14px; }
.user-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.user-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 0 12px; }
.user-table td { background: var(--paper-2); padding: 10px 12px; font-weight: 700; }
.user-table td:first-child { border-radius: 14px 0 0 14px; } .user-table td:last-child { border-radius: 0 14px 14px 0; text-align: right; white-space: nowrap; }
.user-table .btn.sm { margin-left: 4px; }
.badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--sun); margin-left: 6px; }
.badge.warn { background: #ffe0b3; color: #8a4a00; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.lb-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.lb-table td, .lb-table th { padding: 10px 12px; text-align: left; }
.lb-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.lb-table td { background: var(--paper-2); font-weight: 800; }
.lb-table td:first-child { border-radius: 14px 0 0 14px; width: 48px; font-family: var(--head); font-size: 20px; }
.lb-table td:last-child { border-radius: 0 14px 14px 0; }
.lb-table tr.me td { background: #fff1c9; }
.lb-team img { width: 40px; height: 40px; object-fit: contain; }
@media (max-width: 700px) {
  .user-table thead, .lb-table .hide-sm { display: none; }
  .user-table tr { display: flex; flex-wrap: wrap; background: var(--paper-2); border-radius: 14px; margin-bottom: 8px; }
  .user-table td, .user-table td:first-child, .user-table td:last-child { background: none; border-radius: 0; }
  .user-table td:last-child { width: 100%; text-align: left; }
}

/* ---------------- Stat League ---------------- */
.b-spe { font-family: var(--head); font-weight: 600; font-size: 13px; min-width: 34px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; color: #fff; background: #33a1d8; box-shadow: 0 3px 0 rgba(0, 0, 0, .18); text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.b-spe::before { content: '»'; font-size: 12px; }
.iv-tag { position: absolute; left: 8px; bottom: 58px; z-index: 2; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--head); font-weight: 700; font-size: 14px; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.iv-tag.inline { position: static; display: inline-grid; vertical-align: middle; margin-left: 8px; }
.g-S { background: linear-gradient(135deg, #ffcf5c, #ff7a59); } .g-A { background: #7b5cff; } .g-B { background: #3d8bfd; } .g-C { background: #4fb36b; } .g-D { background: #9a92ad; }
.stat-card { background: var(--paper-2); border-radius: 16px; padding: 10px 14px; min-width: 270px; }
.stat-head { font-size: 13px; margin-bottom: 6px; }
.stat-head .up, .stat-table tr.up th { color: #d9601a; } .stat-head .down, .stat-table tr.down th { color: #3d8bfd; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 800; }
.stat-table th { text-align: left; padding: 2px 8px 2px 0; white-space: nowrap; width: 70px; }
.stat-table td { padding: 2px 4px; }
.stat-table td.bar { width: 120px; position: relative; }
.stat-table td.bar i { display: block; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #ffcf5c, #ff7a59); }
.stat-table td.bar span { position: absolute; left: 10px; top: 2px; font-size: 11px; }
.stat-table td.iv { text-align: right; color: var(--ink-soft); width: 40px; }
.stat-table td.iv.best { color: var(--leaf-deep); } .stat-table td.iv.bad { color: #c4264e; }
.stat-table td.val { text-align: right; font-family: var(--head); font-size: 15px; width: 44px; }
@media (max-width: 700px) {
  .b-spe { font-size: 11px; min-width: 0; height: 20px; padding: 0 5px; } .b-spe::before { display: none; }
  .iv-tag { width: 18px; height: 18px; font-size: 11px; bottom: 34px; left: 2px; border-radius: 6px; }
}
.side .badges { gap: 3px; }
.side .b-atk, .side .b-hp, .side .b-spe { font-size: 12px; min-width: 0; height: 22px; padding: 0 6px; }
.side .b-atk::before, .side .b-hp::before, .side .b-spe::before { font-size: 9px; }
.slot .b-atk, .slot .b-hp, .slot .b-spe { min-width: 0; }

/* ---------------- prices, interest, bosses, shiny, mega ---------------- */
.price { position: absolute; top: 6px; left: 42px; z-index: 2; font-family: var(--head); font-weight: 700; font-size: 12px; color: var(--ink);
  background: var(--sun); padding: 1px 8px; border-radius: 999px; box-shadow: 0 2px 0 var(--sun-deep); }
.item-slot .price { left: 8px; }
.price.short { background: #e3d7ea; box-shadow: 0 2px 0 #b9a9c6; color: #8a7d99; }
.hud-item.gold small { font-size: 11px; margin-left: 6px; opacity: .7; }
.hud-item.bracelet { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(135deg, #ffe08a, #ff8fb1); }
.hud-item.bracelet img { width: 22px; height: 22px; image-rendering: pixelated; }
.hud-item.boss { background: var(--ink); color: #ffd36b; }
.boss-warn { margin: 0 0 14px; padding: 10px 16px; border-radius: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, #6b3fd6, #d6406b); box-shadow: 0 4px 0 rgba(42, 33, 69, .35); animation: bosspulse 2s ease-in-out infinite; }
@keyframes bosspulse { 50% { filter: brightness(1.15); } }
.btn.go.boss { background: linear-gradient(135deg, #8b5cf6, #d6406b); box-shadow: 0 5px 0 #4b2a8a; color: #fff; }
.btn.mega { background: linear-gradient(135deg, #ffe08a, #ff8fb1); }
.item-slot.key-item { background: linear-gradient(160deg, #fff4cf, #ffd6e5); box-shadow: 0 0 0 3px #ff8fb1, 0 4px 0 rgba(120, 80, 30, .25); }
.item-slot.key-item .item-img { image-rendering: pixelated; }
.reward { font-weight: 800; color: var(--grape); }

.boss-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 4; font-family: var(--head); font-weight: 700; font-size: 10px; letter-spacing: .08em;
  color: #ffd36b; background: var(--ink); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.unit.is-boss .sprite { transform: scale(1.7); filter: drop-shadow(0 0 10px rgba(255, 211, 107, .8)); }
.unit.is-boss .sprite.flip { transform: scale(-1.7, 1.7); }
.unit.is-shiny .sprite { filter: drop-shadow(0 0 6px rgba(255, 236, 140, .95)); }
.unit.is-shiny .sprite-wrap::before { content: '✦'; position: absolute; top: 4px; left: 14px; z-index: 3; color: #ffe066; font-size: 16px;
  text-shadow: 0 0 6px #fff; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.6) rotate(40deg); } }
.shiny-lv { color: #d99a00; }
.unit.is-mega .sprite { filter: drop-shadow(0 0 8px rgba(255, 120, 200, .9)); }
.mega-tag { position: absolute; top: 34px; right: 8px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--head); font-weight: 700; font-size: 12px; color: #fff; background: conic-gradient(#ff5fa2, #ffd36b, #5fd3ff, #b67bff, #ff5fa2);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25); text-shadow: 0 1px 1px rgba(0, 0, 0, .5); }
.info-sprite.shiny { background: linear-gradient(135deg, #fff4cf, #ffe0ef); }
.arena.boss-arena { background: linear-gradient(180deg, #2a2145 0%, #5b3a8f 55%, #8c4a7a 100%); }
.arena.boss-arena::before { background: #4a3a72; }
.dex-card.boss { background: linear-gradient(160deg, var(--paper), #efe3ff); }
@media (max-width: 700px) {
  .price { left: 4px; top: 26px; font-size: 10px; padding: 0 5px; }
  .item-slot .price { left: 4px; top: 4px; }
  .unit.is-boss .sprite { transform: scale(1.2); } .unit.is-boss .sprite.flip { transform: scale(-1.2, 1.2); }
  .mega-tag { top: 24px; right: 2px; width: 18px; height: 18px; font-size: 10px; }
  .boss-tag { font-size: 8px; padding: 1px 5px; }
}

/* ---------------- buff highlights ---------------- */
.slot.buffed { animation: buffglow 1.6s ease-out; }
@keyframes buffglow {
  0%, 35% { background: rgba(255, 224, 102, .55); box-shadow: 0 0 0 4px #ffd84d, 0 0 24px 6px rgba(255, 216, 77, .9); }
  100% { background: transparent; box-shadow: none; }
}
.slot.caster { animation: castglow 1.2s ease-out; }
@keyframes castglow { 0%, 30% { box-shadow: 0 0 0 4px #b67bff, 0 0 20px 4px rgba(182, 123, 255, .8); } 100% { box-shadow: none; } }
.arena .unit.buffed .sprite-wrap::after { background: radial-gradient(closest-side, rgba(255, 224, 102, .95), rgba(255, 224, 102, 0)); animation: platglow .7s ease-out; }
.arena .unit.debuffed .sprite-wrap::after { background: radial-gradient(closest-side, rgba(170, 120, 255, .95), rgba(170, 120, 255, 0)); animation: platglow .7s ease-out; }
.arena .unit.buffed .badges, .arena .unit.debuffed .badges { animation: badgepop .5s ease-out; }
@keyframes platglow { 0% { transform: scale(.6); } 100% { transform: scale(1.15); } }
@keyframes badgepop { 40% { transform: scale(1.25); } }
.toast .hl { color: #ffd84d; font-weight: 800; }

/* ---------------- type synergies ---------------- */
.synergies { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.synergies.empty { color: var(--ink-soft); font-weight: 700; font-size: 13px; padding: 6px 4px; }
.syn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 12px;
  padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); box-shadow: inset 0 0 0 2px rgba(42, 33, 69, .12); }
.syn .syn-name { text-transform: uppercase; letter-spacing: .04em; }
.syn::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--tc); opacity: .5; }
.syn.on { background: var(--tc); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.syn.on::before { background: #fff; opacity: 1; }
.syn-count { font-family: var(--head); font-weight: 600; }
.syn-pips { display: inline-flex; gap: 3px; }
.syn-pips i { width: 6px; height: 6px; border-radius: 50%; background: rgba(42, 33, 69, .2); }
.syn.on .syn-pips i { background: rgba(255, 255, 255, .4); }
.syn-pips i.on, .syn.on .syn-pips i.on { background: #ffd84d; box-shadow: 0 0 4px #ffd84d; }
.info-trait { display: flex; gap: 16px; align-items: flex-start; }
.info-trait p { margin: 4px 0; }
.info-trait .trait-on { font-weight: 800; color: var(--ink); }
.type.big { font-size: 14px; padding: 8px 14px; text-transform: uppercase; }

/* ---------------- interface scale ---------------- */
/* Big monitors get a bigger interface; Settings → Interface size can override (sets --ui inline). */
:root { --ui: 1; }
@media (min-width: 1400px) { :root { --ui: 1.12; } }
@media (min-width: 1650px) { :root { --ui: 1.25; } }
@media (min-width: 1900px) { :root { --ui: 1.4; } }
@media (min-width: 2400px) { :root { --ui: 1.7; } }
#topbar, main#view, #toasts { zoom: var(--ui); }

/* ---------------- music button + update banner ---------------- */
.chip.music-btn { border: 0; cursor: pointer; font-size: 15px; padding: 7px 12px; }
.chip.music-btn.off { opacity: .55; }
.music-ctl { display: flex; gap: 4px; }
.chip.music-btn.skip { padding: 7px 10px; font-size: 13px; }
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center;
  background: var(--ink); color: #fff; padding: 10px 12px 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.set-row input[type=range] { width: 180px; accent-color: var(--coral); }

/* ---------------- play layout: bag | game | info ---------------- */
main#view { container-type: inline-size; }
main#view:has(#game) { max-width: 1480px; }
.play-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "bag" "main" "info"; }
.play-main { grid-area: main; min-width: 0; }
.play-grid > .info { grid-area: info; }
.bag { grid-area: bag; background: var(--paper); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.bag-title { font-family: var(--head); font-weight: 600; color: var(--ink); white-space: nowrap; }
.bag-slot { flex: 1; min-width: 0; height: 64px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 16px; cursor: pointer;
  background: var(--paper-2); box-shadow: inset 0 0 0 2px rgba(120, 80, 30, .18); transition: background .15s, transform .15s, box-shadow .15s; }
.bag-slot:hover { background: #fff; }
.bag-slot img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.bag-slot span { font-weight: 800; font-size: 13px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.bag-slot.empty { justify-content: center; border: 2px dashed rgba(120, 80, 30, .3); box-shadow: none; background: transparent; }
.bag-slot.empty i { font-style: normal; font-size: 24px; color: var(--ink-soft); opacity: .6; }
.bag-slot.sel { background: #fff; box-shadow: 0 0 0 3px var(--sun), 0 0 0 6px var(--ink); transform: translateY(-2px); }
.bag-slot.over { background: #fff; box-shadow: inset 0 0 0 3px var(--sun); }
.bag-help { display: none; font-size: 12px; color: var(--ink-soft); font-weight: 700; line-height: 1.4; }
@container (min-width: 1200px) {
  .play-grid { grid-template-columns: 124px minmax(0, 1fr) 270px; grid-template-areas: "bag main info"; align-items: start; }
  .bag { flex-direction: column; align-items: stretch; position: sticky; top: 90px; }
  .bag-title { text-align: center; }
  .bag-slot { flex: none; height: auto; min-height: 92px; flex-direction: column; justify-content: center; text-align: center; padding: 8px 6px; }
  .bag-slot span { font-size: 12px; }
  .bag-help { display: block; }
  .play-grid > .info { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
  .play-grid .info-unit, .play-grid .info-item { flex-direction: column; align-items: stretch; }
  .play-grid .info-main { min-width: 0; }
  .play-grid .info-sprite { align-self: center; }
  .play-grid .info-item img { align-self: center; }
}
.play-main .controls { margin-bottom: 0; }
@media (max-width: 700px) { .bag-title { display: none; } .bag { padding: 8px; gap: 6px; } .bag-slot { height: 54px; padding: 4px 6px; } .bag-slot img { width: 32px; height: 32px; } .bag-slot span { font-size: 11px; } }

/* ---------------- chat ---------------- */
#chat { position: fixed; right: 18px; bottom: 18px; z-index: 70; zoom: var(--ui); }
.chat-fab { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; font-size: 26px; background: var(--ink); color: var(--sun);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35); transition: transform .15s; }
.chat-fab:hover { transform: scale(1.06); }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--coral, #ff6b5b); color: #fff;
  font: 700 12px/22px var(--head); box-shadow: 0 0 0 3px var(--paper); }
.chat-panel { position: absolute; right: 0; bottom: 70px; width: 340px; max-width: calc(100vw - 36px); height: 460px; max-height: calc(100vh - 120px); display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px; box-shadow: var(--shadow), 0 20px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--ink); color: var(--sun); font-family: var(--head); font-weight: 600; }
.chat-head .flex1 { flex: 1; }
.chat-head button { border: 0; background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { margin: auto; color: var(--ink-soft); font-weight: 700; text-align: center; }
.chat-msg { max-width: 85%; align-self: flex-start; background: #fff; border-radius: 14px 14px 14px 4px; padding: 6px 10px; box-shadow: 0 2px 0 rgba(120, 80, 30, .15); }
.chat-msg.mine { align-self: flex-end; background: #ffe9a8; border-radius: 14px 14px 4px 14px; }
.chat-msg .who { display: flex; gap: 6px; align-items: baseline; font-size: 11px; color: var(--ink-soft); font-weight: 800; }
.chat-msg .who b { color: var(--ink); font-size: 12px; }
.chat-msg .who button { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--ink-soft); font-size: 11px; padding: 0; }
.chat-msg .txt { font-weight: 700; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 2px solid var(--paper-3); }
.chat-form input { flex: 1; min-width: 0; border: 2px solid var(--paper-3); border-radius: 999px; padding: 8px 12px; font: 700 14px var(--body, inherit); background: #fff; color: var(--ink); }
.chat-form input:focus { outline: none; border-color: var(--ink); }
.chat-form button { border: 0; border-radius: 999px; padding: 0 14px; background: var(--ink); color: var(--sun); font-family: var(--head); font-weight: 600; cursor: pointer; }
.update-bar { bottom: 90px; }
