:root {
  --bg: #0d1220;
  --bg2: #151c30;
  --panel: rgba(20, 26, 44, 0.86);
  --panel-solid: #161d32;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f8;
  --muted: #98a2bd;
  --accent: #ffcb05;
  --accent-2: #ff9f1c;
  --blue: #3d7dff;
  --hp: #3ee07a;
  --hp-low: #ff4d5e;
  --xp: #4fb3ff;
  --danger: #ff4d5e;
  --gold: #ffd54a;
  --silver: #cfd8e6;
  --bronze: #e39a5b;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text); font-family: var(--font);
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  transition: background .2s;
}
#vignette.hurt { background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 50, 0.5) 100%); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-strong); cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  padding: 11px 20px; border-radius: 12px; font-size: 16px; font-weight: 600;
  transition: transform .12s, background .12s, border-color .12s, box-shadow .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible, .choice:focus-visible, .starter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(180deg, #ffd84a, #ffb000); color: #2b1d00; border-color: #ffe27a;
  box-shadow: 0 6px 0 #b07800, 0 10px 24px rgba(255, 176, 0, 0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffe066, #ffbb1a); }
.btn-primary:active { box-shadow: 0 2px 0 #b07800; transform: translateY(4px); }
.btn-danger { background: rgba(255, 77, 94, 0.15); border-color: rgba(255, 77, 94, 0.5); color: #ffb3bb; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.btn-big { font-size: 22px; padding: 14px 28px; }
.icon-btn {
  pointer-events: auto; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(10, 14, 26, 0.7); color: var(--text); font-size: 13px;
}

/* ---------- Screens & panels ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 16px; padding-top: max(16px, env(safe-area-inset-top));
  background: radial-gradient(ellipse at 50% -10%, rgba(61, 125, 255, 0.25), transparent 60%), rgba(8, 11, 22, 0.55);
  touch-action: pan-y;
}
#select, #board, #howto, #settings { justify-content: flex-start; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 20px; width: 100%; max-width: 760px; margin: auto 0;
}
.panel.wide { max-width: 1040px; }
.panel.narrow { max-width: 440px; }
.panel h2 { margin: 0; font-size: 26px; font-weight: 700; }
.panel h3 { margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.panel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 16px; gap: 8px; }
.panel-head > :first-child { justify-self: start; }
.panel-head > :last-child { justify-self: end; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ---------- Title ---------- */
#title { justify-content: space-between; }
.topbar { width: 100%; max-width: 1100px; display: flex; justify-content: space-between; align-items: center; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; opacity: .85; }
.brand:hover { opacity: 1; }
.account { display: flex; align-items: center; gap: 10px; }
.account img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--accent); }
.account .who { font-weight: 600; }
.account .btn { padding: 8px 14px; font-size: 14px; }
.btn-discord { background: #5865f2; border-color: #7983ff; color: #fff; }
.btn-discord:hover { background: #6b77ff; }
.title-main { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px 0; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .9; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .35)); animation: float 4s ease-in-out infinite; }
.logo-top { font-size: clamp(40px, 9vw, 84px); font-weight: 700; color: var(--accent); -webkit-text-stroke: 3px #2a5bd7; paint-order: stroke fill; letter-spacing: .04em; }
.logo-bottom {
  font-size: clamp(30px, 7vw, 64px); font-weight: 700; letter-spacing: .14em;
  background: linear-gradient(180deg, #fff, #ffb3a1 55%, #ff5e3a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tagline { color: var(--muted); max-width: 460px; margin: 0; font-size: 17px; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: min(320px, 100%); }
.mystats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mystats .pill { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.mystats .pill b { color: var(--text); }
.parade { display: flex; justify-content: center; gap: 4px; width: 100%; overflow: hidden; min-height: 96px; }
.parade canvas { width: 96px; height: 96px; }

/* ---------- Starter select ---------- */
.select-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.starter {
  position: relative; cursor: pointer; text-align: center; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 8px 12px;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.starter:hover { transform: translateY(-3px); }
.starter.active { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 35%, transparent), 0 10px 30px color-mix(in srgb, var(--tc) 30%, transparent); }
.starter canvas { width: 96px; height: 96px; display: block; margin: 0 auto; }
.starter .name { font-weight: 700; font-size: 17px; }
.starter .best { font-size: 12px; color: var(--muted); }
.type-badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--tc); color: #111; }
.starter-info { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.starter-info .art { width: 100%; max-width: 200px; aspect-ratio: 1; object-fit: contain; align-self: center; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.starter-info h3 { margin: 0; color: var(--text); font-size: 24px; letter-spacing: 0; text-transform: none; }
.evo-line { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.evo-line canvas { width: 56px; height: 56px; }
.statbar { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.statbar .track { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; }
.statbar .track div { height: 100%; background: var(--tc); border-radius: 4px; }
.startmove { font-size: 14px; background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 8px 10px; border-left: 4px solid var(--tc); }

/* ---------- Leaderboard ---------- */
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, .3); padding: 4px; border-radius: 12px; width: fit-content; margin: 0 auto 12px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 15px; }
.tab.active { background: var(--accent); color: #2b1d00; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.chip { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04); color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.active { color: #111; background: var(--tc, var(--accent)); border-color: transparent; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin-bottom: 14px; }
.podium:empty { display: none; }
.pod { text-align: center; border-radius: var(--radius); padding: 12px 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); position: relative; }
.pod.p1 { border-color: var(--gold); background: linear-gradient(180deg, rgba(255, 213, 74, .18), rgba(255, 213, 74, .03)); padding-top: 18px; }
.pod.p2 { border-color: var(--silver); }
.pod.p3 { border-color: var(--bronze); }
.pod img.av { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--pc); }
.pod.p1 img.av { width: 68px; height: 68px; }
.pod .medal { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 22px; }
.pod .pn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pt { font-size: 22px; font-weight: 700; color: var(--accent); }
.pod .pk { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
.lb th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; background: rgba(0, 0, 0, .25); }
.lb td { padding: 8px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.lb tr.me td { background: rgba(255, 203, 5, .1); }
.lb .rank { font-weight: 700; width: 40px; color: var(--muted); }
.lb .trainer { display: flex; align-items: center; gap: 10px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.lb .trainer img { width: 28px; height: 28px; border-radius: 50%; }
.lb .partner img { width: 36px; height: 36px; image-rendering: pixelated; vertical-align: middle; margin: -6px 0; }
.lb .time { font-weight: 700; }
.lb .won { color: var(--accent); font-size: 12px; margin-left: 4px; }
.lb tr.lb-gap td { text-align: center; color: var(--muted); padding: 2px; border-top: none; }
.lb-filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lb .empty { text-align: center; padding: 30px; color: var(--muted); }
.note { color: var(--muted); font-size: 13px; text-align: center; margin: 12px 0 0; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- How to / settings ---------- */
.howto { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.how-card { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.how-card b { color: var(--accent); }
.how-card span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.settings-body { display: flex; flex-direction: column; gap: 12px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.setting input[type=range] { width: 160px; accent-color: var(--accent); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .15); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; padding: max(8px, env(safe-area-inset-top)) 12px 12px; display: flex; flex-direction: column; }
.xp-wrap { position: relative; height: 16px; background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; overflow: hidden; }
#xpfill { height: 100%; width: 0; background: linear-gradient(90deg, #2f8dff, #6fd3ff); box-shadow: 0 0 12px #4fb3ff; transition: width .15s; }
#lvlbadge { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 8px; gap: 8px; }
.hud-player { display: flex; align-items: center; gap: 8px; background: rgba(10, 14, 26, .7); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px 6px 6px; }
.portrait { width: 52px; height: 52px; border-radius: 12px; background: radial-gradient(circle, rgba(255,255,255,.15), rgba(255,255,255,.02)); overflow: hidden; display: grid; place-items: center; }
.portrait canvas { width: 72px; height: 72px; }
#pname { font-weight: 700; font-size: 14px; }
.hp-wrap { position: relative; width: 160px; height: 14px; background: rgba(0, 0, 0, .6); border-radius: 7px; overflow: hidden; margin-top: 4px; }
#hpghost { position: absolute; inset: 0 auto 0 0; background: #fff6; transition: width .6s ease-out .15s; }
#hpfill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #5cf596, #22b85a); transition: width .1s; }
#hpfill.low { background: linear-gradient(180deg, #ff7381, #d92c3c); animation: pulse .6s infinite alternate; }
@keyframes pulse { to { filter: brightness(1.4); } }
#hptext { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.hud-center { text-align: center; }
#timer { font-size: 30px; font-weight: 700; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); font-variant-numeric: tabular-nums; }
#nextboss { font-size: 12px; color: var(--muted); text-shadow: 0 1px 3px #000; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.stat-pill { background: rgba(10, 14, 26, .7); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 700; display: flex; gap: 6px; font-variant-numeric: tabular-nums; }
#bossbar { align-self: center; width: min(520px, 90%); margin-top: 8px; text-align: center; animation: drop .4s ease-out; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.boss-name { font-weight: 700; font-size: 15px; color: #ffb3b3; text-shadow: 0 1px 3px #000; letter-spacing: .1em; text-transform: uppercase; }
.boss-track { height: 12px; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 90, 90, .5); border-radius: 6px; overflow: hidden; margin-top: 3px; }
#bossfill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3b4e, #ff8a4c); transition: width .15s; }
.hud-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding-bottom: env(safe-area-inset-bottom); }
#moveslots, #itemslots { display: flex; gap: 6px; flex-wrap: wrap; }
#itemslots { justify-content: flex-end; }
.slot { position: relative; width: 48px; height: 48px; border-radius: 12px; background: rgba(10, 14, 26, .75); border: 2px solid var(--tc, var(--line-strong)); display: grid; place-items: center; overflow: hidden; }
.slot .abbr { font-weight: 700; font-size: 13px; z-index: 1; text-shadow: 0 1px 2px #000; }
.slot .lv { position: absolute; bottom: 1px; right: 4px; font-size: 10px; font-weight: 700; z-index: 1; }
.slot .cd { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); transform-origin: bottom; }
.slot.item { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.slot.item .lv { font-size: 9px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 16, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); overflow-y: auto; touch-action: pan-y; }
.levelup-inner { text-align: center; width: 100%; max-width: 900px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.levelup-title { font-size: clamp(36px, 7vw, 60px); font-weight: 700; color: var(--accent); -webkit-text-stroke: 2px #2a5bd7; paint-order: stroke fill; letter-spacing: .06em; }
.levelup-sub { color: var(--muted); margin-bottom: 16px; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.choice {
  position: relative; cursor: pointer; color: var(--text); text-align: left;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 22%, #161d32), #131a2c);
  border: 2px solid color-mix(in srgb, var(--tc) 60%, transparent); border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; min-height: 190px;
  transition: transform .12s, box-shadow .12s; animation: deal .3s ease-out backwards;
}
.choice:nth-child(2) { animation-delay: .05s; }
.choice:nth-child(3) { animation-delay: .1s; }
@keyframes deal { from { transform: translateY(30px); opacity: 0; } }
.choice:hover, .choice:focus-visible { transform: translateY(-6px); box-shadow: 0 14px 30px color-mix(in srgb, var(--tc) 40%, transparent); }
.choice .key { position: absolute; top: 10px; right: 12px; font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.choice .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--tc); display: grid; place-items: center; font-weight: 700; color: #111; font-size: 18px; }
.choice .cname { font-size: 20px; font-weight: 700; }
.choice .ctag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tc); }
.choice .ctag.new { color: var(--accent); }
.choice .cdesc { font-size: 14px; color: var(--muted); line-height: 1.35; }
.choice .pips { display: flex; gap: 3px; margin-top: auto; }
.choice .pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.choice .pips i.on { background: var(--tc); }
.choice .pips i.next { background: #fff; animation: pulse .5s infinite alternate; }
.levelup-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; }
.pause-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.pause-stats div, .go-stats div { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.pause-stats b, .go-stats b { display: block; font-size: 22px; }
.pause-stats span, .go-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.go-panel { animation: pop .3s ease-out; }
.go-hero { display: flex; align-items: center; gap: 16px; justify-content: center; text-align: left; }
.go-hero canvas { width: 120px; height: 120px; }
.go-hero h2 { font-size: 36px; }
.go-hero h2.win { color: var(--accent); }
.go-hero p { margin: 4px 0 0; }
.go-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.go-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.dmg-bars { display: flex; flex-direction: column; gap: 8px; }
.dmg-row { display: grid; grid-template-columns: 110px 1fr 64px; gap: 8px; align-items: center; font-size: 14px; }
.dmg-row .track { height: 10px; background: rgba(255, 255, 255, .08); border-radius: 5px; overflow: hidden; }
.dmg-row .track div { height: 100%; background: var(--tc); border-radius: 5px; animation: grow .8s ease-out backwards; }
@keyframes grow { from { width: 0 !important; } }
.dmg-row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.submit-box { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.submit-box .rank { font-size: 42px; font-weight: 700; color: var(--accent); line-height: 1; }
.go-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Banner & toasts ---------- */
.banner {
  position: fixed; top: 26%; left: 50%; transform: translateX(-50%); pointer-events: none; text-align: center;
  font-size: clamp(26px, 5vw, 46px); font-weight: 700; white-space: nowrap; letter-spacing: .04em;
  color: #fff; -webkit-text-stroke: 2px rgba(0, 0, 0, .6); paint-order: stroke fill; text-shadow: 0 4px 20px rgba(0, 0, 0, .6);
  animation: banner 2.4s ease-out forwards;
}
.banner small { display: block; font-size: .45em; color: var(--accent); letter-spacing: .2em; }
@keyframes banner { 0% { transform: translateX(-50%) scale(1.6); opacity: 0; } 12% { transform: translateX(-50%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.toasts { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; animation: toast 2.6s ease-out forwards; box-shadow: var(--shadow); }
@keyframes toast { 0% { transform: translateY(10px); opacity: 0; } 10%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .select-layout { grid-template-columns: 1fr; }
  .starter-info .art { max-width: 140px; }
  .go-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .panel { padding: 14px; border-radius: 18px; }
  .panel h2 { font-size: 21px; }
  .starter-grid { grid-template-columns: repeat(2, 1fr); }
  .choice-row { grid-template-columns: 1fr; }
  .choice { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .choice .cdesc { flex-basis: 100%; }
  .choice .pips { margin-top: 0; }
  .howto { grid-template-columns: 1fr; }
  .go-stats { grid-template-columns: repeat(2, 1fr); }
  .go-hero h2 { font-size: 28px; }
  .hide-sm { display: none; }
  .hp-wrap { width: 110px; }
  #timer { font-size: 24px; }
  .slot { width: 40px; height: 40px; }
  .slot.item { width: 30px; height: 30px; font-size: 15px; }
  .podium .pt { font-size: 18px; }
  .lb td, .lb th { padding: 8px; }
}
@media (max-width: 460px) {
  #hud { padding-left: 8px; padding-right: 8px; }
  .hud-player { padding: 4px 8px 4px 4px; gap: 6px; }
  .portrait { width: 38px; height: 38px; }
  .portrait canvas { width: 56px; height: 56px; }
  #pname { font-size: 12px; }
  .hp-wrap { width: 84px; }
  #timer { font-size: 20px; }
  #nextboss { font-size: 10px; }
  .stat-pill { padding: 6px 8px; font-size: 13px; }
  .icon-btn { width: 34px; height: 34px; }
  .hud-right { flex-direction: column-reverse; align-items: flex-end; gap: 4px; }
  .panel-head h2 { font-size: 18px; text-align: center; }
  .tab { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .pod { min-width: 0; padding: 10px 4px; }
  .pod img.av { width: 42px; height: 42px; }
  .pod.p1 img.av { width: 52px; height: 52px; }
  .lb .partner img { width: 28px; height: 28px; }
  .lb td, .lb th { padding: 7px 6px; font-size: 13px; }
  .lb .trainer { max-width: 120px; gap: 6px; }
}
/* ================= Wild Rush additions ================= */
.logo-top { font-size: clamp(48px, 11vw, 100px); }
.logo-bottom { font-size: clamp(40px, 9vw, 84px); letter-spacing: .2em; margin-right: -.2em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.wallet { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 213, 74, .12); border: 1px solid rgba(255, 213, 74, .4); color: var(--gold); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wallet span { opacity: .85; }
.wallet.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.15); } }
.menu-buttons { width: min(420px, 100%); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-grid .btn { font-size: 15px; padding: 11px 10px; min-width: 0; }
.screen { overflow-x: hidden; }
@media (max-width: 400px) {
  .menu-grid .btn { font-size: 13px; padding: 10px 6px; gap: 5px; }
  .menu-grid .badge-count { display: none; }
}
.btn-ico { width: 30px; height: 30px; margin: -8px 0; image-rendering: pixelated; }
.badge-count { font-size: 11px; background: rgba(255, 255, 255, .12); padding: 1px 7px; border-radius: 999px; color: var(--muted); }
.unlock-count { color: var(--muted); font-size: 14px; font-weight: 600; }

/* Partner select */
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.search { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-size: 15px; }
.search:focus { outline: 2px solid var(--accent); }
.chips.small { justify-content: flex-start; margin: 0; }
.chips.small .chip { padding: 3px 10px; font-size: 12px; text-transform: capitalize; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 60vh; overflow-y: auto; padding: 2px; touch-action: pan-y; }
.pcard { position: relative; cursor: pointer; background: rgba(255, 255, 255, .04); border: 2px solid var(--line); border-radius: 14px; padding: 6px 4px 8px; text-align: center; color: var(--text); transition: transform .1s, border-color .1s; }
.pcard:hover { transform: translateY(-2px); }
.pcard.active { border-color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 35%, transparent); }
.pcard img { width: 64px; height: 64px; image-rendering: pixelated; display: block; margin: 0 auto; }
.pcard .pn { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .dots { display: flex; gap: 3px; justify-content: center; margin-top: 2px; }
.pcard .dots i { width: 8px; height: 8px; border-radius: 50%; }
.pcard.locked img { filter: brightness(0) opacity(.45); }
.pcard.locked .pn { color: var(--muted); }
.pcard .lock { position: absolute; top: 4px; right: 6px; font-size: 12px; }
.pcard .num { position: absolute; top: 4px; left: 7px; font-size: 10px; color: var(--muted); }
.type-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.movepool { display: flex; flex-wrap: wrap; gap: 4px; }
.movepool span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--tc) 25%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent); }
.movepool span.start { background: var(--tc); color: #111; font-weight: 700; }
.lock-box { background: rgba(0, 0, 0, .3); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.progress-track { height: 8px; background: rgba(255, 255, 255, .08); border-radius: 4px; overflow: hidden; width: 100%; }
.progress-track > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; transition: width .4s; }
.progress-track.big { height: 12px; margin-bottom: 16px; }

/* Kecleon shop */
.kecleon { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.kecleon canvas { width: 96px; height: 96px; flex: none; }
.speech { position: relative; background: #fff; color: #222; border-radius: 16px; padding: 12px 16px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow); }
.speech::before { content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); border: 10px solid transparent; border-right-color: #fff; border-left: 0; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.shop-card { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; grid-template-columns: 48px 1fr; gap: 4px 10px; align-items: center; }
.shop-card img { width: 48px; height: 48px; image-rendering: pixelated; grid-row: span 2; background: rgba(0,0,0,.25); border-radius: 12px; }
.shop-card .sn { font-weight: 700; }
.shop-card .sd { font-size: 13px; color: var(--muted); }
.shop-card .pips { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 6px; }
.shop-card .pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); }
.shop-card .pips i.on { background: var(--accent); }
.shop-card .buy { grid-column: 1 / -1; margin-top: 6px; }
.shop-card.maxed { border-color: rgba(255, 213, 74, .5); }
.btn-buy { width: 100%; background: rgba(62, 224, 122, .15); border-color: rgba(62, 224, 122, .5); color: #b9f7cf; }
.btn-buy:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.shop-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.shop-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sp-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.sp-card img { width: 72px; height: 72px; image-rendering: pixelated; }
.sp-card.unknown img { filter: brightness(0) opacity(.5); }
.sp-card .sn { font-weight: 700; }
.sp-card .sd { font-size: 12px; color: var(--muted); }
.sp-card .progress-track { height: 6px; }

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ach { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.ach img { width: 44px; height: 44px; image-rendering: pixelated; background: rgba(0,0,0,.3); border-radius: 12px; padding: 4px; }
.ach .an { font-weight: 700; }
.ach .ad { font-size: 13px; color: var(--muted); }
.ach .ar { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.ach.done { border-color: rgba(255, 213, 74, .45); background: linear-gradient(90deg, rgba(255, 213, 74, .1), rgba(255,255,255,.03)); }
.ach:not(.done) img { filter: grayscale(1) opacity(.5); }
.ach.done .ar::before { content: "\2713  "; color: var(--hp); }

/* Pokedex */
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 66vh; overflow-y: auto; touch-action: pan-y; }
.dex-cell { background: rgba(255,255,255,.04); border: 2px solid var(--line); border-radius: 12px; padding: 4px; text-align: center; position: relative; }
.dex-cell img { width: 56px; height: 56px; image-rendering: pixelated; }
.dex-cell.unseen img { filter: brightness(0) opacity(.35); }
.dex-cell.partner { border-color: rgba(255, 213, 74, .6); }
.dex-cell .dn { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-cell .dnum { position: absolute; top: 2px; left: 5px; font-size: 9px; color: var(--muted); }
.dex-cell .dk { position: absolute; top: 2px; right: 5px; font-size: 9px; color: var(--gold); }

/* HUD additions */
.stat-pill.money { color: var(--gold); }
.buffs { display: flex; gap: 4px; margin-top: 4px; }
.buffs:empty { display: none; }
.buffs span { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: rgba(255, 213, 74, .2); color: var(--gold); }
.slot img.mico { width: 28px; height: 28px; z-index: 1; }
.slot.item img { width: 28px; height: 28px; image-rendering: pixelated; }
.choice .icon img { width: 34px; height: 34px; image-rendering: pixelated; }
.pause-moves { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.pause-moves span { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--tc); }

/* Chest */
.chest-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: pop .25s ease-out; width: min(520px, 100%); }
.chest-box { position: relative; width: 120px; height: 100px; }
.chest-base { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(180deg, #b8742a, #7a4614); border: 4px solid #4a2a0a; border-radius: 8px; z-index: 1; }
.chest-base::after { content: ""; position: absolute; left: 50%; top: 6px; transform: translateX(-50%); width: 18px; height: 22px; background: var(--gold); border: 3px solid #8a6400; border-radius: 4px; }
.chest-lid { position: absolute; top: 4px; left: -2px; right: -2px; height: 40px; background: linear-gradient(180deg, #d08a3a, #9a5a1c); border: 4px solid #4a2a0a; border-radius: 30px 30px 6px 6px; transform-origin: 10% 100%; animation: lid .6s .3s ease-out forwards; z-index: 2; }
@keyframes lid { to { transform: rotate(-35deg) translate(-10px, -16px); } }
.chest-glow { position: absolute; inset: -40px; background: radial-gradient(circle, rgba(255, 220, 90, .7), transparent 60%); opacity: 0; animation: glow .6s .5s forwards; }
@keyframes glow { to { opacity: 1; } }
.chest-rewards { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.chest-reward { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--tc, var(--line-strong)); border-radius: 14px; padding: 10px 14px; text-align: left; animation: deal .35s ease-out backwards; }
.chest-reward:nth-child(1) { animation-delay: .55s; }
.chest-reward:nth-child(2) { animation-delay: .7s; }
.chest-reward:nth-child(3) { animation-delay: .85s; }
.chest-reward:nth-child(4) { animation-delay: 1s; }
.chest-reward .ci { width: 40px; height: 40px; border-radius: 10px; background: var(--tc, #555); display: grid; place-items: center; font-weight: 700; color: #111; flex: none; }
.chest-reward .ci img { width: 32px; height: 32px; image-rendering: pixelated; }
.chest-reward b { display: block; }
.chest-reward span { font-size: 13px; color: var(--muted); }

/* Game over additions */
.go-side { display: flex; flex-direction: column; gap: 10px; }
.go-side h3 { margin: 0; }
.money-box { background: rgba(255, 213, 74, .08); border: 1px solid rgba(255, 213, 74, .35); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.money-box .row { display: flex; justify-content: space-between; color: var(--muted); }
.money-box .total { display: flex; justify-content: space-between; font-weight: 700; font-size: 20px; color: var(--gold); border-top: 1px solid rgba(255, 213, 74, .3); padding-top: 6px; margin-top: 4px; }

/* Achievement and unlock pop-ups */
.popups { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; width: min(340px, calc(100vw - 28px)); }
.popup { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; background: linear-gradient(135deg, #2a2210, #161d32 60%); border: 2px solid var(--gold); border-radius: 16px; padding: 10px 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 24px rgba(255, 213, 74, .25); animation: popin 4.4s cubic-bezier(.2,.9,.3,1.2) forwards; }
.popup.blue { border-color: var(--xp); background: linear-gradient(135deg, #10223a, #161d32 60%); }
.popup.green { border-color: var(--hp); background: linear-gradient(135deg, #10301e, #161d32 60%); }
.popup img { width: 48px; height: 48px; image-rendering: pixelated; background: rgba(0,0,0,.3); border-radius: 12px; padding: 4px; }
.popup .pk { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.popup.blue .pk { color: var(--xp); }
.popup.green .pk { color: var(--hp); }
.popup .pt { font-weight: 700; font-size: 16px; }
.popup .pd { font-size: 12px; color: var(--muted); }
@keyframes popin { 0% { transform: translateX(120%); opacity: 0; } 8% { transform: none; opacity: 1; } 88% { transform: none; opacity: 1; } 100% { transform: translateX(120%); opacity: 0; } }

@media (max-width: 640px) {
  .partner-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); max-height: 46vh; }
  .pcard img { width: 52px; height: 52px; }
  .kecleon canvas { width: 72px; height: 72px; }
  .speech { font-size: 13px; padding: 10px 12px; }
  .wallet { padding: 4px 10px; font-size: 14px; }
  .ach-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
}

/* ================= Daily, biomes, history, cosmetics ================= */
.btn-daily { background: linear-gradient(90deg, rgba(79, 179, 255, .22), rgba(180, 140, 255, .22)); border-color: rgba(140, 170, 255, .55); }
.daily-dot { width: 9px; height: 9px; border-radius: 50%; background: #4fb3ff; box-shadow: 0 0 10px #4fb3ff; animation: pulse .8s infinite alternate; }
.select-layout > * { min-width: 0; }
.biome-pick { margin-bottom: 12px; }
.biome-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.biome-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; touch-action: pan-x; }
.biome-card { flex: none; width: 128px; border-radius: 12px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--text); border: 2px solid var(--line); background: var(--bg-b, #3f7d3a); position: relative; overflow: hidden; }
.biome-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.55)); }
.biome-card > * { position: relative; }
.biome-card b { display: block; font-size: 13px; }
.biome-card span { font-size: 11px; color: rgba(255,255,255,.75); }
.biome-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 203, 5, .3); }
.biome-card.locked { filter: grayscale(.8); opacity: .65; }
.biome-label { display: flex; align-items: center; gap: 8px; }
#biomecount { text-transform: none; letter-spacing: 0; }
.biome-arrows { margin-left: auto; display: flex; gap: 4px; }
.biome-arrows .icon-btn { width: 28px; height: 28px; font-size: 18px; line-height: 1; }
@media (hover: none) { .biome-arrows { display: none; } }
.biome-row { scroll-snap-type: x proximity; }
.biome-card { width: 150px; min-height: 92px; padding-right: 44px; scroll-snap-align: center; }
.biome-card img, .biome-card .bird { position: absolute; right: 2px; bottom: 2px; width: 44px; height: 44px; image-rendering: pixelated; }
.biome-card .bird { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: rgba(255,255,255,.7); }
.biome-card img.unknown, .biome-detail img.unknown { filter: brightness(0) opacity(.55); }
.biome-detail { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.bd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bd-row > .muted:first-child { width: 64px; flex: none; font-size: 12px; }
.bd-bosses { display: flex; flex-wrap: wrap; gap: 2px; }
.bd-bosses img, .bd-bosses .bird { width: 40px; height: 40px; image-rendering: pixelated; }
.bd-bosses .bird { display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.bd-chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 12px; text-transform: capitalize; }
.info-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.info-pill { font-size: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.info-pill b { color: var(--text); }
.shiny-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; background: rgba(255, 233, 168, .08); border: 1px solid rgba(255, 233, 168, .3); border-radius: 12px; padding: 8px 12px; }
.daily-body { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.daily-hero { display: flex; align-items: center; gap: 16px; }
.daily-hero img { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.daily-mod { background: linear-gradient(90deg, rgba(79,179,255,.15), rgba(180,140,255,.15)); border: 1px solid rgba(140,170,255,.4); border-radius: 14px; padding: 12px 16px; }
.daily-mod b { display: block; font-size: 18px; color: #b9d6ff; }
.history-table td, .history-table th { white-space: nowrap; }
.history-table .partner img { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; margin: -6px 0; }
.cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cos-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.cos-card.equipped { border-color: var(--accent); }
.cos-swatch { width: 54px; height: 54px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 18px var(--cc); }
.cos-swatch.rainbow { background: conic-gradient(#ff5e5e, #ffd43b, #4fcf5a, #4f8dff, #b48cff, #ff5e5e); }
.cos-swatch.aura { background: transparent; border: 5px solid var(--cc); }
.cos-swatch.aura.rainbow { border: 5px solid transparent; background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, conic-gradient(#ff5e5e, #ffd43b, #4fcf5a, #4f8dff, #b48cff, #ff5e5e) border-box; }
.cos-card .sd { font-size: 12px; color: var(--muted); }
.quest .ar { color: var(--xp); }
/* ================= Modes, mastery, gyms, raids, replays, trainer cards ================= */
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-mode { background: linear-gradient(90deg, rgba(255, 203, 5, .16), rgba(255, 120, 60, .12)); border-color: rgba(255, 203, 5, .45); }
.btn-mode.raid { background: linear-gradient(90deg, rgba(255, 45, 85, .2), rgba(160, 40, 120, .14)); border-color: rgba(255, 45, 85, .5); }
.runoptions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.runopt { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; font-size: 14px; color: var(--muted); }
.runopt select, .setting select { background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; font: inherit; max-width: 220px; }
.pcard .mstars, .mstars { color: var(--gold); font-size: 10px; letter-spacing: 1px; }
.pcard.master { box-shadow: inset 0 0 0 2px var(--gold); }
.mastery { background: rgba(255, 213, 74, .06); border: 1px solid rgba(255, 213, 74, .25); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mastery .mhead { display: flex; justify-content: space-between; font-size: 14px; }
.mperks { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.mperks span.on { color: var(--gold); }
.buddy-line { display: flex; align-items: center; gap: 8px; font-size: 14px; background: rgba(79,179,255,.08); border: 1px solid rgba(79,179,255,.3); border-radius: 12px; padding: 6px 10px; }
.buddy-line img { width: 40px; height: 40px; image-rendering: pixelated; }
.weekly { width: 100%; text-align: left; margin-top: 8px; }
.weekly h3 { margin: 0 0 8px; }
.wq { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.wq > div:first-child { display: flex; flex-direction: column; font-size: 14px; }
.wq .wr { color: var(--gold); font-weight: 700; align-self: center; }
.wq .progress-track { grid-column: 1 / -1; }
.wq.done { border-color: rgba(62, 224, 122, .5); }
.tierbadge { font-size: 10px; font-weight: 700; background: rgba(255, 94, 58, .25); color: #ffb3a1; border-radius: 6px; padding: 1px 5px; margin-left: 6px; }
.rowbtns { display: inline-flex; gap: 4px; margin-left: 6px; }
.mini { font: inherit; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; }
.mini:hover { background: rgba(255,255,255,.14); }
.lb a.trainer { color: var(--text); text-decoration: none; display: inline-flex; }
.lb a.trainer:hover { color: var(--accent); }
.badge-case { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 16px; padding: 10px; margin-bottom: 14px; }
.badge-case.small { justify-content: flex-start; padding: 6px; margin-top: 8px; }
.badge-slot { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.06); display: grid; place-items: center; }
.badge-slot img { width: 32px; height: 32px; image-rendering: pixelated; filter: brightness(0) opacity(.35); }
.badge-slot.got img { filter: none; }
.badge-case.small .badge-slot { width: 30px; height: 30px; }
.badge-case.small .badge-slot img { width: 22px; height: 22px; }
.gym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.gym-card { position: relative; display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 18%, transparent), rgba(255,255,255,.02)); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); border-radius: 16px; padding: 10px; }
.gym-card.locked { filter: grayscale(.9); opacity: .55; }
.gym-card.done { border-color: rgba(62, 224, 122, .5); }
.gym-card .trainer-img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.gym-card .gname { font-weight: 700; font-size: 17px; }
.gym-card .ace { width: 34px; height: 34px; image-rendering: pixelated; margin: -8px 0; }
.gym-card .lockmark { font-size: 20px; padding: 0 8px; }
.raid-body { display: flex; flex-direction: column; gap: 12px; }
.raid-hero { position: relative; display: grid; place-items: center; height: 230px; }
.raid-hero img { position: relative; width: 220px; height: 220px; object-fit: contain; filter: drop-shadow(0 0 30px rgba(255,45,85,.6)); }
.raid-glow { position: absolute; inset: 10px 25%; border-radius: 50%; background: radial-gradient(circle, rgba(255,45,85,.55), transparent 70%); animation: pulse 1.2s infinite alternate; }
.raid-hp { position: relative; height: 26px; border-radius: 13px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,45,85,.5); overflow: hidden; }
.raid-hp div { height: 100%; background: linear-gradient(90deg, #ff2d55, #ff9a3c); }
.raid-hp span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; text-shadow: 0 1px 2px #000; }
.replay-canvas { width: 100%; height: auto; border-radius: 14px; background: #000; display: block; }
.replay-controls { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.replay-controls input[type=range] { flex: 1; accent-color: var(--accent); }
.replay-controls select { background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px; font: inherit; }
.rp-events { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tcard { display: flex; flex-direction: column; gap: 14px; }
.thead { display: flex; gap: 14px; align-items: center; }
.thead h3 { margin: 0 0 6px; font-size: 26px; }
.tav { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--line-strong); }
.tav.aura { border-color: var(--aura); box-shadow: 0 0 20px var(--aura); }
.tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tgrid > div { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tgrid h3 { margin: 0 0 8px; }
.trow { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 8px; align-items: center; font-size: 14px; padding: 2px 0; }
.trow img { width: 36px; height: 36px; image-rendering: pixelated; }
.shiny-row { display: flex; flex-wrap: wrap; gap: 2px; }
.shiny-row img { width: 48px; height: 48px; image-rendering: pixelated; }
.setting.keys { flex-direction: column; align-items: stretch; }
.keygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; }
.keybtn { font: inherit; background: rgba(0,0,0,.3); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.keybtn small { color: var(--muted); font-size: 11px; }
.keybtn b { font-size: 18px; }
@media (max-width: 640px) { .gym-card { grid-template-columns: 52px 1fr auto; } .gym-card .trainer-img { width: 52px; height: 52px; } .raid-hero { height: 170px; } .raid-hero img { width: 160px; height: 160px; } }

/* Mega and Dynamax buttons */
.powers { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.power-btn { position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; padding: 8px 14px 8px 8px; border-radius: 14px; font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .06em; color: #fff; cursor: pointer; border: 2px solid; }
.power-btn img { width: 30px; height: 30px; image-rendering: pixelated; z-index: 1; }
.power-btn span, .power-btn kbd { z-index: 1; }
.power-btn kbd { font: inherit; font-size: 10px; opacity: .7; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; padding: 0 4px; }
.power-btn.mega { background: linear-gradient(135deg, #3b2a7a, #9b4dff); border-color: #d1a8ff; box-shadow: 0 0 18px rgba(170, 100, 255, .6); animation: pulse .7s infinite alternate; }
.power-btn.zmove { background: rgba(40, 30, 10, .85); border-color: #ffcb05; }
.power-btn.zmove.ready { background: linear-gradient(135deg, #8a5a00, #ffcb05); box-shadow: 0 0 22px rgba(255, 203, 5, .7); animation: pulse .6s infinite alternate; color: #2b1d00; }
.power-btn.zmove:disabled { opacity: .55; cursor: default; }
.statusline span { background: rgba(255, 77, 94, .25); color: #ffb3bb; }
.statusline .wx { background: rgba(79, 179, 255, .2); color: #b9dcff; }
.statusline .st-paralysis { background: rgba(255, 212, 59, .25); color: #ffe58a; }
.statusline .st-freeze { background: rgba(127, 227, 255, .25); color: #c8f4ff; }
.statusline .st-sleep { background: rgba(180, 140, 255, .25); color: #e0d0ff; }
.statusline .st-poison { background: rgba(180, 80, 216, .25); color: #e8b8ff; }
.ghostline { font-size: 12px; color: #cfd6e6; text-shadow: 0 1px 3px #000; margin-top: 2px; }
.power-btn.dmax { background: rgba(60, 10, 20, .85); border-color: #ff4d6d; }
.power-btn.dmax i { position: absolute; left: 0; bottom: 0; top: 0; width: 0; background: linear-gradient(90deg, #ff2d55, #ff7a8a); opacity: .55; transition: width .2s; }
.power-btn.dmax:disabled { cursor: default; opacity: .85; }
.power-btn.dmax.ready { box-shadow: 0 0 22px rgba(255, 45, 85, .8); animation: pulse .6s infinite alternate; }
.power-btn.dmax.active { background: linear-gradient(135deg, #ff2d55, #ff9a3c); }
#vignette.dmax { background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 30, 70, .4) 100%); }
@media (max-width: 640px) { .powers { bottom: 64px; } .power-btn { font-size: 12px; padding: 6px 10px 6px 6px; } .power-btn img { width: 24px; height: 24px; } .power-btn kbd { display: none; } }

.choice.evo-card { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 213, 74, .4), 0 0 30px rgba(255, 213, 74, .35); }
.choice.evo-card .ctag { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Declutter and phone layout ---------- */
.slot.item.more { font-size: 13px; font-weight: 700; color: var(--muted); border-style: dashed; }
.toast { max-width: min(420px, 90vw); text-align: center; }
@media (max-width: 640px) {
  /* Title: a compact 3 x 3 grid of icon tiles instead of nine full-width buttons. */
  .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .menu-grid .btn { flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.15; padding: 10px 4px; min-height: 64px; }
  .menu-grid .btn .btn-ico { margin: -4px 0 0; width: 28px; height: 28px; }
  .menu-grid .badge-count { display: none; }
  /* In a run: power buttons become round icons on the right, above the slots. */
  .powers { left: auto; right: 8px; transform: none; bottom: calc(64px + env(safe-area-inset-bottom)); flex-direction: column-reverse; gap: 8px; }
  .power-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; justify-content: center; }
  .power-btn span, .power-btn kbd { display: none; }
  .power-btn img { width: 30px; height: 30px; }
  .toasts { bottom: calc(66px + env(safe-area-inset-bottom)); left: 8px; right: 70px; transform: none; align-items: flex-start; }
  .toast { font-size: 12px; padding: 6px 10px; text-align: left; }
  .hud-bottom { gap: 6px; }
  #moveslots { gap: 4px; flex-wrap: nowrap; }
  #itemslots { gap: 3px; flex-wrap: nowrap; }
  .slot { width: 38px; height: 38px; border-radius: 10px; }
  .slot img.mico { width: 24px; height: 24px; }
  .slot.item { width: 28px; height: 28px; border-radius: 8px; }
  .slot.item img { width: 22px; height: 22px; }
  .banner { font-size: 24px; top: 24%; white-space: normal; width: 92vw; }
  #levelup .choice .cdesc { font-size: 13px; }
}
@media (max-width: 400px) {
  .slot { width: 34px; height: 34px; }
  .slot img.mico { width: 22px; height: 22px; }
  .menu-grid .btn { font-size: 11px; }
}
.menu-grid .mi { font-size: 1.1em; }
@media (max-width: 640px) { .menu-grid .mi { font-size: 22px; line-height: 1; } }

/* ---------- Lobby chat panel ---------- */
.chat-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; z-index: 60; display: flex; flex-direction: column; background: var(--panel-solid); border-left: 1px solid var(--line-strong); box-shadow: -12px 0 40px rgba(0, 0, 0, .45); animation: chatin .2s ease-out; }
.chat-panel.hidden { display: none; }
.chat-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-panel iframe { flex: 1; width: 100%; border: 0; background: #0d1220; }
#hud [data-chat] { pointer-events: auto; }
.chat-open-btn { padding: 6px 12px; font-size: 14px; }
@keyframes chatin { from { transform: translateX(30px); opacity: 0; } }
@media (max-width: 640px) { .chat-panel { width: 100%; top: 18%; border-left: 0; border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; } }

/* ---------- Desktop: a wider, two-column title ---------- */
@media (min-width: 1100px) {
  .title-main { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(460px, 560px); grid-template-areas: "logo menu" "tag menu" "stats menu"; align-items: center; column-gap: 64px; row-gap: 14px; max-width: 1120px; margin: 0 auto; padding: 40px 24px; text-align: left; }
  .title-main .logo { grid-area: logo; align-self: end; }
  .title-main .tagline { grid-area: tag; text-align: center; max-width: 420px; justify-self: center; font-size: 18px; }
  .title-main .mystats { grid-area: stats; align-self: start; }
  .title-main .menu-buttons { grid-area: menu; width: 100%; background: rgba(10, 14, 26, .55); border: 1px solid var(--line); border-radius: 22px; padding: 20px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
  .menu-grid .btn { flex-direction: column; gap: 4px; min-height: 78px; font-size: 14px; }
  .menu-grid .mi { font-size: 24px; line-height: 1; }
  .menu-grid .btn-ico { margin: -4px 0 0; width: 32px; height: 32px; }
  .menu-grid .badge-count { font-size: 10px; }
  /* In a run: roomier HUD and slots. */
  .slot { width: 52px; height: 52px; }
  .slot img.mico { width: 32px; height: 32px; }
}
.tipcard { position: fixed; top: 92px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; max-width: min(520px, 92vw); background: var(--panel-solid); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 10px 10px 14px; box-shadow: var(--shadow); font-size: 14px; animation: toast 7s ease-out forwards; }
.tipcard b { color: var(--accent); }
.tipcard .icon-btn { width: 28px; height: 28px; flex: none; }
.tipcard.hidden { display: none; }
@media (max-width: 640px) { .tipcard { top: 118px; font-size: 13px; } }

/* ---------- Pause: build sheet ---------- */
.pause-panel { width: min(920px, 100%); max-height: 92vh; overflow-y: auto; }
.pb-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; text-align: left; }
.pb-grid h4 { margin: 12px 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pb-grid p { margin: 0; font-size: 14px; }
.pb-moves { width: 100%; border-collapse: collapse; font-size: 14px; }
.pb-moves th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 600; }
.pb-moves td { padding: 4px 6px; border-top: 1px solid var(--line); }
.pb-moves td small, .pb-item small, .pb-syn small { display: block; color: var(--muted); font-size: 12px; }
.pb-moves .num { text-align: right; font-variant-numeric: tabular-nums; }
.pb-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 2px solid var(--tc); background: rgba(10, 14, 26, .7); font-size: 11px; font-weight: 700; }
.pb-ico img.mico { width: 22px; height: 22px; }
.pb-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pb-item { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.pb-item img { width: 28px; height: 28px; image-rendering: pixelated; }
.pb-syn { padding: 6px 8px; border: 1px dashed var(--line-strong); border-radius: 10px; margin-bottom: 6px; font-size: 13px; }
.pb-syn.on { border-style: solid; border-color: var(--ok, #3ee07a); }
.pb-match { font-size: 13px; margin-bottom: 4px; }
.pb-type { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--tc); color: #fff; font-weight: 700; font-size: 12px; text-transform: capitalize; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.pb-match .good { color: #3ee07a; display: inline; } .pb-match .bad { color: #ff7a7a; display: inline; }
.pause-settings { margin: 12px 0; text-align: left; }
.pause-settings summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
@media (max-width: 760px) { .pb-grid { grid-template-columns: 1fr; } .pb-items { grid-template-columns: 1fr; } }

.slottip { position: fixed; z-index: 70; max-width: 280px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; font-size: 13px; box-shadow: var(--shadow); pointer-events: none; }
.slottip.hidden { display: none; }
.slottip p { margin: 4px 0; color: var(--text); }
.slottip small { color: var(--muted); }
#moveslots .slot, #itemslots .slot { pointer-events: auto; cursor: help; touch-action: none; }

/* ---------- Phones held sideways ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  #hud { padding: max(4px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
  .hud-top { margin-top: 4px; }
  .portrait { width: 34px; height: 34px; }
  #pname { font-size: 12px; }
  .hp-wrap { width: 110px; }
  #timer { font-size: 18px; }
  .stat-pill { padding: 4px 8px; font-size: 12px; }
  .hud-right { flex-direction: row; }
  .slot { width: 34px; height: 34px; }
  .slot img.mico { width: 22px; height: 22px; }
  .slot.item { width: 26px; height: 26px; }
  .powers { left: auto; right: max(10px, env(safe-area-inset-right)); top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; }
  .power-btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; justify-content: center; }
  .power-btn span, .power-btn kbd { display: none; }
  .toasts { bottom: 52px; }
  .banner { top: 18%; font-size: 22px; }
  .tipcard { top: 56px; }
  .overlay .panel { max-height: 94vh; overflow-y: auto; }
  #levelup .choices, #choices { grid-template-columns: repeat(3, 1fr); }
  .choice { padding: 8px; }
  .choice .cdesc { font-size: 12px; }
  .title-main { padding: 8px 0; gap: 8px; }
  .logo-top { font-size: 44px; } .logo-bottom { font-size: 36px; }
  .chat-panel { top: 0; width: 60%; left: auto; border-radius: 0; }
}

.shiny-toggle-btn { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); font-size: 14px; filter: grayscale(1) opacity(.6); cursor: pointer; }
.shiny-toggle-btn.on { filter: none; background: rgba(255, 213, 74, .25); border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 213, 74, .5); }

.shop-card { position: relative; }
.shop-card.deal { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 18px rgba(255, 213, 74, .25); }
.deal-tag { position: absolute; top: -9px; right: 10px; background: var(--gold); color: #2b1d00; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pstars { font-size: 13px; }
.btn-small { padding: 6px 12px; font-size: 13px; margin-top: 8px; }
.ach.collection .col-ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--cc) var(--p), rgba(255, 255, 255, .08) 0); flex: none; }
.ach.collection .col-ring b { font-size: 11px; background: var(--panel-solid); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }

/* Banners, toasts and tips wait while a menu covers the game. */
body.overlay-open #banner, body.overlay-open #toasts, body.overlay-open #tipcard { visibility: hidden; }

/* HUD portrait: the Mystery Dungeon face (or the sprite when there isn't one). */
.portrait img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; border-radius: 10px; }
.portrait img.still { object-fit: contain; transform: scale(1.4); }

.title-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 18px; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.credits { display: flex; flex-direction: column; gap: 10px; }
.credit { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.credit span { color: var(--muted); font-size: 14px; }
.credit a { color: var(--accent); font-size: 14px; }

.power-btn.dash { border-color: #cfe0ff; background: linear-gradient(180deg, rgba(110,140,200,.6), rgba(40,60,110,.7)); }
.power-btn.dash i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); pointer-events: none; }
.power-btn.catch { border-color: #ff5c5c; background: linear-gradient(180deg, rgba(220,70,70,.55), rgba(110,20,30,.7)); }
.power-btn.catch.ready { box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(255,92,92,.8); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.curses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.curses > span { width: 100%; font-size: 13px; }
.curse { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04); color: var(--text); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.curse small { color: var(--muted); }
.curse.on { border-color: #b450d8; background: rgba(180, 80, 216, .25); }
.curse.on small, .gold { color: var(--gold); }

.talent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.talent-card { border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: rgba(255, 255, 255, .03); }
.talent-card.maxed { box-shadow: 0 0 0 1px var(--tc) inset; }
.talent-card .th { display: flex; justify-content: space-between; align-items: center; }
.talent-card .seals { font-weight: 700; color: var(--gold); }
.talent-card .tl { font-size: 13px; color: var(--muted); }
.talent-card .tl b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 11px; margin-right: 4px; }
.talent-card .tl.on { color: var(--text); }
.talent-card .tl.on b { background: var(--tc); border-color: var(--tc); color: #fff; }

/* Visible focus for keyboard and controller players. */
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, .choice:focus { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* High contrast */
body.hc { --muted: #d2d8e6; --line: rgba(255,255,255,.35); --line-strong: rgba(255,255,255,.6); }
body.hc .btn, body.hc .panel, body.hc .slot, body.hc .stat-pill, body.hc .hud-player { border-width: 2px; }
body.hc #hptext, body.hc #timer, body.hc .stat-pill { text-shadow: 0 0 3px #000, 0 0 3px #000; }
body.hc .toast, body.hc .tipcard { background: #000; border-color: #fff; }

/* Mini map: top right, under the counters. */
.minimap { position: absolute; top: calc(max(8px, env(safe-area-inset-top)) + 70px); right: 12px; width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 4px 18px rgba(0,0,0,.4); pointer-events: none; }
.minimap.hidden { display: none; }
@media (max-width: 640px) { .minimap { width: 92px; height: 92px; top: calc(max(8px, env(safe-area-inset-top)) + 84px); right: auto; left: 8px; } }
@media (orientation: landscape) and (max-height: 500px) { .minimap { width: 90px; height: 90px; top: 50px; } }

#vignette.lowhp { animation: lowhp 0.85s ease-in-out infinite; background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 30, 50, 0.38) 100%); }
@keyframes lowhp { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #vignette.lowhp { animation: none; } }

.power-btn.tera { border-color: #7fe3ff; background: linear-gradient(180deg, rgba(120,200,255,.55), rgba(70,40,160,.7)); }
.power-btn.tera i { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); pointer-events: none; }
.power-btn.tera.ready { box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(127,227,255,.8); }
.runopt.champ { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.runopt.champ.locked { opacity: .5; }

.btn-trials { background: linear-gradient(180deg, rgba(255,213,74,.22), rgba(150,100,0,.25)); border-color: rgba(255,213,74,.6); }
.trial-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.trial-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 14px; background: rgba(255,255,255,.03); }
.trial-card img { width: 64px; height: 64px; image-rendering: pixelated; flex: none; }
.trial-card .ti { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trial-card.done { border-color: var(--gold); }
.trial-card.locked { opacity: .6; }
.trial-head { grid-column: 1 / -1; }
.trial-head .note { margin: 6px 0 0; }
.trial-meta { font-size: 12px; color: var(--muted, #9fb3c8); }
.rank { display: inline-block; min-width: 18px; text-align: center; border-radius: 6px; padding: 0 4px; margin-right: 2px; background: #3a4458; color: #fff; }
.rank.rS { background: #ffcb05; color: #222; } .rank.rA { background: #3ee07a; color: #10261a; } .rank.rB { background: #7fb8ff; color: #0d1a2c; }

/* ---------- Power cutscenes ---------- */
.cutscene { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; display: grid; place-items: center; }
.cutscene.hidden { display: none; }
.cs-bar { position: absolute; left: 0; right: 0; height: 14vh; background: #000; }
.cs-bar.top { top: 0; transform: translateY(-100%); }
.cs-bar.bottom { bottom: 0; transform: translateY(100%); }
.cs-rays { position: absolute; inset: -50%; opacity: 0; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cs) 55%, transparent) 0 6deg, transparent 6deg 18deg); }
.cs-stage { position: relative; width: min(46vh, 70vw); aspect-ratio: 1; }
.cs-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; filter: drop-shadow(0 0 24px var(--cs)); }
.cs-text { position: absolute; bottom: 17vh; text-align: center; opacity: 0; }
.cs-kicker { display: block; color: var(--cs); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: clamp(13px, 2.2vw, 18px); text-shadow: 0 2px 8px #000; }
.cs-title { display: block; color: #fff; font-size: clamp(28px, 6vw, 56px); font-weight: 700; -webkit-text-stroke: 2px rgba(0,0,0,.6); paint-order: stroke fill; }
.cutscene.play .cs-bar.top { animation: csBarTop 1.6s ease both; }
.cutscene.play .cs-bar.bottom { animation: csBarBottom 1.6s ease both; }
.cutscene.play .cs-rays { animation: csRays 1.6s ease both; }
.cutscene.play .cs-text { animation: csText 1.6s ease both; }
.cutscene.play .cs-to { animation: csPop 1.6s ease both; }
/* Mega: the old form glows white and shrinks away while the Mega form bursts in. */
.cutscene.cs-mega.play .cs-from { animation: csMegaOut 1.6s ease both; }
.cutscene.cs-mega.play .cs-to { animation: csMegaIn 1.6s ease both; }
/* Dynamax: the Pokemon swells far past the frame in red. */
.cutscene.cs-dmax.play .cs-to { animation: csGrow 1.6s ease both; filter: drop-shadow(0 0 40px #ff2d55) saturate(1.3); }
/* Z-Move: a fast zoom and shake. */
.cutscene.cs-z.play .cs-to { animation: csZ 1.6s ease both; }
/* Tera: a crystal flash. */
.cutscene.cs-tera.play .cs-to { animation: csTera 1.6s ease both; }
.cutscene.calm.play * { animation-duration: .8s !important; }
.cutscene.calm .cs-rays { display: none; }
@keyframes csBarTop { 0% { transform: translateY(-100%); } 15%, 85% { transform: none; } 100% { transform: translateY(-100%); } }
@keyframes csBarBottom { 0% { transform: translateY(100%); } 15%, 85% { transform: none; } 100% { transform: translateY(100%); } }
@keyframes csRays { 0% { opacity: 0; transform: rotate(0); } 20%, 75% { opacity: .9; } 100% { opacity: 0; transform: rotate(60deg); } }
@keyframes csText { 0%, 30% { opacity: 0; transform: translateY(20px); } 45%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes csPop { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.08); } 35%, 85% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes csMegaOut { 0% { opacity: 0; transform: scale(.8); } 15% { opacity: 1; filter: brightness(1); } 40% { opacity: 1; filter: brightness(8); transform: scale(1); } 50%, 100% { opacity: 0; transform: scale(.5); filter: brightness(8); } }
@keyframes csMegaIn { 0%, 42% { opacity: 0; transform: scale(.5); filter: brightness(8); } 55% { opacity: 1; transform: scale(1.12); filter: brightness(1.6) drop-shadow(0 0 30px var(--cs)); } 65%, 88% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 24px var(--cs)); } 100% { opacity: 0; } }
@keyframes csGrow { 0% { opacity: 0; transform: scale(.3); } 20% { opacity: 1; transform: scale(.8); } 70% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes csZ { 0% { opacity: 0; transform: scale(2) rotate(-8deg); } 18% { opacity: 1; transform: scale(1) rotate(0); } 22% { transform: translateX(-8px); } 26% { transform: translateX(8px); } 30%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.8); } }
@keyframes csTera { 0% { opacity: 0; transform: scale(.6); filter: brightness(6) hue-rotate(0deg); } 30% { opacity: 1; transform: scale(1.05); filter: brightness(3) drop-shadow(0 0 30px var(--cs)); } 50%, 85% { opacity: 1; transform: scale(1); filter: brightness(1.2) drop-shadow(0 0 24px var(--cs)); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cutscene.play * { animation-duration: .6s !important; } .cs-rays { display: none; } }

.type-badge-dot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8, var(--tc) 55%); color: #fff; font-size: 10px; font-weight: 700; text-shadow: 0 1px 2px #000; }

.power-btn.support { border-color: #7fe3ff; background: linear-gradient(180deg, rgba(90,180,220,.55), rgba(20,70,110,.7)); }
.choice.disabled { opacity: .45; cursor: not-allowed; }
.portraitsay { position: absolute; left: 68px; top: 58px; background: #fff; color: #1a2234; font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 12px; box-shadow: var(--shadow); white-space: nowrap; animation: toast 2.6s ease-out forwards; z-index: 5; }
.portraitsay::before { content: ""; position: absolute; left: 14px; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
.portraitsay.hidden { display: none; }
.hud-player { position: relative; }
.affection { margin-top: 8px; font-size: 13px; }
.affection .hearts { color: #ff5c8a; letter-spacing: 2px; }
.affection .hearts .empty { color: rgba(255,255,255,.18); }

/* ---------- Pokedex ---------- */
.dex-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.dex-filters .search { flex: 1 1 200px; }
.dex-filters select { background: rgba(0,0,0,.3); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; font: inherit; }
button.dex-cell { font: inherit; color: inherit; cursor: pointer; }
.dex-entry { width: min(860px, 100%); max-height: 92vh; overflow-y: auto; position: relative; }
.dex-close { position: absolute; top: 12px; right: 12px; }
.de-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--tc); padding-bottom: 12px; }
.de-head h2 { margin: 2px 0 6px; }
.de-art { width: 150px; height: 150px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.de-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.dex-entry h4 { margin: 12px 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.de-stat { display: grid; grid-template-columns: 56px 34px 1fr; align-items: center; gap: 6px; font-size: 13px; }
.de-stat i { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #4fb3ff, #3ee07a); }
.de-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.de-evo { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.de-evo.on { border-color: var(--accent); }
.de-evo img { width: 48px; height: 48px; image-rendering: pixelated; }
.de-arrow { color: var(--muted); font-size: 22px; }
.de-sig { display: flex; align-items: center; gap: 10px; border: 1px solid var(--tc); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.de-sig img { width: 44px; height: 44px; flex: none; }
.de-sig div { flex: 1; min-width: 0; }
.de-sig p { margin: 2px 0 0; font-size: 12px; }
.de-sig-state { font-size: 12px; white-space: nowrap; }
.de-moves { display: flex; flex-wrap: wrap; gap: 4px; }
.de-moves span { border: 1px solid var(--tc); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
@media (max-width: 640px) { .de-grid { grid-template-columns: 1fr; } .de-head { flex-direction: column; text-align: center; } .de-art { width: 120px; height: 120px; } }
/* ---------- Achievements ---------- */
.ach-cat { grid-column: 1 / -1; margin: 14px 0 2px; font-size: 16px; }
.ach-prog { position: relative; height: 14px; border-radius: 7px; background: rgba(255,255,255,.08); margin-top: 5px; overflow: hidden; }
.ach-prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #4fb3ff, #3ee07a); }
.ach-prog span { position: relative; font-size: 10px; font-weight: 700; padding-left: 6px; line-height: 14px; }
.pin { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px; }
.pin.on { color: var(--gold); }
.showcase { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 10px 0; }
.showcase .sc { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px; border: 1px solid var(--gold); border-radius: 14px; background: rgba(255,213,74,.08); }
.showcase .sc span { font-size: 12px; color: var(--muted); }

/* Trainer callouts (rivals, villains) */
.callout { position: fixed; left: 12px; top: 40%; z-index: 45; display: flex; align-items: center; gap: 10px; max-width: min(420px, 90vw); padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--panel-solid); border: 2px solid var(--cc); box-shadow: var(--shadow); pointer-events: none; }
.callout.hidden { display: none; }
.callout img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; flex: none; }
.callout b { display: block; color: var(--cc); }
.callout span { font-size: 14px; }
.callout.play { animation: calloutIn 3.6s ease both; }
@keyframes calloutIn { 0% { transform: translateX(-120%); } 10%, 88% { transform: none; } 100% { transform: translateX(-120%); } }
/* Settings presets and search */
.settings-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.settings-top .search { flex: 1 1 180px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .btn-small { margin-top: 0; }

/* Phones: the power buttons form a two-column cluster in the bottom right instead of one tall
   column, and the ones still charging step back. */
@media (max-width: 640px) {
  .powers { display: grid; grid-template-columns: repeat(2, 52px); grid-auto-flow: row dense; direction: rtl; gap: 8px; align-content: end; }
  .powers > * { direction: ltr; }
  .power-btn:disabled { opacity: .55; transform: scale(.9); }
}

/* Co-op shared level-up picker (guests) */
.coopperk { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 50; background: var(--panel-solid); border: 2px solid #3ee07a; border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); text-align: center; max-width: 94vw; }
.coopperk.hidden { display: none; }
.coopperk > div { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.coopperk .btn { flex-direction: column; gap: 2px; font-size: 14px; padding: 8px 12px; }
.coopperk small { font-size: 11px; color: var(--muted); font-weight: 500; }

.btn-bossrush { background: linear-gradient(180deg, rgba(255,77,94,.22), rgba(120,0,20,.3)); border-color: rgba(255,77,94,.6); }

.go-recap { margin: 10px 0; text-align: left; }
.go-recap summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.recap-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.recap-grid h4 { margin: 4px 0 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.recap-chart { width: 100%; height: auto; background: rgba(0,0,0,.2); border-radius: 10px; }
.recap-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; }
.recap-legend span::before { content: ""; display: inline-block; width: 10px; height: 3px; background: var(--tc); margin-right: 4px; vertical-align: middle; }
.recap-timeline { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; font-size: 13px; }
.recap-timeline li { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.recap-timeline .rt { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 40px; }
@media (max-width: 760px) { .recap-grid { grid-template-columns: 1fr; } }
.cutscene.cs-boss.play .cs-to { animation: csPop 1.6s ease both; }
.cutscene.cs-trainer .cs-to { image-rendering: pixelated; }
.season-pill { font-size: 13px; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

.resume-box { display: flex; gap: 8px; }
.resume-box .btn-resume { flex: 1; background: linear-gradient(180deg, rgba(62,224,122,.25), rgba(0,90,40,.3)); border-color: rgba(62,224,122,.7); }
.resume-box .btn-small { margin-top: 0; }

/* Kecleon Shop: partners tab */
.sp-summary { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.sp-summary .ok { color: #3ee07a; font-weight: 700; }
.sp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sp-filters .search { flex: 1 1 180px; margin: 0; }
.sp-filters select { background: rgba(255,255,255,.06); color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; }
.sp-filters select option { color: #000; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.05); color: inherit; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.chip b { opacity: .7; margin-left: 2px; }
.chip.on { background: rgba(62,224,122,.18); border-color: rgba(62,224,122,.7); }
.shop-partners { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sp-card { position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 18%, transparent), rgba(255,255,255,.03)); transition: transform .12s, border-color .12s; }
.sp-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tc) 70%, transparent); }
.sp-card.ready { border-color: rgba(255,213,74,.55); }
.sp-card.can { box-shadow: 0 0 0 1px rgba(62,224,122,.6), 0 0 18px rgba(62,224,122,.18); }
.sp-card .sp-no { position: absolute; top: 6px; left: 8px; font-size: 11px; color: var(--muted); }
.sp-card .sp-tag { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; background: #ffd54a; color: #2a2000; border-radius: 6px; padding: 1px 6px; }
.sp-card img { margin-top: 8px; }
@media (max-width: 640px) { .shop-partners { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } .sp-filters select { flex: 1 1 30%; } }

/* Game modes hub: every way to play behind the one Play button */
.mode-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mode-card { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; min-height: 92px; border-radius: 16px; border: 1px solid var(--mc, var(--line)); color: inherit; font: inherit; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mc, #888) 28%, transparent), rgba(255,255,255,.03)); transition: transform .12s, box-shadow .12s; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 22px color-mix(in srgb, var(--mc, #888) 35%, transparent); }
.mode-card .mc-ico { width: 48px; height: 48px; flex: none; image-rendering: pixelated; display: grid; place-items: center; font-size: 34px; }
.mode-card .mc-ico.daily-dot { width: 18px; height: 18px; margin: 0 15px; }
.mode-card .mc-text { display: flex; flex-direction: column; gap: 3px; }
.mode-card .mc-text b { font-size: 18px; }
.mode-card .mc-text span { font-size: 13px; color: var(--muted); }
.mode-card .badge-count { position: absolute; top: 8px; right: 10px; }
.mc-adventure { --mc: #3ee07a; grid-column: 1 / -1; min-height: 110px; }
.mc-adventure .mc-text b { font-size: 24px; }
.mc-draft { --mc: #b48cff; } .mc-daily { --mc: #ffd54a; } .mc-bossrush { --mc: #ff4d5e; } .mc-rush { --mc: #ff9f1c; } .mc-gym { --mc: #4da3ff; }
.mc-raid { --mc: #e04dff; } .mc-trials { --mc: #ffb347; } .mc-coop { --mc: #4dd9ff; }
@media (max-width: 640px) { .mode-hub { grid-template-columns: 1fr; } .mode-card { min-height: 76px; padding: 12px; } }

/* Boss intro card: a fighting-game style name plate that slides in for every boss */
.bosscard { position: fixed; left: 0; right: 0; top: 18%; z-index: 40; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 24px;
  background: linear-gradient(90deg, transparent, rgba(8,10,24,.88) 18%, rgba(8,10,24,.88) 82%, transparent); }
.bosscard .bc-stripe { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--bc); box-shadow: 0 0 18px var(--bc); }
.bosscard .bc-art { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 0 18px var(--bc)); }
.bosscard .bc-plate { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bosscard .bc-kicker { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--bc); font-weight: 800; }
.bosscard .bc-name { font-size: 40px; font-weight: 900; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
.bosscard .bc-genus { color: var(--muted); font-size: 14px; }
.bosscard .bc-line { font-style: italic; font-size: 14px; opacity: .9; }
.bosscard .bc-vs { position: absolute; right: 8%; font-size: 64px; font-weight: 900; color: var(--bc); opacity: .35; transform: skewX(-12deg); }
.bosscard.in .bc-art { animation: bc-slide-l .45s cubic-bezier(.2,1.4,.4,1) both; }
.bosscard.in .bc-plate { animation: bc-slide-r .45s .08s cubic-bezier(.2,1.4,.4,1) both; }
.bosscard.out { opacity: 0; transition: opacity .35s; }
@keyframes bc-slide-l { from { transform: translateX(-60vw); } to { transform: none; } }
@keyframes bc-slide-r { from { transform: translateX(60vw); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) { .bosscard { top: 12%; gap: 10px; } .bosscard .bc-art { width: 90px; height: 90px; } .bosscard .bc-name { font-size: 26px; } .bosscard .bc-vs { display: none; } }
@media (prefers-reduced-motion: reduce) { .bosscard.in .bc-art, .bosscard.in .bc-plate { animation: none; } }

/* FPS and memory overlay */
.perfoverlay { position: fixed; right: 8px; bottom: 8px; z-index: 60; margin: 0; padding: 6px 9px; font: 600 11px/1.35 ui-monospace, Consolas, monospace; color: #b8ffcf; background: rgba(0,0,0,.65); border-radius: 8px; pointer-events: none; white-space: pre; }

/* Draft */
.draft-h { margin: 14px 0 8px; }
.draft-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.draft-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); color: inherit; font: inherit; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 22%, transparent), rgba(255,255,255,.03)); transition: transform .12s, border-color .12s; }
.draft-card:hover { transform: translateY(-2px); }
.draft-card.on { border-color: var(--tc); box-shadow: 0 0 0 2px var(--tc), 0 0 22px color-mix(in srgb, var(--tc) 45%, transparent); }
.draft-card img { width: 110px; height: 110px; object-fit: contain; }
.draft-card.move img { width: 48px; height: 48px; }
.draft-card small { color: var(--muted); font-size: 12px; }
#draftgo { margin-top: 16px; width: 100%; }
@media (max-width: 640px) { .draft-row { grid-template-columns: 1fr; } .draft-card { flex-direction: row; flex-wrap: wrap; text-align: left; } .draft-card img { width: 64px; height: 64px; } }

/* Skill tree */
.skilltree { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; background: rgba(255,255,255,.03); }
.st-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.st-head .muted { font-size: 12px; }
.st-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.st-col { display: flex; flex-direction: column; gap: 6px; }
.st-br { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; }
.st-node { display: flex; flex-direction: column; gap: 2px; padding: 7px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit; font: inherit; cursor: pointer; text-align: left; }
.st-node small { font-size: 11px; color: var(--muted); }
.st-node:disabled { opacity: .45; cursor: default; }
.st-node.can { border-color: rgba(255,213,74,.6); }
.st-node.on { border-color: #3ee07a; background: rgba(62,224,122,.15); }
@media (max-width: 640px) { .st-cols { grid-template-columns: 1fr; } }

/* Pokedex research */
.research { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rt { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rt small { opacity: .7; }
.rt.ready { color: #ffd54a; border-color: rgba(255,213,74,.6); }
.rt.claimed { color: #3ee07a; border-color: rgba(62,224,122,.5); }

/* Daycare */
.dc-pair { display: flex; justify-content: center; align-items: center; gap: 16px; }
.dc-pair img { width: 140px; height: 140px; object-fit: contain; }
.dc-heart { font-size: 34px; color: #ff6b9a; animation: dc-beat 1.2s infinite; }
@keyframes dc-beat { 50% { transform: scale(1.25); } }
.dc-actions { display: flex; justify-content: center; gap: 10px; }
.dc-chosen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.dc-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 110px; justify-content: center; border: 2px dashed var(--line); border-radius: 14px; padding: 8px; }
.dc-slot img { width: 64px; height: 64px; image-rendering: pixelated; }
.dc-slot small { color: var(--muted); }
#dcdrop { width: 100%; margin-bottom: 12px; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; }
.dc-mon { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.dc-mon img { width: 56px; height: 56px; image-rendering: pixelated; }
.dc-mon.on { border-color: #ff6b9a; background: rgba(255,107,154,.15); }

/* Admin */
.ad-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ad-card { display: flex; flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.ad-card b { font-size: 24px; }
.ad-card span { color: var(--muted); font-size: 12px; }
.ad-chart { width: 100%; height: 160px; background: rgba(255,255,255,.03); border-radius: 10px; }
.ad-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.ad-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ad-lists ol { margin: 0; padding-left: 18px; font-size: 13px; }
.ad-lists li span { margin-right: 6px; }
.ad-tool { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-tool .search { flex: 1 1 200px; margin: 0; }
.btn-danger { border-color: rgba(255,77,94,.7); color: #ff8a96; }
.ad-out { white-space: pre-wrap; font-size: 13px; color: var(--muted); }
.mode-card .badge-count:empty { display: none; }

/* Auto-pick countdown under the level-up cards */
.autopick { position: relative; height: 22px; margin: 10px auto 0; max-width: 420px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
.autopick i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(255,213,74,.55), rgba(255,159,67,.55)); transition: width .2s linear; }
.autopick span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; font-weight: 700; }
/* Admin page spacing: sections were crammed together */
#adminbody h3 { margin: 26px 0 10px; }
#adminbody h4 { margin: 0 0 6px; }
.ad-lists { margin-top: 18px; }
.ad-lists li { line-height: 1.6; }
.ad-chart { display: block; }
.ad-axis { margin-top: 4px; }

/* Pokedex milestones and cell markers */
.dex-milestones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.dex-ms { display: flex; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); font-size: 13px; }
.dex-ms > div:last-child { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dex-ms .cos-swatch { width: 30px; height: 30px; flex: none; }
.dex-ms.done { border-color: var(--gold); }
.dex-cell { position: relative; }
.dex-cell .dcaught { position: absolute; left: 4px; bottom: 22px; color: #ff4d5e; font-size: 10px; }
.dex-cell .dshiny { position: absolute; right: 4px; bottom: 22px; font-size: 11px; }

/* Photo mode */
.photo-bar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  padding: 8px 12px; border-radius: 16px; background: rgba(13,18,32,.82); border: 1px solid var(--line); backdrop-filter: blur(6px); max-width: calc(100vw - 32px); }
.photo-opt { display: flex; gap: 4px; align-items: center; font-size: 13px; }
body.photo #vignette, body.photo #minimap { display: none; }

/* Spectate */
.live-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.live-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 14px; background: rgba(255,255,255,.03); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.live-card:hover { background: rgba(255,255,255,.07); }
.live-card img.mon { width: 56px; height: 56px; image-rendering: pixelated; flex: none; }
.live-card img.av { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.live-card .li { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4d5e; margin-right: 4px; animation: livepulse 1.2s infinite; }
@keyframes livepulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Settings tabs and groups */
.settings-tabs { flex-wrap: wrap; margin: 0; }
.settings-group { display: flex; flex-direction: column; gap: 10px; }
.settings-group h4 { margin: 4px 2px 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.settings-group.hidden { display: none; }
.settings-foot { display: flex; justify-content: flex-end; }
.pause-settings .settings-tabs .tab { padding: 6px 10px; font-size: 13px; }
@media (max-width: 520px) { .setting { flex-wrap: wrap; } .setting input[type=range] { width: 100%; } .setting select { max-width: 100%; } }

/* Safari Zone: no fighting HUD */
body.safari-mode #terabtn, body.safari-mode #dmaxbtn, body.safari-mode #zbtn, body.safari-mode #megabtn, body.safari-mode #moveslots, body.safari-mode #itemslots, body.safari-mode .xp-wrap, body.safari-mode #nextboss { display: none !important; }
body.spectating #moveslots, body.spectating #itemslots, body.spectating #minimap, body.spectating .stat-pill.money { display: none !important; }
.trial-head .search { width: 100%; margin-bottom: 8px; }
.trial-region { grid-column: 1 / -1; margin: 10px 2px 0; font-size: 16px; }
.photo-view { z-index: 80; }
.photo-view .panel { max-width: min(900px, calc(100vw - 32px)); text-align: center; }
.photo-view img { width: 100%; border-radius: 10px; }

/* Phones: a bigger Catch button that still shows how many balls are left. */
@media (pointer: coarse) {
  .power-btn.catch { width: 64px !important; height: 64px !important; }
  .power-btn.catch img { width: 36px; height: 36px; }
  .power-btn.catch span { display: block !important; position: absolute; right: 2px; bottom: 2px; font-size: 0; }
  .power-btn.catch span b { font-size: 12px; background: #fff; color: #b0202a; border-radius: 999px; padding: 0 5px; }
}
.live-pill { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: #fff; background: rgba(255,77,94,.85); border-radius: 999px; padding: 1px 8px; display: inline-block; }
.live-pill.bad { background: rgba(80,90,110,.85); font-weight: 600; letter-spacing: 0; }

/* Spectator emotes */
.emote-feed { position: fixed; right: max(12px, env(safe-area-inset-right)); top: 190px; z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.emote-bubble { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.95); color: #1b2236; box-shadow: 0 4px 14px rgba(0,0,0,.35); animation: emotepop .28s cubic-bezier(.2,1.6,.4,1); transition: opacity .4s, transform .4s; }
.emote-bubble img { width: 40px; height: 40px; border-radius: 50%; background: #e9eefb; image-rendering: pixelated; }
.emote-bubble b { display: block; font-size: 15px; line-height: 1.1; }
.emote-bubble small { display: block; font-size: 11px; color: #5b6680; }
.emote-bubble.out { opacity: 0; transform: translateX(30px); }
@keyframes emotepop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.emote-bar { display: none; position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 40; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(13,18,32,.82); border: 1px solid var(--line); max-width: calc(100vw - 24px); overflow-x: auto; }
body.spectating .emote-bar { display: flex; }
.emote-bar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 4px; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 11px; cursor: pointer; }
.emote-bar button:hover { background: rgba(255,255,255,.14); }
.emote-bar button:disabled { opacity: .45; cursor: default; }
.emote-bar img { width: 38px; height: 38px; border-radius: 50%; image-rendering: pixelated; }
@media (prefers-reduced-motion: reduce) { .emote-bubble { animation: none; transition: opacity .4s; } }
.emote-bubble.custom img { border-radius: 8px; background: none; object-fit: contain; width: 48px; height: 48px; image-rendering: auto; }
.emote-bar .em-more { font-size: 26px; line-height: 38px; height: 38px; }
.emote-picker { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px); z-index: 41; width: min(460px, calc(100vw - 24px)); max-height: 46vh; overflow-y: auto;
  padding: 10px; border-radius: 16px; background: rgba(13,18,32,.95); border: 1px solid var(--line); }
body:not(.spectating) .emote-picker { display: none; }
.emote-picker .search { width: 100%; margin-bottom: 8px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.ep-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); cursor: pointer; padding: 4px; }
.ep-grid button:hover { background: rgba(255,255,255,.16); }
.ep-grid img { width: 100%; height: 100%; object-fit: contain; }

/* Admin trolls */
.troll-panel b { display: block; margin-bottom: 8px; }
.troll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.troll-grid button { display: flex; align-items: center; gap: 6px; padding: 8px; border: 0; border-radius: 10px; background: rgba(255,255,255,.07); color: #fff; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.troll-grid button:hover { background: rgba(255,255,255,.16); }
.troll-grid button span { font-size: 18px; }
.troll-msg { display: flex; gap: 6px; margin-top: 8px; }
.troll-msg .search { flex: 1; }
body.troll-dark #vignette { background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.2) 0, rgba(0,0,0,.97) 120px); opacity: 1; transition: none; }
.troll-spawn { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.troll-spawn .search { flex: 1 1 140px; }
.troll-spawn select { background: rgba(0,0,0,.35); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px; font: inherit; }
.troll-spawn .troll-hp { flex: 0 1 130px; }
.troll-spawn .troll-count { flex: 0 0 64px; }

/* Extra bosses: smaller bars under the main boss bar */
.boss-bars { align-self: center; width: min(420px, 80%); display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.boss-mini { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 8px; }
.boss-mini span { font-size: 11px; font-weight: 700; color: #ffb3b3; text-shadow: 0 1px 3px #000; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.boss-mini .boss-track { height: 7px; margin: 0; }
.boss-mini .boss-track div { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3b4e, #ff8a4c); transition: width .15s; }
.boss-more { font-size: 11px; color: #ffb3b3; text-align: center; }
.md-list { display: flex; flex-direction: column; gap: 8px; max-height: 66vh; overflow-y: auto; }
.md-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.md-move { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--tc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.md-move img, .md-move canvas, .md-move svg { width: 36px; height: 36px; flex: none; }
.md-move small { display: block; color: var(--muted); font-size: 11px; }
.md-op { font-size: 22px; font-weight: 800; color: var(--muted); }
.md-item { display: flex; flex-direction: column; align-items: center; font-size: 12px; min-width: 70px; }
.md-item img { width: 36px; height: 36px; }
.md-mons { display: flex; flex-wrap: wrap; gap: 2px; max-width: 45%; }
.md-mons img { width: 40px; height: 40px; image-rendering: pixelated; }
@media (max-width: 640px) { .md-row { flex-wrap: wrap; } .md-move { flex-basis: 100%; } .md-op { width: 100%; text-align: center; font-size: 16px; } .md-mons { max-width: 100%; } }
.dex-tabs { display: flex; gap: 6px; margin-bottom: 8px; } .dex-tabs .btn { flex: 1; }

/* ---------- UI polish ---------- */
/* Menu: icon tiles in a 3x3 grid at every width, so no button sits alone on its own row. */
.menu-grid { grid-template-columns: repeat(3, 1fr); }
.menu-grid .btn { flex-direction: column; gap: 4px; min-height: 72px; line-height: 1.15; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); }
.menu-grid .btn:hover { border-color: rgba(255, 203, 5, .55); box-shadow: 0 0 0 1px rgba(255, 203, 5, .25), 0 8px 20px rgba(0, 0, 0, .35); }
.menu-grid .mi { font-size: 22px; line-height: 1; }
.menu-grid .btn-ico { margin: -4px 0 0; width: 30px; height: 30px; }
.menu-grid .badge-count { font-size: 10px; }
.title-main .tagline { text-shadow: 0 2px 8px rgba(0, 0, 0, .85), 0 0 2px #000; color: #c9d1e6; }
.title-main .menu-buttons { background: rgba(10, 14, 26, .55); border: 1px solid var(--line); border-radius: 22px; padding: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); }

/* Screens slide in, headers stay put while long panels scroll. */
.screen:not(.hidden) > .panel { animation: panelIn .22s ease-out; }
@keyframes panelIn { from { transform: translateY(12px); opacity: 0; } }
.panel-head { position: sticky; top: 0; z-index: 5; margin: -20px -20px 16px; padding: 14px 20px;
  background: linear-gradient(180deg, var(--panel-solid) 75%, rgba(22, 29, 50, 0)); border-radius: 22px 22px 0 0; }
.panel h2 { letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }

/* Tabs scroll sideways on narrow screens instead of squashing. */
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; transition: background .12s, color .12s; }
.tab:not(.active):hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.tab.active { box-shadow: 0 3px 10px rgba(255, 176, 0, .3); }

/* Leaderboard rows. */
.lb tbody tr { transition: background .12s; }
.lb tbody tr:not(.lb-gap):hover td { background: rgba(255, 255, 255, .04); }
.lb tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* Thin themed scrollbars. */
.screen, .panel, .table-wrap { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.screen::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.screen::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }

@media (prefers-reduced-motion: reduce) { .screen:not(.hidden) > .panel { animation: none; } }
@media (max-width: 640px) {
  .menu-grid .btn { min-height: 64px; font-size: 12px; padding: 10px 4px; }
  .title-main .menu-buttons { padding: 12px; border-radius: 18px; }
  .panel-head { margin: -14px -14px 12px; padding: 10px 14px; }
}

/* Move test page (dev only, ?movetest) */
#movetest { position: fixed; inset: 0; z-index: 9999; overflow: auto; padding: 12px 16px; background: var(--bg, #14121f); color: var(--text, #fff); }
#movetest.hidden { display: none; }
.mt-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: -12px; padding: 8px 0; background: inherit; }
.mt-head input[type="text"], .mt-head #mtq { flex: 1; min-width: 140px; }
.mt-row { display: grid; grid-template-columns: 36px 1fr auto auto auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-left: 3px solid var(--tc); margin-bottom: 2px; font-size: 13px; }
.mt-row img { width: 32px; height: 32px; }
.mt-row i { opacity: 0.6; font-style: normal; font-size: 11px; }
.mt-hi { background: rgba(255, 90, 60, 0.18); }
.mt-lo { background: rgba(80, 140, 255, 0.18); }
@media (max-width: 600px) { .mt-row { grid-template-columns: 32px 1fr auto; } .mt-row > span:nth-of-type(2) { display: none; } }
.slot .sig-star { position: absolute; top: -2px; left: 2px; font-size: 11px; color: #ffd43b; text-shadow: 0 0 4px #000; z-index: 1; }
.md-row.md-learned { background: rgba(62, 224, 122, 0.08); border-radius: 10px; }
.md-check { margin-left: auto; color: #3ee07a; font-weight: 700; }
/* Update blog (What's new) */
.blog { display: grid; gap: 16px; }
.post { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.02); }
.post-hero { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 96px; padding: 16px 20px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tc) 55%, #0c0f1c), color-mix(in srgb, var(--tc) 18%, #0c0f1c)); position: relative; overflow: hidden; }
.post.open .post-hero { min-height: 170px; }
.post-hero:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.post-hero-text { flex: 1; display: grid; gap: 6px; position: relative; z-index: 1; }
.post-date { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: 8px; }
.post-new { background: var(--accent); color: #1a1530; border-radius: 999px; padding: 1px 8px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.post-title { font-family: Fredoka, system-ui; font-weight: 700; font-size: 20px; line-height: 1.15; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.post.open .post-title { font-size: 28px; }
.post-hero-art { width: 96px; height: 96px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); transition: width .2s, height .2s; }
.post.open .post-hero-art { width: 150px; height: 150px; }
.post-body { display: none; padding: 16px 20px 20px; }
.post.open .post-body { display: block; }
.post-intro { font-size: 15px; line-height: 1.55; margin: 0 0 16px; }
.post-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.post-sec { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.post-sec h4 { margin: 0 0 4px; font-size: 15px; }
.post-sec p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.post-art { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--tc) 22%, transparent); }
.post-art img { width: 44px; height: 44px; object-fit: contain; }
.post-art img.pixel { image-rendering: pixelated; }
@media (max-width: 600px) {
  .post-hero { padding: 14px 16px; }
  .post.open .post-hero { min-height: 140px; }
  .post.open .post-title { font-size: 22px; }
  .post.open .post-hero-art { width: 110px; height: 110px; }
  .post-hero-art { width: 72px; height: 72px; }
  .post-body { padding: 14px 16px 16px; }
}
.md-check { white-space: nowrap; font-size: 13px; }
.md-mastered { color: #ffd43b; }

/* ---------- Title menu: news card, six tiles, utility links ---------- */
.news-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 14px 10px 10px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--tc, #ffcb05) 55%, transparent); position: relative; overflow: hidden;
  background: linear-gradient(110deg, color-mix(in srgb, var(--tc, #ffcb05) 40%, #0c0f1c), rgba(12, 15, 28, .85)); transition: transform .12s, box-shadow .12s; }
.news-card:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 1px color-mix(in srgb, var(--tc, #ffcb05) 60%, transparent); }
.news-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.news-art { width: 64px; height: 64px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }
.news-text { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; }
.news-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .7); display: flex; align-items: center; gap: 6px; }
.news-new { background: var(--accent); color: #1a1530; border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.news-title { font-family: Fredoka, system-ui; font-weight: 700; font-size: 16px; line-height: 1.2; color: #fff; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.news-go { font-size: 28px; line-height: 1; color: rgba(255, 255, 255, .6); }
.menu-grid .btn-ico { image-rendering: pixelated; }
.menu-util { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding-top: 2px; }
.menu-util .linkbtn { font-size: 13px; color: var(--muted); padding: 4px 2px; text-decoration: none; }
.menu-util .linkbtn:hover { color: var(--text); }
@media (max-width: 640px) {
  .news-card { min-height: 64px; }
  .news-art { width: 52px; height: 52px; }
  .news-title { font-size: 14px; }
}
.menu-grid .btn .btn-ico { width: 44px; height: 44px; margin: -8px 0 -4px; }
.menu-grid .btn .btn-ico[data-sprite] { width: 52px; height: 52px; margin: -12px 0 -8px; }
@media (max-width: 640px) { .menu-grid .btn .btn-ico { width: 38px; height: 38px; margin: -6px 0 -2px; } .menu-grid .btn .btn-ico[data-sprite] { width: 46px; height: 46px; margin: -10px 0 -6px; } }

/* Title quest card (weekly quests) */
.quest-card { border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .04); padding: 0; text-align: left; }
.quest-card summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.quest-card summary::-webkit-details-marker { display: none; }
.quest-card summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.quest-card:not([open]) summary::after { transform: rotate(-90deg); }
.qc-title { font-weight: 700; }
.qc-count { color: var(--gold); font-weight: 700; font-size: 13px; }
.qc-reset { color: var(--muted); font-size: 12px; }
.qc-list { display: grid; gap: 8px; padding: 0 14px 12px; }
.qc-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; font-size: 13px; }
.qc-row.done .qc-text { color: var(--muted); }
.qc-reward { color: var(--gold); font-weight: 700; font-size: 12px; }
.qc-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.qc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3ee07a, #ffcb05); border-radius: inherit; }
.qc-row.done .qc-bar i { background: #3ee07a; }
.qc-prog { font-size: 11px; color: var(--muted); text-align: right; }
.quest-card summary { position: relative; padding-right: 32px; }
.quest-card summary::after { position: absolute; right: 14px; top: 10px; margin: 0; }

/* Trainer card: an ID-card banner in the favorite partner's type color. */
.tc-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 170px; padding: 20px 22px; border-radius: 20px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent);
  background: radial-gradient(circle at 85% 50%, color-mix(in srgb, var(--tc) 55%, transparent), transparent 60%), linear-gradient(120deg, color-mix(in srgb, var(--tc) 35%, #0c0f1c), #0e1222 70%); }
.tc-hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 14px); pointer-events: none; }
.tc-id { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; min-width: 0; }
.tc-hero .tav { width: 88px; height: 88px; border: 3px solid rgba(255,255,255,.75); box-shadow: 0 6px 16px rgba(0,0,0,.4); flex: none; }
.tc-who { display: grid; gap: 4px; min-width: 0; }
.tc-who h3 { margin: 0; font-size: 28px; line-height: 1.05; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.45); overflow-wrap: anywhere; }
.tc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: color-mix(in srgb, var(--tc) 40%, #fff); }
.tc-idno { font-family: ui-monospace, monospace; font-size: 12px; color: rgba(255,255,255,.65); letter-spacing: .08em; }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tc-tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.18); color: #fff; }
.tc-tag.gold { border-color: var(--gold); color: var(--gold); }
.tc-partner { width: 150px; height: 150px; object-fit: contain; flex: none; position: relative; z-index: 1; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.tc-stats { grid-template-columns: repeat(6, 1fr); margin: 0; }
.tc-prog { margin-bottom: 10px; }
.tc-prog-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.tc-count { font-size: 13px; font-weight: 400; }
.tc-empty { color: var(--muted); font-size: 14px; margin: 0; }
@media (max-width: 640px) {
  .tc-hero { min-height: 0; padding: 16px; }
  .tc-hero .tav { width: 64px; height: 64px; }
  .tc-who h3 { font-size: 22px; }
  .tc-partner { width: 96px; height: 96px; position: absolute; right: 6px; bottom: 6px; opacity: .55; z-index: 0; }
  .tc-stats { grid-template-columns: repeat(3, 1fr); }
}
/* Mode menu groups */
.mode-group { grid-column: 1 / -1; margin: 10px 0 -2px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mode-group:first-child { margin-top: 0; }
.mode-card.mc-featured { min-height: 110px; }
.mode-card.mc-featured .mc-text b { font-size: 21px; }
.mode-card.mc-adventure.mc-featured { grid-column: auto; }
/* Achievements: filters and the "Almost there" strip */
.ach-tools { grid-column: 1 / -1; display: grid; gap: 6px; }
.ach-tools .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-close { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.ach.close { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Kecleon Shop: affordable cards stand out, and each shows its current and next effect. */
.shop-card.afford { border-color: rgba(62, 224, 122, .65); box-shadow: 0 0 0 1px rgba(62, 224, 122, .25), 0 6px 18px rgba(62, 224, 122, .12); }
.s-now { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.s-now b { color: var(--text); }
.btn-buy small { font-weight: 400; opacity: .8; }
.shop-card .s-now { grid-column: 2; }
.season-pill.event { border-color: #ff8a1f; color: #ffd0a0; box-shadow: 0 0 14px rgba(255, 138, 31, .35); }
/* Title login streak strip */
.streak-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.sk-title b { color: var(--gold); }
.sk-days { display: flex; gap: 4px; }
.sk-day { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .07); color: var(--muted); }
.sk-day.got { background: #3ee07a; color: #08260f; }
.sk-day.big { border: 1px solid var(--gold); color: var(--gold); }
.sk-day.big.got { background: var(--gold); color: #3a2a00; }
.sk-next { color: var(--muted); }
.sk-next b { color: var(--gold); }
.lb-follow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.tc-compare { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tc-compare table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tc-compare th, .tc-compare td { padding: 6px 10px; text-align: center; border-bottom: 1px solid var(--line); }
.tc-compare tbody th { color: var(--muted); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tc-compare thead th { background: rgba(255, 255, 255, .04); }
.tc-compare td.win { color: #3ee07a; font-weight: 700; }
.tc-compare td.win::after { content: " \25B2"; font-size: 10px; }
.share-preview { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; margin: 8px 0 12px; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Kecleon Shop: item sets */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.set-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255, 255, 255, .03); display: grid; gap: 8px; }
.set-head { display: grid; gap: 2px; }
.set-bonus { font-size: 13px; color: #3ee07a; }
.set-pieces { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.set-piece { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); min-width: 64px; text-align: center; }
.set-piece img { width: 36px; height: 36px; image-rendering: pixelated; }
.set-plus { color: var(--muted); font-weight: 700; }

/* Spectating: the bar while watching and the featured live run */
.spec-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px);
  padding: 6px 8px; border-radius: 16px; background: rgba(10, 14, 26, .85); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.spec-bar.hidden { display: none; }
.spec-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.spec-who img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.spec-who div { display: grid; min-width: 0; }
.spec-who b, .spec-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.spec-who span { font-size: 11px; }
.spec-live { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spec-nav { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; background: rgba(255, 255, 255, .08); }
.spec-nav:hover { background: rgba(255, 255, 255, .16); }
.spec-nav:focus-visible { outline: 2px solid var(--accent); }
@media (max-width: 640px) { .spec-live { display: none; } }
.live-feature { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; margin-bottom: 12px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent); background: linear-gradient(110deg, color-mix(in srgb, var(--tc) 40%, #0c0f1c), #0e1222 75%); }
.live-feature:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }
.live-feature:focus-visible { outline: 3px solid var(--accent); }
.lf-art { width: 110px; height: 110px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)); }
.lf-text { display: grid; gap: 4px; min-width: 0; }
.lf-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .75); display: flex; align-items: center; gap: 6px; }
.lf-text b { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.lf-text b .av { width: 28px; height: 28px; border-radius: 50%; }
.lf-text > span:not(.lf-kicker):not(.lf-cta) { font-size: 13px; color: var(--muted); }
.lf-cta { justify-self: start; margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #1a1530; font-weight: 700; font-size: 13px; }
.live-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.live-feature, .live-chips { grid-column: 1 / -1; } .live-chips { align-items: center; } .live-chips .chip { align-self: center; }
.spec-bar { top: auto; bottom: 108px; }
.spec-who div { min-width: 90px; }
@media (max-width: 640px) { .spec-bar { bottom: 96px; } }
/* Gacha variants */
[data-variant="rainbow"] { animation: variantRainbow 4s linear infinite; }
@keyframes variantRainbow { from { filter: hue-rotate(0deg) saturate(1.6); } to { filter: hue-rotate(360deg) saturate(1.6); } }
@media (prefers-reduced-motion: reduce) { [data-variant="rainbow"] { animation: none; filter: hue-rotate(180deg) saturate(1.6); } }
.variant-badge { position: absolute; top: 4px; left: 6px; font-size: 12px; }
.variant-badge.v1 { color: #7fe3ff; } .variant-badge.v2 { color: #ffd43b; } .variant-badge.v3 { color: #ff7ad0; text-shadow: 0 0 6px #ff7ad0; }

/* Gacha */
.gacha-card { --tc: #ffcb05; }
.gacha { display: grid; gap: 14px; }
.g-banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-radius: 20px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tc) 60%, transparent); background: radial-gradient(circle at 85% 50%, color-mix(in srgb, var(--tc) 55%, transparent), transparent 60%), linear-gradient(120deg, color-mix(in srgb, var(--tc) 30%, #0c0f1c), #0e1222 70%); }
.g-btext { display: grid; gap: 6px; max-width: 520px; position: relative; z-index: 1; }
.g-btext h3 { margin: 0; font-size: 30px; color: #fff; }
.g-btext p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .8); }
.g-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.g-pity { display: grid; gap: 4px; margin-top: 6px; }
.g-pity-top { display: flex; justify-content: space-between; font-size: 13px; }
.g-guar { font-size: 12px; color: var(--gold); }
.g-hero { width: 170px; height: 170px; object-fit: contain; flex: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.g-wallet { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 15px; }
.g-pull { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.g-pull .btn { display: grid; gap: 2px; justify-items: center; }
.g-pull small { font-size: 12px; font-weight: 400; opacity: .85; }
.g-stage { display: grid; gap: 10px; justify-items: center; }
.g-stage:empty { display: none; }
.g-balls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; }
.g-balls:has(.g-slot:only-child) { grid-template-columns: minmax(0, 220px); justify-content: center; }
.g-slot { min-height: 150px; display: grid; place-items: center; }
.g-ball { width: 54px; height: 54px; border-radius: 50%; position: relative;
  background: linear-gradient(180deg, var(--rc) 0 46%, #1a1d2a 46% 54%, #f2f4f8 54%); box-shadow: 0 0 18px color-mix(in srgb, var(--rc) 60%, transparent), inset 0 -4px 0 rgba(0, 0, 0, .2);
  animation: gBallDrop .5s cubic-bezier(.3, 1.6, .5, 1) both, gBallShake .5s .55s ease-in-out 2; }
.g-ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: #fff; border: 3px solid #1a1d2a; }
.g-ball.r-legendary { background: linear-gradient(180deg, #ffcb05 0 46%, #1a1d2a 46% 54%, #fff6c0 54%); box-shadow: 0 0 26px #ffcb05, 0 0 46px #ff7ad0; }
@keyframes gBallDrop { from { transform: translateY(-120px) scale(.6); opacity: 0; } }
@keyframes gBallShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }
.g-prize { position: relative; width: 100%; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 10px 6px; border-radius: 14px;
  border: 2px solid var(--rc); background: color-mix(in srgb, var(--rc) 14%, #10142a); animation: gPop .35s ease-out; }
.g-prize.r-legendary { box-shadow: 0 0 24px rgba(255, 203, 5, .55); }
@keyframes gPop { from { transform: scale(.4); opacity: 0; } }
.g-art { height: 64px; display: grid; place-items: center; }
.g-art img { width: 64px; height: 64px; }
.g-icon { font-size: 36px; color: var(--gold); }
.g-prize b { font-size: 13px; display: grid; }
.g-prize small { font-weight: 400; font-size: 11px; color: var(--muted); }
.g-rar { font-size: 11px; font-weight: 700; color: var(--rc); text-transform: uppercase; letter-spacing: .06em; }
.g-new, .g-feat { position: absolute; top: -8px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.g-new { left: 6px; background: #3ee07a; color: #08260f; }
.g-feat { right: 6px; background: var(--gold); color: #3a2a00; }
.g-odds summary { cursor: pointer; color: var(--muted); }
.g-odds table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.g-odds td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.g-h { margin: 6px 0 0; }
.g-dust { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.g-dcard { display: grid; justify-items: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); font-size: 13px; text-align: center; }
.g-dcard img { width: 56px; height: 56px; }
.g-dbtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.g-dbtns .btn { font-size: 11px; padding: 4px 8px; }
@media (max-width: 640px) {
  .g-hero { width: 110px; height: 110px; }
  .g-btext h3 { font-size: 24px; }
  .g-pull { grid-template-columns: 1fr; }
  .g-balls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .g-ball, .g-prize { animation: none; } }

/* Partner screen: the run setup bar, the Look picker and the phone start bar */
.run-setup { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); margin-bottom: 12px; }
.run-setup > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; }
.run-setup > summary::-webkit-details-marker { display: none; }
.run-setup[open] > summary { border-bottom: 1px solid var(--line); }
.run-setup > :not(summary) { margin: 12px 14px; }
.rs-title { font-weight: 700; margin-right: 4px; }
.rs-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.rs-chip.gold { border-color: var(--gold); color: var(--gold); }
.rs-change { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 600; }
.run-setup[open] .rs-change { visibility: hidden; }
.look-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.look-pick .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
.look-pick .look-1.on { border-color: #7fe3ff; } .look-pick .look-2.on { border-color: var(--gold); } .look-pick .look-3.on { border-color: #ff7ad0; box-shadow: 0 0 10px rgba(255, 122, 208, .4); }
.start-bar { display: none; }
@media (max-width: 900px) {
  .start-bar:not(:empty) { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; margin: 12px -14px -14px; padding: 10px 14px;
    background: linear-gradient(0deg, var(--panel-solid) 80%, rgba(22, 29, 50, 0)); border-top: 1px solid var(--line); }
  .start-bar img { width: 44px; height: 44px; image-rendering: pixelated; }
  .start-bar > span { flex: 1; display: grid; min-width: 0; }
  .start-bar b, .start-bar .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .start-bar .muted { font-size: 12px; }
}

/* Pokemon candies */
.g-candy { font-size: 11px; color: #ff9ad0; }
.candy-box { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, #ff9ad0 45%, transparent); border-radius: 14px; background: rgba(255, 154, 208, .06); }
.candy-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.candy-pips { display: flex; gap: 3px; }
.candy-pips i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.candy-pips i.on { background: #ff9ad0; }
.candy-now { font-size: 12px; }
.candy-box .btn { justify-self: start; }
.candy-max { font-size: 12px; color: var(--gold); font-weight: 700; }
