@font-face {
  font-family: "Pixelify Sans";
  src: url("../assets/fonts/PixelifySans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url("../assets/fonts/PixelifySans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #edf2e8;
  --muted: #9daea1;
  --green: #b7dc8b;
  --gold: #f0c77a;
  --pixel: "Pixelify Sans", "Courier New", monospace;
  --sans: "Pixelify Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #111a20; }
body { color: var(--ink); font: 14px/1.45 var(--sans); user-select: none; -webkit-font-smoothing: antialiased; }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.hidden { display: none !important; }
#arena-app, .setup-screen, .combat-screen { position: fixed; inset: 0; }
.setup-screen { overflow: auto; padding: 28px clamp(22px, 5vw, 82px) 18px; background: radial-gradient(ellipse at 86% 16%, #31483d 0, #1d2c2a 32%, #111a20 72%); }
.setup-screen::before { content: ""; position: fixed; inset: 0; opacity: .11; pointer-events: none; background-image: linear-gradient(rgba(225,242,212,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(225,242,212,.13) 1px, transparent 1px); background-size: 4px 4px; }
.back-link { position: relative; z-index: 1; display: inline-flex; padding: 8px 0; color: #b6c5b7; font-size: 12px; text-decoration: none; }
.back-link:hover { color: white; }
.setup-layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(210px, .75fr) minmax(550px, 1.5fr); gap: clamp(24px, 5vw, 78px); align-items: start; width: min(1210px, 100%); margin: clamp(22px, 5vh, 58px) auto 28px; }
.setup-heading { padding-top: 40px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #b7caac; letter-spacing: 2px; font-size: 9px; font-weight: 800; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #b6df8a; box-shadow: 0 0 14px #b6df8a; }
.setup-heading h1 { margin: 25px 0 18px; font: 26px/1.9 var(--pixel); color: #f0f3db; text-shadow: 0 4px rgba(5,14,9,.3); }
.setup-heading h1 em { color: #bbdc92; font-style: normal; }
.setup-heading p { max-width: 290px; color: #a8b8aa; font-size: 14px; }
.setup-card { padding: clamp(18px, 2.5vw, 32px); border: 1px solid rgba(201,224,190,.16); border-radius: 18px; background: rgba(15,25,24,.88); box-shadow: 0 22px 70px rgba(0,0,0,.24); }
.section-title { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.section-title>span { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #576d53; border-radius: 9px; color: #bfdc9b; font: 9px var(--pixel); }
.section-title h2 { margin: 0; font-size: 16px; }
.section-title small { color: #91a293; font-size: 11px; }
.pokemon-roster { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.pokemon-choice { min-width: 0; padding: 7px 4px 6px; border: 1px solid rgba(238,247,219,.1); border-radius: 10px; background: rgba(255,255,255,.035); text-align: center; transition: .15s ease; }
.pokemon-choice:hover { transform: translateY(-2px); border-color: rgba(201,224,190,.34); }
.pokemon-choice.selected { border-color: #b7dc8b; background: rgba(183,220,139,.12); box-shadow: inset 0 0 0 1px rgba(183,220,139,.12); }
.pokemon-choice img { display: block; width: 52px; height: 52px; margin: 0 auto 3px; image-rendering: pixelated; object-fit: contain; }
.pokemon-choice b { display: block; overflow: hidden; color: #e8eee1; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pokemon-choice small { display: block; margin-top: 2px; color: #9bab99; font-size: 8px; }
.pokemon-detail { display: grid; grid-template-columns: minmax(165px, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: center; min-height: 100px; margin: 14px 0 21px; padding: 13px 15px; border: 1px solid rgba(238,247,219,.08); border-radius: 11px; background: rgba(255,255,255,.025); }
.detail-profile { display: flex; align-items: center; gap: 11px; }
.detail-profile img { width: 61px; height: 61px; image-rendering: pixelated; object-fit: contain; }
.detail-profile strong { display: block; font-size: 14px; }
.detail-profile small { color: #a5b59f; font-size: 10px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px 12px; }
.stat-item { color: #a5b59f; font-size: 9px; }
.stat-item b { display: block; margin-top: 2px; color: #e5eddc; font-size: 11px; }
.move-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.move-chip { min-width: 0; padding: 6px 8px; border-left: 2px solid var(--move-color); background: rgba(255,255,255,.035); }
.move-chip span { display: block; color: #9dab9d; font-size: 8px; }
.move-chip b { display: block; overflow: hidden; margin-top: 2px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.setup-options { display: grid; gap: 16px; }
.option-heading { display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px; }
.option-heading b { font-size: 11px; }
.option-heading small { color: #849587; font-size: 9px; }
.option-grid { display: grid; gap: 7px; }
.mode-grid { grid-template-columns: repeat(3, 1fr); }
.compact-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.arena-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
.choice { min-height: 36px; padding: 7px 9px; border: 1px solid rgba(238,247,219,.1); border-radius: 8px; background: rgba(255,255,255,.035); color: #dce5d8; font-size: 10px; text-align: left; }
.choice:hover { border-color: rgba(201,224,190,.3); background: rgba(255,255,255,.07); }
.choice.selected { border-color: rgba(183,220,139,.65); background: rgba(183,220,139,.12); color: #d8f0b5; }
.mode-grid .choice b, .mode-grid .choice small { display: block; }
.mode-grid .choice b { font-size: 10px; }
.mode-grid .choice small { margin-top: 2px; color: #96a598; font-size: 8px; }
.arena-grid .choice { text-align: center; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 21px; padding-top: 16px; border-top: 1px solid rgba(238,247,219,.1); }
.control-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; max-width: 350px; color: #87988b; font-size: 8px; }
.control-summary span { margin-right: 5px; color: #e0e9dc; font-size: 8px; font-weight: 700; }
.start-button { min-height: 46px; padding: 0 17px; border: 0; border-radius: 9px; background: #b9d995; box-shadow: 0 4px 0 #769a61; color: #1b2c21; font-weight: 800; transition: transform .16s ease, background .16s ease; }
.start-button span { margin-left: 18px; font-size: 17px; }
.start-button:hover { transform: translateY(-2px); background: #cbe8a6; }
.legal-note { position: relative; z-index: 1; width: min(1210px, 100%); margin: 14px auto 0; color: #718177; font-size: 9px; text-align: right; }

.combat-screen { background: #315744; }
#arena-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; }
.arena-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(8,19,15,.52),transparent 25%,transparent 73%,rgba(8,18,14,.4)); }
.combat-top { position: absolute; z-index: 2; top: 16px; left: 18px; right: 18px; display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 9px 12px; border: 1px solid rgba(238,247,219,.14); border-radius: 13px; background: rgba(17,29,25,.86); backdrop-filter: blur(12px); box-shadow: 0 8px 26px rgba(9,18,13,.22); }
.fighter-card { position: relative; display: grid; grid-template-columns: 49px 112px minmax(110px, 230px); grid-template-rows: 1fr 12px; align-items: center; gap: 2px 9px; min-width: min(44vw, 415px); }
.fighter-card img { grid-row: 1 / 3; width: 47px; height: 47px; image-rendering: pixelated; object-fit: contain; }
.fighter-meta strong, .fighter-meta span { display: block; }
.fighter-meta strong { max-width: 110px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.fighter-meta span { color: #b3c2a9; font-size: 8px; letter-spacing: .8px; }
.hp-meter { position: relative; height: 13px; overflow: hidden; border: 1px solid rgba(255,255,255,.17); border-radius: 4px; background: rgba(0,0,0,.35); }
.hp-meter i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg,#82bd67,#b9db82); transition: width .14s; }
.hp-meter b { position: absolute; inset: 0; color: white; font-size: 8px; line-height: 11px; text-align: center; text-shadow: 0 1px 3px #000; }
.shield-meter { grid-column: 3; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.1); }
.shield-meter i { display: block; width: 0; height: 100%; background: #76c9f3; transition: width .14s; }
.match-readout { display: grid; justify-items: center; flex: 1; line-height: 1.2; }
.match-readout span { color: #afc1a8; font-size: 8px; letter-spacing: 1.4px; }
.match-readout b { font: 17px var(--pixel); color: #f3edc9; }
.match-readout small { margin-top: 4px; color: #879888; font-size: 7px; }
.score-card { display: grid; min-width: 95px; justify-items: center; }
.score-card small { color: #96a794; font-size: 7px; letter-spacing: .7px; }
.score-card b { color: #f2dc8d; font: 15px var(--pixel); }
.score-card span { color: #b9c6b7; font-size: 8px; }
.pause-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.06); font-size: 16px; }
.pause-button:hover { background: rgba(255,255,255,.13); }
.combat-notice { position: absolute; z-index: 2; top: 112px; left: 50%; min-width: 1px; padding: 0; color: #fff3bd; font-size: 12px; font-weight: 700; text-align: center; text-shadow: 0 2px 6px #101710; transform: translateX(-50%); transition: opacity .2s; }
.combat-bottom { position: absolute; z-index: 2; right: 18px; bottom: 17px; left: 18px; display: flex; align-items: end; justify-content: space-between; gap: 14px; pointer-events: none; }
.combat-tip { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; max-width: 215px; padding: 9px 11px; border: 1px solid rgba(238,247,219,.12); border-radius: 9px; background: rgba(17,29,25,.78); color: #a8b6a8; font-size: 9px; }
kbd { display: inline-grid; place-items: center; min-width: 19px; min-height: 18px; padding: 1px 4px; border: 1px solid rgba(236,245,226,.22); border-radius: 4px; background: rgba(255,255,255,.07); color: #eff3e8; font: 8px var(--sans); font-weight: 800; }
.ability-bar { display: flex; justify-content: center; gap: 8px; pointer-events: auto; }
.ability-slot { position: relative; width: 91px; height: 68px; overflow: hidden; padding: 7px 8px; border: 1px solid rgba(238,247,219,.2); border-radius: 10px; background: rgba(17,29,25,.9); box-shadow: 0 5px 15px rgba(0,0,0,.2); text-align: left; }
.ability-slot:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--slot-color); }
.ability-slot:disabled { cursor: default; opacity: .58; }
.ability-slot .slot-key { display: inline-grid; place-items: center; min-width: 17px; height: 16px; margin-bottom: 5px; border-radius: 4px; background: rgba(255,255,255,.13); color: white; font: 8px var(--pixel); }
.ability-slot b { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ability-slot small { display: block; margin-top: 2px; color: #a9b5a7; font-size: 8px; }
.ability-slot .cooldown-mask { position: absolute; inset: 0 0 auto; height: var(--cooldown, 0%); background: rgba(10,17,17,.75); pointer-events: none; transition: height .08s linear; }
.dash-panel { display: grid; justify-items: end; gap: 5px; min-width: 82px; padding: 8px 10px; border: 1px solid rgba(238,247,219,.12); border-radius: 9px; background: rgba(17,29,25,.78); pointer-events: auto; }
.dash-panel>span { color: #b4c3b0; font-size: 8px; letter-spacing: 1.1px; }
.dash-panel kbd { color: #e6d896; }
.dash-charges { display: flex; gap: 5px; }
.dash-charge { position: relative; width: 23px; height: 10px; overflow: hidden; border: 1px solid rgba(233,244,218,.24); border-radius: 3px; background: rgba(255,255,255,.08); }
.dash-charge i { display: block; width: 100%; height: 100%; background: #d8ce7c; }
.dash-charge.empty i { width: var(--recharge, 0%); background: #a8a272; }
.combat-overlay { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(8,14,14,.64); backdrop-filter: blur(7px); }
.result-card { width: min(460px, 100%); padding: 31px; border: 1px solid rgba(201,224,190,.2); border-radius: 16px; background: #172522; box-shadow: 0 24px 70px rgba(0,0,0,.45); text-align: center; animation: card-in .25s ease both; }
.result-eyebrow { color: #b9dc8f; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.result-card h2 { margin: 13px 0 8px; font-size: 22px; }
.result-card p { margin: 0; color: #a3b2a5; font-size: 12px; }
.result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 23px 0; }
.result-stats.ranked { grid-template-columns: repeat(4,1fr); }
.result-stat { padding: 10px 5px; border: 1px solid rgba(238,247,219,.1); border-radius: 8px; background: rgba(255,255,255,.035); }
.result-stat b { display: block; color: #e5eddb; font-size: 16px; }
.result-stat small { color: #93a393; font-size: 8px; }
.result-actions { display: grid; gap: 8px; }
.result-actions .start-button { width: 100%; }
.secondary-button { display: block; width: 100%; min-height: 38px; padding: 9px; border: 1px solid rgba(238,247,219,.11); border-radius: 8px; background: rgba(255,255,255,.04); color: #c7d2c5; font-size: 11px; text-decoration: none; }
.secondary-button:hover { background: rgba(255,255,255,.09); }

@keyframes card-in { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 950px) {
  .setup-layout { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .setup-heading { padding: 0; }
  .setup-heading h1 { display: inline-block; margin: 11px 20px 0 0; font-size: 19px; line-height: 1.7; }
  .setup-heading p { display: inline-block; max-width: 270px; margin: 0; font-size: 12px; }
  .setup-heading .eyebrow { font-size: 8px; }
  .legal-note { margin-top: 0; }
}
@media (max-width: 650px) {
  .setup-screen { padding: 14px 14px 12px; }
  .back-link { font-size: 10px; }
  .setup-layout { margin: 10px auto 14px; }
  .setup-heading h1 { font-size: 16px; }
  .setup-heading p { max-width: 190px; font-size: 10px; }
  .setup-card { padding: 14px; border-radius: 13px; }
  .section-title h2 { font-size: 14px; }
  .section-title small { font-size: 9px; }
  .pokemon-roster { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .pokemon-choice { display: flex; align-items: center; gap: 5px; padding: 4px; text-align: left; }
  .pokemon-choice img { flex: 0 0 36px; width: 36px; height: 36px; margin: 0; }
  .pokemon-choice b { font-size: 8px; }
  .pokemon-choice small { font-size: 7px; }
  .pokemon-detail { grid-template-columns: 1fr; gap: 8px; margin: 8px 0 12px; padding: 9px; }
  .detail-profile img { width: 44px; height: 44px; }
  .detail-stats { grid-template-columns: repeat(3,1fr); }
  .move-list { gap: 4px; }
  .move-chip { padding: 5px; }
  .move-chip b { font-size: 8px; }
  .move-chip span { font-size: 7px; }
  .setup-options { gap: 10px; }
  .option-heading { display: block; margin-bottom: 5px; }
  .option-heading small { display: block; }
  .mode-grid { gap: 4px; }
  .mode-grid .choice { padding: 6px 5px; }
  .mode-grid .choice b { font-size: 8px; }
  .mode-grid .choice small { font-size: 7px; }
  .compact-grid { gap: 4px; }
  .choice { min-height: 32px; padding: 5px; font-size: 9px; }
  .setup-footer { align-items: stretch; flex-direction: column; margin-top: 12px; padding-top: 11px; }
  .control-summary { max-width: none; font-size: 7px; }
  .start-button { min-height: 42px; }
  .legal-note { font-size: 7px; text-align: center; }
  .combat-top { top: 8px; left: 8px; right: 8px; gap: 5px; min-height: 57px; padding: 5px; border-radius: 9px; }
  .fighter-card { grid-template-columns: 31px minmax(57px,1fr); grid-template-rows: 1fr 10px; gap: 1px 4px; min-width: 0; flex: 1; }
  .fighter-card img { width: 30px; height: 30px; }
  .fighter-meta strong { max-width: 70px; font-size: 9px; }
  .fighter-meta span { font-size: 6px; }
  .hp-meter { grid-column: 2; height: 10px; }
  .hp-meter b { font-size: 7px; line-height: 8px; }
  .shield-meter { grid-column: 2; }
  .match-readout { flex: 0 0 70px; }
  .match-readout span { font-size: 6px; letter-spacing: .5px; }
  .match-readout b { font-size: 12px; }
  .match-readout small { font-size: 6px; }
  .score-card { min-width: 38px; }
  .score-card small { display: none; }
  .score-card b { font-size: 11px; }
  .score-card span { max-width: 60px; font-size: 6px; text-align: center; }
  .pause-button { width: 29px; height: 29px; }
  .combat-notice { top: 76px; font-size: 10px; }
  .combat-bottom { right: 8px; bottom: 8px; left: 8px; justify-content: center; gap: 5px; }
  .combat-tip { display: none; }
  .ability-bar { flex: 1; gap: 4px; }
  .ability-slot { width: auto; height: 58px; flex: 1; padding: 5px; border-radius: 7px; }
  .ability-slot .slot-key { width: 14px; height: 14px; margin-bottom: 4px; font-size: 7px; }
  .ability-slot b { font-size: 8px; }
  .ability-slot small { font-size: 7px; }
  .dash-panel { min-width: 57px; padding: 6px; }
  .dash-panel>span { font-size: 7px; }
  .dash-charge { width: 16px; height: 8px; }
  .dash-panel kbd { font-size: 7px; }
  .result-card { padding: 24px 18px; }
  .result-stats { gap: 5px; }
  .result-stat { padding: 9px 3px; }
  .result-stat b { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.pokemon-choice canvas.dex-sprite {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  margin: 0;
  image-rendering: pixelated;
}
.detail-profile canvas.detail-portrait {
  width: 49px;
  height: 49px;
  image-rendering: pixelated;
}
.fighter-card canvas.fighter-portrait {
  grid-row: 1 / 3;
  width: 47px;
  height: 47px;
  image-rendering: pixelated;
  border: 2px solid rgba(229, 240, 206, .28);
  background: rgba(17, 29, 25, .18);
}
@media (max-width: 950px) {
  .pokemon-choice canvas.dex-sprite { width: 40px; height: 40px; flex-basis: 40px; }
}
@media (max-width: 650px) {
  .pokemon-choice canvas.dex-sprite { width: 34px; height: 34px; flex-basis: 34px; }
  .detail-profile canvas.detail-portrait { width: 42px; height: 42px; }
  .fighter-card canvas.fighter-portrait { width: 29px; height: 29px; }
}
@media (max-width: 400px) {
  .fighter-card canvas.fighter-portrait { width: 25px; height: 25px; }
}

/* Pixel-art lobby and arcade HUD */
:root {
  --pixel-ink: #25213f;
  --pixel-deep: #292648;
  --pixel-leaf: #69c9a5;
  --pixel-sun: #ffc15a;
  --pixel-paper: #fff1dc;
  --pixel-frame: #292648;
}

.setup-screen {
  overflow: auto;
  padding: 18px clamp(18px, 4vw, 64px) 15px;
  color: var(--pixel-ink);
  background:
    radial-gradient(ellipse at 18% 82%, rgba(119,103,170,.24), transparent 42%),
    linear-gradient(155deg, #282648 0%, #39395f 52%, #505a7b 100%);
  scrollbar-color: #8d87b9 #343452;
}
.setup-screen::before {
  position: fixed;
  z-index: 0;
  opacity: .1;
  background-image:
    linear-gradient(rgba(222,224,255,.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(222,224,255,.6) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}
.setup-screen::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .13;
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(17,17,42,.2) 5px 6px);
}
.lobby-topbar, .setup-layout, .legal-note { position: relative; z-index: 1; }
.lobby-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1450px, 100%);
  min-height: 36px;
  margin: 0 auto;
}
.back-link {
  width: fit-content;
  padding: 6px 10px 6px 0;
  color: #d3d4f1;
  font: 800 9px var(--sans);
  letter-spacing: 1px;
  text-decoration: none;
}
.back-link span { margin-right: 6px; font-size: 15px; }
.lobby-brand { display: flex; align-items: center; gap: 9px; color: #f2eafb; font: 900 10px var(--pixel); letter-spacing: -.5px; }
.lobby-brand strong { color: #ffdc91; text-shadow: 2px 2px #25213f; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 2px solid #25213f;
  background: var(--pixel-sun);
  box-shadow: 2px 2px 0 #8274a8;
  font: 900 11px var(--pixel);
}
.offline-pill {
  justify-self: end;
  padding: 6px 9px;
  border: 2px solid #69c9a5;
  background: rgba(105,201,165,.16);
  color: #e5ffed;
  font: 800 8px var(--pixel);
}
.offline-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: #8df0a2; box-shadow: 0 0 0 2px rgba(141,240,162,.2); animation: offline-blink 1.8s steps(2) infinite; }
.setup-layout {
  grid-template-columns: minmax(290px, .82fr) minmax(590px, 1.38fr);
  gap: clamp(24px, 4vw, 62px);
  align-items: center;
  width: min(1450px, 100%);
  margin: clamp(10px, 2.2vh, 24px) auto 10px;
}
.setup-heading { align-self: center; padding: 0; }
.eyebrow {
  color: #d0cdef;
  font: 900 8px var(--pixel);
  letter-spacing: 1px;
}
.eyebrow span { width: 9px; height: 9px; border: 2px solid #25213f; border-radius: 0; background: #ffc15a; box-shadow: 2px 2px 0 rgba(17,17,42,.35); }
.setup-heading h1 {
  margin: 16px 0 6px;
  color: #fff1dc;
  font: 900 clamp(22px, 2.6vw, 35px)/1.5 var(--pixel);
  letter-spacing: -1.7px;
  text-shadow: 3px 3px 0 #494571, 6px 6px 0 rgba(17,17,42,.32);
}
.setup-heading h1 em { color: #ffd26d; font-style: normal; }
.setup-heading>p { margin: 5px 0 12px; color: #e0def5; font-size: 12px; font-weight: 700; }
.lobby-stage {
  position: relative;
  height: clamp(205px, 30vh, 265px);
  overflow: hidden;
  border: 4px solid var(--pixel-frame);
  background: linear-gradient(180deg, #a9bafa 0 47%, #c4b1e6 47% 100%);
  box-shadow: 0 5px 0 #554878, 0 11px 0 rgba(17,17,42,.24);
  image-rendering: pixelated;
  isolation: isolate;
}
.lobby-stage::before, .lobby-stage::after { position: absolute; z-index: 1; content: ""; pointer-events: none; }
.lobby-stage::before {
  top: 21px;
  right: 12%;
  width: 31px;
  height: 31px;
  background: #ffdc76;
  box-shadow: 0 0 0 5px rgba(255,220,118,.18), -9px 5px 0 -3px #ffdc76, 9px -5px 0 -3px #ffdc76;
  animation: sun-wink 4s steps(2) infinite;
}
.lobby-stage::after {
  right: -5%;
  bottom: 34px;
  left: -5%;
  height: 32px;
  background: #548e78;
  clip-path: polygon(0 60%, 7% 60%, 7% 35%, 14% 35%, 14% 55%, 22% 55%, 22% 20%, 30% 20%, 30% 60%, 39% 60%, 39% 30%, 47% 30%, 47% 52%, 56% 52%, 56% 15%, 65% 15%, 65% 58%, 74% 58%, 74% 28%, 82% 28%, 82% 56%, 91% 56%, 91% 20%, 100% 20%, 100% 100%, 0 100%);
}
.stage-sun { position: absolute; top: 25px; right: 13%; width: 29px; height: 29px; background: #ffdc76; box-shadow: 0 0 18px rgba(255,220,118,.48); animation: sun-wink 4s steps(2) infinite; }
.stage-cloud { position: absolute; z-index: 1; height: 10px; background: #f5efff; opacity: .9; box-shadow: 12px -7px 0 -2px #f5efff, 24px 0 0 -1px #f5efff, 35px -5px 0 -3px #f5efff; }
.cloud-one { top: 41px; left: 12%; width: 24px; animation: cloud-drift 17s linear infinite; }
.cloud-two { top: 82px; right: 28%; width: 17px; transform: scale(.75); animation: cloud-drift 23s linear infinite reverse; }
.stage-spark { position: absolute; z-index: 4; color: #fff0a5; font: 13px var(--pixel); animation: spark-pop 1.8s steps(2) infinite; }
.spark-one { top: 27%; left: 25%; }
.spark-two { top: 46%; right: 22%; animation-delay: -.8s; }
.stage-grass { position: absolute; z-index: 2; right: 0; bottom: 48px; left: 0; height: 19px; background: #70b987; clip-path: polygon(0 58%, 10% 58%, 10% 31%, 22% 31%, 22% 64%, 34% 64%, 34% 21%, 45% 21%, 45% 57%, 58% 57%, 58% 26%, 69% 26%, 69% 65%, 82% 65%, 82% 25%, 91% 25%, 91% 55%, 100% 55%, 100% 100%, 0 100%); }
#selection-preview {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  animation: hero-bob 2.2s ease-in-out infinite;
}
.stage-ground { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; height: 45px; border-top: 4px solid #468b70; background: repeating-linear-gradient(90deg,#548a69 0 17px,#65a47a 17px 34px); }
.stage-ground::after { position: absolute; top: 12px; left: 9%; width: 7px; height: 4px; background: #f2d889; box-shadow: 63px 9px #f2d889, 125px -3px #f2d889, 225px 6px #f2d889; content: ""; }
.stage-caption { position: absolute; z-index: 4; right: 9px; bottom: 9px; left: 10px; display: flex; justify-content: space-between; color: #fff5e3; font: 8px var(--pixel); text-shadow: 2px 2px #292648; }
.stage-caption b { color: #ffdc76; }
.lobby-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 19px 0 11px; color: #e1def6; font: 8px var(--pixel); }
.lobby-controls kbd { min-width: 24px; height: 22px; border: 2px solid #292648; border-radius: 0; background: var(--pixel-paper); box-shadow: 2px 2px 0 #77739a; color: #292648; font: 8px var(--pixel); }
.lobby-controls i { width: 4px; height: 4px; margin: 0 3px; background: #7edbb2; }
.pokemon-detail {
  grid-template-columns: minmax(120px, .8fr) minmax(130px,1.2fr);
  gap: 8px;
  min-height: 0;
  margin: 13px 0 0;
  padding: 9px;
  border: 3px solid #39345d;
  background: rgba(255,241,220,.94);
  box-shadow: 3px 3px 0 rgba(17,17,42,.25);
}
.detail-profile { gap: 7px; }
.detail-profile img { width: 45px; height: 45px; }
.detail-profile strong { color: #292648; font: 900 11px var(--pixel); }
.detail-profile small { display: block; color: #716986; font-size: 9px; }
.stat-item { color: #716986; font: 7px var(--pixel); }
.stat-item b { color: #292648; font: 800 11px var(--sans); }
.move-list { gap: 4px; }
.move-chip { padding: 5px; border: 1px solid rgba(57,52,93,.15); border-left: 3px solid var(--move-color); background: rgba(255,255,255,.68); }
.move-chip span { color: #716986; font: 6px var(--pixel); }
.move-chip b { color: #292648; font-size: 8px; }
.setup-card {
  padding: clamp(15px, 1.7vw, 23px);
  border: 4px solid var(--pixel-frame);
  border-radius: 0;
  background: var(--pixel-paper);
  box-shadow: 0 6px 0 #554878, 7px 12px 0 rgba(17,17,42,.28);
  color: var(--pixel-ink);
}
.section-title { gap: 10px; margin-bottom: 12px; }
.section-title>span {
  width: 34px;
  height: 34px;
  border: 3px solid #39345d;
  border-radius: 0;
  background: #91dfb6;
  box-shadow: 2px 2px 0 #638c84;
  color: #292648;
  font: 9px var(--pixel);
}
.section-title h2 { color: #292648; font: 900 12px var(--pixel); }
.section-title small { color: #716986; font-size: 9px; }
.roster-count { margin-left: auto; padding: 6px 7px; border: 2px solid #638c84; background: #d8f0d9; color: #365f59; font: 8px var(--pixel); }
.pokemon-roster { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
.pokemon-choice {
  display: flex;
  align-items: center;
  min-height: 61px;
  gap: 6px;
  padding: 4px 7px;
  border: 2px solid #d0c6b7;
  border-radius: 0;
  background: #fff9ee;
  box-shadow: 2px 2px 0 rgba(54,48,82,.15);
  text-align: left;
  transition: transform .12s steps(2), box-shadow .12s steps(2), background .12s;
}
.pokemon-choice:hover { transform: translateY(-2px); border-color: #887bb5; background: #fffdf7; }
.pokemon-choice.selected {
  transform: translateY(-2px);
  border: 3px solid #39345d;
  background: #c9edcf;
  box-shadow: 0 3px 0 #71ad8b, 0 0 0 2px var(--pokemon-color);
  animation: select-pop .28s steps(2);
}
.pokemon-choice img { width: 46px; height: 46px; flex: 0 0 46px; margin: 0; filter: drop-shadow(2px 2px 0 rgba(42,59,38,.22)); }
.pokemon-choice b { color: #292648; font-size: 9px; font-weight: 900; }
.pokemon-choice small { color: #716986; font-size: 8px; }
.setup-options { gap: 11px; margin-top: 16px; }
.option-heading { gap: 8px; margin-bottom: 6px; }
.option-heading b { color: #4a456d; font: 8px var(--pixel); }
.option-heading small { color: #827a91; font-size: 9px; }
.option-grid { gap: 5px; }
.mode-grid .choice, .compact-grid .choice {
  position: relative;
  min-height: 37px;
  padding: 6px 9px;
  border: 2px solid #d0c6b7;
  border-radius: 0;
  background: #fff9ee;
  box-shadow: 2px 2px 0 rgba(54,48,82,.13);
  color: #39345d;
  transition: transform .12s steps(2), background .12s, box-shadow .12s;
}
.mode-grid .choice:hover, .compact-grid .choice:hover { transform: translateY(-2px); border-color: #887bb5; background: #fffdf7; }
.mode-grid .choice.selected, .compact-grid .choice.selected {
  border: 2px solid #39345d;
  background: #c9edcf;
  box-shadow: 0 3px 0 #71ad8b;
  color: #292648;
}
.mode-grid .choice b { font: 900 9px var(--sans); }
.mode-grid .choice small { color: #716986; font: 6px var(--pixel); }
.mode-grid .choice i { position: absolute; top: 6px; right: 7px; color: #8178a8; font: 7px var(--pixel); font-style: normal; }
.compact-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.difficulty-grid .choice { text-align: center; font: 8px var(--pixel); }
.arena-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
.arena-grid .choice { min-height: 32px; padding: 4px; text-align: center; font: 7px var(--pixel); }
.setup-footer { gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 2px dashed #cbc3d5; }
.control-summary { max-width: none; display: grid; grid-template-columns: 25px auto; align-items: center; column-gap: 7px; color: #554f70; }
.control-summary>b { grid-row: span 2; color: #cb7855; font-size: 20px; }
.control-summary span { margin: 0; color: #403b62; font: 7px var(--pixel); }
.control-summary small { color: #7b748f; font-size: 9px; }
.start-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 174px;
  min-height: 48px;
  padding: 0 13px;
  border: 3px solid #292648;
  border-radius: 0;
  background: #f2c64f;
  box-shadow: 0 4px 0 #bd793c, 3px 7px 0 rgba(17,17,42,.28);
  color: #292648;
  font: 900 9px var(--pixel);
  transition: transform .12s steps(2), box-shadow .12s;
}
.start-button span { margin: 0; font: inherit; }
.start-button b { font: 18px var(--sans); }
.start-button:hover { transform: translateY(-2px); background: #ffd878; }
.start-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #bd793c; }
.legal-note { display: flex; justify-content: space-between; width: min(1450px,100%); margin: 12px auto 0; color: #d8d5f0; font: 7px var(--pixel); text-align: left; }
.legal-note span:first-child { color: #b7b2dc; }

.combat-screen { background: #416947; }
.combat-screen::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .12;
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(20,37,26,.3) 5px 6px);
}
.arena-vignette { background: linear-gradient(180deg,rgba(17,35,23,.28),transparent 25%,transparent 73%,rgba(17,35,23,.24)); }
.combat-top {
  gap: 9px;
  min-height: 74px;
  border: 3px solid #292648;
  border-radius: 0;
  background: #fff1dc;
  box-shadow: 0 5px 0 #554878, 4px 8px 0 rgba(17,17,42,.3);
  color: #292648;
  backdrop-filter: none;
}
.fighter-card { min-width: min(40vw,390px); }
.fighter-card img {
  width: 53px;
  height: 53px;
  border: 2px solid #625a87;
  background: #d8f0d9;
}
.fighter-meta strong { color: #292648; font: 900 10px var(--pixel); }
.fighter-meta span { color: #716986; font: 7px var(--pixel); }
.hp-meter { height: 15px; border: 2px solid #39345d; border-radius: 0; background: #71647b; }
.hp-meter i { background: repeating-linear-gradient(90deg,#55b985 0 9px,#79d39b 9px 18px); }
.hp-meter b { color: #fffbe3; font: 8px var(--pixel); line-height: 11px; }
.shield-meter { height: 4px; border-radius: 0; background: #c7bed0; }
.shield-meter i { background: #6ccbe1; }
.match-readout { padding: 5px 13px; border-left: 2px dashed #cbc3d5; border-right: 2px dashed #cbc3d5; }
.match-readout span { color: #716986; font: 7px var(--pixel); }
.match-readout b { color: #292648; font: 15px var(--pixel); text-shadow: 2px 2px #d8f0d9; }
.match-readout small { color: #827a91; font: 6px var(--pixel); }
.score-card { min-width: 88px; }
.score-card small { color: #716986; font: 6px var(--pixel); }
.score-card b { color: #cb7855; font: 14px var(--pixel); }
.score-card span { color: #554f70; font-size: 8px; font-weight: 800; }
.pause-button { width: 36px; height: 36px; border: 2px solid #39345d; border-radius: 0; background: #c9edcf; box-shadow: 2px 2px 0 #71ad8b; color: #292648; }
.pause-button:hover { transform: translateY(-1px); background: #f2c64f; }
.combat-notice { color: #fff4bd; font: 9px var(--pixel); }
.combat-notice:not(:empty) { padding: 9px 13px; border: 2px solid #292648; background: #39345d; box-shadow: 3px 3px 0 rgba(17,17,42,.3); animation: notice-pop .2s steps(2); }
.combat-bottom { align-items: end; gap: 10px; }
.combat-tip, .dash-panel {
  border: 3px solid #292648;
  border-radius: 0;
  background: #fff1dc;
  box-shadow: 0 4px 0 #554878, 3px 6px 0 rgba(17,17,42,.25);
  color: #403b62;
  backdrop-filter: none;
}
.combat-tip { max-width: 215px; font-size: 8px; font-weight: 800; }
.combat-tip kbd, .dash-panel kbd {
  border: 2px solid #625a87;
  border-radius: 0;
  background: #d8f0d9;
  box-shadow: 1px 1px 0 #91b798;
  color: #292648;
  font: 7px var(--pixel);
}
.ability-bar { gap: 7px; }
.ability-slot {
  width: 104px;
  height: 75px;
  padding: 7px;
  border: 3px solid #292648;
  border-radius: 0;
  background: #fff1dc;
  box-shadow: 0 4px 0 #554878, 3px 6px 0 rgba(17,17,42,.25);
  color: #292648;
  transition: transform .12s steps(2), background .12s;
}
.ability-slot:hover:not(:disabled) { transform: translateY(-3px); border-color: #625a87; background: #fff9ee; }
.ability-slot.selected {
  transform: translateY(-4px);
  border-color: var(--slot-color);
  background: #e2f5c3;
  box-shadow: 0 0 0 3px var(--slot-color), 0 6px 0 #554878, 3px 8px 0 rgba(17,17,42,.25);
  animation: selected-ability-pulse 1.1s steps(2) infinite;
}
.ability-slot.selected small { color: #32654f; }
.ability-slot:disabled { opacity: .76; }
.ability-slot .slot-key {
  min-width: 20px;
  height: 19px;
  border: 2px solid #625a87;
  border-radius: 0;
  background: var(--slot-color);
  color: #292648;
  font: 8px var(--pixel);
}
.ability-slot b { color: #39345d; font-size: 9px; font-weight: 900; }
.ability-slot small { color: #716986; font-size: 8px; font-weight: 700; }
.ability-slot .cooldown-mask { background: rgba(41,38,72,.66); }
.ability-slot.ultradash-slot {
  width: 148px;
  height: 85px;
  padding: 8px;
  border-color: #9c562e;
  background: linear-gradient(135deg,#fff1a7,#f3a544 52%,#e96d43);
  box-shadow: 0 0 0 2px #ffe58a, 0 0 20px rgba(255,195,74,.72), 0 5px 0 #8e493e, 3px 8px 0 rgba(17,17,42,.35);
  animation: ultradash-ready .8s steps(2) infinite;
}
.ability-slot.ultradash-slot:hover:not(:disabled) {
  transform: translateY(-5px) scale(1.04);
  border-color: #fff3a1;
  background: linear-gradient(135deg,#fff9bd,#ffd35f 52%,#ff8b57);
}
.ability-slot.ultradash-slot .slot-key {
  width: 23px;
  height: 22px;
  border-color: #703b52;
  background: #fff5c3;
  color: #713e50;
  font-size: 10px;
}
.ability-slot.ultradash-slot b {
  color: #713e50;
  font: 900 14px var(--pixel);
  text-shadow: 1px 1px #fff3c1;
}
.ability-slot.ultradash-slot small { color: #713e50; font: 8px var(--pixel); }
.ability-slot.ultradash-slot .special-ribbon {
  position: absolute;
  top: 3px;
  right: 3px;
  padding: 3px 4px;
  background: #713e50;
  color: #fff6cf;
  font: 6px var(--pixel);
}
.special-announcement {
  position: absolute;
  z-index: 4;
  inset: 10% 4% 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px,3vw,42px);
  overflow: hidden;
  pointer-events: none;
}
.setup-screen::-webkit-scrollbar { width: 10px; }
.setup-screen::-webkit-scrollbar-track { background: #102b38; }
.setup-screen::-webkit-scrollbar-thumb { border: 2px solid #102b38; background: #708b89; }
.special-announcement::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: -5%;
  width: 110%;
  height: min(31vh,230px);
  border-block: 3px solid #fff4ad;
  background:
    linear-gradient(90deg,transparent,rgba(255,244,173,.2) 12%,rgba(255,244,173,.08) 88%,transparent),
    repeating-linear-gradient(110deg,rgba(255,218,101,.04) 0 18px,rgba(255,242,161,.3) 18px 23px,rgba(255,218,101,.04) 23px 42px);
  box-shadow: 0 0 34px rgba(255,193,74,.6), inset 0 0 30px rgba(255,244,173,.2);
  content: "";
  transform: translateY(-50%) skewX(-9deg);
}
.special-announcement::after {
  position: absolute;
  z-index: 0;
  inset: -45%;
  background: repeating-conic-gradient(from 0deg,transparent 0deg 8deg,rgba(255,242,161,.23) 8deg 10deg,transparent 10deg 18deg);
  content: "";
  mask-image: radial-gradient(circle,transparent 0 18%,#000 55%,transparent 78%);
  opacity: .8;
}
.special-announcement.active { animation: ultradash-enter 1.8s ease-out both; }
.combat-screen.ultradash-active::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: radial-gradient(circle at 50% 50%,rgba(255,247,195,.72),rgba(255,226,123,.12) 48%,transparent 76%);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: ultradash-flash 1.8s ease-out both;
}
.ultradash-pikachu-frame {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 min(28vw,300px);
  width: min(28vw,300px);
  height: min(34vh,280px);
  place-items: center;
  border: 3px solid #fff4ad;
  background:
    radial-gradient(circle at 48% 46%,rgba(255,255,255,.92),rgba(255,242,161,.62) 30%,rgba(255,177,71,.18) 58%,transparent 72%),
    linear-gradient(135deg,rgba(65,49,103,.72),rgba(251,187,78,.28));
  box-shadow: 0 0 0 4px #39345d, 0 0 0 7px rgba(255,242,161,.5), 0 0 38px rgba(255,193,74,.9), 8px 9px 0 #793e5b;
  clip-path: polygon(50% 0,62% 7%,77% 3%,84% 17%,97% 24%,91% 40%,100% 50%,91% 60%,97% 76%,83% 84%,77% 97%,62% 93%,50% 100%,38% 93%,23% 97%,17% 83%,3% 76%,9% 60%,0 50%,9% 40%,3% 24%,17% 17%,23% 3%,38% 7%);
  transform: rotate(-3deg);
  animation: ultradash-frame .42s steps(2) infinite;
}
.special-announcement canvas {
  position: relative;
  z-index: 1;
  width: 86%;
  height: 90%;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 14px #fff2a1) drop-shadow(5px 6px 0 #733f55);
  animation: ultradash-pikachu .28s steps(2) infinite;
}
.ultradash-spark {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 8px;
  background: #fffce5;
  box-shadow: 0 0 12px #fff2a1, 0 0 22px #ffbd55;
  animation: ultradash-spark .36s steps(2) infinite alternate;
}
.ultradash-spark.spark-a { top: 18%; right: 2%; transform: rotate(-38deg); }
.ultradash-spark.spark-b { bottom: 20%; left: 3%; width: 15px; animation-delay: .12s; transform: rotate(38deg); }
.ultradash-spark.spark-c { top: 8%; left: 31%; width: 11px; animation-delay: .22s; transform: rotate(90deg); }
.special-announcement.active .special-title { animation: ultradash-title .52s cubic-bezier(.16,1.3,.35,1) both; }
.special-announcement.active::after { animation: ultradash-rays 1.8s ease-out both; }
.special-announcement.active .ultradash-spark { animation-duration: .2s; }
.special-announcement.active .special-title strong { animation: ultradash-word .38s steps(2) .08s both; }
.special-announcement.active .special-title small { animation: ultradash-subtitle .35s ease-out .24s both; }
.special-title {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  color: #fff8d5;
  text-align: left;
  text-shadow: 3px 3px 0 #793e5b, 6px 6px 0 #292648;
}
.special-title span { font: 9px var(--pixel); letter-spacing: .16em; }
.special-title strong {
  color: #fff2a1;
  background: linear-gradient(180deg,#fffde0 0%,#ffe783 42%,#ffb13e 100%);
  background-clip: text;
  font: 900 clamp(24px,6.5vw,76px) var(--pixel);
  letter-spacing: .04em;
  line-height: 1.2;
  -webkit-text-stroke: 1px #793e5b;
  -webkit-text-fill-color: transparent;
}
.special-title small {
  width: fit-content;
  padding: 7px 9px;
  border: 2px solid #fff2a1;
  background: rgba(41,38,72,.88);
  color: #fff8d5;
  font: 7px var(--pixel);
  letter-spacing: .04em;
  box-shadow: 3px 3px 0 #793e5b;
}
.dash-panel { min-width: 87px; color: #403b62; }
.dash-panel>span { color: #716986; font: 7px var(--pixel); }
.dash-charge { border: 2px solid #39345d; border-radius: 0; background: #aaa4bd; }
.dash-charge i { background: repeating-linear-gradient(90deg,#ffbd55 0 5px,#ffe17a 5px 9px); }
.dash-charge.empty i { background: #9e96b2; }
.combat-screen.low-health .fighter-card { animation: hp-flash .42s steps(2) infinite; }
.combat-screen.low-health .hp-meter i { background: repeating-linear-gradient(90deg,#da6157 0 9px,#f18364 9px 18px); }
.combat-overlay { background: rgba(27,24,52,.78); }
.combat-overlay.victory::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle,#fff2a1 0 2px,transparent 3px),
    radial-gradient(circle,#fff 0 1px,transparent 2px),
    radial-gradient(circle,#f2c64f 0 2px,transparent 3px);
  background-position: 0 0, 20px 34px, 43px 16px;
  background-size: 61px 73px, 83px 97px, 107px 89px;
  content: "";
  opacity: .8;
  pointer-events: none;
  animation: victory-confetti 1.1s linear infinite;
}
.combat-overlay.victory::after {
  position: absolute;
  inset: -30%;
  z-index: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%,rgba(255,236,155,.16) 0deg 5deg,transparent 5deg 15deg);
  content: "";
  mask-image: radial-gradient(circle,transparent 0 10%,#000 55%,transparent 78%);
  opacity: .7;
  pointer-events: none;
  animation: victory-burst 4s ease-in-out infinite;
}
.combat-overlay.victory .result-card {
  position: relative;
  z-index: 1;
  border-color: #e2b64f;
  box-shadow: 0 0 0 4px #554878, 0 0 34px rgba(255,215,95,.65), 0 8px 0 #554878, 7px 14px 0 rgba(17,17,42,.4);
  animation: victory-card .72s cubic-bezier(.16,1.3,.35,1) both;
}
.combat-overlay.victory .result-card::before {
  position: absolute;
  top: -22px;
  right: 0;
  left: 0;
  color: #fff2a1;
  content: "✦  ✦  ✦";
  font: 16px var(--pixel);
  text-shadow: 2px 2px #554878;
  animation: victory-stars .45s steps(2) infinite alternate;
}
.combat-overlay.victory .result-card::after {
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(255,242,161,.72);
  box-shadow: 0 0 16px rgba(255,215,95,.5);
  content: "";
  pointer-events: none;
  animation: victory-frame 1s steps(2) infinite alternate;
}
.combat-overlay.victory .result-eyebrow { color: #c4853f; }
.combat-overlay.victory .result-card h2 {
  color: #c47545;
  font-size: clamp(18px,2.4vw,27px);
  text-shadow: 2px 2px #ffe7a0;
}
.combat-overlay.victory .result-stat {
  animation: victory-stat .38s cubic-bezier(.16,1.3,.35,1) both;
}
.combat-overlay.victory .result-stat:nth-child(2) { animation-delay: .12s; }
.combat-overlay.victory .result-stat:nth-child(3) { animation-delay: .2s; }
.combat-overlay.victory .result-stat:nth-child(4) { animation-delay: .28s; }
.result-card {
  border: 4px solid #292648;
  border-radius: 0;
  background: var(--pixel-paper);
  box-shadow: 0 6px 0 #554878, 7px 12px 0 rgba(17,17,42,.36);
  color: #292648;
}
.result-eyebrow { color: #548d70; font: 8px var(--pixel); }
.result-card h2 { color: #292648; font: 900 17px var(--pixel); line-height: 1.7; }
.result-card p { color: #716986; }
.result-stat { border: 2px solid #c7bed0; border-radius: 0; background: #fff9ee; }
.result-stat b { color: #39345d; font: 14px var(--pixel); }
.result-stat small { color: #716986; font: 6px var(--pixel); }
.secondary-button { border: 2px solid #8178a8; border-radius: 0; background: #e6e1f3; color: #39345d; font-weight: 800; }
.secondary-button:hover { background: #d8f0d9; }

@keyframes hero-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes cloud-drift { 0% { translate: -15px 0; } 50% { translate: 22px 4px; } 100% { translate: -15px 0; } }
@keyframes sun-wink { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.13); } }
@keyframes spark-pop { 0%,100% { opacity: .35; transform: translateY(2px) scale(.8); } 50% { opacity: 1; transform: translateY(-4px) scale(1.15); } }
@keyframes select-pop { 0% { transform: scale(.94); } 100% { transform: scale(1) translateY(-2px); } }
@keyframes offline-blink { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes notice-pop { from { opacity: 0; transform: translate(-50%,6px); } to { opacity: 1; transform: translate(-50%,0); } }
@keyframes selected-ability-pulse { 50% { filter: brightness(1.13); } }
@keyframes victory-card { from { opacity: 0; transform: translateY(28px) scale(.72) rotate(-2deg); } 75% { transform: translateY(-4px) scale(1.04) rotate(1deg); } to { opacity: 1; transform: none; } }
@keyframes victory-confetti { to { background-position: 0 146px, 20px 228px, 43px 194px; } }
@keyframes victory-stars { to { filter: brightness(1.5); transform: scale(1.12); } }
@keyframes victory-burst { 50% { opacity: 1; transform: rotate(12deg) scale(1.05); } }
@keyframes victory-frame { to { inset: -17px; opacity: .5; } }
@keyframes victory-stat { from { opacity: 0; transform: translateY(12px) scale(.82); } to { opacity: 1; transform: none; } }
@keyframes ultradash-ready { 50% { filter: brightness(1.14); box-shadow: 0 0 0 3px #fff2a1, 0 0 28px rgba(255,195,74,.95), 0 5px 0 #8e493e, 3px 8px 0 rgba(17,17,42,.35); } }
@keyframes ultradash-enter { 0% { opacity: 0; transform: scale(.62) skewX(-8deg); } 8% { opacity: 1; transform: scale(.96); } 16%,78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes ultradash-flash { 0% { opacity: 0; } 3% { opacity: .7; } 12% { opacity: .16; } 22% { opacity: .4; } 34%,100% { opacity: 0; } }
@keyframes ultradash-rays { 0% { transform: rotate(-16deg) scale(.5); opacity: 0; } 15% { opacity: .9; } 72% { opacity: .55; } 100% { transform: rotate(18deg) scale(1.12); opacity: 0; } }
@keyframes ultradash-frame { 50% { transform: rotate(2deg) scale(1.035); filter: brightness(1.2); } }
@keyframes ultradash-pikachu { 50% { transform: translateY(-11px) scale(1.08); } }
@keyframes ultradash-spark { to { opacity: .35; transform: translate(4px,-5px) scale(.6) rotate(25deg); } }
@keyframes ultradash-title { from { opacity: 0; transform: translateX(90px) skewX(-12deg); } to { opacity: 1; transform: translateX(0) skewX(0); } }
@keyframes ultradash-word { 0% { filter: brightness(2.2); transform: scale(1.22); } 100% { filter: brightness(1); transform: scale(1); } }
@keyframes ultradash-subtitle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes hp-flash { 0%,100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px rgba(220,85,69,.65); } }

@media (max-width: 980px) {
  .setup-layout { grid-template-columns: minmax(230px,.82fr) minmax(450px,1.18fr); gap: 20px; align-items: center; }
  .setup-heading h1 { font-size: 23px; }
  .lobby-stage { height: 220px; }
  .lobby-controls { font-size: 6px; }
  .pokemon-choice { min-height: 54px; padding: 3px 5px; }
  .pokemon-choice img { width: 39px; height: 39px; flex-basis: 39px; }
  .setup-card { padding: 14px; }
}
@media (max-width: 760px) {
  .setup-screen { padding: 12px 13px 14px; }
  .lobby-topbar { grid-template-columns: 1fr auto; min-height: 30px; }
  .lobby-brand { display: none; }
  .setup-layout { grid-template-columns: 1fr; gap: 14px; margin: 15px auto 10px; }
  .setup-heading { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(190px,1.2fr); align-items: center; column-gap: 14px; }
  .setup-heading .eyebrow, .setup-heading h1, .setup-heading>p { grid-column: 1; }
  .setup-heading h1 { margin: 8px 0 2px; font-size: 18px; }
  .setup-heading>p { margin: 0; font-size: 10px; }
  .lobby-stage { grid-column: 2; grid-row: 1 / span 4; height: 190px; }
  .lobby-controls, .pokemon-detail { display: none; }
  .setup-card { padding: 13px; }
  .section-title h2 { font-size: 10px; }
  .section-title small { font-size: 8px; }
  .pokemon-roster { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .pokemon-choice { min-height: 48px; }
  .pokemon-choice img { width: 34px; height: 34px; flex-basis: 34px; }
  .pokemon-choice b { font-size: 8px; }
  .pokemon-choice small { font-size: 7px; }
  .setup-options { gap: 8px; margin-top: 11px; }
  .option-heading { display: flex; gap: 7px; }
  .option-heading b { font-size: 7px; }
  .option-heading small { font-size: 8px; }
  .mode-grid .choice { min-height: 34px; padding: 5px; }
  .mode-grid .choice b { font-size: 8px; }
  .mode-grid .choice i { display: none; }
  .arena-grid .choice { min-height: 28px; font-size: 6px; }
  .setup-footer { margin-top: 10px; padding-top: 9px; }
  .control-summary { display: none; }
  .start-button { min-width: 150px; min-height: 40px; }
  .legal-note { margin-top: 8px; font-size: 6px; }
  .legal-note span:last-child { display: none; }
  .combat-top { top: 9px; left: 9px; right: 9px; min-height: 59px; padding: 5px; }
  .fighter-card { min-width: 0; flex: 1; grid-template-columns: 39px minmax(50px,1fr); grid-template-rows: 1fr 10px; gap: 2px 5px; }
  .fighter-card img { width: 37px; height: 37px; }
  .fighter-meta strong { max-width: 76px; font-size: 8px; }
  .fighter-meta span { font-size: 6px; }
  .hp-meter { grid-column: 2; height: 11px; }
  .hp-meter b { font-size: 6px; line-height: 7px; }
  .shield-meter { grid-column: 2; }
  .match-readout { flex: 0 0 72px; padding: 4px; }
  .match-readout span { font-size: 5px; }
  .match-readout b { font-size: 10px; }
  .match-readout small { font-size: 5px; }
  .score-card { min-width: 43px; }
  .score-card small { display: none; }
  .score-card b { font-size: 10px; }
  .score-card span { max-width: 52px; font-size: 6px; text-align: center; }
  .pause-button { width: 28px; height: 28px; }
  .combat-notice { top: 77px; font-size: 7px; }
  .combat-bottom { right: 8px; bottom: 8px; left: 8px; gap: 5px; }
  .combat-tip { display: none; }
  .ability-bar { flex: 1; gap: 4px; }
  .ability-slot { width: auto; height: 61px; flex: 1; padding: 4px; }
  .ability-slot.ultradash-slot { width: auto; height: 66px; flex: 1.35; padding: 4px; }
  .ability-slot.ultradash-slot b { font-size: 8px; }
  .ability-slot.ultradash-slot .special-ribbon { top: 2px; right: 2px; font-size: 5px; }
  .special-announcement { inset: 12% 5% 16%; flex-direction: column; justify-content: center; gap: 12px; }
  .ultradash-pikachu-frame { width: min(50vw,190px); height: min(25vh,175px); flex-basis: auto; }
  .special-announcement canvas { width: 86%; height: 90%; }
  .special-title { gap: 4px; text-align: center; }
  .special-title span { font-size: 7px; }
  .special-title strong { font-size: clamp(22px,8vw,48px); }
  .special-title small { margin: 0 auto; padding: 5px 6px; font-size: 6px; }
  .ability-slot .slot-key { width: 16px; min-width: 16px; height: 15px; margin-bottom: 4px; font-size: 6px; }
  .ability-slot b { font-size: 7px; }
  .ability-slot small { font-size: 6px; }
  .dash-panel { min-width: 52px; padding: 5px; }
  .dash-panel>span { font-size: 6px; }
  .dash-charge { width: 15px; height: 8px; }
  .dash-panel kbd { min-width: 18px; font-size: 6px; }
  .result-card { padding: 23px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .lobby-stage *, .pokemon-choice, .offline-pill i { animation: none !important; }
  .ability-slot.selected, .ability-slot.ultradash-slot, .special-announcement.active, .special-announcement canvas,
  .ultradash-pikachu-frame, .ultradash-spark, .special-title, .special-title strong, .special-title small,
  .combat-screen.ultradash-active::after, .combat-screen.special-active::after, .special-announcement.active::after,
  .combat-overlay.victory::before, .combat-overlay.victory::after, .combat-overlay.victory .result-card,
  .combat-overlay.victory .result-card::before, .combat-overlay.victory .result-card::after,
  .combat-overlay.victory .result-stat { animation: none !important; }
}

:root {
  --ink: #f2f5ff;
  --muted: #9aa9c5;
  --green: #67e5d1;
  --gold: #ffd273;
  --ui-ink: #10182b;
  --ui-line: rgba(179, 199, 236, .17);
  --ui-panel: rgba(10, 17, 34, .9);
  --ui-cyan: #74e6eb;
  --ui-pink: #ff789d;
}

body {
  background: #080e1d;
  color: var(--ink);
}

button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ui-cyan); outline-offset: 3px; }

.setup-screen {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px clamp(14px, 3vw, 46px) 20px;
  background:
    linear-gradient(112deg, rgba(7, 12, 27, .96), rgba(9, 17, 35, .84) 56%, rgba(12, 17, 36, .91)),
    url("../assets/arena/sky.png") center / cover fixed,
    #080e1d;
}

.setup-screen::before {
  z-index: 0;
  opacity: .14;
  background-image:
    linear-gradient(rgba(196, 218, 255, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 218, 255, .16) 1px, transparent 1px);
  background-size: 32px 32px;
}

.setup-screen::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(ellipse at 5% 90%, rgba(61, 110, 228, .2), transparent 42%),
    radial-gradient(ellipse at 94% 7%, rgba(180, 90, 211, .18), transparent 34%);
  content: "";
  pointer-events: none;
}

.lobby-topbar {
  min-height: 46px;
  grid-template-columns: 1fr auto 1fr;
}

.back-link {
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: rgba(9, 17, 34, .58);
  color: #c9d6f1;
  font-size: 10px;
}

.back-link:hover { border-color: var(--ui-cyan); color: #fff; }
.lobby-brand { gap: 11px; color: #fff; font: 800 10px var(--sans); letter-spacing: 1.5px; }
.lobby-brand strong { color: var(--ui-cyan); text-shadow: none; }
.brand-mark {
  width: 35px;
  height: 35px;
  border: 1px solid rgba(116, 230, 235, .65);
  border-radius: 11px;
  background: linear-gradient(145deg, #324b78, #172746);
  box-shadow: 0 0 20px rgba(116, 230, 235, .14);
  color: var(--ui-cyan);
  font: 800 12px var(--sans);
}

.offline-pill {
  padding: 8px 11px;
  border: 1px solid rgba(103, 229, 209, .3);
  border-radius: 999px;
  background: rgba(43, 175, 157, .1);
  color: #b6fff1;
  font: 700 8px var(--sans);
  letter-spacing: 1px;
}

.offline-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #68f0b2;
  box-shadow: 0 0 10px #68f0b2;
}

.setup-layout {
  grid-template-columns: minmax(270px, .76fr) minmax(0, 1.55fr);
  gap: clamp(16px, 2.2vw, 30px);
  align-items: stretch;
  width: min(1440px, 100%);
  margin: clamp(12px, 2vh, 22px) auto 12px;
}

.setup-heading {
  align-self: stretch;
  min-width: 0;
  padding: clamp(18px, 2vw, 26px);
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(12, 20, 42, .88), rgba(10, 16, 33, .77)),
    url("../assets/arena/sky.png") center / cover;
  box-shadow: 0 22px 65px rgba(0, 0, 0, .28), inset 0 1px rgba(255,255,255,.07);
}

.eyebrow {
  color: #a9badc;
  font: 800 9px var(--sans);
  letter-spacing: 1.6px;
}

.eyebrow span {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--ui-cyan);
  box-shadow: 0 0 13px var(--ui-cyan);
}

.setup-heading h1 {
  margin: 15px 0 7px;
  color: #fff;
  font: 900 clamp(24px, 2.8vw, 38px)/1.3 var(--sans);
  letter-spacing: -1.5px;
  text-shadow: 0 5px 25px rgba(89, 190, 242, .2);
}

.setup-heading h1 em {
  color: var(--ui-cyan);
  font-style: normal;
}

.setup-heading>p { margin: 0 0 16px; color: #a9b8d5; font-size: 12px; }

.lobby-stage {
  height: clamp(180px, 25vh, 235px);
  border: 1px solid rgba(191, 216, 255, .28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(9, 18, 38, .08), rgba(11, 16, 31, .48)),
    url("../assets/arena/sky.png") center / cover;
  box-shadow: 0 12px 30px rgba(0,0,0,.24), inset 0 0 45px rgba(104, 160, 255, .12);
}

.lobby-stage::before {
  top: 19px;
  right: 15%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff0b0;
  box-shadow: 0 0 0 7px rgba(255, 240, 176, .11), 0 0 28px rgba(255, 220, 118, .45);
}

.lobby-stage::after {
  right: -5%;
  bottom: 0;
  left: -5%;
  height: 35px;
  background: linear-gradient(180deg, rgba(22, 126, 117, .25), rgba(12, 56, 76, .9));
  clip-path: none;
}

.stage-cloud { opacity: .65; }
.stage-spark { color: #c2faff; }
.stage-grass { opacity: .65; }
.stage-ground {
  height: 22px;
  border-top: 1px solid rgba(117, 230, 205, .6);
  background: linear-gradient(180deg, rgba(29, 128, 113, .75), rgba(10, 51, 65, .95));
}

.stage-ground::after { display: none; }

#selection-preview { filter: drop-shadow(0 11px 6px rgba(4, 10, 23, .6)); }

.stage-caption {
  right: 12px;
  bottom: 9px;
  left: 12px;
  align-items: center;
  color: #effbff;
  font: 700 8px var(--sans);
  letter-spacing: 1.2px;
}

.stage-caption b { color: var(--ui-cyan); }

.lobby-controls {
  gap: 7px;
  margin: 15px 0 8px;
  color: #9db1d1;
  font: 700 8px var(--sans);
  letter-spacing: .4px;
}

.lobby-controls kbd {
  min-width: 25px;
  height: 22px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  box-shadow: none;
  color: #eaf5ff;
  font: 700 8px var(--sans);
}

.lobby-controls i { border-radius: 50%; background: var(--ui-pink); }

.pokemon-detail {
  grid-template-columns: minmax(118px, .8fr) minmax(0, 1.2fr);
  gap: 10px;
  margin: 11px 0 0;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  background: rgba(7, 14, 30, .68);
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}

.detail-profile { gap: 10px; }
.detail-profile img { width: 54px; height: 54px; }
.detail-profile strong { color: #fff; font: 800 13px var(--sans); }
.detail-profile small { color: #a8b8d6; font-size: 10px; }
.stat-item { color: #94a8cb; font: 700 8px var(--sans); letter-spacing: .6px; }
.stat-item b { color: #f0f5ff; font: 800 12px var(--sans); }
.move-list { gap: 5px; }
.move-chip {
  padding: 7px;
  border: 1px solid rgba(173, 198, 238, .12);
  border-left: 2px solid var(--move-color);
  border-radius: 7px;
  background: rgba(255,255,255,.045);
}
.move-chip span { color: #9aaccb; font: 700 7px var(--sans); }
.move-chip b { color: #edf4ff; font-size: 8px; }

.setup-card {
  min-width: 0;
  padding: clamp(16px, 2vw, 25px);
  border: 1px solid rgba(176, 199, 239, .2);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(17, 26, 49, .97), rgba(10, 16, 32, .94));
  box-shadow: 0 24px 70px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.06);
  color: var(--ink);
  backdrop-filter: blur(12px);
}

.section-title { gap: 12px; margin-bottom: 14px; }
.section-title>span {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(116, 230, 235, .42);
  border-radius: 12px;
  background: rgba(116, 230, 235, .11);
  box-shadow: none;
  color: var(--ui-cyan);
  font: 800 10px var(--sans);
}
.section-title h2 { color: #fff; font: 800 15px var(--sans); }
.section-title small { color: var(--muted); font-size: 10px; }
.roster-count {
  padding: 6px 9px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: #c1d0ed;
  font: 700 8px var(--sans);
}

.pokemon-roster { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.pokemon-choice {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  gap: 0 8px;
  padding: 6px 8px;
  border: 1px solid rgba(179, 199, 236, .15);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.pokemon-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(116, 230, 235, .55);
  background: rgba(116, 230, 235, .08);
}

.pokemon-choice.selected {
  border-color: var(--ui-cyan);
  background: linear-gradient(115deg, rgba(63, 197, 200, .17), rgba(91, 123, 232, .11));
  box-shadow: inset 0 0 0 1px rgba(116, 230, 235, .12), 0 0 19px rgba(88, 216, 223, .09);
}

.pokemon-choice img {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  margin: 0;
}

.pokemon-choice span { min-width: 0; }
.pokemon-choice b { color: #f2f6ff; font-size: 10px; }
.pokemon-choice small { color: #9aabc9; font-size: 8px; }

.setup-options {
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 17px;
}

.setup-options>section {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(179, 199, 236, .12);
  border-radius: 13px;
  background: rgba(5, 11, 24, .38);
}

.setup-options>section:first-child { grid-column: 1 / -1; }
.option-heading { gap: 8px; margin-bottom: 8px; }
.option-heading b { color: #eaf3ff; font: 800 9px var(--sans); letter-spacing: .8px; }
.option-heading small { color: #8496b7; font-size: 9px; }
.option-grid { gap: 6px; }

.mode-grid .choice {
  position: relative;
  display: flex;
  min-height: 62px;
  flex-direction: column;
  justify-content: center;
  padding: 9px 11px;
  border-radius: 10px;
}

.mode-grid .choice b { color: #edf4ff; font-size: 11px; }
.mode-grid .choice small { color: #9aaccb; font-size: 8px; }
.mode-grid .choice i {
  position: absolute;
  top: 9px;
  right: 10px;
  color: #7185aa;
  font: 700 8px var(--sans);
}

.choice {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid rgba(179, 199, 236, .14);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: #cbd7ed;
  font-size: 9px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.choice:hover { border-color: rgba(116, 230, 235, .55); background: rgba(116, 230, 235, .08); }
.choice.selected {
  border-color: rgba(116, 230, 235, .75);
  background: rgba(116, 230, 235, .13);
  color: #d7ffff;
  box-shadow: inset 0 0 0 1px rgba(116, 230, 235, .12);
}

.mode-grid .choice, .compact-grid .choice {
  border: 1px solid rgba(179, 199, 236, .14);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  box-shadow: none;
  color: #cbd7ed;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.mode-grid .choice:hover, .compact-grid .choice:hover {
  border-color: rgba(116, 230, 235, .55);
  background: rgba(116, 230, 235, .08);
}

.mode-grid .choice.selected, .compact-grid .choice.selected {
  border-color: rgba(116, 230, 235, .75);
  background: rgba(116, 230, 235, .13);
  box-shadow: inset 0 0 0 1px rgba(116, 230, 235, .12);
  color: #d7ffff;
}

.mode-grid .choice b { font-size: 11px; }
.mode-grid .choice small { color: #9aaccb; font: 700 8px var(--sans); }
.compact-grid .choice { font: 700 9px var(--sans); }
.difficulty-grid .choice { font: 700 9px var(--sans); }
.arena-grid .choice { font: 700 8px var(--sans); }

.arena-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
.arena-grid .choice { text-align: center; }

.setup-footer {
  gap: 12px;
  margin-top: 15px;
  padding-top: 14px;
  border-color: rgba(179, 199, 236, .15);
}

.control-summary { color: #91a4c5; font-size: 8px; }
.control-summary b { color: var(--ui-cyan); }
.control-summary span { color: #dfeaff; font-size: 8px; }
.start-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(181, 255, 242, .55);
  border-radius: 11px;
  background: linear-gradient(115deg, #7df2d4, #75d7ec);
  box-shadow: 0 7px 22px rgba(74, 221, 204, .18), inset 0 1px rgba(255,255,255,.55);
  color: #0c2630;
  font-weight: 900;
}
.start-button:hover { transform: translateY(-2px); background: linear-gradient(115deg, #a2ffe5, #91e8ff); }
.start-button:active { transform: translateY(1px); box-shadow: 0 3px 12px rgba(74, 221, 204, .16); }
.start-button span { margin-left: 12px; font-size: 16px; }

.legal-note {
  gap: 12px;
  color: #8494b3;
  font: 700 7px var(--sans);
  letter-spacing: .4px;
}
.legal-note span:first-child { color: #a8b7d2; }
.legal-note a { color: var(--ui-cyan); }

.combat-screen { background: #091321; }
.combat-screen::before {
  opacity: .045;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(210, 230, 255, .24) 7px 8px);
}
.arena-vignette {
  background: linear-gradient(180deg, rgba(5, 11, 24, .18), transparent 22%, transparent 76%, rgba(5, 11, 24, .25));
}

.combat-top {
  top: 14px;
  right: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(112px, .55fr) minmax(90px, .42fr) 40px;
  gap: 14px;
  min-height: 82px;
  padding: 10px 14px;
  border: 1px solid rgba(184, 209, 250, .19);
  border-radius: 17px;
  background: linear-gradient(110deg, rgba(9, 16, 34, .96), rgba(18, 27, 51, .9));
  box-shadow: 0 13px 40px rgba(4, 8, 18, .34), inset 0 1px rgba(255,255,255,.06);
  color: #edf4ff;
  backdrop-filter: blur(14px);
}

.fighter-card { min-width: 0; grid-template-columns: 54px 112px minmax(90px,1fr); gap: 3px 10px; }
.fighter-card img {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(116, 230, 235, .35);
  border-radius: 12px;
  background: linear-gradient(145deg, #26395d, #121c35);
}
.fighter-meta strong { color: #f4f7ff; font: 800 11px var(--sans); }
.fighter-meta span { color: #8fa4c9; font: 700 8px var(--sans); letter-spacing: 1px; }
.hp-meter { height: 14px; border: 1px solid rgba(195, 216, 248, .2); border-radius: 999px; background: rgba(3, 8, 20, .8); }
.hp-meter i { border-radius: inherit; background: linear-gradient(90deg, #41d5b2, #b2ef75); }
.hp-meter b { color: #f9fbff; font: 700 8px var(--sans); line-height: 12px; }
.shield-meter { height: 4px; border-radius: 999px; background: rgba(163, 183, 223, .16); }
.shield-meter i { border-radius: inherit; background: linear-gradient(90deg, #5fc9ff, #ad8cff); }

.match-readout {
  min-width: 0;
  padding: 3px 12px;
  border-left: 1px solid var(--ui-line);
  border-right: 1px solid var(--ui-line);
}
.match-readout span { color: #92a7cb; font: 700 8px var(--sans); letter-spacing: 1.3px; }
.match-readout b { color: #fff; font: 800 16px var(--sans); font-variant-numeric: tabular-nums; text-shadow: none; }
.match-readout small { color: #8193b2; font: 700 7px var(--sans); letter-spacing: .6px; }
.score-card { min-width: 0; }
.score-card small { color: #91a3c3; font: 700 7px var(--sans); letter-spacing: .7px; }
.score-card b { color: var(--gold); font: 900 17px var(--sans); }
.score-card span { color: #c0cde4; font-size: 8px; }
.pause-button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(179, 199, 236, .2);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  box-shadow: none;
  color: #d8e6ff;
}
.pause-button:hover { transform: translateY(-1px); border-color: var(--ui-cyan); background: rgba(116, 230, 235, .12); }

.combat-notice { top: 108px; color: #e7fbff; font: 800 10px var(--sans); text-shadow: 0 2px 10px #07101f; }
.combat-notice:not(:empty) {
  padding: 9px 15px;
  border: 1px solid rgba(116, 230, 235, .38);
  border-radius: 999px;
  background: rgba(9, 18, 37, .88);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}

.combat-bottom {
  right: 18px;
  bottom: 17px;
  left: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0,1fr) minmax(74px, 96px);
  align-items: end;
  gap: 12px;
}

.combat-tip, .dash-panel {
  border: 1px solid rgba(179, 199, 236, .17);
  border-radius: 13px;
  background: rgba(9, 16, 33, .9);
  box-shadow: 0 10px 28px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.05);
  color: #aab9d3;
  backdrop-filter: blur(12px);
}

.combat-tip {
  max-width: 180px;
  padding: 10px;
  font-size: 8px;
  font-weight: 600;
}

kbd {
  min-width: 21px;
  min-height: 20px;
  border: 1px solid rgba(181, 202, 240, .24);
  border-radius: 6px;
  background: rgba(255,255,255,.075);
  color: #edf5ff;
  font: 700 8px var(--sans);
}

.ability-bar { gap: 8px; }
.ability-slot {
  width: min(10vw, 108px);
  height: 78px;
  padding: 8px;
  border: 1px solid rgba(177, 200, 239, .2);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(19, 30, 55, .97), rgba(9, 16, 32, .97));
  box-shadow: 0 8px 22px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.06);
  color: #f1f5ff;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ability-slot:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: var(--slot-color);
  background: linear-gradient(155deg, rgba(31, 44, 72, .98), rgba(11, 19, 37, .98));
}

.ability-slot:disabled { opacity: .64; }
.ability-slot .slot-key {
  min-width: 21px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--slot-color), white 28%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--slot-color), transparent 80%);
  color: #f4fbff;
  font: 800 8px var(--sans);
}

.ability-slot b { color: #f2f6ff; font-size: 9px; font-weight: 800; }
.ability-slot small { color: #9cacc8; font-size: 8px; }
.ability-slot .cooldown-mask { background: rgba(4, 9, 22, .72); }
.ability-slot.selected {
  transform: translateY(-5px);
  border-color: var(--slot-color);
  background: linear-gradient(145deg, color-mix(in srgb, var(--slot-color), #131e36 82%), #0b1326);
  box-shadow: 0 0 0 1px var(--slot-color), 0 10px 25px color-mix(in srgb, var(--slot-color), transparent 76%);
}

.ability-slot.selected small { color: #d4e4ff; }
.ability-slot.ultradash-slot {
  width: min(11vw, 122px);
  height: 84px;
  border-color: rgba(255, 205, 107, .8);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffdb85, #f49858 52%, #d75772);
  box-shadow: 0 0 0 1px rgba(255, 220, 139, .5), 0 0 25px rgba(255, 164, 87, .27), 0 9px 24px rgba(0,0,0,.25);
}

.ability-slot.ultradash-slot .slot-key {
  border-color: rgba(110, 46, 61, .6);
  background: rgba(255,255,255,.65);
  color: #5a2847;
}

.ability-slot.ultradash-slot b { color: #54253f; font: 900 11px var(--sans); text-shadow: none; }
.ability-slot.ultradash-slot small { color: #66324c; font: 800 7px var(--sans); }
.ability-slot.ultradash-slot .special-ribbon { top: 5px; right: 6px; padding: 3px 5px; border-radius: 999px; background: rgba(98, 42, 63, .82); color: #fff3d4; font: 800 6px var(--sans); }
.ability-slot.ultradash-slot:hover:not(:disabled) { transform: translateY(-5px) scale(1.025); border-color: #fff3c0; }

.dash-panel {
  min-width: 0;
  justify-items: center;
  gap: 7px;
  padding: 10px 8px;
}
.dash-panel>span { color: #a9b9d4; font: 800 8px var(--sans); letter-spacing: 1.4px; }
.dash-panel kbd { color: var(--gold); }
.dash-charges { gap: 5px; }
.dash-charge { width: 24px; height: 9px; border: 1px solid rgba(177, 200, 239, .28); border-radius: 999px; background: rgba(255,255,255,.08); }
.dash-charge i { border-radius: inherit; background: linear-gradient(90deg, #ffcf6f, #fff0a1); }
.dash-charge.empty i { background: linear-gradient(90deg, #7685a7, #aab7d2); }

.special-announcement { inset: 12% 5% 13%; }
.special-announcement::before {
  border-block: 1px solid rgba(255, 242, 173, .9);
  border-radius: 14px;
  background: linear-gradient(90deg, transparent, rgba(16, 28, 57, .88) 12%, rgba(36, 34, 71, .86) 88%, transparent);
  box-shadow: 0 0 42px rgba(116, 230, 235, .22), inset 0 0 35px rgba(255, 213, 122, .12);
}

.combat-overlay {
  background: rgba(5, 9, 21, .79);
  backdrop-filter: blur(12px) saturate(.8);
}

.result-card {
  width: min(480px, 100%);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(176, 203, 245, .22);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(20, 31, 57, .99), rgba(9, 16, 33, .99));
  box-shadow: 0 30px 90px rgba(0,0,0,.5), inset 0 1px rgba(255,255,255,.08);
  color: #edf4ff;
}

.result-eyebrow { color: var(--ui-cyan); font: 800 9px var(--sans); letter-spacing: 2px; }
.result-card h2 { margin: 15px 0 8px; color: #fff; font: 900 clamp(20px,3vw,28px)/1.25 var(--sans); }
.result-card p { color: #aab9d3; font-size: 13px; }
.result-stats { gap: 9px; margin: 22px 0; }
.result-stat {
  padding: 12px 6px;
  border: 1px solid rgba(177, 200, 239, .14);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.result-stat b { color: #fff; font: 900 17px var(--sans); }
.result-stat small { color: #99abc8; font: 700 7px var(--sans); letter-spacing: .5px; }
.result-actions { gap: 9px; }
.result-actions .start-button { width: 100%; }
.secondary-button {
  min-height: 42px;
  padding: 10px;
  border: 1px solid rgba(177, 200, 239, .17);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  color: #d7e2f6;
  font-size: 11px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.secondary-button:hover { border-color: rgba(116, 230, 235, .4); background: rgba(116, 230, 235, .09); }

.combat-overlay.victory .result-card {
  border-color: rgba(255, 211, 114, .58);
  box-shadow: 0 0 0 1px rgba(255, 211, 114, .16), 0 0 55px rgba(255, 185, 90, .15), 0 30px 90px rgba(0,0,0,.5);
}
.combat-overlay.victory .result-eyebrow { color: var(--gold); }
.combat-overlay.victory .result-card h2 { color: #fff0c7; font-size: clamp(20px,3vw,28px); text-shadow: 0 0 25px rgba(255, 206, 115, .22); }
.combat-overlay.victory .result-card::before { color: var(--gold); text-shadow: 0 0 12px rgba(255, 211, 114, .6); }
.combat-overlay.victory .result-card::after { border-color: rgba(255, 211, 114, .42); border-radius: 26px; }

@keyframes ui-glow { 50% { box-shadow: 0 0 0 1px var(--ui-cyan), 0 0 24px rgba(116, 230, 235, .2); } }
@keyframes ui-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .setup-layout { grid-template-columns: minmax(240px,.72fr) minmax(0,1.3fr); gap: 14px; }
  .setup-heading { padding: 17px; }
  .setup-card { padding: 15px; }
  .pokemon-choice { grid-template-columns: 40px minmax(0,1fr); gap: 0 5px; padding: 5px; }
  .pokemon-choice img { width: 40px; height: 40px; }
  .combat-top { grid-template-columns: minmax(200px,1fr) 100px 72px 36px; gap: 8px; }
  .fighter-card { grid-template-columns: 46px 94px minmax(68px,1fr); gap: 3px 7px; }
  .fighter-card img { width: 44px; height: 44px; }
  .combat-bottom { grid-template-columns: minmax(90px,140px) minmax(0,1fr) 76px; gap: 8px; }
  .ability-bar { gap: 5px; }
  .ability-slot { width: min(10vw,94px); padding: 7px 6px; }
  .ability-slot.ultradash-slot { width: min(11vw,106px); }
}

@media (max-width: 760px) {
  .setup-screen { padding: 10px 12px 16px; }
  .lobby-topbar { display: flex; justify-content: space-between; gap: 8px; min-height: 38px; }
  .lobby-brand { display: flex; gap: 6px; font-size: 8px; letter-spacing: .8px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; font-size: 10px; }
  .back-link { padding: 6px 8px; font-size: 8px; }
  .offline-pill { padding: 6px 8px; font-size: 6px; }
  .setup-layout { grid-template-columns: minmax(0,1fr); gap: 11px; margin: 11px auto; }
  .setup-heading {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(145px,.8fr);
    align-items: center;
    gap: 4px 12px;
    padding: 14px;
  }
  .setup-heading .eyebrow, .setup-heading h1, .setup-heading>p { grid-column: 1; }
  .setup-heading h1 { margin: 5px 0; font-size: clamp(18px,5vw,25px); }
  .setup-heading>p { margin: 0; font-size: 10px; }
  .lobby-stage { grid-column: 2; grid-row: 1 / span 4; width: 100%; height: 180px; }
  .lobby-controls { margin: 9px 0 0; font-size: 7px; }
  .pokemon-detail { grid-column: 1 / -1; grid-template-columns: minmax(115px,.8fr) minmax(0,1.2fr); }
  .setup-card { padding: 13px; }
  .pokemon-roster { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .pokemon-choice { min-height: 54px; grid-template-columns: 34px minmax(0,1fr); gap: 0 4px; padding: 4px; border-radius: 9px; }
  .pokemon-choice img { width: 34px; height: 34px; }
  .pokemon-choice b { font-size: 8px; }
  .pokemon-choice small { font-size: 7px; }
  .setup-options { gap: 7px; margin-top: 10px; }
  .setup-options>section { padding: 8px; border-radius: 10px; }
  .setup-options>section:first-child { grid-column: 1 / -1; }
  .option-heading { flex-wrap: wrap; gap: 2px 6px; margin-bottom: 6px; }
  .option-heading b { font-size: 8px; }
  .option-heading small { font-size: 8px; }
  .mode-grid .choice { min-height: 51px; padding: 6px; }
  .mode-grid .choice b { font-size: 9px; }
  .mode-grid .choice i { display: none; }
  .mode-grid .choice small { font-size: 7px; }
  .compact-grid { gap: 4px; }
  .choice { min-height: 31px; padding: 5px 3px; font-size: 8px; }
  .arena-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .setup-footer { margin-top: 10px; padding-top: 10px; }
  .control-summary { display: flex; max-width: 160px; }
  .control-summary small { display: none; }
  .start-button { min-height: 40px; padding: 0 11px; font-size: 11px; }
  .start-button span { margin-left: 6px; font-size: 14px; }
  .legal-note { justify-content: center; margin: 5px auto; font-size: 6px; }
  .legal-note span:last-child { display: none; }

  .combat-top {
    top: 8px;
    right: 8px;
    left: 8px;
    grid-template-columns: minmax(0,1fr) 65px 42px 32px;
    gap: 5px;
    min-height: 62px;
    padding: 6px;
    border-radius: 13px;
  }
  .fighter-card { grid-template-columns: 36px minmax(54px,.7fr) minmax(50px,1fr); gap: 2px 4px; }
  .fighter-card img { width: 34px; height: 34px; border-radius: 8px; }
  .fighter-meta strong { max-width: 75px; font-size: 8px; }
  .fighter-meta span { font-size: 6px; }
  .hp-meter { height: 11px; }
  .hp-meter b { font-size: 6px; line-height: 9px; }
  .match-readout { padding: 3px 4px; }
  .match-readout span { font-size: 5px; }
  .match-readout b { font-size: 10px; }
  .match-readout small { font-size: 5px; }
  .score-card small { display: none; }
  .score-card b { font-size: 11px; }
  .score-card span { max-width: 45px; font-size: 6px; text-align: center; }
  .pause-button { width: 29px; height: 29px; border-radius: 9px; font-size: 13px; }
  .combat-notice { top: 78px; font-size: 8px; }
  .combat-bottom {
    right: 8px;
    bottom: 8px;
    left: 8px;
    grid-template-columns: minmax(0,1fr) 62px;
    gap: 6px;
  }
  .combat-tip { display: none; }
  .ability-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .ability-slot, .ability-slot.ultradash-slot {
    width: auto;
    min-width: 0;
    height: 66px;
    padding: 5px 3px;
    border-radius: 9px;
  }
  .ability-slot .slot-key { min-width: 17px; height: 17px; margin-bottom: 3px; font-size: 7px; }
  .ability-slot b { font-size: 7px; }
  .ability-slot small { margin-top: 2px; font-size: 6px; }
  .ability-slot.ultradash-slot b { font-size: 8px; }
  .ability-slot.ultradash-slot .special-ribbon { top: 3px; right: 3px; padding: 2px 3px; font-size: 5px; }
  .dash-panel { width: 100%; min-width: 0; gap: 6px; padding: 7px 4px; border-radius: 10px; }
  .dash-panel>span { font-size: 6px; }
  .dash-panel kbd { min-width: 32px; font-size: 6px; }
  .dash-charges { gap: 3px; }
  .dash-charge { width: 18px; height: 8px; }
  .special-announcement { inset: 10% 4% 18%; }
  .combat-overlay { padding: 14px; }
  .result-card { padding: 25px 18px; border-radius: 17px; }
  .result-stats { gap: 5px; }
  .result-stat { padding: 9px 3px; }
  .result-stat b { font-size: 14px; }
  .result-stat small { font-size: 6px; }
}

@media (max-width: 430px) {
  .setup-heading { grid-template-columns: minmax(0,1fr); }
  .setup-heading .eyebrow, .setup-heading h1, .setup-heading>p, .lobby-stage { grid-column: 1; }
  .lobby-stage { grid-row: auto; height: 165px; }
  .pokemon-detail { grid-template-columns: minmax(95px,.75fr) minmax(0,1.25fr); gap: 5px; padding: 8px; }
  .detail-profile img { width: 39px; height: 39px; }
  .detail-profile strong { font-size: 10px; }
  .detail-profile small { font-size: 8px; }
  .stat-item { font-size: 6px; }
  .stat-item b { font-size: 10px; }
  .move-chip { padding: 4px 3px; }
  .move-chip span { font-size: 5px; }
  .move-chip b { font-size: 6px; }
  .setup-options { grid-template-columns: minmax(0,1fr); }
  .setup-options>section:first-child { grid-column: 1; }
  .arena-grid .choice { font-size: 7px; }
  .combat-top { grid-template-columns: minmax(0,1fr) 57px 34px 29px; }
  .fighter-card { grid-template-columns: 31px minmax(45px,.7fr) minmax(40px,1fr); }
  .fighter-card img { width: 29px; height: 29px; }
  .fighter-meta strong { max-width: 63px; font-size: 7px; }
  .fighter-meta span { font-size: 5px; }
  .pause-button { width: 26px; height: 26px; }
  .combat-bottom { grid-template-columns: minmax(0,1fr) 55px; }
  .ability-bar { gap: 3px; }
  .ability-slot, .ability-slot.ultradash-slot { height: 60px; padding: 4px 2px; }
  .ability-slot b { font-size: 6px; }
  .ability-slot.ultradash-slot b { font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .pokemon-choice, .ability-slot, .start-button, .secondary-button { transition: none !important; }
  .setup-screen::after { display: none; }
}

/* Pixel-art pass: crisp edges in menus and a lightweight in-match overlay. */
.setup-screen::before { background-size: 8px 8px; opacity: .06; }
.setup-heading, .setup-card, .setup-options>section, .pokemon-detail, .lobby-stage,
.pokemon-choice, .section-title>span, .roster-count, .mode-grid .choice,
.compact-grid .choice, .move-chip, .start-button, .back-link, .offline-pill {
  border-radius: 0;
}

.setup-heading {
  border: 2px solid rgba(147, 195, 220, .34);
  box-shadow: 4px 4px 0 rgba(4, 9, 20, .5);
}
.setup-heading h1 { font: 20px/1.7 var(--pixel); letter-spacing: 0; }
.lobby-stage { border: 2px solid rgba(190, 228, 240, .45); box-shadow: 4px 4px 0 rgba(4, 9, 20, .48); }
.stage-caption, .eyebrow, .lobby-controls, .lobby-brand, .offline-pill,
.option-heading b, .section-title>span, .mode-grid .choice b,
.control-summary span, .start-button {
  font-family: var(--pixel);
}
.eyebrow { font-size: 7px; letter-spacing: 1px; }
.lobby-brand { font-size: 7px; letter-spacing: 0; }
.offline-pill { font-size: 6px; }
.setup-card {
  border: 2px solid rgba(161, 185, 218, .35);
  box-shadow: 4px 4px 0 rgba(4, 9, 20, .5);
}
.section-title>span { border-width: 2px; font-size: 8px; }
.section-title h2 { font: 10px/1.7 var(--pixel); }
.pokemon-choice { border-width: 2px; box-shadow: 2px 2px 0 rgba(3, 8, 18, .38); }
.pokemon-choice.selected { box-shadow: inset 0 0 0 1px rgba(116, 230, 235, .2), 3px 3px 0 rgba(70, 207, 215, .28); }
.pokemon-choice b { font-size: 8px; }
.option-heading b { font-size: 6px; letter-spacing: 0; }
.setup-options>section { border-width: 2px; box-shadow: 2px 2px 0 rgba(3, 8, 18, .35); }
.mode-grid .choice, .compact-grid .choice { border-width: 2px; }
.mode-grid .choice b { font-size: 8px; }
.choice.selected { box-shadow: inset 0 0 0 1px rgba(116, 230, 235, .16), 2px 2px 0 rgba(116, 230, 235, .22); }
.start-button {
  border: 2px solid #d5fff3;
  box-shadow: 0 3px 0 #237b83, 3px 4px 0 rgba(3, 8, 18, .45);
  font-size: 7px;
}
.start-button:hover { box-shadow: 0 3px 0 #237b83, 3px 4px 0 rgba(3, 8, 18, .45); }
.start-button:active { box-shadow: 0 1px 0 #237b83; }
.back-link { font-family: var(--pixel); font-size: 7px; }
.roster-count { font: 7px var(--pixel); }

.combat-top {
  min-height: 70px;
  padding: 6px 9px;
  border: 2px solid rgba(207, 229, 255, .36);
  border-radius: 0;
  background: rgba(7, 13, 25, .2);
  box-shadow: 3px 3px 0 rgba(3, 7, 15, .28);
  backdrop-filter: none;
}
.fighter-card img { border: 2px solid rgba(190, 221, 244, .42); border-radius: 0; background: rgba(8, 15, 27, .18); }
.fighter-meta strong, .fighter-meta span, .score-card small, .score-card span,
.match-readout span, .match-readout small, .combat-tip, .dash-panel>span {
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .9), -1px -1px 0 rgba(0, 0, 0, .6);
}
.match-readout { border-color: rgba(207, 229, 255, .23); }
.match-readout b, .score-card b { font-family: var(--pixel); font-size: 10px; text-shadow: 2px 2px 0 #080d18; }
.hp-meter { border-radius: 0; background: rgba(0, 0, 0, .48); }
.hp-meter i, .shield-meter i { border-radius: 0; }
.pause-button, .combat-tip, .dash-panel {
  border-radius: 0;
  background: rgba(7, 13, 25, .18);
  box-shadow: 2px 2px 0 rgba(3, 7, 15, .26);
  backdrop-filter: none;
}
.pause-button { border: 2px solid rgba(207, 229, 255, .4); }
.combat-notice:not(:empty) {
  border: 2px solid rgba(116, 230, 235, .55);
  border-radius: 0;
  background: rgba(7, 13, 25, .42);
  box-shadow: 2px 2px 0 rgba(3, 7, 15, .36);
}
.combat-bottom { gap: 8px; }
.combat-tip { border: 2px solid rgba(207, 229, 255, .28); }
kbd { border-radius: 0; background: rgba(7, 13, 25, .32); }
.ability-slot, .ability-slot.ultradash-slot {
  border-width: 2px;
  border-radius: 0;
  background: rgba(7, 13, 25, .2);
  box-shadow: 2px 2px 0 rgba(3, 7, 15, .3);
  backdrop-filter: none;
}
.ability-slot:hover:not(:disabled) { background: rgba(7, 13, 25, .36); }
.ability-slot .slot-key { border-radius: 0; font-family: var(--pixel); }
.ability-slot.selected {
  background: color-mix(in srgb, var(--slot-color), transparent 82%);
  box-shadow: 0 0 0 1px var(--slot-color), 2px 2px 0 rgba(3, 7, 15, .35);
}
.ability-slot.ultradash-slot {
  border-color: #ffd273;
  background: rgba(246, 139, 77, .25);
  box-shadow: 2px 2px 0 rgba(3, 7, 15, .35);
}
.ability-slot.ultradash-slot .slot-key { border-radius: 0; background: rgba(17, 25, 40, .42); color: #fff3d4; }
.ability-slot.ultradash-slot b, .ability-slot.ultradash-slot small { color: #fff4d8; text-shadow: 1px 1px 0 rgba(51, 22, 32, .9); }
.ability-slot.ultradash-slot .special-ribbon { border-radius: 0; }
.dash-panel { border: 2px solid rgba(207, 229, 255, .28); }
.dash-charge { border-radius: 0; }
.dash-charge i { border-radius: 0; }
.special-announcement::before {
  border-radius: 0;
  background: linear-gradient(90deg, transparent, rgba(16, 28, 57, .5) 12%, rgba(36, 34, 71, .48) 88%, transparent);
  backdrop-filter: none;
}

.result-card, .result-stat, .secondary-button { border-radius: 0; }
.result-card {
  border: 3px solid rgba(176, 203, 245, .5);
  box-shadow: 4px 4px 0 rgba(3, 7, 15, .55), inset 0 0 0 2px rgba(255,255,255,.04);
}
.result-eyebrow, .result-card h2, .result-stat small { font-family: var(--pixel); }
.result-eyebrow { font-size: 7px; }
.result-card h2 { font-size: 13px; line-height: 1.8; }
.result-stat { border-width: 2px; }
.result-stat b { font-family: var(--pixel); font-size: 11px; }
.secondary-button { border-width: 2px; font-family: var(--pixel); font-size: 7px; }

@media (max-width: 760px) {
  .setup-heading h1 { font-size: 14px; }
  .section-title h2 { font-size: 8px; }
  .setup-card { box-shadow: 3px 3px 0 rgba(4, 9, 20, .5); }
  .combat-top { min-height: 58px; background: rgba(7, 13, 25, .17); }
  .ability-slot, .ability-slot.ultradash-slot { background: rgba(7, 13, 25, .2); }
  .ability-slot.ultradash-slot { background: rgba(246, 139, 77, .25); }
}

:root {
  --ink: #edf2e8;
  --muted: #9daea1;
  --green: #b7dc8b;
  --gold: #f0c77a;
  --ui-ink: #111d1b;
  --ui-line: rgba(195, 220, 187, .16);
  --ui-panel: rgba(18, 30, 27, .9);
  --ui-cyan: #b7dc8b;
  --ui-pink: #f0c77a;
  --pixel-ink: #1b2c21;
  --pixel-deep: #111d1b;
  --pixel-leaf: #83b97d;
  --pixel-sun: #f0c77a;
  --pixel-paper: #edf2e8;
  --pixel-frame: #355441;
}

body { background: #111d1b; color: var(--ink); }
button:focus-visible, a:focus-visible { outline-color: var(--green); }

.setup-screen {
  background: radial-gradient(ellipse at 86% 16%, #31483d 0, #1d2c2a 32%, #111d1b 77%);
}
.setup-screen::before {
  opacity: .14;
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
}
.setup-screen::after {
  background:
    radial-gradient(ellipse at 5% 90%, rgba(183, 220, 139, .1), transparent 42%),
    radial-gradient(ellipse at 94% 7%, rgba(240, 199, 122, .08), transparent 34%);
}

.lobby-brand strong, .brand-mark { color: var(--green); }
.brand-mark { border-color: rgba(183, 220, 139, .55); background: linear-gradient(145deg, #3c6348, #203b30); }
.offline-pill { border-color: rgba(183, 220, 139, .3); background: rgba(183, 220, 139, .08); color: #d7edbd; }
.offline-pill i { background: #b7dc8b; box-shadow: 0 0 10px #b7dc8b; }
.back-link:hover { border-color: var(--green); }

.setup-heading {
  border-color: rgba(195, 220, 187, .18);
  background:
    linear-gradient(180deg, rgba(18, 30, 27, .74), rgba(17, 29, 27, .62)),
    url("../assets/arena/sky.png") center / cover;
  box-shadow: 4px 4px 0 rgba(5, 14, 9, .35);
}
.setup-heading h1 { font: 900 clamp(16px, 2.1vw, 25px)/1.8 var(--pixel); }
.setup-heading h1 em { color: var(--green); }
.eyebrow { color: #b7caac; }
.eyebrow span { background: var(--green); box-shadow: 0 0 13px rgba(183, 220, 139, .6); }
.lobby-stage { border-color: rgba(195, 220, 187, .3); box-shadow: 4px 4px 0 rgba(5, 14, 9, .35); }
.stage-caption b { color: var(--green); }
.lobby-controls { color: #c3d2c1; }
.lobby-controls kbd { border-color: #355441; background: #edf2e8; box-shadow: 2px 2px 0 #536b54; color: #24352a; }

.setup-card {
  border-color: rgba(195, 220, 187, .16);
  background: rgba(18, 30, 27, .9);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .24);
  color: var(--ink);
}
.section-title>span { border-color: #576d53; background: transparent; color: #bfdc9b; }
.section-title h2 { color: #f0f3db; }
.section-title small, .roster-count { color: #9daea1; }
.roster-count { border-color: rgba(195, 220, 187, .16); background: rgba(255,255,255,.035); }
.pokemon-choice { border-color: rgba(238, 247, 219, .1); background: rgba(255,255,255,.035); }
.pokemon-choice:hover { border-color: rgba(201, 224, 190, .34); background: rgba(255,255,255,.07); }
.pokemon-choice.selected { border-color: var(--green); background: rgba(183, 220, 139, .12); box-shadow: inset 0 0 0 1px rgba(183, 220, 139, .14), 2px 2px 0 rgba(7, 16, 11, .38); }
.pokemon-choice b { color: #e8eee1; }
.pokemon-choice small, .option-heading small { color: #91a293; }
.setup-options>section { border-color: rgba(238, 247, 219, .08); background: rgba(255,255,255,.025); box-shadow: none; }
.option-heading b { color: #c9d8bd; }
.mode-grid .choice, .compact-grid .choice {
  border-color: rgba(238, 247, 219, .1);
  background: rgba(255,255,255,.035);
  color: #dce5d8;
}
.mode-grid .choice:hover, .compact-grid .choice:hover { border-color: rgba(201, 224, 190, .3); background: rgba(255,255,255,.07); }
.mode-grid .choice.selected, .compact-grid .choice.selected {
  border-color: rgba(183, 220, 139, .65);
  background: rgba(183, 220, 139, .12);
  color: #d8f0b5;
  box-shadow: inset 0 0 0 1px rgba(183, 220, 139, .12);
}
.mode-grid .choice b { color: #e8eee1; }
.mode-grid .choice small { color: #96a598; }
.choice.selected { border-color: rgba(183, 220, 139, .65); background: rgba(183, 220, 139, .12); color: #d8f0b5; }
.setup-footer { border-color: rgba(238, 247, 219, .1); }
.control-summary { color: #87988b; }
.control-summary b { color: var(--green); }
.control-summary span { color: #e0e9dc; }
.start-button {
  border: 1px solid rgba(201, 224, 190, .2);
  background: #b9d995;
  box-shadow: 0 4px 0 #769a61, 0 12px 30px rgba(138, 177, 106, .11);
  color: #1b2c21;
}
.start-button:hover { background: #cbe8a6; box-shadow: 0 4px 0 #769a61, 0 12px 30px rgba(138, 177, 106, .11); }
.start-button:active { box-shadow: 0 1px 0 #769a61; }
.legal-note, .legal-note span:first-child { color: #91a293; }
.legal-note a { color: var(--green); }

.combat-screen { background: #325f49; }
.arena-vignette { background: linear-gradient(180deg, rgba(8,19,15,.3), transparent 25%, transparent 73%, rgba(8,18,14,.25)); }
.combat-top {
  border-color: rgba(238, 247, 219, .22);
  background: rgba(17, 29, 25, .28);
  box-shadow: 0 8px 26px rgba(9, 18, 13, .2);
}
.fighter-card img { border-color: rgba(229, 240, 206, .28); background: rgba(17, 29, 25, .18); }
.fighter-meta strong { color: #edf2e8; }
.fighter-meta span, .score-card small { color: #b3c2a9; }
.hp-meter { border-color: rgba(255,255,255,.22); background: rgba(0,0,0,.35); }
.hp-meter i { background: linear-gradient(90deg, #82bd67, #b9db82); }
.shield-meter { background: rgba(255,255,255,.12); }
.match-readout { border-color: rgba(238, 247, 219, .16); }
.match-readout span { color: #afc1a8; }
.match-readout b { color: #f3edc9; }
.match-readout small, .score-card span { color: #b9c6b7; }
.score-card b { color: #f2dc8d; }
.pause-button, .combat-tip, .dash-panel {
  border-color: rgba(238, 247, 219, .18);
  background: rgba(17, 29, 25, .24);
  color: #d5dfd1;
}
.pause-button { color: #edf2e8; }
.pause-button:hover { border-color: var(--green); background: rgba(183, 220, 139, .12); }
.combat-notice { color: #fff3bd; }
.combat-notice:not(:empty) { border-color: rgba(240, 199, 122, .42); background: rgba(17, 29, 25, .42); }
kbd { border-color: rgba(236, 245, 226, .22); background: rgba(17, 29, 25, .32); color: #eff3e8; }
.ability-slot, .ability-slot.ultradash-slot {
  border-color: rgba(238, 247, 219, .25);
  background: rgba(17, 29, 25, .28);
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
  color: #edf2e8;
}
.ability-slot:hover:not(:disabled) { background: rgba(17, 29, 25, .44); }
.ability-slot .slot-key { background: rgba(255,255,255,.13); color: #fff; }
.ability-slot b { color: #edf2e8; }
.ability-slot small { color: #c2cec0; }
.ability-slot .cooldown-mask { background: rgba(10, 17, 17, .58); }
.ability-slot.selected {
  background: color-mix(in srgb, var(--slot-color), transparent 84%);
  box-shadow: 0 0 0 1px var(--slot-color), 2px 2px 0 rgba(3, 7, 15, .3);
}
.ability-slot.ultradash-slot {
  border-color: rgba(240, 199, 122, .75);
  background: rgba(240, 199, 122, .22);
}
.ability-slot.ultradash-slot .slot-key { border-color: rgba(240, 199, 122, .45); background: rgba(17, 29, 25, .56); color: #ffe9b7; }
.ability-slot.ultradash-slot b, .ability-slot.ultradash-slot small { color: #fff1d2; }
.ability-slot.ultradash-slot .special-ribbon { background: rgba(17, 29, 25, .8); color: #ffe5a7; }
.dash-panel>span { color: #c8d4c2; }
.dash-panel kbd { color: #f0c77a; }
.dash-charge { border-color: rgba(233, 244, 218, .3); background: rgba(255,255,255,.08); }
.dash-charge i { background: #d8ce7c; }
.dash-charge.empty i { background: #a8a272; }
.special-announcement::before {
  border-color: rgba(240, 199, 122, .82);
  background: linear-gradient(90deg, transparent, rgba(17, 29, 25, .58) 12%, rgba(30, 46, 37, .56) 88%, transparent);
}

.result-card {
  border-color: rgba(195, 220, 187, .22);
  background: rgba(23, 36, 31, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  color: #edf2e8;
}
.result-eyebrow { color: #b9dc8f; }
.result-card h2 { color: #f0f3db; }
.result-card p { color: #a3b2a5; }
.result-stat { border-color: rgba(238, 247, 219, .1); background: rgba(255,255,255,.035); }
.result-stat b { color: #e5eddb; }
.result-stat small { color: #93a393; }
.secondary-button { border-color: rgba(238, 247, 219, .15); background: rgba(255,255,255,.045); color: #d9e8ca; }
.secondary-button:hover { border-color: rgba(183, 220, 139, .35); background: rgba(183, 220, 139, .1); }
.combat-overlay.victory .result-card { border-color: rgba(240, 199, 122, .55); }
.combat-overlay.victory .result-eyebrow, .combat-overlay.victory .result-card h2 { color: #f0c77a; }
.combat-overlay.victory .result-card h2 { font-size: 13px; }

@media (max-width: 760px) {
  .setup-heading h1 { font-size: 16px; }
  .combat-top { background: rgba(17, 29, 25, .24); }
  .ability-slot, .ability-slot.ultradash-slot { background: rgba(17, 29, 25, .28); }
  .ability-slot.ultradash-slot { background: rgba(240, 199, 122, .22); }
}

.special-description {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-left: 3px solid var(--move-color);
  background: rgba(255,255,255,.035);
}
.special-description b { color: var(--move-color); font-size: 9px; }
.special-description span { color: #a9b8a9; font-size: 9px; line-height: 1.5; }
.special-move-chip { background: color-mix(in srgb, var(--move-color), transparent 88%); }
.special-move-chip span { color: var(--move-color); font-weight: 800; }
.ability-slot.special-slot b { font: 800 8px/1.35 var(--sans); }
.ability-slot.special-slot .special-ribbon { background: var(--slot-color); color: #18251c; }
.special-announcement::before {
  border-color: var(--special-color, #f0c77a);
  box-shadow: 0 0 34px color-mix(in srgb, var(--special-color, #f0c77a), transparent 45%), inset 0 0 30px rgba(255,244,173,.2);
}
.special-announcement canvas { filter: drop-shadow(0 0 16px var(--special-color, #fff2a1)) drop-shadow(5px 6px 0 #733f55); }
.special-title strong {
  max-width: 58vw;
  background: linear-gradient(180deg, #fffde0, var(--special-color, #ffe783));
  background-clip: text;
  font-size: clamp(18px, 4.8vw, 58px);
  overflow-wrap: anywhere;
}
.special-title small { max-width: min(440px, 54vw); white-space: normal; line-height: 1.6; }
.combat-screen.special-active::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--special-color, #fff7c3), transparent 40%), transparent 72%);
  content: "";
  opacity: 0;
  pointer-events: none;
  animation: ultradash-flash 1.8s ease-out both;
}
@media (max-width: 650px) {
  .special-description { padding: 6px 8px; }
  .special-description span { font-size: 8px; }
  .special-announcement .special-title { max-width: 90%; }
  .special-title strong { max-width: 86vw; font-size: clamp(18px, 7vw, 38px); text-align: center; }
  .special-title small { max-width: 84vw; }
}
.match-readout .round-score { color: #c9e6a3; font-size: 7px; letter-spacing: .5px; }
.round-announcement {
  position: absolute;
  z-index: 4;
  top: 104px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 8px 13px;
  border: 1px solid rgba(205,235,174,.34);
  border-radius: 999px;
  background: rgba(15,27,25,.88);
  box-shadow: 0 5px 22px rgba(0,0,0,.28), inset 0 0 16px rgba(220,246,177,.035);
  backdrop-filter: blur(8px);
  text-align: left;
  transform: translateX(-50%);
  pointer-events: none;
}
.round-announcement::before {
  flex: 0 0 4px;
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f8e49b, #b9dc8f);
  box-shadow: 0 0 10px rgba(205,235,174,.55);
  content: "";
}
.round-announcement small {
  color: #c8d7c1;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}
.round-announcement strong {
  color: #f0e9bd;
  font: clamp(14px, 2.4vw, 20px)/1.2 var(--pixel);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(208,236,150,.3), 0 2px #42533d;
}
.round-announcement span {
  padding-left: 9px;
  border-left: 1px solid rgba(238,247,219,.18);
  color: #b7c8b3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}
.round-announcement.round-text-enter { animation: round-text-pop .28s cubic-bezier(.2,.8,.2,1) both; }
.round-announcement[data-phase="countdown"] {
  top: 106px;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  text-align: center;
}
.round-announcement[data-phase="countdown"]::before,
.round-announcement[data-phase="countdown"] span { display: none; }
.round-announcement[data-phase="countdown"] small { display: none; }
.round-announcement[data-phase="countdown"] strong {
  position: relative;
  color: #ff3937;
  font-size: clamp(52px, 10vw, 76px);
  line-height: 1;
  -webkit-text-stroke: 2px #f7fbff;
  paint-order: stroke fill;
  text-shadow: 4px 5px 0 #07122e, -3px 0 #07122e, 3px 0 #07122e, 0 3px #07122e;
}
.round-announcement[data-phase="countdown"].round-text-enter strong {
  animation: countdown-number-in .32s cubic-bezier(.18,.85,.25,1.25) both;
}
.round-announcement[data-phase="countdown"] strong::after {
  display: inline-block;
  margin-left: .12em;
  color: currentColor;
  content: "···";
  font-size: .34em;
  letter-spacing: .03em;
  vertical-align: .18em;
  -webkit-text-stroke: 0;
  text-shadow: 2px 3px 0 #07122e;
}
.round-announcement[data-phase="countdown"][data-count="2"] strong { color: #ffd51f; }
.round-announcement[data-phase="countdown"][data-count="1"] strong { color: #43e64a; }
.round-announcement[data-phase="countdown"][data-count="GO!"] strong {
  color: #f7fbff;
  font-size: clamp(42px, 8vw, 60px);
  -webkit-text-stroke: 1px #fff;
  text-shadow: 4px 5px 0 #07122e, -3px 0 #07122e, 3px 0 #07122e, 0 3px #07122e, 0 0 18px #1688ff;
}
.round-announcement[data-phase="countdown"][data-count="GO!"] strong::before,
.round-announcement[data-phase="countdown"][data-count="GO!"] strong::after {
  position: absolute;
  top: 30%;
  width: 13px;
  height: 5px;
  border: 2px solid #07122e;
  border-radius: 2px;
  background: #1688ff;
  content: "";
}
.round-announcement[data-phase="countdown"][data-count="GO!"] strong::before {
  left: -27px;
  transform: rotate(25deg);
  box-shadow: 0 10px 0 -1px #1688ff, 0 20px 0 -1px #1688ff;
}
.round-announcement[data-phase="countdown"][data-count="GO!"] strong::after {
  right: -27px;
  transform: rotate(-25deg);
  box-shadow: 0 10px 0 -1px #1688ff, 0 20px 0 -1px #1688ff;
}
.round-announcement[data-phase="victory"] { border-color: rgba(255,215,119,.58); }
.round-announcement[data-phase="victory"] strong { color: #ffe29a; }
.round-announcement[data-phase="intermission"] { border-color: rgba(151,204,182,.42); }
.round-announcement[data-phase="final"] { border-color: rgba(219,192,132,.52); }
@keyframes round-text-pop {
  from { opacity: 0; transform: translate(-50%, -7px) scale(.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes countdown-number-in {
  from { opacity: .35; transform: translateY(8px) scale(.68); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .round-announcement.round-text-enter,
  .round-announcement[data-phase="countdown"].round-text-enter strong { animation: none; }
}
@media (max-width: 650px) {
  .round-announcement { top: 101px; gap: 7px; padding: 7px 10px; }
  .round-announcement small { font-size: 6px; }
  .round-announcement strong { font-size: 14px; }
  .round-announcement span { padding-left: 7px; font-size: 7px; }
  .round-announcement[data-phase="countdown"] { top: 101px; gap: 2px; padding: 0; }
  .round-announcement[data-phase="countdown"] strong { font-size: clamp(54px, 14vw, 82px); }
  .round-announcement[data-phase="countdown"][data-count="GO!"] strong { font-size: clamp(46px, 13vw, 72px); }
}

/* Unified PokéRevenge pixel interface */
:root {
  color-scheme: dark;
  --ink: #e8e4d3;
  --muted: #9fb3b4;
  --green: #88b8aa;
  --gold: #d7b56d;
  --pixel: "Pixelify Sans", Consolas, monospace;
  --sans: "Pixelify Sans", Arial, sans-serif;
  --ui-ink: #142a39;
  --ui-line: #456171;
  --ui-panel: #12303c;
  --pixel-ink: #1b3040;
  --pixel-deep: #102533;
  --pixel-leaf: #739c91;
  --pixel-sun: #d7b56d;
  --pixel-paper: #f0e7ce;
  --pixel-frame: #526d78;
}

html, body { background: #0c202c; }
body { color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #e0c47f;
  outline-offset: 3px;
}

.setup-screen {
  padding: 18px clamp(16px, 4vw, 60px) 20px;
  scrollbar-color: #708b89 #102b38;
  scrollbar-width: thin;
  background:
    radial-gradient(ellipse at 87% 9%, rgba(84, 127, 139, .25), transparent 34%),
    radial-gradient(ellipse at 7% 90%, rgba(73, 118, 119, .18), transparent 38%),
    #0c202c;
}
.setup-screen::before {
  position: fixed;
  inset: 0;
  opacity: .1;
  background-image:
    linear-gradient(rgba(185, 210, 208, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 210, 208, .16) 1px, transparent 1px);
  background-size: 8px 8px;
}
.setup-screen::after {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, transparent 48%, rgba(215, 181, 109, .035) 48% 52%, transparent 52%);
  pointer-events: none;
}
.lobby-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1320px, 100%);
  min-height: 48px;
  margin: 0 auto;
  border-bottom: 2px solid rgba(151, 185, 188, .22);
}
.lobby-brand, .lobby-brand strong { color: #f0e7ce; }
.lobby-brand { gap: 10px; font: 800 12px var(--pixel); letter-spacing: .3px; }
.lobby-brand strong { color: var(--gold); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 2px solid #d7b56d;
  background: #193d4a;
  box-shadow: 2px 2px 0 #071720;
  color: #f0e7ce;
  font: 800 9px var(--pixel);
}
.offline-pill {
  padding: 6px 9px;
  border: 2px solid #3c6672;
  background: #102b38;
  color: #d7e5df;
  font: 700 7px var(--pixel);
}
.offline-pill i { background: #9bc2a5; box-shadow: none; }

.setup-layout {
  grid-template-columns: minmax(275px, .78fr) minmax(0, 1.55fr);
  gap: clamp(18px, 2.8vw, 38px);
  align-items: start;
  width: min(1320px, 100%);
  margin: clamp(15px, 3vh, 30px) auto 18px;
}
.setup-heading {
  display: block;
  padding: 20px;
  border: 3px solid #446572;
  background: linear-gradient(180deg, rgba(19, 50, 62, .96), rgba(15, 39, 51, .96));
  box-shadow: 4px 4px 0 #071720, inset 0 0 0 2px rgba(209, 225, 214, .055);
}
.eyebrow {
  color: #a9c5c6;
  font: 700 8px var(--pixel);
  letter-spacing: .5px;
}
.eyebrow span { background: #d7b56d; box-shadow: none; }
.setup-heading h1 {
  margin: 16px 0 8px;
  color: #f0e7ce;
  font: 900 clamp(18px, 2vw, 26px)/1.65 var(--pixel);
  letter-spacing: -.5px;
  text-shadow: 3px 3px 0 #0b202b;
}
.setup-heading h1 em { color: #d7b56d; }
.setup-heading p { max-width: 310px; margin: 0; color: #b7c9c4; font-size: 12px; }
.lobby-stage {
  width: 100%;
  height: clamp(180px, 20vw, 242px);
  margin-top: 20px;
  border: 3px solid #668795;
  background: linear-gradient(180deg, #718e96 0%, #9daea1 54%, #4f746c 55%, #294e4e 100%);
  box-shadow: 4px 4px 0 #071720;
}
.stage-sun { background: #e4c47e; box-shadow: 0 0 0 5px rgba(228, 196, 126, .12); }
.stage-cloud { opacity: .68; filter: sepia(.1) hue-rotate(135deg); }
.stage-grass { background: #587d70; }
.stage-ground { border-color: #3c625b; background: repeating-linear-gradient(90deg, #365d57 0 17px, #426d63 17px 34px); }
.stage-ground::after { background: #d7b56d; box-shadow: 63px 9px #d7b56d, 125px -3px #d7b56d, 225px 6px #d7b56d; }
.stage-caption { color: #f0e7ce; font: 700 7px var(--pixel); text-shadow: 2px 2px #142a39; }
.stage-caption b, .stage-spark { color: #e4c47e; }
.lobby-controls {
  gap: 6px;
  margin: 15px 0 10px;
  color: #b5c8c6;
  font: 700 7px var(--pixel);
}
kbd {
  min-width: 21px;
  min-height: 20px;
  padding: 2px 5px;
  border: 2px solid #597782;
  background: #e6dfc9;
  box-shadow: 2px 2px 0 #243e4a;
  color: #19303d;
  font: 700 8px var(--pixel);
}
.pokemon-detail {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px 12px;
  margin: 12px 0 0;
  padding: 11px;
  border: 3px solid #c9b986;
  background: #f0e7ce;
  box-shadow: 3px 3px 0 #081923, inset 0 0 0 2px rgba(255,255,255,.35);
}
.detail-profile { gap: 8px; }
.detail-profile img { width: 49px; height: 49px; }
.detail-profile strong { color: #1b3040; font: 900 11px var(--pixel); }
.detail-profile small, .stat-item { color: #596c6d; }
.detail-profile small { font-size: 9px; }
.detail-stats { gap: 5px 8px; }
.stat-item { font: 700 7px var(--pixel); }
.stat-item b { color: #1b3040; font: 800 11px var(--sans); }
.move-list { gap: 5px; }
.move-chip {
  padding: 6px;
  border: 1px solid #d4c7a6;
  border-left: 3px solid var(--move-color);
  background: #fbf5e5;
}
.move-chip span { color: #73817a; font: 700 6px var(--pixel); }
.move-chip b { color: #263d49; font-size: 8px; }
.special-description { border-left-width: 3px; background: #e4dcc3; }
.special-description b { font: 800 8px var(--pixel); }
.special-description span { color: #5c6c6d; font-size: 9px; }

.setup-card {
  padding: clamp(15px, 2vw, 25px);
  border: 4px solid #55727d;
  background: #f0e7ce;
  box-shadow: 4px 4px 0 #071720, inset 0 0 0 2px rgba(255,255,255,.35);
  color: #1b3040;
}
.section-title { gap: 10px; margin-bottom: 12px; }
.section-title>span {
  width: 34px;
  height: 34px;
  border: 3px solid #526d78;
  background: #193a49;
  box-shadow: 2px 2px 0 #c6ad70;
  color: #eddfbd;
  font: 800 8px var(--pixel);
}
.section-title h2 { color: #1b3040; font: 900 13px/1.6 var(--pixel); }
.section-title small { color: #687a78; font-size: 10px; }
.roster-count {
  margin-left: auto;
  padding: 6px 8px;
  border: 2px solid #c5b27e;
  background: #e4dcc3;
  color: #36545b;
  font: 800 7px var(--pixel);
}
.dex-trigger {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 54px auto;
  align-items: center;
  width: 100%;
  min-height: 72px;
  gap: 10px;
  padding: 8px 12px;
  border: 3px solid #526d78;
  background: #173a49;
  box-shadow: 3px 3px 0 #c7b783;
  color: #f0e7ce;
  text-align: left;
  transition: transform .12s steps(2), background .12s;
}
.dex-trigger:hover, .dex-trigger.open { transform: translate(-1px, -1px); background: #214958; }
.dex-trigger-mark { color: #d7b56d; font-size: 17px; }
.dex-trigger-copy { display: grid; gap: 4px; }
.dex-trigger-copy small, .dex-trigger-action { color: #b4c8c4; font: 700 7px var(--pixel); }
.dex-trigger-copy strong { color: #f0e7ce; font: 900 12px var(--pixel); }
.dex-selected-sprite { width: 52px; height: 52px; image-rendering: pixelated; }
.dex-trigger-action { display: flex; align-items: center; gap: 10px; justify-self: end; padding: 7px; border: 2px solid #708b89; background: #102d3a; white-space: nowrap; }
.dex-trigger-action b { color: #e0c47f; font-size: 12px; transition: transform .12s steps(2); }
.dex-trigger.open .dex-trigger-action b { transform: rotate(180deg); }
.pokemon-picker {
  display: grid;
  gap: 10px;
  margin-top: 9px;
  padding: 11px;
  border: 3px solid #bcae84;
  background: #e5dcc3;
  box-shadow: 3px 3px 0 #a99a70;
  animation: card-in .16s ease both;
}
.pokemon-picker[hidden] { display: none !important; }
.dex-toolbar { display: grid; gap: 8px; }
.dex-search { display: grid; gap: 5px; color: #4a6369; font: 700 7px var(--pixel); }
.dex-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 2px solid #82918a;
  border-radius: 0;
  background: #fbf5e5;
  color: #1b3040;
  font: 600 12px var(--sans);
  user-select: text;
}
.dex-search input::placeholder { color: #83908a; }
.dex-search input::-webkit-search-cancel-button { cursor: pointer; }
.dex-type-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.dex-filter {
  min-height: 28px;
  padding: 5px 8px;
  border: 2px solid #aeb19b;
  background: #f7f0dc;
  color: #40595f;
  font: 700 7px var(--pixel);
  transition: transform .12s steps(2), background .12s;
}
.dex-filter:hover { transform: translateY(-1px); border-color: #63818a; }
.dex-filter.selected { border-color: #294d5a; background: #294d5a; box-shadow: 2px 2px 0 #c5ae72; color: #f3e8c8; }
.pokemon-roster {
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 7px;
  max-height: min(36vh, 310px);
  overflow: auto;
  padding: 2px 3px 5px 2px;
  overscroll-behavior: contain;
  scrollbar-color: #71878a #d5c9a9;
  scrollbar-width: thin;
}
.pokemon-choice {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  min-height: 62px;
  gap: 5px;
  padding: 5px 7px;
  border: 2px solid #c3b995;
  background: #f7f0dc;
  box-shadow: 2px 2px 0 rgba(44, 66, 70, .16);
  text-align: left;
  transition: transform .12s steps(2), border-color .12s, background .12s;
}
.pokemon-choice:hover { transform: translateY(-2px); border-color: #65828a; background: #fff9e9; }
.pokemon-choice.selected {
  border: 3px solid #315662;
  background: #dce5d2;
  box-shadow: 2px 2px 0 #c2aa6c, inset 0 0 0 1px var(--pokemon-color);
}
.dex-sprite { width: 46px; height: 46px; image-rendering: pixelated; }
.pokemon-choice b { color: #1b3040; font-size: 10px; font-weight: 800; }
.pokemon-choice small { color: #657774; font-size: 9px; }
.dex-empty { margin: 0; padding: 13px 10px; border: 2px dashed #a79d7d; color: #5d706e; font-size: 11px; text-align: center; }

.setup-options { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.setup-options>section {
  padding: 11px;
  border: 2px solid #d1c5a6;
  background: #e9e0c8;
  box-shadow: 2px 2px 0 rgba(38, 62, 70, .13);
}
.setup-options>section:first-child { grid-column: 1 / -1; }
.option-heading { flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.option-heading b { color: #294653; font: 800 8px var(--pixel); }
.option-heading small { color: #71817a; font-size: 10px; }
.option-grid { gap: 6px; }
.mode-grid .choice, .compact-grid .choice {
  min-height: 39px;
  padding: 7px;
  border: 2px solid #c1b693;
  background: #f8f2df;
  box-shadow: 2px 2px 0 rgba(43, 68, 74, .14);
  color: #294653;
  transition: transform .12s steps(2), background .12s, border-color .12s;
}
.mode-grid .choice:hover, .compact-grid .choice:hover { transform: translateY(-2px); border-color: #66838a; background: #fff9e9; }
.mode-grid .choice.selected, .compact-grid .choice.selected {
  border-color: #365e68;
  background: #d9e3d4;
  box-shadow: 2px 2px 0 #c2a969, inset 0 0 0 1px rgba(54, 94, 104, .12);
  color: #203d49;
}
.mode-grid .choice b { color: #203d49; font: 800 9px var(--sans); }
.mode-grid .choice small { color: #6f7e78; font: 700 6px var(--pixel); }
.mode-grid .choice i { color: #a18143; }
.compact-grid .choice { font: 700 8px var(--pixel); text-align: center; }
.arena-grid .choice { min-height: 33px; padding: 5px 3px; }
.setup-footer { gap: 10px; margin-top: 13px; padding-top: 12px; border-color: #c9bea0; }
.control-summary { color: #6a7c77; }
.control-summary>b { color: #a98442; }
.control-summary span { color: #31515c; font: 700 7px var(--pixel); }
.control-summary small { color: #77827a; font-size: 9px; }
.start-button {
  min-height: 46px;
  padding: 0 14px;
  border: 3px solid #234552;
  background: #d8b86f;
  box-shadow: 0 4px 0 #a18149, 3px 5px 0 rgba(30, 48, 56, .28);
  color: #1c3440;
  font: 900 8px var(--pixel);
  transition: transform .12s steps(2), background .12s, box-shadow .12s;
}
.start-button:hover { transform: translateY(-2px); background: #e6c982; box-shadow: 0 5px 0 #a18149, 3px 6px 0 rgba(30, 48, 56, .28); }
.start-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a18149; }
.start-button span { margin-left: 8px; font: inherit; }
.start-button b { font: 18px var(--sans); }
.legal-note { width: min(1320px, 100%); margin: 10px auto 0; color: #9aaeb0; font: 700 6px var(--pixel); }
.legal-note span:first-child { color: #b9c9c2; }

.combat-screen { background: #243f46; }
.arena-vignette { background: linear-gradient(180deg, rgba(8, 24, 34, .4), transparent 24%, transparent 72%, rgba(8, 24, 34, .35)); }
.combat-top {
  border: 3px solid #607c84;
  background: rgba(15, 39, 50, .94);
  box-shadow: 4px 4px 0 rgba(7, 20, 28, .52), inset 0 0 0 2px rgba(231, 228, 207, .05);
  backdrop-filter: none;
}
.fighter-card img { border: 2px solid #748e91; background: #1b3b47; }
.fighter-meta strong { color: #f0e7ce; font: 800 11px var(--pixel); }
.fighter-meta span, .score-card small { color: #b1c6c2; font: 700 7px var(--pixel); }
.hp-meter { border: 2px solid #bcc4aa; background: #263d41; }
.hp-meter i { background: linear-gradient(180deg, #9fc487, #628b6c); }
.hp-meter b { font: 700 7px var(--pixel); }
.shield-meter { background: #42626a; }
.shield-meter i { background: #9ac5bc; }
.match-readout { padding: 5px 10px; border-left: 2px solid #55717b; border-right: 2px solid #55717b; }
.match-readout span, .match-readout small { color: #b4c7c1; font: 700 7px var(--pixel); }
.match-readout b, .score-card b { color: #e0c47f; font: 800 11px var(--pixel); text-shadow: 2px 2px #102533; }
.score-card span { color: #c0d0c8; font-size: 8px; }
.pause-button, .combat-tip, .dash-panel {
  border: 2px solid #66838a;
  background: rgba(15, 39, 50, .9);
  box-shadow: 2px 2px 0 rgba(7, 20, 28, .5);
  color: #e8e4d3;
}
.pause-button { border-width: 3px; color: #f0e7ce; }
.pause-button:hover { border-color: #dfc27b; background: #244b59; }
.combat-notice { color: #f0e7ce; font: 700 10px var(--pixel); text-shadow: 2px 2px #102533; }
.combat-notice:not(:empty) {
  padding: 9px 12px;
  border: 3px solid #d2b66f;
  background: rgba(17, 44, 54, .96);
  box-shadow: 3px 3px 0 rgba(7, 20, 28, .45);
}
.combat-tip { color: #c5d2cc; font-size: 8px; }
.combat-tip kbd, .dash-panel kbd { border-color: #71878a; background: #dcd4ba; color: #1b3040; }
.ability-slot, .ability-slot.ultradash-slot {
  border: 3px solid #6a858d;
  background: rgba(15, 39, 50, .96);
  box-shadow: 3px 3px 0 rgba(7, 20, 28, .5);
  color: #f0e7ce;
}
.ability-slot:hover:not(:disabled) { transform: translateY(-2px); background: #214856; }
.ability-slot .slot-key { border: 1px solid #a69059; background: #d7bb76; color: #1a3440; }
.ability-slot b { color: #f0e7ce; font-size: 9px; }
.ability-slot small { color: #b8c8c1; }
.ability-slot.selected { border-color: var(--slot-color); background: #31525b; }
.ability-slot.ultradash-slot { border-color: #d4b76f; background: rgba(80, 68, 46, .96); }
.ability-slot.ultradash-slot .slot-key { border-color: #d5bb7b; background: #d4b76f; color: #203844; }
.ability-slot.ultradash-slot b, .ability-slot.ultradash-slot small { color: #f4e9c9; }
.ability-slot.ultradash-slot .special-ribbon { background: #e0c47f; color: #203844; }
.dash-panel>span { color: #c5d2cc; font: 700 7px var(--pixel); }
.dash-panel kbd { color: #536d71; }
.dash-charge { border: 2px solid #75898b; background: #2a454d; }
.dash-charge i { background: #d8b86f; }
.dash-charge.empty i { background: #91a696; }
.round-announcement {
  top: 103px;
  border: 3px solid #d2b66f;
  background: #143543;
  box-shadow: 3px 3px 0 rgba(7, 20, 28, .48);
  backdrop-filter: none;
}
.round-announcement::before { background: #d7b56d; box-shadow: none; }
.round-announcement small, .round-announcement span { color: #d5ded2; font-family: var(--pixel); }
.round-announcement strong { color: #f0e7ce; text-shadow: 2px 2px #1a3440; }
.round-announcement[data-phase="countdown"] strong { color: #f0e7ce !important; text-shadow: 3px 3px #173543; }
.round-announcement[data-phase="countdown"][data-count="GO!"] strong { color: #e4c47e !important; }
.round-announcement[data-phase="victory"] { border-color: #d7b56d; }
.round-announcement[data-phase="victory"] strong { color: #e4c47e; }
.round-announcement[data-phase="intermission"], .round-announcement[data-phase="final"] { border-color: #8eaaa4; }
.round-announcement[data-phase="intermission"] strong, .round-announcement[data-phase="final"] strong { color: #e4c47e; }

.combat-overlay { background: rgba(7, 22, 31, .76); backdrop-filter: blur(2px); }
.result-card {
  width: min(470px, 100%);
  padding: clamp(22px, 4vw, 32px);
  border: 4px solid #b89f5c;
  background: #f0e7ce;
  box-shadow: 4px 4px 0 #0a1c26, inset 0 0 0 3px #fff8e6;
  color: #1b3040;
}
.result-eyebrow { color: #59777b; font: 800 8px var(--pixel); }
.result-card h2 { color: #1b3040; font: 900 15px/1.6 var(--pixel); }
.result-card p { color: #61716e; font-size: 12px; }
.result-stat { border: 2px solid #c7b88f; background: #e7dec5; }
.result-stat b { color: #244754; font: 900 10px var(--pixel); }
.result-stat small { color: #71807a; font: 700 6px var(--pixel); }
.combat-overlay.victory .result-card { border-color: #b89f5c; }
.combat-overlay.victory .result-eyebrow, .combat-overlay.victory .result-card h2 { color: #886b31; }
.secondary-button {
  min-height: 40px;
  border: 2px solid #657f85;
  background: #dfe1cf;
  color: #244451;
  font: 700 8px var(--pixel);
}
.secondary-button:hover { border-color: #b89f5c; background: #e8dfc7; }
.special-announcement::before {
  border: 3px solid var(--special-color, #d7b56d);
  background: linear-gradient(90deg, transparent, rgba(18, 48, 60, .94) 12%, rgba(22, 54, 66, .94) 88%, transparent);
  box-shadow: 0 0 24px rgba(215, 181, 109, .24);
  backdrop-filter: none;
}
.special-title span { color: #dfcf9e; font: 700 8px var(--pixel); }
.special-title strong {
  background: none;
  color: #f0e7ce;
  font-family: var(--pixel);
  text-shadow: 3px 3px #183542;
}
.special-title small { color: #d4d8c8; font-family: var(--pixel); font-size: 7px; }
.special-announcement canvas { filter: drop-shadow(4px 5px 0 #183542); }

@media (max-width: 1000px) {
  .setup-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .setup-heading {
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(220px,.9fr);
    align-items: center;
    gap: 0 18px;
    padding: 15px;
  }
}

#progression-quicknav[hidden], #progression-screen[hidden], #progression-startup-error[hidden] {
  display: none !important;
}

.setup-screen {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
.progression-quicknav {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 8px 0;
}
.quick-profile-summary {
    overflow: hidden;
    max-width: 260px;
    margin-right: auto;
    color: #d3ddcf;
    font: 700 8px var(--pixel);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.progression-quicknav button {
    min-height: 34px;
    padding: 7px 12px;
    border: 2px solid rgba(116, 230, 235, .38);
    background: rgba(15, 28, 54, .88);
    color: #e8f1df;
    font: 700 8px var(--pixel);
    cursor: pointer;
}
.progression-quicknav button:hover {
    border-color: var(--ui-cyan);
    background: rgba(116, 230, 235, .14);
    color: #fff3cc;
}
.progression-screen {
    position: relative;
    z-index: 2;
    width: min(1320px, 100%);
    margin: 12px auto 28px;
    padding: clamp(12px, 2vw, 22px);
    border: 2px solid rgba(116, 230, 235, .35);
    background: rgba(8, 15, 34, .96);
    box-shadow: 4px 4px 0 rgba(3, 8, 18, .5);
}
.progression-screen-header {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}
.progression-heading-copy { min-width: 0; }
.progression-screen-header h2 {
    margin: 0;
    color: #f0e7ce;
    font: 900 14px/1.6 var(--pixel);
}
.progression-screen-header p { margin: 2px 0 0; color: #a7b6a4; font-size: 11px; }
.progression-nav-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.progression-screen-header .secondary-button { width: auto; min-height: 34px; }
.progression-select-wrap { display: flex; align-items: center; gap: 7px; color: #8df0ec; font: 700 7px var(--pixel); }
.progression-select-wrap select {
  min-height: 34px;
  max-width: min(240px, 52vw);
  padding: 6px 28px 6px 9px;
  border: 2px solid rgba(116,230,235,.42);
  border-radius: 0;
  background: #101a32;
  color: #e8f1df;
  font: 700 8px var(--pixel);
}
.progression-content { min-height: 280px; }
.progression-alert {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 2px solid #7ea57e;
    background: rgba(47, 81, 57, .32);
    color: #dbf1cf;
    font-size: 12px;
}
.progression-alert.is-error, .startup-alert {
    border-color: #db8a72;
    background: rgba(109, 43, 42, .34);
    color: #ffe4d7;
}
.startup-alert { position: relative; z-index: 2; width: min(1000px, 100%); margin: 14px auto; }
.progression-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.hub-tile {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  min-height: 150px;
  padding: clamp(14px, 2vw, 23px);
  border: 2px solid rgba(158, 185, 241, .3);
  background: linear-gradient(145deg, rgba(42, 66, 116, .96), rgba(22, 38, 77, .97));
  box-shadow: 3px 4px 0 rgba(3, 8, 20, .5), inset 0 1px rgba(255,255,255,.07);
  color: #eff5ff;
  text-align: left;
  cursor: pointer;
  transition: transform .12s steps(2), border-color .12s;
}
.hub-tile:hover { transform: translateY(-2px); border-color: var(--ui-cyan); }
.hub-tile strong { color: #fff; font: 800 13px var(--pixel); }
.hub-tile small { color: #c4d2ec; font: 10px/1.45 var(--sans); }
.hub-icon { color: var(--gold); font: 26px var(--pixel); }
.hub-play { grid-column: span 2; grid-row: span 2; min-height: 312px; border-color: #ffd273; }
.hub-play strong { color: #ffda66; font-size: 24px; }
.hub-play .hub-icon { display: grid; place-items: center; width: 76px; height: 76px; border: 2px solid rgba(255,210,115,.65); border-radius: 50%; background: rgba(12,21,44,.65); font-size: 31px; }
.hub-summary { grid-column: span 2; display: grid; align-content: center; gap: 7px; }
.hub-summary strong { color: #fff; font: 800 12px var(--pixel); }
.hub-summary>span { color: #c4d2ec; font-size: 10px; }
.progress-card {
    min-width: 0;
    padding: 16px;
    border: 2px solid rgba(156, 182, 218, .24);
    background: rgba(20, 33, 65, .92);
    box-shadow: 2px 2px 0 rgba(3, 8, 18, .32);
}
.progress-card h3, .chest-card h3 {
    margin: 4px 0 6px;
    color: #f0e7ce;
    font-size: 15px;
}
.progress-card p { margin: 5px 0; color: #abb9ad; font-size: 11px; }
.progress-kicker { color: #b7dc8b; font: 700 7px var(--pixel); letter-spacing: .3px; }
.trainer-card { display: flex; align-items: center; gap: 16px; grid-column: 1 / -1; }
.trainer-avatar-wrap { position: relative; flex: 0 0 96px; }
.trainer-avatar-wrap canvas { display: block; width: 96px; height: 96px; border: 2px solid var(--green); background: rgba(6, 15, 16, .45); image-rendering: pixelated; }
.trainer-avatar-wrap span { position: absolute; right: -7px; bottom: -7px; padding: 3px 6px; background: #d8c184; color: #27392e; font: 700 7px var(--pixel); }
.trainer-main { flex: 1; min-width: 0; }
.trainer-main h3 { margin: 5px 0 0; font-size: 20px; }
.trainer-currency { display: grid; gap: 4px; padding: 10px 14px; border: 1px solid rgba(240, 199, 122, .42); background: rgba(240, 199, 122, .08); color: #f0d28e; text-align: center; }
.trainer-currency b { font: 800 12px var(--pixel); }
.trainer-currency small { font: 700 6px var(--pixel); }
.xp-track, .rank-track, .ai-stat i, .result-rank-progress i {
    display: block;
    overflow: hidden;
    height: 9px;
    border: 1px solid rgba(226, 238, 216, .25);
    background: rgba(0, 0, 0, .35);
  }
  .xp-track { margin: 8px 0 4px; }
  .xp-track i, .rank-track i, .ai-stat em, .result-rank-progress em { display: block; height: 100%; background: linear-gradient(90deg, #70b67c, #c0e18e); }
  .username-form { display: grid; gap: 8px; margin-top: 14px; }
  .username-form label { color: #b7dc8b; font: 700 7px var(--pixel); }
  .username-form>div { display: flex; gap: 7px; }
  .username-form input {
    min-width: 0;
    flex: 1;
    height: 38px;
    padding: 0 9px;
    border: 2px solid rgba(183, 220, 139, .42);
    background: #101c19;
    color: #f0e7ce;
    font: 12px var(--sans);
  }
  .progress-action, .collection-select, .collection-upgrade, .avatar-button {
    min-height: 35px;
    padding: 7px 10px;
    border: 2px solid #d5fff3;
    background: #73aaa0;
    color: #10251f;
    font: 700 7px var(--pixel);
    cursor: pointer;
  }
  .progress-action:hover, .collection-select:hover, .collection-upgrade:hover, .avatar-button:hover { filter: brightness(1.12); }
  .progress-action:disabled, .collection-upgrade:disabled, .favorite-toggle:disabled { opacity: .45; cursor: not-allowed; }
  .rank-summary { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 12px; border-color: color-mix(in srgb, var(--rank-color), transparent 40%); }
  .rank-emblem { display: grid; place-items: center; width: 56px; height: 56px; border: 2px solid var(--rank-color); color: var(--rank-color); font: 24px var(--pixel); text-shadow: 2px 2px rgba(0, 0, 0, .4); }
  .rank-emblem.large { width: 72px; height: 72px; font-size: 32px; }
  .rank-summary h3 { margin: 3px 0; color: var(--rank-color); }
  .rank-summary>div:nth-child(2)>b { color: #f0e7ce; font: 800 10px var(--pixel); }
  .rank-progress-copy { grid-column: 1 / -1; color: #c2cdbd; font-size: 10px; }
  .rank-track { grid-column: 1 / -1; height: 11px; border-color: color-mix(in srgb, var(--rank-color), transparent 55%); }
  .rank-track i { background: var(--rank-color); }
  .progress-stat-grid { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
  .progress-stat-card { display: grid; place-items: center; gap: 4px; text-align: center; }
  .progress-stat-card>b { overflow: hidden; max-width: 100%; color: #f0d28e; font: 800 14px var(--pixel); text-overflow: ellipsis; white-space: nowrap; }
  .progress-stat-card>small { color: #aab8a7; font: 700 6px var(--pixel); }
  .favorites-card, .history-card, .rank-ladder-card { grid-column: 1 / -1; }
  .card-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .card-heading h3 { margin: 3px 0 0; }
  .progress-link { border: 0; background: transparent; color: #b7dc8b; font: 700 7px var(--pixel); cursor: pointer; }
  .favorite-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
  .favorite-entry { display: grid; justify-items: center; gap: 3px; color: #d7e2d4; font-size: 9px; }
  .favorite-entry canvas { image-rendering: pixelated; }
  .history-list { display: grid; gap: 5px; margin-top: 9px; }
  .history-row { display: grid; grid-template-columns: 90px minmax(90px,1fr) 90px 80px 120px; align-items: center; gap: 8px; padding: 7px 9px; background: rgba(8, 18, 17, .45); color: #d9e3d4; font-size: 10px; }
  .history-row.win .history-result { color: #9ada8a; }
  .history-row.loss .history-result { color: #ef9b85; }
  .history-result, .history-row small { font: 700 7px var(--pixel); }
  .history-row b { color: #f0d28e; }
  .history-row small { color: #adbaaa; }
  .empty-progress, .muted-copy { color: #9eaea1 !important; }
  .ranked-hero { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px 14px; border-color: color-mix(in srgb, var(--rank-color), transparent 38%); }
  .ranked-heading h3 { margin: 4px 0; color: var(--rank-color); font-size: 22px; }
  .ranked-heading>b { color: #f0e7ce; font: 800 12px var(--pixel); }
  .ranked-heading p { margin-top: 6px; }
  .ranked-hero .rank-track, .rank-track-labels, .ranked-start, .ranked-fairness { grid-column: 1 / -1; }
  .ranked-hero .rank-track { height: 13px; }
  .ranked-hero .rank-track i { background: var(--rank-color); }
  .rank-track-labels { display: flex; justify-content: space-between; color: #b8c5b7; font: 700 6px var(--pixel); }
  .ranked-start { min-height: 44px; margin-top: 5px; border-color: var(--rank-color); background: color-mix(in srgb, var(--rank-color), #18251f 55%); color: #fff; }
  .ranked-fairness { margin: 0 !important; }
  .ai-stat-list { display: grid; gap: 11px; margin-top: 15px; }
  .ai-stat { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; color: #d4dfd1; font-size: 10px; }
  .ai-stat>b { color: #f0d28e; font: 700 8px var(--pixel); }
  .ai-stat i { grid-column: 1 / -1; height: 6px; }
  .ai-stat em { background: linear-gradient(90deg, #6ea983, #d6bd78); }
  .opponent-estimate { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(183, 220, 139, .2); color: #b8c5b7; font-size: 10px; }
  .opponent-estimate b { color: #f0d28e; font: 800 9px var(--pixel); }
  .rank-ladder { display: grid; gap: 5px; margin: 12px 0; }
  .rank-ladder-row { display: grid; grid-template-columns: 28px minmax(100px,1fr) 100px 100px; align-items: center; gap: 8px; padding: 6px 9px; border-left: 3px solid var(--rank-color); background: rgba(8,18,17,.4); color: #c6d1c5; }
  .rank-ladder-row>b { color: var(--rank-color); font: 16px var(--pixel); }
  .rank-ladder-row>small { color: #95a397; font-size: 9px; }
  .rank-ladder-row>strong { color: #f0d28e; font: 700 7px var(--pixel); text-align: right; }
  .rank-ladder-row.current { background: color-mix(in srgb, var(--rank-color), transparent 84%); outline: 1px solid color-mix(in srgb, var(--rank-color), transparent 35%); }
  .rank-ladder-row.achieved>span::after { content: " ✓"; color: #a3d08e; }
  .collection-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 12px; color: #aebdaf; font-size: 10px; }
  .collection-summary>b { color: #f0d28e; font: 800 11px var(--pixel); }
  .collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 9px; }
  .collection-card { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 9px; border: 2px solid color-mix(in srgb, var(--rarity-color), transparent 58%); background: rgba(26,43,37,.8); box-shadow: 2px 2px 0 rgba(3,8,18,.3); text-align: center; }
  .collection-card.selected { outline: 2px solid var(--green); outline-offset: 1px; }
  .collection-card.unlocked { cursor: context-menu; }
  .collection-card.locked { filter: saturate(.45); background: rgba(18,30,27,.75); }
  .collection-portrait { position: relative; display: grid; place-items: center; min-height: 76px; }
  .collection-portrait canvas { image-rendering: pixelated; }
  .lock-mark { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7,14,16,.48); font-size: 19px; }
  .favorite-toggle { position: absolute; top: 0; right: 0; width: 25px; height: 25px; border: 1px solid rgba(240,210,142,.5); background: #18251f; color: #f0d28e; font: 16px var(--sans); cursor: pointer; }
  .collection-name { overflow: hidden; color: #eff2e7; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
  .rarity-label { color: var(--rarity-color); font: 700 7px var(--pixel); }
  .collection-stats { display: grid; gap: 3px; margin: 5px 0; color: #aebdaf; font-size: 8px; text-align: left; }
  .collection-stats span { display: flex; justify-content: space-between; }
  .collection-stats b { color: #eee6cf; }
  .collection-match-record { color: #aebdaf; font-size: 8px; }
  .collection-select, .collection-upgrade, .avatar-button { min-height: 30px; padding: 5px; font-size: 6px; }
  .collection-select { border-color: #b7dc8b; background: rgba(113,169,123,.48); color: #f0f3db; }
  .collection-upgrade { border-color: #d7b56d; background: rgba(138,106,49,.55); color: #f7e3b2; }
  .avatar-button { border-color: rgba(155,191,201,.45); background: rgba(42,72,76,.6); color: #d5e7e1; }
  .avatar-current, .locked-copy { padding: 5px 2px; color: #b7dc8b; font: 700 6px var(--pixel); }
  .locked-copy { color: #a6b0a7; line-height: 1.7; }
  .potential-note { margin-top: 6px; color: #b7dc8b; font: 700 6px var(--pixel); }
  .potential-note.locked-potential { color: #e4be7a; }
  .chest-intro { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; padding: 15px; border: 2px solid rgba(183,220,139,.28); background: rgba(26,43,37,.75); }
  .chest-intro h3 { margin: 4px 0; color: #f0d28e; font: 800 12px var(--pixel); }
  .chest-intro p { margin: 3px 0; color: #aebdaf; font-size: 10px; }
  .chest-open-count { display: grid; gap: 4px; min-width: 96px; color: #b7dc8b; text-align: center; }
  .chest-open-count b { font: 800 16px var(--pixel); }
  .chest-open-count small { font: 700 6px var(--pixel); }
  .chest-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
  .chest-card { display: grid; justify-items: center; align-content: start; gap: 7px; padding: 15px; border: 2px solid rgba(183,220,139,.35); background: rgba(26,43,37,.82); text-align: center; }
  .chest-advanced { border-color: rgba(83,169,238,.5); }
  .chest-master { border-color: rgba(255,201,75,.6); }
  .chest-illustration { display: grid; place-items: center; width: 58px; height: 58px; border: 2px solid rgba(183,220,139,.48); color: #c8d89e; font: 28px var(--pixel); }
  .chest-advanced .chest-illustration { border-color: #53a9ee; color: #76c4fa; }
  .chest-master .chest-illustration { border-color: #ffc94b; color: #ffd86e; }
  .chest-card h3 { min-height: 34px; font-size: 12px; }
  .chest-price { color: #f0d28e; font: 800 10px var(--pixel); }
  .chest-odds { display: grid; width: 100%; gap: 5px; margin: 6px 0; }
  .chest-odds span { display: grid; grid-template-columns: 8px 1fr auto; gap: 5px; align-items: center; color: #bdc9bc; font-size: 9px; text-align: left; }
  .chest-odds i, .rarity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rarity-color); }
  .chest-odds b { color: var(--rarity-color); font: 700 7px var(--pixel); }
  .chest-card .progress-action { width: 100%; }
  .chest-reward { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 13px; border: 2px solid var(--rarity-color); background: rgba(14,26,23,.9); animation: chest-reveal .35s steps(4) both; }
  .chest-reward canvas { image-rendering: pixelated; }
  .chest-reward small { color: var(--rarity-color); font: 700 7px var(--pixel); }
  .chest-reward h3 { margin: 3px 0; color: #f0e7ce; }
  .chest-reward b { color: var(--rarity-color); font: 700 8px var(--pixel); }
  .chest-reward p { margin: 4px 0 0; color: #bdc9bc; font-size: 10px; }
  .chest-history-card { margin-top: 12px; }
  .chest-history { display: grid; gap: 4px; margin-top: 8px; }
  .chest-history>div { display: grid; grid-template-columns: 10px 1fr 1fr 90px; gap: 8px; align-items: center; padding: 6px; background: rgba(8,18,17,.4); color: #d8e1d5; font-size: 9px; }
  .chest-history>div small { color: #aebdaf; }
  .chest-history time { color: #aebdaf; text-align: right; }
  .ranked-save-error { grid-column: 1/-1; padding: 9px; border: 2px solid #b65f50; background: #f3d9c9; color: #763b32; font: 700 7px var(--pixel); }
  .ranked-save-error small { font: 10px var(--sans); }
  .unranked-save-note { grid-column: 1/-1; padding: 7px; border: 1px solid #71a97b; background: #e0edd8; color: #3b6542; font: 700 7px var(--pixel); }
  #retry-save-button[hidden] { display: none; }
  .result-card.ranked-results { width: min(650px, 100%); }
  .result-stats .ranked-result-card { display: grid; grid-column: 1/-1; grid-template-columns: repeat(4,1fr); gap: 7px; padding: 10px; border: 2px solid color-mix(in srgb, var(--rank-color), transparent 35%); background: #e5dfc9; }
  .ranked-result-card>div:not(.result-rank-progress):not(.rank-promotion-banner) { display: grid; gap: 5px; padding: 6px 3px; border: 1px solid #c5b991; }
  .ranked-result-card small { color: #66776c; font: 700 6px var(--pixel); }
  .ranked-result-card b { color: #263f40; font: 800 9px var(--pixel); }
  .result-rank-progress { display: grid; grid-column: 1/-1; gap: 5px; color: #405d56; font: 700 7px var(--pixel); text-align: left; }
  .result-rank-progress i { height: 8px; border-color: #b0b99f; }
  .result-rank-progress em { background: var(--rank-color); }
  .rank-promotion-banner { display: flex; grid-column: 1/-1; justify-content: center; align-items: center; gap: 10px; padding: 8px; border: 2px solid var(--rank-color); background: rgba(255,255,255,.35); color: #634e20; font: 800 8px var(--pixel); animation: promotion-pop .65s steps(5) both; }
  .rank-promotion-banner span { color: var(--rank-color); font-size: 22px; }
  .ranked-result-card.promoted { animation: promotion-glow 1s steps(4) both; }
  .pokemon-context-menu {
    position: fixed;
    z-index: 20;
    display: grid;
    gap: 5px;
    width: 225px;
    padding: 9px;
    border: 2px solid #b7dc8b;
    background: #13231f;
    box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  }
  .pokemon-context-menu[hidden] { display: none; }
  .pokemon-context-menu>b { padding: 4px 5px; color: #f0e7ce; font-size: 12px; }
  .pokemon-context-menu button {
    min-height: 31px;
    padding: 6px;
    border: 1px solid rgba(183,220,139,.3);
    background: rgba(183,220,139,.08);
    color: #dae8d2;
    font: 700 6px var(--pixel);
    text-align: left;
    cursor: pointer;
  }
  .pokemon-context-menu button:hover { border-color: #b7dc8b; background: rgba(183,220,139,.2); }
  .pokemon-context-menu button:disabled { opacity: .5; cursor: not-allowed; }
  @keyframes chest-reveal { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes promotion-pop { 0% { opacity: 0; transform: scale(.7); } 70% { transform: scale(1.05); } 100% { opacity: 1; transform: scale(1); } }
  @keyframes promotion-glow { 0%,100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 0 16px color-mix(in srgb, var(--rank-color), transparent 45%); } }

  @media (max-width: 760px) {
    .progression-quicknav { justify-content: flex-start; gap: 4px; }
    .quick-profile-summary { flex-basis: 100%; max-width: none; margin-bottom: 2px; }
    .progression-quicknav button { min-height: 30px; padding: 6px 8px; font-size: 6px; }
    .progression-screen { margin-top: 5px; padding: 9px; }
    .progression-screen-header { align-items: stretch; gap: 9px; }
    .progression-nav-controls { justify-content: space-between; }
    .progression-screen-header .secondary-button { min-height: 30px; padding: 5px; font-size: 6px; }
    .progression-screen-header h2 { font-size: 10px; }
    .progression-grid { grid-template-columns: 1fr; gap: 8px; }
    .hub-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .hub-play { grid-column: 1 / -1; grid-row: auto; min-height: 175px; }
    .hub-summary { grid-column: 1 / -1; }
    .progress-card { padding: 11px; }
    .trainer-card, .progress-stat-grid, .favorites-card, .history-card, .rank-ladder-card { grid-column: 1; }
    .progress-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
    .progress-stat-card { min-height: 55px; }
    .progress-stat-card>b { font-size: 10px; }
    .trainer-avatar-wrap, .trainer-avatar-wrap canvas { width: 68px; height: 68px; }
    .trainer-avatar-wrap { flex-basis: 68px; }
    .trainer-main h3 { font-size: 15px; }
    .trainer-currency { padding: 7px; }
    .trainer-currency b { font-size: 8px; }
    .history-row { grid-template-columns: 70px 1fr 65px 62px; gap: 4px; padding: 6px 4px; font-size: 8px; }
    .history-row small { display: none; }
    .rank-ladder-row { grid-template-columns: 22px minmax(70px,1fr) 70px 72px; gap: 5px; font-size: 9px; }
    .rank-ladder-row>small { font-size: 8px; }
    .rank-ladder-row>strong { font-size: 6px; }
    .collection-grid { grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 6px; }
    .collection-card { padding: 7px; }
    .chest-grid { grid-template-columns: 1fr; }
    .chest-card { grid-template-columns: 54px 1fr; justify-items: start; text-align: left; }
    .chest-illustration { grid-row: 1 / span 3; width: 48px; height: 48px; }
    .chest-card h3 { min-height: auto; margin: 0; }
    .chest-price { grid-column: 2; }
    .chest-odds, .chest-card .progress-action { grid-column: 1/-1; }
    .chest-reward { align-items: flex-start; padding: 8px; }
    .chest-reward canvas { width: 68px; height: 68px; }
    .chest-history>div { grid-template-columns: 10px 1fr 1fr; }
    .chest-history time { display: none; }
    .result-stats .ranked-result-card { grid-template-columns: repeat(2,1fr); }
    .result-card.ranked-results { padding: 14px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .chest-reward, .ranked-result-card, .rank-promotion-banner { animation: none !important; }
  }
@media (max-height: 700px) and (min-width: 1001px) {
  .setup-screen { padding-top: 10px; padding-bottom: 10px; }
  .lobby-topbar { min-height: 36px; }
  .setup-layout { margin-top: 8px; margin-bottom: 8px; }
  .setup-heading { padding-top: 12px; padding-bottom: 12px; }
  .lobby-stage { height: clamp(110px, 20vh, 165px); }
  .progression-screen { margin-top: 5px; padding: 14px; }
}
@media (max-width: 1000px) {
  .setup-heading .eyebrow, .setup-heading h1, .setup-heading>p, .lobby-controls { grid-column: 1; }
  .setup-heading h1 { margin: 10px 0 6px; font-size: clamp(17px, 3vw, 23px); }
  .lobby-stage { grid-column: 2; grid-row: 1 / span 4; height: 190px; margin: 0; }
  .lobby-controls { margin: 10px 0 0; }
  .pokemon-detail { grid-column: 1 / -1; }
  .legal-note { margin-top: 7px; }
}
@media (max-width: 650px) {
  .setup-screen { padding: 10px 10px 12px; }
  .lobby-topbar { min-height: 40px; }
  .lobby-brand { font-size: 9px; }
  .brand-mark { width: 27px; height: 27px; font-size: 8px; }
  .offline-pill { padding: 5px 6px; font-size: 6px; }
  .setup-layout { gap: 11px; margin: 10px auto 12px; }
  .setup-heading {
    grid-template-columns: minmax(0,1fr);
    gap: 0;
    padding: 12px;
  }
  .setup-heading .eyebrow, .setup-heading h1, .setup-heading>p, .lobby-controls, .lobby-stage { grid-column: 1; }
  .setup-heading h1 { margin: 9px 0 5px; font-size: 16px; }
  .setup-heading p { font-size: 10px; }
  .lobby-stage { grid-row: auto; height: 165px; margin-top: 12px; }
  .lobby-controls { gap: 4px; margin: 10px 0 2px; font-size: 6px; }
  .lobby-controls kbd { min-width: 17px; min-height: 17px; font-size: 6px; }
  .pokemon-detail { grid-column: 1; grid-template-columns: minmax(0,1fr); gap: 7px; margin-top: 8px; padding: 8px; }
  .detail-profile img { width: 42px; height: 42px; }
  .detail-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .move-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .setup-card { padding: 12px; }
  .section-title { gap: 7px; }
  .section-title h2 { font-size: 10px; }
  .section-title small { font-size: 8px; }
  .section-title>span { width: 29px; height: 29px; font-size: 7px; }
  .roster-count { padding: 5px; font-size: 6px; }
  .dex-trigger {
    grid-template-columns: 20px minmax(0,1fr) 42px;
    min-height: 62px;
    gap: 6px;
    padding: 6px 8px;
  }
  .dex-trigger-mark { font-size: 13px; }
  .dex-trigger-copy small, .dex-trigger-action { font-size: 6px; }
  .dex-trigger-copy strong { font-size: 10px; }
  .dex-selected-sprite { width: 42px; height: 42px; }
  .dex-trigger-action { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; padding: 5px 7px; }
  .pokemon-picker { gap: 8px; padding: 8px; }
  .pokemon-roster { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: min(34vh, 260px); gap: 5px; }
  .pokemon-choice { grid-template-columns: 40px minmax(0,1fr); min-height: 54px; gap: 4px; padding: 4px; }
  .dex-sprite { width: 38px; height: 38px; }
  .pokemon-choice b { font-size: 9px; }
  .pokemon-choice small { font-size: 8px; }
  .dex-type-filters { gap: 4px; }
  .dex-filter { min-height: 25px; padding: 4px 6px; font-size: 6px; }
  .setup-options { grid-template-columns: minmax(0,1fr); gap: 7px; margin-top: 10px; }
  .setup-options>section, .setup-options>section:first-child { grid-column: 1; padding: 8px; }
  .option-heading { display: block; margin-bottom: 6px; }
  .option-heading b { font-size: 7px; }
  .option-heading small { display: block; margin-top: 3px; font-size: 8px; }
  .mode-grid .choice { min-height: 44px; padding: 5px; }
  .mode-grid .choice b { font-size: 8px; }
  .mode-grid .choice small { font-size: 6px; }
  .compact-grid .choice { min-height: 32px; font-size: 7px; }
  .setup-footer { align-items: stretch; flex-direction: column; margin-top: 10px; padding-top: 10px; }
  .control-summary { max-width: none; }
  .start-button { min-height: 42px; }
  .legal-note { justify-content: center; gap: 5px; font-size: 5px; text-align: center; }
  .combat-top {
    top: 7px;
    right: 7px;
    left: 7px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 62px 38px 29px;
    gap: 4px;
    min-height: 58px;
    padding: 5px;
  }
  .fighter-card { grid-template-columns: 31px minmax(48px,.7fr) minmax(42px,1fr); grid-template-rows: 1fr 10px; gap: 1px 4px; min-width: 0; }
  .fighter-card img { width: 29px; height: 29px; }
  .fighter-meta strong { max-width: 65px; font-size: 7px; }
  .fighter-meta span { font-size: 5px; }
  .hp-meter { height: 10px; }
  .hp-meter b { font-size: 5px; line-height: 7px; }
  .match-readout { padding: 2px; }
  .match-readout span, .match-readout small { font-size: 5px; }
  .match-readout b { font-size: 9px; }
  .score-card { min-width: 34px; }
  .score-card small { display: none; }
  .score-card b { font-size: 9px; }
  .score-card span { max-width: 42px; font-size: 5px; text-align: center; }
  .pause-button { width: 26px; height: 26px; }
  .combat-notice { top: 73px; font-size: 8px; }
  .combat-bottom {
    right: 7px;
    bottom: 7px;
    left: 7px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 57px;
    gap: 5px;
  }
  .combat-tip { display: none; }
  .ability-bar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; }
  .ability-slot, .ability-slot.ultradash-slot { width: auto; min-width: 0; height: 60px; padding: 4px 2px; }
  .ability-slot .slot-key { min-width: 14px; height: 14px; margin-bottom: 3px; font-size: 6px; }
  .ability-slot b { font-size: 6px; }
  .ability-slot small { font-size: 6px; }
  .dash-panel { width: 100%; min-width: 0; padding: 5px 3px; }
  .dash-panel>span { font-size: 6px; }
  .dash-panel kbd { min-width: 30px; font-size: 6px; }
  .dash-charges { gap: 2px; }
  .dash-charge { width: 16px; height: 8px; }
  .round-announcement { top: 91px; }
  .round-announcement[data-phase="countdown"] { top: 92px; }
  .round-announcement[data-phase="countdown"] strong { font-size: clamp(52px, 14vw, 76px); }
  .result-card { padding: 22px 14px; }
  .result-card h2 { font-size: 12px; }
  .result-stats { gap: 4px; margin: 16px 0; }
  .result-stat { padding: 8px 3px; }
  .result-stat b { font-size: 8px; }
  .result-stat small { font-size: 5px; }
}
@media (max-width: 390px) {
  .combat-top { grid-template-columns: minmax(0,1fr) 54px 31px 26px; gap: 3px; }
  .fighter-card { grid-template-columns: 27px minmax(41px,.7fr) minmax(36px,1fr); gap: 1px 3px; }
  .fighter-card img { width: 25px; height: 25px; }
  .fighter-meta strong { max-width: 54px; font-size: 6px; }
  .pause-button { width: 23px; height: 23px; }
  .combat-bottom { grid-template-columns: minmax(0,1fr) 52px; }
  .ability-slot, .ability-slot.ultradash-slot { height: 57px; }
}
@media (prefers-reduced-motion: reduce) {
  .dex-trigger, .dex-filter, .pokemon-choice, .mode-grid .choice, .compact-grid .choice,
  .start-button, .secondary-button { transition: none !important; }
  .pokemon-picker { animation: none !important; }
}
