:root {
  color-scheme: dark;
  --ink: #f3f5ff;
  --muted: #a7b3d2;
  --green: #63efdf;
  --gold: #ffd76f;
  --ui-cyan: #72edf1;
  --ui-pink: #eb7aff;
  --pixel: "Pixelify Sans", "Courier New", monospace;
  --sans: "Segoe UI", "Trebuchet MS", sans-serif;
  --panel: rgba(11, 17, 42, .94);
  --panel-soft: rgba(21, 28, 62, .88);
  --line: rgba(157, 177, 255, .25);
  --shadow: 0 24px 70px rgba(2, 5, 23, .48);
}

html, body { background: #080d24; }
body { color: var(--ink); font-family: var(--sans); }
button, input, select { font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--ui-cyan);
  outline-offset: 3px;
}

.setup-screen {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px clamp(16px, 4vw, 64px) 20px;
  background:
    linear-gradient(180deg, rgba(8, 14, 34, .16), rgba(8, 14, 34, .48)),
    url("../assets/arena/sky.png") center 35% / cover fixed,
    #080d24;
  scrollbar-color: #7264d5 #111632;
}

.setup-screen::before {
  z-index: 0;
  opacity: .1;
  background-image:
    linear-gradient(rgba(196, 206, 255, .15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 206, 255, .15) 1px, transparent 1px);
  background-size: 4px 4px;
  animation: pixel-drift 28s linear infinite;
}

.setup-screen::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 12, 29, .05), rgba(7, 12, 29, .22));
  content: "";
  pointer-events: none;
}

.lobby-topbar, .progression-quicknav, .setup-layout, .progression-screen, .legal-note {
  position: relative;
  z-index: 2;
}

.lobby-topbar {
  min-height: 52px;
  border-bottom: 1px solid rgba(139, 173, 180, .38);
}

.lobby-brand { gap: 11px; color: #fff; font: 800 12px var(--pixel); }
.lobby-brand strong { color: #9bd4ac; }
.brand-mark {
  width: 36px;
  height: 36px;
  border: 2px solid #7996a0;
  border-radius: 4px;
  background: #192a3d;
  box-shadow: 2px 2px 0 #050a13;
  color: #e8ffff;
}
.offline-pill {
  border: 1px solid #58776d;
  border-radius: 3px;
  background: #122638;
  color: #b7e2bb;
  font: 700 8px var(--pixel);
}
.offline-pill i { background: #83d89b; box-shadow: none; }

#setup-screen:not(.on-main-menu) .setup-heading,
#setup-screen:not(.on-main-menu) .setup-card {
  border: 2px solid #607c92;
  border-radius: 6px;
  box-shadow: 4px 5px 0 rgba(3, 8, 17, .66);
}
#setup-screen:not(.on-main-menu) .setup-heading {
  background:
    linear-gradient(180deg, rgba(8, 15, 31, .95), rgba(8, 15, 31, .86)),
    url("../assets/arena/sky.png") center / cover;
}
#setup-screen:not(.on-main-menu) .eyebrow {
  color: #b6d4bb;
  font: 700 8px var(--pixel);
  letter-spacing: 1px;
}
#setup-screen:not(.on-main-menu) .eyebrow span { background: #9bd4ac; box-shadow: none; }
#setup-screen:not(.on-main-menu) .setup-heading h1 {
  color: #f3f0e2;
  font: 900 clamp(22px, 2.4vw, 32px)/1.35 var(--pixel);
  letter-spacing: 0;
  text-shadow: 3px 3px 0 #07111f;
}
#setup-screen:not(.on-main-menu) .setup-heading h1 em { color: #e6c77e; }
#setup-screen:not(.on-main-menu) .setup-heading > p { color: #c1ccca; font-size: 11px; }
#setup-screen:not(.on-main-menu) .lobby-stage {
  border: 2px solid #607c92;
  border-radius: 5px;
  box-shadow: 2px 3px 0 #050b14;
}
#setup-screen:not(.on-main-menu) .lobby-stage::before { box-shadow: none; }
#setup-screen:not(.on-main-menu) .lobby-stage::after {
  background: linear-gradient(180deg, rgba(32, 107, 101, .42), rgba(11, 42, 55, .92));
}
#setup-screen:not(.on-main-menu) .stage-ground {
  border-color: rgba(141, 207, 165, .62);
  background: linear-gradient(180deg, rgba(39, 105, 91, .86), #102b38);
}
#setup-screen:not(.on-main-menu) .lobby-controls { color: #b6c8c7; font: 700 8px var(--pixel); }
#setup-screen:not(.on-main-menu) .lobby-controls kbd {
  border: 2px solid #627e8c;
  border-radius: 3px;
  background: #14283a;
  box-shadow: 2px 2px 0 #050b14;
  color: #e6e9d8;
  font: 700 7px var(--pixel);
}
#setup-screen:not(.on-main-menu) .lobby-controls i { border-radius: 0; background: #9bd4ac; }
#setup-screen:not(.on-main-menu) .pokemon-detail {
  border: 2px solid #52697d;
  border-radius: 5px;
  background: #172437;
  box-shadow: 2px 3px 0 rgba(3, 8, 17, .58);
}
#setup-screen:not(.on-main-menu) .detail-profile strong { color: #f3f0e2; font: 800 12px var(--pixel); }
#setup-screen:not(.on-main-menu) .detail-profile small,
#setup-screen:not(.on-main-menu) .stat-item { color: #b3c2c7; }
#setup-screen:not(.on-main-menu) .stat-item { font-size: 8px; }
#setup-screen:not(.on-main-menu) .stat-item b { color: #f3f0e2; font-size: 11px; }
#setup-screen:not(.on-main-menu) .move-chip {
  border-color: #3b5064;
  border-left: 3px solid var(--move-color);
  border-radius: 3px;
  background: #101d30;
}
#setup-screen:not(.on-main-menu) .move-chip span { color: #b5c3c6; font-size: 7px; }
#setup-screen:not(.on-main-menu) .move-chip b { color: #edf2e8; font-size: 9px; }
#setup-screen:not(.on-main-menu) .special-description {
  border-left-width: 3px;
  background: #14263a;
}
#setup-screen:not(.on-main-menu) .special-description span { color: #c0cbca; }
#setup-screen:not(.on-main-menu) .setup-card {
  border-color: #607c92;
  background: #101a2b;
  box-shadow: 4px 5px 0 rgba(3, 8, 17, .66);
  color: #edf2e8;
  backdrop-filter: none;
}
#setup-screen:not(.on-main-menu) .section-title > span {
  border: 2px solid #708c96;
  border-radius: 4px;
  background: #192b3d;
  box-shadow: 2px 2px 0 #050b14;
  color: #e6c77e;
}
#setup-screen:not(.on-main-menu) .section-title h2 { color: #f3f0e2; font: 800 14px var(--pixel); }
#setup-screen:not(.on-main-menu) .section-title small { color: #b4c3c6; font-size: 10px; }
#setup-screen:not(.on-main-menu) .roster-count {
  border: 2px solid #819f91;
  border-radius: 3px;
  background: #1a2c39;
  color: #b8dfbb;
  font: 700 8px var(--pixel);
}
#setup-screen:not(.on-main-menu) .dex-trigger {
  border: 2px solid #718a97;
  border-radius: 4px;
  background: #162b40;
  box-shadow: 3px 3px 0 #050b14;
  color: #f3f0e2;
}
#setup-screen:not(.on-main-menu) .dex-trigger:hover,
#setup-screen:not(.on-main-menu) .dex-trigger.open { background: #20394c; }
#setup-screen:not(.on-main-menu) .dex-trigger-copy small,
#setup-screen:not(.on-main-menu) .dex-trigger-action { color: #bed0c8; }
#setup-screen:not(.on-main-menu) .dex-trigger-copy strong { color: #f3f0e2; }
#setup-screen:not(.on-main-menu) .dex-trigger-action {
  border: 2px solid #627b8c;
  border-radius: 3px;
  background: #101d30;
}
#setup-screen:not(.on-main-menu) .dex-trigger-action b,
#setup-screen:not(.on-main-menu) .dex-trigger-mark { color: #e6c77e; }
#setup-screen:not(.on-main-menu) .pokemon-picker {
  border: 2px solid #607c92;
  border-radius: 4px;
  background: #101a2b;
  box-shadow: 3px 4px 0 rgba(3, 8, 17, .66);
}
#setup-screen:not(.on-main-menu) .dex-search { color: #b6d4bb; font-size: 8px; }
#setup-screen:not(.on-main-menu) .dex-search input {
  border: 2px solid #536a7c;
  border-radius: 3px;
  background: #0c1523;
  color: #f3f0e2;
}
#setup-screen:not(.on-main-menu) .dex-search input::placeholder { color: #91a5a9; }
#setup-screen:not(.on-main-menu) .dex-type-filters { gap: 5px; }
#setup-screen:not(.on-main-menu) .dex-filter {
  border: 2px solid #536a7c;
  border-radius: 3px;
  background: #172437;
  color: #d3dddb;
  font-size: 8px;
}
#setup-screen:not(.on-main-menu) .dex-filter:hover { border-color: #9bd4ac; }
#setup-screen:not(.on-main-menu) .dex-filter.selected {
  border-color: #9bd4ac;
  background: #31574b;
  box-shadow: 2px 2px 0 #050b14;
  color: #f0f3df;
}
#setup-screen:not(.on-main-menu) .pokemon-roster {
  scrollbar-color: #607c92 #101a2b;
}
#setup-screen:not(.on-main-menu) .pokemon-choice {
  border: 2px solid #425a70;
  border-radius: 4px;
  background: #172437;
  box-shadow: 2px 2px 0 rgba(3, 8, 17, .55);
}
#setup-screen:not(.on-main-menu) .pokemon-choice:hover {
  transform: translateY(-1px);
  border-color: #9bd4ac;
  background: #203447;
}
#setup-screen:not(.on-main-menu) .pokemon-choice.selected {
  border-color: #a4d6ae;
  background: #27463d;
  box-shadow: 2px 2px 0 #050b14;
}
#setup-screen:not(.on-main-menu) .pokemon-choice b { color: #f3f0e2; }
#setup-screen:not(.on-main-menu) .pokemon-choice small { color: #bac8c9; }
#setup-screen:not(.on-main-menu) .dex-empty {
  border-color: #627b8c;
  color: #c0cbca;
}
#setup-screen:not(.on-main-menu) .setup-options > section {
  border: 2px solid #425a70;
  border-radius: 4px;
  background: #172437;
  box-shadow: 2px 3px 0 rgba(3, 8, 17, .52);
}
#setup-screen:not(.on-main-menu) .option-heading b {
  color: #b6d4bb;
  font: 700 9px var(--pixel);
  letter-spacing: .3px;
}
#setup-screen:not(.on-main-menu) .option-heading small { color: #b5c2c4; font-size: 9px; }
#setup-screen:not(.on-main-menu) .mode-grid .choice,
#setup-screen:not(.on-main-menu) .compact-grid .choice {
  border: 2px solid #52697d;
  border-radius: 4px;
  background: #111d30;
  box-shadow: 2px 2px 0 #050b14;
  color: #d6dfdc;
  transition: transform .12s steps(2), border-color .14s, background-color .14s;
}
#setup-screen:not(.on-main-menu) .mode-grid .choice:hover,
#setup-screen:not(.on-main-menu) .compact-grid .choice:hover {
  transform: translateY(-1px);
  border-color: #9bd4ac;
  background: #203447;
}
#setup-screen:not(.on-main-menu) .mode-grid .choice.selected,
#setup-screen:not(.on-main-menu) .compact-grid .choice.selected {
  border-color: #a4d6ae;
  background: #31574b;
  box-shadow: 2px 2px 0 #050b14;
  color: #f0f3df;
}
#setup-screen:not(.on-main-menu) .mode-grid .choice b { color: #f3f0e2; font-size: 11px; }
#setup-screen:not(.on-main-menu) .mode-grid .choice small { color: #b5c2c4; font-size: 8px; }
#setup-screen:not(.on-main-menu) .mode-grid .choice i { color: #e6c77e; }
#setup-screen:not(.on-main-menu) .difficulty-grid .choice,
#setup-screen:not(.on-main-menu) .arena-grid .choice { font: 700 9px var(--pixel); }
#setup-screen:not(.on-main-menu) .setup-footer {
  border-top: 2px solid #425a70;
}
#setup-screen:not(.on-main-menu) .control-summary { color: #b5c2c4; font-size: 9px; }
#setup-screen:not(.on-main-menu) .control-summary b { color: #e6c77e; }
#setup-screen:not(.on-main-menu) .control-summary span { color: #e7eddf; font-size: 8px; }
#setup-screen:not(.on-main-menu) #start-match {
  min-height: 46px;
  border: 2px solid #f0d58f;
  border-radius: 4px;
  background: #c7a968;
  box-shadow: 0 4px 0 #705532;
  color: #172337;
  font: 800 9px var(--pixel);
  transition: transform .12s steps(2), background-color .14s;
}
#setup-screen:not(.on-main-menu) #start-match:hover {
  transform: translateY(-1px);
  background: #e2c47a;
}
#setup-screen:not(.on-main-menu) #start-match:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #705532;
}
#setup-screen:not(.on-main-menu) #start-match:disabled {
  opacity: .56;
  cursor: not-allowed;
}

.progression-quicknav {
  align-items: center;
  width: min(1320px, 100%);
  min-height: 50px;
  margin: 0 auto;
  padding: 7px 0;
}
.quick-profile-summary {
  color: #dce5ff;
  font: 700 8px var(--pixel);
}
.progression-quicknav button, .progression-screen-header .secondary-button {
  min-height: 36px;
  border: 2px solid #526783;
  border-radius: 4px;
  background: #111d32;
  color: #eaf3ff;
  font: 700 8px var(--pixel);
  box-shadow: 2px 2px 0 #050a13;
  transition: transform .12s steps(2), border-color .14s, background .14s;
}
.progression-quicknav button:hover, .progression-screen-header .secondary-button:hover {
  transform: translateY(-1px);
  border-color: #a4d6ae;
  background: #1b2b3d;
}

.progression-screen {
  width: min(1320px, 100%);
  margin: 10px auto 28px;
  padding: clamp(16px, 2.4vw, 28px);
  border: 2px solid #425873;
  border-radius: 7px;
  background: #101a2b;
  box-shadow: 4px 5px 0 rgba(3, 8, 17, .66);
}

.progression-screen.is-home {
  margin-top: 2px;
  padding: 4px 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.progression-screen.is-home .progression-screen-header {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 0 0 12px;
}
.progression-screen.is-home .progression-heading-copy { flex: 1; min-width: 0; }
.progression-screen.is-home .progression-heading-copy h2 {
  color: #e5d59a;
  font-size: 11px;
  letter-spacing: 1px;
}
.progression-screen.is-home .progression-heading-copy p { color: #c1ccca; font-size: 10px; }
.progression-screen.is-home .progression-nav-controls { justify-content: flex-end; }
.progression-screen.is-home .progression-select-wrap { color: #b6d4bb; }
.progression-screen.is-home .progression-select-wrap select:hover,
.progression-screen.is-home .progression-select-wrap select:focus-visible { border-color: #b6d4bb; }
.progression-screen-header {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 15px;
}
.progression-heading-copy h2 {
  margin: 0;
  color: #f5f5ff;
  font: 900 14px/1.5 var(--pixel);
  letter-spacing: .4px;
}
.progression-heading-copy p { margin: 4px 0 0; color: #aab8dd; font-size: 11px; }
.progression-nav-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.progression-screen-header .secondary-button { width: auto; padding: 8px 12px; }
.progression-screen-header #progression-back[hidden] { display: none; }
.progression-select-wrap { display: flex; align-items: center; gap: 8px; color: #b7c8ff; font: 700 7px var(--pixel); }
.progression-select-wrap select {
  min-height: 36px;
  max-width: min(250px, 55vw);
  padding: 7px 30px 7px 10px;
  border: 2px solid #66809a;
  border-radius: 4px;
  background: #111d32;
  color: #f3f5ff;
  font: 700 8px var(--pixel);
  box-shadow: 2px 2px 0 #050a13;
  cursor: pointer;
}
.progression-content { min-height: 280px; animation: screen-enter .22s ease both; }
.progression-alert {
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid rgba(104, 239, 209, .48);
  border-radius: 12px;
  background: rgba(22, 75, 88, .75);
  color: #d7fff8;
  font-size: 12px;
}
.progression-alert.is-error {
  border-color: rgba(255, 119, 160, .65);
  background: rgba(87, 30, 71, .9);
  color: #ffe4f2;
}
.progression-startup-error { max-width: 1000px; }

.menu-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  min-height: clamp(290px, 36vw, 430px);
  overflow: hidden;
  margin: 0 0 16px;
  padding: clamp(22px, 4vw, 50px);
  border: 2px solid #607c92;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(8, 15, 31, .96) 0%, rgba(8, 15, 31, .86) 42%, rgba(8, 15, 31, .16) 100%),
    url("../assets/arena/sky.png") center 45% / cover;
  box-shadow: 4px 5px 0 rgba(3, 8, 17, .66);
  isolation: isolate;
}
.menu-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(7, 13, 28, .36));
  content: "";
}
.menu-hero-copy { position: relative; z-index: 2; max-width: 530px; }
.menu-eyebrow, .dialog-kicker {
  color: #93f4ee;
  font: 700 8px var(--pixel);
  letter-spacing: 1.2px;
}
.menu-logo {
  display: block;
  width: min(100%, 490px);
  max-height: 150px;
  margin: 8px 0 11px -9px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(3px 3px 0 rgba(7, 13, 28, .72));
  image-rendering: pixelated;
}
.menu-hero-copy > p:last-child { max-width: 360px; margin: 0; color: #d6dcff; font-size: 14px; line-height: 1.6; }
.menu-island {
  position: absolute;
  z-index: 1;
  right: -2%;
  bottom: -19%;
  width: min(67%, 780px);
  max-height: 118%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(4px 5px 0 rgba(4, 9, 22, .45));
  animation: island-float 8s ease-in-out infinite;
  pointer-events: none;
}
.menu-player-strip {
  position: absolute;
  z-index: 3;
  right: clamp(14px, 2vw, 26px);
  bottom: 17px;
  left: clamp(14px, 2vw, 26px);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 52px);
  padding: 10px 15px 10px 10px;
  border: 2px solid #7693a2;
  border-radius: 5px;
  background: #101d31;
  box-shadow: 3px 4px 0 rgba(3, 8, 17, .72);
}
.menu-player-strip canvas { width: 52px; height: 52px; image-rendering: pixelated; }
.menu-player-name { display: grid; gap: 4px; min-width: 105px; }
.menu-player-name small { color: #a9c5b4; font: 700 7px var(--pixel); }
.menu-player-name strong { max-width: 190px; overflow: hidden; color: #fff; font: 800 10px var(--pixel); text-overflow: ellipsis; white-space: nowrap; }
.menu-rank, .menu-currency { display: grid; gap: 4px; padding-left: 12px; border-left: 2px solid #354c5c; }
.menu-rank small, .menu-currency small { color: #a9c5b4; font: 700 7px var(--pixel); }
.menu-rank strong { color: var(--rank-color, #c2ac77); font: 800 9px var(--pixel); }
.menu-rank span { color: #dce2ff; font-size: 9px; }
.menu-currency strong { color: var(--gold); font: 800 10px var(--pixel); }

.progression-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hub-tile {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  min-width: 0;
  min-height: 142px;
  overflow: hidden;
  padding: clamp(15px, 2vw, 23px);
  border: 2px solid #536a7c;
  border-radius: 5px;
  background: #172539;
  box-shadow: 3px 4px 0 rgba(3, 8, 17, .7);
  color: #f1f3ff;
  text-align: left;
  cursor: pointer;
  transition: transform .12s steps(2), border-color .14s, background-color .14s, box-shadow .14s;
}
.hub-tile::after {
  display: none;
}
.hub-tile:hover {
  transform: translateY(-2px);
  border-color: #9ccea6;
  background: #1d3043;
  box-shadow: 3px 6px 0 rgba(3, 8, 17, .72);
}
.hub-tile:active { transform: translate(2px, 2px); box-shadow: 1px 2px 0 rgba(3, 8, 17, .72); }
.hub-tile strong { position: relative; z-index: 1; color: #fff; font: 800 12px var(--pixel); }
.hub-tile small { position: relative; z-index: 1; max-width: 260px; color: #c3cfca; font: 12px/1.5 var(--sans); }
.hub-icon { position: relative; z-index: 1; color: #a9d8ae; font: 24px var(--pixel); }
.hub-play {
  grid-column: span 2;
  grid-row: span 2;
  justify-items: center;
  min-height: 297px;
  border-color: #d2b878;
  border-left-width: 5px;
  background: #263648;
  text-align: center;
}
.hub-play small { max-width: 100%; text-align: center; }
.hub-play:hover { border-color: #f0d48a; background: #2d4050; }
.hub-play strong { color: #f0d48a; font-size: 22px; }
.hub-play .hub-icon { display: grid; place-items: center; width: 58px; height: 58px; border: 2px solid #d2b878; border-radius: 4px; background: #182639; color: #f0d48a; font: 24px var(--pixel); }
.hub-summary {
  grid-column: span 2;
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 95px;
  padding: 17px 21px;
  border: 2px solid #536a7c;
  border-radius: 5px;
  background: #111d30;
  box-shadow: 3px 4px 0 rgba(3, 8, 17, .7);
}
.hub-summary strong { color: #fff; font: 800 11px var(--pixel); }
.hub-summary > span { color: #b9c9c4; font-size: 11px; }

.progress-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid #40576d;
  border-radius: 6px;
  background: #172437;
  box-shadow: 3px 3px 0 rgba(3, 8, 17, .58);
}
.progress-card h3, .chest-card h3 { margin: 4px 0 6px; color: #f5f5ff; font-size: 15px; }
.progress-card p { margin: 6px 0; color: #b5c0e2; font-size: 11px; }
.progress-kicker { color: #97e9f2; font: 700 7px var(--pixel); letter-spacing: .5px; }
.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: 1px solid rgba(114, 237, 241, .42); border-radius: 14px; background: #141941; image-rendering: pixelated; }
.trainer-avatar-wrap span { position: absolute; right: -7px; bottom: -7px; padding: 4px 7px; border: 1px solid #fff0ae; border-radius: 8px; background: #6651bf; color: white; 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: 11px 14px; border: 1px solid rgba(255, 215, 111, .4); border-radius: 12px; background: rgba(255, 215, 111, .08); color: var(--gold); 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(200, 210, 255, .2); border-radius: 999px; background: rgba(4, 8, 27, .7); }
.xp-track { margin: 8px 0 4px; }
.xp-track i, .rank-track i, .ai-stat em, .result-rank-progress em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6bdfdf, #9c87ff, #f079db); }
.username-form { display: grid; gap: 8px; margin-top: 14px; }
.username-form label { color: #a4edf0; font: 700 7px var(--pixel); }
.username-form > div { display: flex; gap: 4px; }
.username-form input, .welcome-form input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(142, 167, 255, .38);
  border-radius: 10px;
  background: #0c1230;
  color: #fff;
  font-size: 13px;
  user-select: text;
}
.username-form input::placeholder, .welcome-form input::placeholder { color: #7783ac; }
.progress-action, .collection-select, .collection-upgrade, .collection-moves, .collection-level, .avatar-button {
  min-height: 36px;
  padding: 8px 11px;
  border: 2px solid #8cc9a8;
  border-radius: 4px;
  background: #497f70;
  box-shadow: 2px 2px 0 #080f19;
  color: #081b1d;
  font: 800 7px var(--pixel);
  cursor: pointer;
  transition: filter .14s, transform .12s steps(2), box-shadow .14s;
}
.progress-action:hover, .collection-select:hover, .collection-upgrade:hover, .collection-moves:hover, .collection-level:hover, .avatar-button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.progress-action:active, .collection-select:active, .collection-upgrade:active, .collection-moves:active, .collection-level:active, .avatar-button:active { transform: translate(2px,2px); box-shadow: none; }
.progress-action:disabled, .collection-upgrade:disabled, .collection-level:disabled, .favorite-toggle:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.rank-summary { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px 13px; border-color: color-mix(in srgb, var(--rank-color), transparent 48%); }
.rank-emblem { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid var(--rank-color); border-radius: 17px; background: color-mix(in srgb, var(--rank-color), #171b4a 84%); color: var(--rank-color); font: 24px var(--pixel); text-shadow: 0 0 18px currentColor; }
.rank-emblem.large { width: 78px; height: 78px; font-size: 34px; }
.rank-summary h3 { margin: 3px 0; color: var(--rank-color); }
.rank-summary > div:nth-child(2) > b { color: #fff; font: 800 10px var(--pixel); }
.rank-progress-copy { grid-column: 1 / -1; color: #c4c9e6; font-size: 10px; }
.rank-track { grid-column: 1 / -1; height: 11px; border-color: color-mix(in srgb, var(--rank-color), transparent 48%); }
.rank-track i { background: linear-gradient(90deg, var(--rank-color), #72edf1); }
.progress-stat-grid { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 9px; }
.progress-stat-card { display: grid; place-items: center; gap: 5px; min-height: 82px; text-align: center; }
.progress-stat-card > b { overflow: hidden; max-width: 100%; color: #fff; font: 800 13px var(--pixel); text-overflow: ellipsis; white-space: nowrap; }
.progress-stat-card > small { color: #9eacd2; 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: #8fe9f0; 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: #d7def6; font-size: 9px; }
.favorite-entry canvas { image-rendering: pixelated; }
.history-list { display: grid; gap: 6px; margin-top: 10px; }
.history-row { display: grid; grid-template-columns: 90px minmax(90px,1fr) 90px 80px 120px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(162, 177, 245, .12); border-radius: 9px; background: rgba(6, 11, 33, .54); color: #dce4ff; font-size: 10px; }
.history-row.win .history-result { color: #83f1c0; }
.history-row.loss .history-result { color: #ff8cad; }
.history-result, .history-row small { font: 700 7px var(--pixel); }
.history-row b { color: var(--gold); }
.history-row small { color: #a4b0d1; }
.empty-progress, .muted-copy { color: #a1afd2 !important; }
.ranked-hero { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 15px; border-color: color-mix(in srgb, var(--rank-color), transparent 40%); }
.ranked-heading h3 { margin: 4px 0; color: var(--rank-color); font-size: 22px; }
.ranked-heading > b { color: #fff; 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; }
.rank-track-labels { display: flex; justify-content: space-between; color: #aebbe0; font: 700 6px var(--pixel); }
.ranked-start { min-height: 46px; margin-top: 4px; border-color: var(--rank-color); background: linear-gradient(105deg, color-mix(in srgb, var(--rank-color), #252765 47%), #5247bd); 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: #d4defb; font-size: 10px; }
.ai-stat > b { color: var(--gold); font: 700 8px var(--pixel); }
.ai-stat i { grid-column: 1 / -1; height: 6px; }
.ai-stat em { background: linear-gradient(90deg, #6bdfdf, #a288ff); }
.opponent-estimate { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(165, 181, 255, .2); color: #b4c0e1; font-size: 10px; }
.opponent-estimate b { color: var(--gold); 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: 7px 10px; border-left: 3px solid var(--rank-color); border-radius: 0 8px 8px 0; background: rgba(7, 12, 35, .58); color: #d0d9f4; }
.rank-ladder-row > b { color: var(--rank-color); font: 16px var(--pixel); }
.rank-ladder-row > small { color: #9ba9cb; font-size: 9px; }
.rank-ladder-row > strong { color: var(--gold); font: 700 7px var(--pixel); text-align: right; }
.rank-ladder-row.current { background: color-mix(in srgb, var(--rank-color), transparent 87%); outline: 1px solid color-mix(in srgb, var(--rank-color), transparent 45%); }
.rank-ladder-row.achieved > span::after { content: " ✓"; color: #83f1c0; }

.collection-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 12px; color: #abb9da; font-size: 10px; }
.collection-summary > b { color: var(--gold); font: 800 11px var(--pixel); }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
.collection-card { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 10px; border: 2px solid color-mix(in srgb, var(--rarity-color), transparent 45%); border-radius: 5px; background: #172437; box-shadow: 2px 3px 0 rgba(3,5,14,.62); text-align: center; transition: transform .12s steps(2), border-color .14s, filter .14s; }
.collection-card:hover { transform: translateY(-3px); border-color: var(--rarity-color); }
.collection-card.selected { outline: 2px solid var(--ui-cyan); outline-offset: 2px; box-shadow: 0 0 22px rgba(114,237,241,.13); }
.collection-card.unlocked { cursor: context-menu; }
.collection-card.locked { filter: saturate(.48); background: #111b2b; }
.collection-portrait { position: relative; display: grid; place-items: center; min-height: 78px; }
.collection-portrait canvas { image-rendering: pixelated; }
.lock-mark { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(5, 8, 27, .6); color: #ced7ff; font-size: 19px; }
.favorite-toggle { position: absolute; top: 0; right: 0; width: 28px; height: 28px; border: 1px solid rgba(255, 215, 111, .45); border-radius: 8px; background: #171b43; color: var(--gold); font: 16px var(--sans); cursor: pointer; }
.collection-name { overflow: hidden; color: #f3f5ff; 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: 4px; margin: 5px 0; color: #aab7d7; font-size: 8px; text-align: left; }
.collection-stats span { display: flex; justify-content: space-between; }
.collection-stats b { color: #edf2ff; }
.collection-match-record { color: #a6b1d0; font-size: 8px; }
.collection-select, .collection-upgrade, .collection-moves, .collection-level, .avatar-button { min-height: 31px; padding: 6px; font-size: 6px; }
.collection-select { border-color: #83c8ad; background: #315e58; color: #e1f3df; }
.collection-upgrade { border-color: #d1b877; background: #665735; color: #fff0bd; }
.collection-level { border-color: #a4ca78; background: #3a6246; color: #e7f2ce; }
.collection-moves { border-color: #7ab8cd; background: #294d64; color: #d9f4ff; }
.avatar-button { border-color: #708ca1; background: #263d4d; color: #e4eaff; }
.avatar-current, .locked-copy { padding: 5px 2px; color: #a0edf0; font: 700 6px var(--pixel); }
.locked-copy { color: #a6b0d2; line-height: 1.7; }
.potential-note { margin-top: 6px; color: #a0edf0; font: 700 6px var(--pixel); }
.potential-note.locked-potential { color: #e2baff; }

.chest-intro { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; padding: 17px; border: 1px solid rgba(255, 215, 111, .3); border-radius: 15px; background: linear-gradient(110deg, rgba(76, 52, 126, .48), rgba(25, 29, 72, .82)); }
.chest-intro h3 { margin: 4px 0; color: var(--gold); font: 800 12px var(--pixel); }
.chest-intro p { margin: 3px 0; color: #bcc7e5; font-size: 10px; }
.chest-open-count { display: grid; gap: 4px; min-width: 96px; color: #d6c3ff; 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: 11px; }
.chest-card { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 17px; border: 1px solid rgba(166, 182, 255, .31); border-radius: 16px; background: linear-gradient(145deg, rgba(35, 42, 95, .92), rgba(15, 20, 54, .96)); text-align: center; transition: transform .18s ease, box-shadow .18s ease; }
.chest-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(5,6,25,.4), 0 0 22px rgba(152,124,255,.12); }
.chest-advanced { border-color: rgba(93, 196, 255, .5); }
.chest-master { border-color: rgba(255, 208, 103, .58); }
.chest-illustration { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(171, 152, 255, .65); border-radius: 17px; background: linear-gradient(145deg, #44347f, #191c52); color: #d8c6ff; font: 29px var(--pixel); box-shadow: 0 0 24px rgba(133, 111, 255, .15); }
.chest-advanced .chest-illustration { border-color: #53c5f3; color: #92ecff; }
.chest-master .chest-illustration { border-color: #ffd273; color: #ffe493; }
.chest-card h3 { min-height: 34px; font-size: 12px; }
.chest-price { color: var(--gold); font: 800 10px var(--pixel); }
.chest-odds { display: grid; width: 100%; gap: 6px; margin: 6px 0; }
.chest-odds span { display: grid; grid-template-columns: 8px 1fr auto; gap: 6px; align-items: center; color: #c1cbea; 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-history-card { margin-top: 12px; }
.chest-history { display: grid; gap: 5px; margin-top: 8px; }
.chest-history > div { display: grid; grid-template-columns: 10px 1fr 1fr 90px; gap: 8px; align-items: center; padding: 7px; border: 1px solid rgba(162,177,245,.1); border-radius: 8px; background: rgba(7,12,35,.55); color: #dce4f7; font-size: 9px; }
.chest-history > div small, .chest-history time { color: #aeb9d5; }
.chest-history time { text-align: right; }

.chest-reveal-scene {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 14px;
  min-height: 190px;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 18px 48px 18px 18px;
  border: 1px solid rgba(255, 215, 111, .56);
  border-radius: 16px;
  background: radial-gradient(ellipse at 27% 50%, rgba(157,102,255,.33), transparent 36%), linear-gradient(120deg, rgba(27,25,76,.97), rgba(9,15,44,.96));
}
.chest-opening-visual { position: relative; display: grid; place-items: center; min-height: 145px; }
.chest-opening-glyph { color: #ffe28c; font: 62px var(--pixel); filter: drop-shadow(0 0 18px rgba(255,211,113,.75)); animation: chest-open-pulse .72s steps(6) infinite alternate; }
.chest-opening-spark { position: absolute; color: #e5dcff; font: 18px var(--pixel); animation: chest-spark 1s ease-in-out infinite alternate; }
.chest-opening-spark.one { top: 14%; left: 18%; }
.chest-opening-spark.two { right: 17%; bottom: 16%; animation-delay: .3s; }
.chest-reward {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 135px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--rarity-color);
  border-radius: 13px;
  background: rgba(8, 13, 40, .85);
  animation: reward-reveal .55s .52s cubic-bezier(.2,.8,.2,1) both;
}
.chest-reward canvas { image-rendering: pixelated; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rarity-color), transparent 35%)); }
.chest-reward small { color: var(--rarity-color); font: 700 7px var(--pixel); }
.chest-reward h3 { margin: 3px 0; color: #fff; }
.chest-reward b { color: var(--rarity-color); font: 700 8px var(--pixel); }
.chest-reward p { margin: 4px 0 0; color: #bdc9e7; font-size: 10px; }
.chest-reveal-scene.is-skipped .chest-reward { animation: none; }
.chest-reveal-skip { position: absolute; top: 10px; right: 10px; min-height: 28px; padding: 5px 8px; border: 1px solid rgba(190,202,255,.35); border-radius: 7px; background: rgba(9,14,39,.8); color: #dfe6ff; font: 700 6px var(--pixel); cursor: pointer; }
.chest-reveal-skip:hover { border-color: var(--ui-cyan); }

.game-dialog {
  width: min(500px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: min(90vh, 760px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--ink);
}
.game-dialog::backdrop { background: rgba(4, 6, 22, .82); backdrop-filter: blur(7px) saturate(.8); }
.dialog-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid rgba(157, 174, 255, .39);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 90% 0, rgba(127, 91, 230, .26), transparent 42%),
    linear-gradient(145deg, #171a4a, #0b1130 72%);
  box-shadow: 0 32px 90px rgba(2,4,20,.7), inset 0 1px rgba(255,255,255,.1);
  animation: dialog-enter .28s cubic-bezier(.2,.8,.2,1) both;
}
.dialog-mark { position: absolute; top: 18px; right: 22px; color: var(--gold); font-size: 25px; text-shadow: 0 0 18px rgba(255,215,111,.5); }
.welcome-logo { display: block; width: min(270px, 72%); max-height: 82px; margin: 0 auto 13px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 7px 16px rgba(0,0,0,.4)); }
.welcome-card { text-align: center; }
.welcome-card .dialog-kicker { margin: 4px 0 9px; }
.welcome-card h2 { margin: 0; color: #fff; font: 900 clamp(16px, 4vw, 22px)/1.5 var(--pixel); }
.welcome-copy { margin: 10px 0 22px; color: #bdc8e9; font-size: 13px; }
.welcome-form { display: grid; gap: 9px; text-align: left; }
.welcome-form label { color: #a5f2ee; font: 700 7px var(--pixel); }
.welcome-form input { width: 100%; height: 47px; font-size: 14px; }
.welcome-form small { color: #9ba9cf; font-size: 10px; }
.welcome-submit { width: 100%; min-height: 48px; margin-top: 6px; border: 1px solid rgba(209,255,250,.68); border-radius: 11px; background: linear-gradient(115deg, #62e2dc, #a08aff); box-shadow: 0 8px 24px rgba(103,154,255,.22); color: #111632; font: 900 8px var(--pixel); }
.welcome-submit:hover { filter: brightness(1.1); }
.welcome-submit span { margin-left: 10px; }
.dialog-error { margin: 0; color: #ff9fbd; font-size: 11px; text-align: left; }
.upgrade-dialog { width: min(680px, calc(100vw - 28px)); }
.upgrade-dialog-content { padding: clamp(20px, 4vw, 32px); }
.upgrade-dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.upgrade-dialog-heading h2 { margin: 4px 0 0; color: #fff; font: 900 13px/1.5 var(--pixel); }
.upgrade-close { border: 1px solid rgba(168,185,255,.28); border-radius: 8px; background: rgba(255,255,255,.04); color: #dbe3ff; font-size: 18px; }
.upgrade-pokemon { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 14px; padding: 12px; border: 1px solid rgba(167,181,255,.2); border-radius: 14px; background: rgba(5,10,32,.5); }
.upgrade-pokemon canvas { width: 90px; height: 90px; image-rendering: pixelated; }
.upgrade-pokemon h3 { margin: 0 0 6px; color: #fff; font: 800 12px var(--pixel); }
.upgrade-pokemon p { margin: 0; color: #aebbe0; font-size: 11px; }
.upgrade-potential { margin: 14px 0; }
.upgrade-potential-line { display: flex; justify-content: space-between; color: #d8def6; font: 700 7px var(--pixel); }
.upgrade-potential-track { height: 12px; overflow: hidden; margin-top: 8px; border: 1px solid rgba(164,179,255,.28); border-radius: 999px; background: #080e29; }
.upgrade-potential-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#61dedc,#a17cf4,#f07bdb); transition: width .4s ease; }
.upgrade-stat-deltas { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 14px 0; }
.upgrade-stat-deltas > div { display: grid; gap: 5px; padding: 10px 7px; border: 1px solid rgba(157,174,255,.18); border-radius: 10px; background: rgba(255,255,255,.035); text-align: center; }
.upgrade-stat-deltas small { color: #9eacd2; font: 700 6px var(--pixel); }
.upgrade-stat-deltas strong { color: #dfffe9; font: 800 10px var(--pixel); }
.upgrade-price { color: var(--gold); font: 800 9px var(--pixel); }
.upgrade-dialog-actions { display: flex; gap: 9px; margin-top: 16px; }
.upgrade-dialog-actions > * { flex: 1; }
.move-build-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(94vh, 920px);
  border: 2px solid #718c98;
  border-radius: 5px;
  background: #0c1726;
  box-shadow: 5px 6px 0 rgba(2, 7, 14, .75);
}
.move-build-dialog-content {
  display: grid;
  gap: 15px;
  overflow: visible;
  padding: clamp(13px, 2.2vw, 24px);
  border: 0;
  border-radius: 0;
  background: #101e2d;
  box-shadow: none;
  animation: dialog-enter .2s ease-out both;
}
.move-build-heading, .move-build-title-group, .move-section-heading, .move-slot-topline, .move-option-top {
  display: flex;
  align-items: center;
}
.move-build-heading { justify-content: space-between; gap: 12px; }
.move-build-title-group { min-width: 0; gap: 10px; }
.move-build-title-group canvas { flex: 0 0 54px; width: 54px; height: 54px; image-rendering: pixelated; }
.move-build-title-group .dialog-kicker { color: #a9d2b1; font: 700 8px var(--pixel); letter-spacing: .5px; }
.move-build-title-group h2 { margin: 4px 0 2px; color: #f3f0e2; font: 800 clamp(12px, 1.4vw, 16px)/1.4 var(--pixel); }
.move-build-title-group p { margin: 0; color: #b2c1c4; font-size: 10px; }
.move-build-dialog .upgrade-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 2px solid #617988;
  border-radius: 3px;
  background: #17283a;
  box-shadow: 2px 2px 0 #070d15;
  color: #f0e8d1;
  cursor: pointer;
}
.move-build-loadout, .move-picker-panel, .move-build-details {
  min-width: 0;
  border: 1px solid #425a6c;
  background: #0c1826;
  box-shadow: 2px 3px 0 rgba(2, 7, 14, .5);
}
.move-build-loadout { padding: 10px; }
.move-section-heading { justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #dce7dc; font: 700 9px var(--pixel); }
.move-section-heading span { color: #a8c0bd; font-size: 8px; }
.move-build-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.move-build-slot {
  min-width: 0;
  border: 1px solid #526b79;
  background: #17283a;
  box-shadow: 2px 2px 0 #070d15;
}
.move-build-slot.is-active { border-color: #b4d79a; background: #213b3d; }
.move-build-slot.is-empty { border-style: dashed; background: #111f2d; }
.move-build-slot-main {
  display: grid;
  width: 100%;
  min-height: 88px;
  align-content: start;
  gap: 7px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #edf2e8;
  text-align: left;
  cursor: pointer;
}
.move-slot-topline { gap: 7px; }
.move-slot-key {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 2px solid #718c98;
  background: #0d1a27;
  color: #e6c77e;
  font: 700 8px var(--pixel);
}
.move-slot-topline small { color: #b3c5c6; font: 700 8px var(--pixel); }
.move-build-slot-main > strong {
  overflow: hidden;
  color: #f3f0e2;
  font: 700 9px/1.45 var(--pixel);
  text-overflow: ellipsis;
}
.move-build-slot.is-empty .move-build-slot-main > strong { color: #a8d1ae; }
.move-slot-meta { overflow: hidden; color: #aebfc2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.move-slot-remove {
  width: calc(100% - 12px);
  min-height: 23px;
  margin: 0 6px 6px;
  border: 1px solid #526b79;
  background: #101d2a;
  color: #c9c8b7;
  font: 700 8px var(--pixel);
  cursor: pointer;
}
.move-slot-remove:hover { border-color: #e39b86; color: #ffe0d3; }
.move-slot-remove:disabled { opacity: .5; cursor: wait; }
.move-picker-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 270px); gap: 10px; min-height: 0; }
.move-picker-panel { display: grid; min-height: 0; grid-template-rows: auto auto auto auto minmax(110px, 1fr) auto; gap: 8px; padding: 10px; }
.move-build-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 0 9px;
  border: 1px solid #536a7c;
  background: #091521;
  color: #e6c77e;
}
.move-build-search > span { font-size: 18px; line-height: 1; }
.move-build-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #f3f0e2; font: 10px var(--sans); }
.move-build-search input::placeholder { color: #83979e; }
.move-filter-row, .move-type-row { display: flex; gap: 5px; overflow-x: auto; padding: 2px 2px 5px; scrollbar-color: #637d89 #101d2a; }
.move-filter, .move-type-filter {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 5px 7px;
  border: 1px solid #455d6d;
  background: #142435;
  color: #c0cbca;
  font: 700 8px var(--pixel);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.move-filter:hover, .move-type-filter:hover { border-color: #9dc79e; color: #f3f0e2; }
.move-filter.is-active { border-color: #a7cf9f; background: #28443e; color: #eff3de; }
.move-type-filter { border-left: 3px solid var(--move-type-color, #83939a); }
.move-type-filter.is-active { border-color: var(--move-type-color, #a7cf9f); background: #293d45; color: #fff; }
.move-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  align-content: start;
  gap: 6px;
  max-height: clamp(185px, 34vh, 355px);
  overflow: auto;
  padding: 2px 4px 4px 2px;
  scrollbar-color: #637d89 #101d2a;
}
.move-option-card {
  display: grid;
  min-width: 0;
  min-height: 85px;
  align-content: start;
  gap: 5px;
  padding: 8px;
  border: 1px solid #435b6c;
  border-left: 3px solid var(--move-type-color, #83939a);
  background: #142435;
  color: #e8eee5;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.move-option-card[hidden] { display: none; }
.move-option-card:hover, .move-option-card:focus-visible { transform: translateY(-1px); border-color: #a5cf9c; background: #1d3440; }
.move-option-card.is-selected { border-color: #e2c77f; background: #263c3c; }
.move-option-card.is-locked { background: #17222d; color: #a4afb1; }
.move-option-card.is-locked .move-option-lock { color: #e6ac81; }
.move-option-top { justify-content: space-between; gap: 5px; }
.move-type-tag { overflow: hidden; color: var(--move-type-color, #c0cbca); font: 700 8px var(--pixel); text-overflow: ellipsis; white-space: nowrap; }
.move-power { flex: 0 0 auto; color: #c3cfbd; font: 700 8px var(--pixel); }
.move-option-card > strong { overflow: hidden; color: #f3f0e2; font: 700 9px/1.4 var(--pixel); text-overflow: ellipsis; white-space: nowrap; }
.move-option-meta { overflow: hidden; color: #aebfc2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.move-option-lock { color: #9fcca2; font: 700 8px var(--pixel); }
.move-build-empty { margin: 6px 0; color: #b2c1c4; font-size: 10px; text-align: center; }
.move-build-details { align-self: stretch; padding: 12px; }
.move-details-card { display: grid; align-content: start; gap: 9px; }
.move-details-type { width: fit-content; padding: 5px 7px; border-left: 3px solid var(--move-type-color); background: #172a37; color: #e6e9d8; font: 700 8px var(--pixel); }
.move-details-card h3 { margin: 0; color: #f3f0e2; font: 800 12px/1.5 var(--pixel); overflow-wrap: anywhere; }
.move-details-category { margin: -6px 0 0; color: #b1c2c2; font: 700 8px var(--pixel); line-height: 1.6; }
.move-details-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.move-details-stats > div { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 8px; border: 1px solid #3e5667; background: #142435; }
.move-details-stats small, .move-details-effect small { color: #acc9ae; font: 700 8px var(--pixel); }
.move-details-stats b { color: #f0ead4; font: 700 9px/1.4 var(--pixel); overflow-wrap: anywhere; }
.move-details-effect { padding: 8px; border-left: 2px solid var(--move-type-color); background: #142435; }
.move-details-effect p { margin: 5px 0 0; color: #c1ccca; font-size: 9px; line-height: 1.5; }
.move-details-unlock { margin: 0; color: #a5cf9c; font: 700 8px var(--pixel); }
.move-equip-button {
  min-height: 36px;
  padding: 7px;
  border: 2px solid #8eae88;
  background: #28433b;
  box-shadow: 2px 2px 0 #070d15;
  color: #f3f0e2;
  font: 700 8px var(--pixel);
  cursor: pointer;
}
.move-equip-button:hover:not(:disabled) { background: #34584b; }
.move-equip-button:disabled { border-color: #485c65; background: #1b2a34; color: #849397; cursor: not-allowed; box-shadow: none; }
.move-equip-button.is-equipped { color: #c5d3c4; }
.move-details-empty { display: grid; min-height: 160px; align-content: center; justify-items: center; gap: 9px; text-align: center; }
.move-details-empty > span { color: #e6c77e; font-size: 21px; }
.move-details-empty b { color: #dce7dc; font: 700 8px var(--pixel); }
.move-details-empty p { max-width: 220px; margin: 0; color: #aebfc2; font-size: 9px; line-height: 1.5; }
.move-build-status { min-height: 14px; margin: -6px 0 0; color: #a8c0bd; font-size: 9px; }
.move-build-status.is-error { color: #ffb0a1; }

.settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.settings-control { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-control p { margin-bottom: 0; }
.settings-control button[aria-pressed="true"] { border-color: var(--ui-cyan); background: rgba(37,111,135,.5); color: #e4ffff; }
.settings-card { display: grid; align-content: start; gap: 8px; }
.settings-card h3 { margin: 0; }
.settings-card p { margin: 0; line-height: 1.6; }
.settings-action { width: 100%; margin-top: 6px; }
.settings-note { grid-column: 1 / -1; color: #98a7cb; font-size: 11px; }

.combat-screen { background: #070d24; }
.arena-vignette { background: linear-gradient(180deg, rgba(5,8,26,.36), transparent 22%, transparent 76%, rgba(5,8,26,.42)); }
.combat-top {
  border: 1px solid rgba(165,182,255,.27);
  border-radius: 16px;
  background: linear-gradient(110deg, rgba(8,14,38,.96), rgba(27,24,71,.91));
  box-shadow: 0 14px 40px rgba(2,4,20,.44), inset 0 1px rgba(255,255,255,.08);
  color: #f3f5ff;
  backdrop-filter: blur(14px);
}
.fighter-card img { border: 1px solid rgba(114,237,241,.4); border-radius: 12px; background: #171d4e; }
.fighter-meta strong { color: #f5f6ff; font-family: var(--pixel); }
.fighter-meta span, .score-card small { color: #aeb9e0; }
.hp-meter { border: 1px solid rgba(210,220,255,.3); border-radius: 999px; background: rgba(4,8,27,.85); }
.hp-meter i { border-radius: inherit; background: linear-gradient(90deg,#54e3bd,#b4f178); }
.shield-meter { border-radius: 999px; background: rgba(155,174,255,.2); }
.shield-meter i { border-radius: inherit; background: linear-gradient(90deg,#62dcf3,#a68cff); }
.match-readout { border-color: rgba(157,174,255,.22); }
.match-readout span, .match-readout small { color: #aebce0; }
.match-readout b { color: #fff; font-family: var(--pixel); }
.score-card b { color: var(--gold); }
.pause-button, .combat-tip, .dash-panel {
  border: 1px solid rgba(171,187,255,.26);
  border-radius: 12px;
  background: rgba(10,16,43,.9);
  box-shadow: 0 10px 28px rgba(2,4,20,.35);
  color: #e8edff;
  backdrop-filter: blur(12px);
}
.pause-button:hover { border-color: var(--ui-cyan); background: rgba(83,91,178,.45); }
.combat-notice { color: #e6ffff; text-shadow: 0 2px 10px #050818; }
.combat-notice:not(:empty) { border: 1px solid rgba(114,237,241,.42); border-radius: 999px; background: rgba(8,14,39,.94); }
.combat-tip kbd, .dash-panel kbd { border-color: rgba(171,187,255,.32); border-radius: 6px; background: rgba(255,255,255,.1); color: #fff; }
.ability-slot, .ability-slot.ultradash-slot {
  border: 1px solid rgba(169,184,255,.29);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(28,34,82,.98), rgba(9,15,41,.98));
  box-shadow: 0 9px 25px rgba(2,4,20,.35), inset 0 1px rgba(255,255,255,.08);
  color: #f3f5ff;
}
.ability-slot:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--slot-color); background: linear-gradient(155deg, rgba(47,54,117,.98), rgba(13,19,49,.98)); }
.ability-slot .slot-key { border: 1px solid color-mix(in srgb, var(--slot-color), white 30%); border-radius: 6px; background: color-mix(in srgb, var(--slot-color), transparent 72%); color: white; }
.ability-slot b { color: #f3f5ff; }
.ability-slot small { color: #b2bee0; }
.ability-slot .cooldown-mask { background: rgba(4,8,27,.75); }
.ability-slot.selected { border-color: var(--slot-color); box-shadow: 0 0 0 1px var(--slot-color), 0 0 24px color-mix(in srgb,var(--slot-color),transparent 65%); }
.ability-slot.empty-slot { border-color: #455660; background: #18232b; color: #97a3a4; cursor: not-allowed; filter: saturate(.35); }
.ability-slot.empty-slot b, .ability-slot.empty-slot small { color: #9aa8a6; }
.ability-slot.ultradash-slot { border-color: #ffd36d; background: linear-gradient(145deg,#70489e,#3e266f 55%,#7a3a77); }
.ability-slot.ultradash-slot .slot-key { border-color: rgba(255,227,150,.6); background: rgba(255,255,255,.18); color: #fff4cb; }
.ability-slot.ultradash-slot b, .ability-slot.ultradash-slot small { color: #fff4df; }
.ability-slot.ultradash-slot .special-ribbon { background: #ffd36d; color: #352056; }
.dash-panel > span { color: #bac6ed; }
.dash-panel kbd { color: var(--gold); }
.dash-charge { border: 1px solid rgba(173,190,255,.4); border-radius: 999px; background: rgba(255,255,255,.08); }
.dash-charge i { border-radius: inherit; background: linear-gradient(90deg,#ffcc68,#fff19c); }
.dash-charge.empty i { background: linear-gradient(90deg,#6e79ae,#b4a1ef); }
.combat-overlay { background: rgba(4,7,24,.82); backdrop-filter: blur(12px); }
.result-card {
  border: 1px solid rgba(177,191,255,.33);
  border-radius: 20px;
  background: linear-gradient(145deg,#1d2058,#0c1231);
  box-shadow: 0 30px 90px rgba(1,3,18,.7), inset 0 1px rgba(255,255,255,.09);
  color: #f3f5ff;
}
.result-eyebrow { color: var(--ui-cyan); }
.result-card h2 { color: #fff; font-family: var(--pixel); }
.result-card p { color: #b7c1e0; }
.result-stat { border: 1px solid rgba(166,182,255,.2); border-radius: 10px; background: rgba(255,255,255,.045); }
.result-stat b { color: #fff; }
.result-stat small { color: #aab6d6; }
.secondary-button { border: 2px solid #526783; border-radius: 4px; background: #111d32; box-shadow: 2px 2px 0 #050a13; color: #e2e8ff; transition: transform .12s steps(2), border-color .14s, background-color .14s; }
.secondary-button:hover { transform: translateY(-1px); border-color: #9ccea6; background: #1b2b3d; }
.combat-overlay.victory .result-card { border-color: rgba(255,215,111,.65); box-shadow: 0 0 48px rgba(255,191,92,.18), 0 30px 90px rgba(1,3,18,.7); }
.combat-overlay.victory .result-eyebrow, .combat-overlay.victory .result-card h2 { color: #ffe39a; }

.loading-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(7, 14, 29, .47), rgba(7, 14, 29, .88)),
    url("../assets/arena/sky.png") center / cover,
    #08111e;
  opacity: 0;
  transition: opacity .24s ease;
}
.loading-overlay::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(196, 206, 255, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 206, 255, .13) 1px, transparent 1px);
  background-size: 8px 8px;
  content: "";
  opacity: .14;
  pointer-events: none;
}
.loading-overlay::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18vh;
  background: linear-gradient(180deg, transparent, rgba(7, 20, 32, .45));
  content: "";
  pointer-events: none;
}
.loading-overlay[hidden] { display: none; }
.loading-overlay.is-visible { opacity: 1; }
.loading-overlay.is-leaving { opacity: 0; pointer-events: none; }
.loading-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(600px, 100%);
  padding: 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
}
.loading-overlay.is-visible .loading-card { opacity: 1; transform: none; }
.loading-kicker {
  margin-bottom: 20px;
  color: #b6d4bb;
  font: 700 9px var(--pixel);
  letter-spacing: 1px;
}
.loading-card img {
  width: min(460px, 88vw);
  max-height: 210px;
  margin-bottom: 34px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(4, 10, 19, .45));
}
.loading-copy { display: grid; justify-items: center; gap: 10px; }
.loading-card strong { color: #f3f0e2; font: 800 15px var(--pixel); }
.loading-card small { color: #c1ccca; font-size: 12px; }
.loading-progress-wrap { width: min(620px, 100%); margin-top: 30px; }
.loading-progress {
  height: 16px;
  overflow: hidden;
  padding: 3px;
  border: 2px solid #718a97;
  background: #0b1725;
  box-shadow: 3px 3px 0 rgba(3, 8, 17, .72);
}
.loading-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #85c89f, #c2d48e 72%, #e6c77e);
  transition: width .22s ease-out;
}
.loading-overlay.is-indeterminate .loading-progress-bar {
  width: 34%;
  animation: loading-sweep 1.15s ease-in-out infinite;
}
.loading-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  color: #b6c8c7;
  font: 700 9px var(--pixel);
}
.loading-progress-meta b { color: #e6c77e; font-size: 9px; }
@media (max-width: 620px) {
  .loading-card { padding: 18px 10px; }
  .loading-kicker { font-size: 7px; }
  .loading-card img { width: min(360px, 85vw); max-height: 160px; margin-bottom: 27px; }
  .loading-card strong { font-size: 11px; }
  .loading-card small { font-size: 9px; }
  .loading-progress-wrap { margin-top: 23px; }
  .loading-progress-meta { font-size: 7px; }
}

.pokemon-context-menu { border: 1px solid rgba(156,174,255,.4); border-radius: 12px; background: #101638; box-shadow: 0 18px 40px rgba(2,4,20,.6); }
.pokemon-context-menu > b { color: #fff; }
.pokemon-context-menu button { border-color: rgba(156,174,255,.2); border-radius: 7px; background: rgba(134,145,255,.08); color: #e1e7ff; }
.pokemon-context-menu button:hover { border-color: var(--ui-cyan); background: rgba(114,237,241,.13); }

@keyframes loading-sweep { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
@keyframes screen-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes island-float { 50% { transform: translateY(-8px); } }
@keyframes pixel-drift { to { background-position: 64px 32px, 32px 64px; } }
@keyframes chest-open-pulse { to { transform: translateY(-7px) scale(1.08); filter: drop-shadow(0 0 27px rgba(255,230,145,.9)); } }
@keyframes chest-spark { to { opacity: .35; transform: translateY(-9px) scale(.8); } }
@keyframes reward-reveal { from { opacity: 0; transform: translateY(9px) scale(.94); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  .menu-hero { min-height: 310px; }
  .menu-island { right: -8%; width: 69%; }
  .hub-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hub-play { grid-column: 1 / -1; grid-row: auto; min-height: 190px; }
  .hub-summary { grid-column: 1 / -1; }
  .progress-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .progression-quicknav { justify-content: flex-start; gap: 6px; }
  .quick-profile-summary { flex-basis: 100%; max-width: none; }
  .progression-screen { margin-top: 6px; padding: 12px; }
  .progression-screen.is-home { padding: 2px 0 18px; }
  .progression-nav-controls { justify-content: space-between; }
  .progression-screen-header .secondary-button { min-height: 32px; padding: 6px 8px; font-size: 6px; }
  .progression-screen-header h2 { font-size: 10px; }
  .progression-grid { grid-template-columns: 1fr; gap: 9px; }
  .settings-grid { grid-template-columns: 1fr; }
  .progress-card { padding: 12px; }
  .trainer-card, .progress-stat-grid, .favorites-card, .history-card, .rank-ladder-card, .settings-note { grid-column: 1; }
  .progress-stat-card { min-height: 64px; }
  .trainer-avatar-wrap, .trainer-avatar-wrap canvas { width: 70px; height: 70px; }
  .trainer-avatar-wrap { flex-basis: 70px; }
  .trainer-main h3 { font-size: 15px; }
  .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: 24px minmax(70px,1fr) 74px 76px; 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(125px,1fr)); gap: 7px; }
  .chest-grid { grid-template-columns: 1fr; }
  .chest-card { grid-template-columns: 96px minmax(0, 1fr); justify-items: start; text-align: left; }
  .chest-illustration { grid-row: 1 / span 3; width: 48px; height: 48px; }
  .chest-card h3 { min-height: 0; margin: 0; }
  .chest-price { grid-column: 2; }
  .chest-odds, .chest-card .progress-action { grid-column: 1 / -1; }
  .chest-history > div { grid-template-columns: 10px 1fr 1fr; }
  .chest-history time { display: none; }
  .chest-reveal-scene { grid-template-columns: 1fr; gap: 4px; padding: 42px 12px 12px; }
  .chest-opening-visual { min-height: 95px; }
  .chest-opening-glyph { font-size: 48px; }
  .chest-reward { padding: 9px; }
  .chest-reward canvas { width: 68px; height: 68px; }
  .result-stats .ranked-result-card { grid-template-columns: repeat(2,1fr); }
  .move-build-dialog { max-height: calc(100dvh - 16px); }
  .move-picker-layout { grid-template-columns: minmax(0, 1fr); }
  .move-build-details { padding: 10px; }
  .move-details-empty { min-height: 110px; }
  .move-option-grid { max-height: min(31vh, 270px); }
}

@media (max-width: 620px) {
  .setup-screen { padding: 10px 12px 14px; }
  .lobby-topbar { min-height: 42px; }
  .offline-pill { padding: 5px 7px; font-size: 6px; }
  .progression-screen.is-home .progression-screen-header { display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; }
  .progression-screen.is-home .progression-nav-controls { justify-content: flex-start; }
  .progression-screen.is-home .progression-heading-copy { grid-row: 1; }
  .menu-hero { display: block; min-height: 365px; padding: 20px 17px 95px; border-radius: 5px; }
  .menu-logo { width: min(82%, 340px); max-height: 105px; margin-left: -5px; }
  .menu-hero-copy > p:last-child { max-width: 270px; font-size: 11px; }
  .menu-island { right: -19%; bottom: -9%; width: 88%; opacity: .82; }
  .menu-player-strip { right: 10px; bottom: 10px; left: 10px; max-width: calc(100% - 20px); gap: 7px; padding: 7px; }
  .menu-player-strip canvas { width: 42px; height: 42px; }
  .menu-player-name { min-width: 72px; }
  .menu-player-name strong { max-width: 100px; font-size: 8px; }
  .menu-rank, .menu-currency { padding-left: 7px; }
  .menu-rank strong, .menu-currency strong { font-size: 7px; }
  .hub-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .hub-play { min-height: 155px; }
  .hub-tile { min-height: 118px; padding: 12px; border-radius: 13px; }
  .hub-tile strong { font-size: 9px; }
  .hub-tile small { font-size: 9px; }
  .hub-icon { font-size: 20px; }
  .hub-play strong { font-size: 17px; }
  .hub-summary { min-height: 80px; padding: 12px; }
  .progression-select-wrap { gap: 5px; font-size: 6px; }
  .progression-select-wrap select { max-width: 52vw; min-height: 31px; padding: 5px 22px 5px 7px; font-size: 6px; }
  .progression-screen-header .secondary-button { min-height: 31px; font-size: 5px; }
  .trainer-card { align-items: flex-start; gap: 10px; }
  .trainer-currency { padding: 7px; }
  .trainer-currency b { font-size: 8px; }
  .upgrade-stat-deltas { gap: 5px; }
  .upgrade-stat-deltas > div { padding: 8px 4px; }
  .upgrade-dialog-actions { flex-direction: column-reverse; }
  .move-build-dialog { max-height: calc(100vh - 14px); }
  .move-build-dialog-content { gap: 10px; padding: 11px; }
  .move-build-title-group { gap: 7px; }
  .move-build-title-group canvas { flex-basis: 42px; width: 42px; height: 42px; }
  .move-build-title-group p { font-size: 9px; }
  .move-build-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .move-build-slot-main { min-height: 77px; padding: 7px; }
  .move-slot-meta { font-size: 7px; }
  .move-picker-panel { gap: 6px; padding: 8px; }
  .move-option-grid { grid-template-columns: 1fr; max-height: 26vh; }
  .move-option-card { min-height: 73px; }
  .move-build-details { padding: 9px; }
  .move-details-card { gap: 7px; }
  .welcome-copy { font-size: 11px; }
  .welcome-form small { line-height: 1.5; }
  .legal-note { justify-content: center; gap: 5px; font-size: 5px; text-align: center; }
  .combat-top { top: 7px; right: 7px; left: 7px; grid-template-columns: minmax(0,1fr) 61px 36px 29px; gap: 4px; min-height: 59px; padding: 5px; border-radius: 12px; }
  .fighter-card { grid-template-columns: 37px minmax(54px, .65fr) minmax(55px,1fr); gap: 2px 4px; }
  .fighter-card img { width: 35px; height: 35px; }
  .fighter-meta strong { max-width: 64px; font-size: 8px; }
  .fighter-meta span { font-size: 6px; letter-spacing: 0; }
  .hp-meter { height: 12px; }
  .hp-meter b { font-size: 6px; line-height: 10px; }
  .match-readout { padding: 2px; border: 0; }
  .match-readout span, .match-readout small { font-size: 5px; letter-spacing: 0; }
  .match-readout b { font-size: 10px; }
  .score-card { min-width: 0; }
  .score-card small { font-size: 5px; }
  .score-card b { font-size: 11px; }
  .score-card span { font-size: 6px; }
  .pause-button { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
  .combat-bottom { right: 7px; bottom: 8px; left: 7px; grid-template-columns: minmax(0,1fr) 50px; align-items: end; gap: 5px; }
  .combat-tip { display: none; }
  .ability-bar { grid-column: 1; grid-row: 1; gap: 4px; }
  .ability-slot { width: min(20vw,76px); height: 61px; padding: 5px; border-radius: 9px; }
  .ability-slot .slot-key { min-width: 16px; height: 15px; margin-bottom: 3px; font-size: 6px; }
  .ability-slot b { font-size: 7px; }
  .ability-slot small { font-size: 6px; }
  .ability-slot.ultradash-slot { width: min(21vw,84px); height: 66px; }
  .ability-slot.ultradash-slot b { font-size: 8px; }
  .ability-slot.ultradash-slot .special-ribbon { font-size: 5px; }
  .dash-panel { grid-column: 2; grid-row: 1; gap: 4px; padding: 6px 4px; }
  .dash-panel > span, .dash-panel kbd { font-size: 6px; }
  .dash-charge { width: 18px; height: 7px; }
  .combat-notice { top: 73px; font-size: 9px; }
  .round-announcement { top: 76px; }
  .result-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
.effects-off .setup-screen::before, .effects-off .menu-island { animation: none !important; }

.currency-value { display: inline-flex; align-items: center; gap: .35em; white-space: nowrap; }
.screen-reader-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }
.coin-icon { display: inline-block; flex: 0 0 auto; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.rank-symbol { display: inline-block; width: 1em; height: 1em; vertical-align: -0.16em; color: var(--rank-color, currentColor); }
.inline-rank-symbol { width: 1.2em; height: 1.2em; }
.rank-emblem .rank-symbol { width: 72%; height: 72%; }
.rank-ladder-row > b { display: grid; place-items: center; width: 24px; height: 24px; color: var(--rank-color); }
.rank-ladder-row > b .rank-symbol { width: 20px; height: 20px; }
.hub-logo-wrap { position: relative; z-index: 1; display: grid; place-items: center; width: 78px; height: 66px; }
.hub-logo { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(2px 3px 0 rgba(5, 9, 20, .62)); }
.hub-play .hub-logo-wrap { width: min(58%, 190px); height: 145px; }
.hub-icon { width: 38px; height: 38px; color: #a9d8ae; fill: currentColor; }
.hub-play { gap: 12px; }
.chest-illustration { width: 136px; height: 118px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.chest-logo { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(2px 3px 0 rgba(5, 9, 20, .65)); }
.chest-opening-glyph { display: block; width: min(100%, 220px); height: 148px; font-size: 0; filter: none; animation: chest-open-pulse .72s steps(6) infinite alternate; }
.chest-opening-glyph img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 18px rgba(255, 211, 113, .45)); }
.chest-opening-spark { z-index: 1; }

.rank-promotion-overlay {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--rank-color, #f3c75e), transparent 82%), transparent 48%),
    rgba(8, 15, 25, .97);
}
.rank-promotion-overlay::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(213, 230, 219, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(213, 230, 219, .07) 1px, transparent 1px);
  background-size: 8px 8px;
  content: "";
  opacity: .3;
  pointer-events: none;
}
.rank-promotion-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(430px, 100%);
  padding: 28px 20px;
  border: 3px solid var(--rank-color, #f3c75e);
  outline: 2px solid rgba(9, 18, 30, .9);
  background: #142235;
  box-shadow: 7px 8px 0 rgba(0, 0, 0, .45), inset 0 0 0 4px rgba(231, 238, 216, .08);
  color: #f2f0db;
  text-align: center;
  animation: rank-promotion-enter .56s steps(5, end) both;
}
.rank-promotion-kicker, .rank-promotion-caption { color: #bdc9bc; font: 700 8px var(--pixel); }
.rank-promotion-card h2 { margin: 0; color: #ffe294; font: 900 clamp(16px, 4vw, 23px)/1.5 var(--pixel); text-shadow: 3px 3px #312646; }
.rank-promotion-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 2px 0;
  border: 3px solid var(--rank-color);
  background: color-mix(in srgb, var(--rank-color), #101b2a 84%);
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .42), 0 0 34px color-mix(in srgb, var(--rank-color), transparent 65%);
  animation: rank-badge-bounce .72s .2s steps(5, end) both;
}
.rank-promotion-symbol { width: 72px; height: 72px; color: var(--rank-color); }
.rank-promotion-badge i { position: absolute; width: 7px; height: 7px; background: #fff0a0; box-shadow: 0 0 10px #ffe294; animation: rank-spark .72s steps(2) infinite alternate; }
.rank-promotion-badge i:nth-of-type(1) { top: 8px; left: -14px; }
.rank-promotion-badge i:nth-of-type(2) { top: -12px; right: 9px; animation-delay: .16s; }
.rank-promotion-badge i:nth-of-type(3) { right: -15px; bottom: 14px; animation-delay: .3s; }
.rank-promotion-trail { color: #c3d0c4; font: 700 8px/1.7 var(--pixel); }
.rank-promotion-name { color: var(--rank-color); font: 900 14px/1.5 var(--pixel); }
.rank-promotion-banner { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; gap: 8px; padding: 8px; border: 1px solid color-mix(in srgb, var(--rank-color), transparent 35%); background: color-mix(in srgb, var(--rank-color), transparent 88%); color: var(--rank-color); font: 800 7px/1.6 var(--pixel); }
.rank-promotion-banner .rank-symbol { width: 22px; height: 22px; }
@keyframes rank-promotion-enter {
  0% { opacity: 0; transform: translateY(28px) scale(.86); }
  65% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rank-badge-bounce {
  0% { opacity: 0; transform: scale(.2) rotate(-12deg); }
  70% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes rank-spark { from { opacity: .25; transform: scale(.65); } to { opacity: 1; transform: scale(1.25); } }
@media (max-width: 620px) {
  .hub-play .hub-logo-wrap { width: min(72%, 155px); height: 98px; }
  .hub-tile:not(.hub-play) .hub-logo-wrap { width: 62px; height: 52px; }
  .hub-icon { width: 30px; height: 30px; }
  .chest-illustration { width: 88px; height: 68px; }
  .chest-opening-glyph { width: min(100%, 180px); height: 118px; }
  .rank-promotion-card { gap: 9px; padding: 22px 14px; }
  .rank-promotion-badge { width: 90px; height: 90px; }
  .rank-promotion-symbol { width: 60px; height: 60px; }
}
@media (max-width: 360px) {
  .rank-ladder-row {
    grid-template-columns: 24px minmax(0, 1fr) 58px 56px;
    gap: 3px;
    padding: 6px 5px;
  }
  .rank-ladder-row > span { min-width: 0; overflow-wrap: anywhere; }
  .rank-ladder-row > small { font-size: 7px; }
  .rank-ladder-row > strong { font-size: 5px; }
}
