:root {
  --navy: #162940;
  --light: #fff1d3;
  --brass: #f3be63;
  --outline: #5e7181;
}
html,
body,
#shell {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body {
  background: #182b3e;
  color: var(--light);
  font-family: "Trebuchet MS", sans-serif;
}
header,
.plate,
.intro > p {
  display: none;
}
#shell {
  max-width: none;
  padding: 0;
}
#lobby {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  background: #213951 url(title-scene.png) center/cover;
  image-rendering: pixelated;
}
#lobby:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #1423369c, transparent 40%, #41325012);
  pointer-events: none;
}
#lobby:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 18% 75%, #ffe398 90%, transparent),
    radial-gradient(2px 2px at 72% 57%, #ffe398 90%, transparent),
    radial-gradient(1.5px 1.5px at 37% 34%, #ffeeac 90%, transparent);
  background-size: 43vw 51vh;
  animation: embers 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
@keyframes embers {
  to {
    background-position: 18px -25px;
    opacity: 0.35;
  }
}
.intro,
:is(#overlay,#personalOverlay),
.console,
.vitals,
#gameHead,
#partyRail,
#dock,
.arenaTitle,
.system button {
  background: linear-gradient(145deg, #23374bf5, #132138f7);
  border: 2px solid #7f8e95;
  box-shadow:
    0 0 0 3px #142137,
    0 6px 0 2px #0b182886;
  color: var(--light);
}
.intro {
  position: relative;
  width: min(390px, 90vw);
  max-height: 85dvh;
  overflow: auto;
  border-radius: 12px;
  padding: 26px 30px;
  text-align: center;
  border-top: 4px solid var(--brass);
}
.kicker {
  display: block;
  color: #ebc87f;
  letter-spacing: 0.2em;
  font-size: 11px;
}
.kicker i {
  display: none;
}
h1 {
  font:
    400 clamp(40px, 6vh, 66px) / 1 Gloock,
    Georgia,
    serif;
  letter-spacing: -0.04em;
  margin: 12px 0 23px;
  color: #fff3cc;
  text-shadow: 0 3px #0005;
}
h1 em {
  display: block;
  color: #ffca70;
  margin: 0;
}
h1 br,
h1 span {
  display: none;
}
.tabs {
  gap: 0;
  border: 0;
  background: #0c19298f;
  padding: 3px;
  border-radius: 6px;
}
.tabs button {
  flex: 1;
  padding: 7px 2px;
  font-size: 14px;
  color: #c0ced7;
  border: 0;
}
.tabs .active,
.battleTabs [aria-pressed="true"] {
  color: #192a36;
  background: #f4c570;
  border-radius: 4px;
}
.intro label {
  text-align: left;
  color: #d9dfdf;
}
.primary,
#gateSubmit {
  background: #ffc769;
  color: #34281b;
  border: 1px solid #ffdd9e;
  box-shadow: 0 3px #8d5b32;
}
.in-room .intro {
  padding: 15px 22px;
}
.in-room h1 {
  font-size: 30px;
  margin: 6px;
}
.in-room h1 em {
  display: inline;
  margin-left: 6px;
}
.panel {
  background: transparent;
  border: 0;
  color: inherit;
}
.panel h3 {
  color: #ffd184;
}
.panel .note,
.panel small,
.panel label,
.panel .muted,
.intro .note {
  color: #cad7d6;
}
.notice {
  background: #344a53;
}
.system {
  position: fixed;
  right: 15px;
  top: 15px;
  display: flex;
  gap: 8px;
  z-index: 20;
}
.system button {
  border-radius: 7px;
  min-width: 38px;
  font-size: 18px;
  padding: 5px;
}
.system button:hover,
#dock button:hover,
#partyRail button:hover {
  background: #38536a;
}
#game {
  position: absolute;
  inset: 0;
  background: #237a9e;
}
#map {
  position: absolute;
  inset: 0;
  overflow: auto;
}
#map > div {
  width: 100% !important;
  height: 100% !important;
  min-width: 630px;
}
#gameHead {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  align-items: center;
  border-radius: 9px;
  pointer-events: none;
}
#gameHead small,
#partyRail small {
  color: #eccb86;
  font: 700 10px monospace;
  letter-spacing: 0.13em;
}
.turn,
.turnName {
  display: grid;
  padding: 7px 13px;
}
.turn {
  border-right: 1px solid #77899a;
  text-align: center;
}
.turn b {
  font: 26px Georgia;
}
.turn sub {
  font: 13px monospace;
  vertical-align: baseline;
}
.turnName span {
  font-size: 12px;
  color: #c1d5d6;
}
#partyRail {
  --slot-width: clamp(46px, 7vw, 68px);
  --slot-height: clamp(30px, 10dvh, 63px);
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  padding: 7px;
  display: grid;
  gap: 6px;
  text-align: center;
  border-radius: 10px;
}
#partyRail :is(button, .rail-empty) {
  box-sizing: border-box;
  width: var(--slot-width);
  height: var(--slot-height);
  min-height: 0;
  border-radius: 7px;
}
#partyRail button {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 4px;
  gap: 2px;
  padding: 3px;
  overflow: hidden;
  background: #132337;
  border: 1px solid #566b7b;
  color: #7490a1;
  font-size: 21px;
}
#partyRail .monToken,
#partyRail img {
  width: 100%;
  height: 100%;
  min-height: 0;
}
#partyRail .monToken {
  display: block;
}
#partyRail img {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}
#partyRail progress {
  display: block;
  width: 100%;
  height: 4px;
  accent-color: #70be76;
}
#dock {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  border-radius: 10px;
  padding: 5px;
  max-width: 97vw;
}
#dock button {
  background: transparent;
  color: #fff1cf;
  border: 0;
  border-radius: 4px;
  padding: 4px clamp(8px, 2vw, 30px);
  white-space: nowrap;
  font-size: 14px;
}
#dock button + button {
  border-left: 1px solid #526271;
}
#dock i {
  display: block;
  color: #ffca66;
  font: 24px Georgia;
}
:is(#overlay,#personalOverlay) {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(425px, 88vw);
  max-height: 70dvh;
  overflow: auto;
  border-radius: 10px;
  z-index: 5;
}
:is(#dismiss,#dismissPersonal) {
  float: right;
  position: sticky;
  top: 5px;
  margin: 5px;
  z-index: 1;
  color: #e8dcca;
  background: #263b51;
  border: 0;
  font-size: 20px;
  padding: 1px 10px;
}
.panel {
  margin: 0;
}
.panel + .panel {
  border-top: 1px solid #546a77;
  border-radius: 0;
}
.panel .bars {
  color: #e7f0d9;
}
.slot {
  border-color: #546876;
}
.panel button {
  font-size: 14px;
}
.panel .notice {
  color: white;
}
#toast {
  z-index: 30;
  bottom: 95px;
}
#arena {
  position: absolute;
  inset: 0;
  background: #182b40;
  z-index: 8;
}
.field {
  position: absolute;
  inset: 0 0 clamp(150px, 24vh, 220px);
  background: #789e75 url(arena.png) center/100% 100%;
  image-rendering: pixelated;
}
.arenaTitle {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  padding: 7px 15px;
  border-radius: 6px;
}
.unit {
  position: absolute;
  width: clamp(95px, 18vw, 250px);
  height: 30%;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: end;
  justify-content: center;
}
.unit.own {
  left: 24%;
  top: 80%;
}
.unit.foe {
  left: 69%;
  top: 61%;
}
.fighter {
  object-fit: contain;
  image-rendering: pixelated;
}
.unit .fighter {
  height: 100%;
  width: 100%;
  object-fit: scale-down;
  object-position: center bottom;
  filter: drop-shadow(0 7px 3px #1a242766);
  animation: bob 1.5s ease-in-out infinite alternate;
}
.vitals {
  position: absolute;
  bottom: 105%;
  width: max-content;
  min-width: min(160px, 30vw);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}
.vitals .bars {
  margin: 2px;
}
.impact .fighter {
  animation: strike 0.36s ease-out;
}
.console {
  position: absolute;
  bottom: 0;
  height: clamp(150px, 24vh, 220px);
  width: 100%;
  padding: 10px clamp(12px, 7vw, 110px);
  overflow: auto;
}
.message {
  color: #eed7a2;
  font-size: 15px;
}
.battleTabs,
.moves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0;
}
.battleTabs button {
  border: 0;
  background: #3a5062;
  color: white;
}
.moves button {
  background: #e8e6ce;
  color: #203849;
}
.moves {
  color: #d0dede;
}
.fighting #gameHead,
.fighting #partyRail,
.fighting #dock {
  visibility: hidden;
}
@keyframes bob {
  to {
    transform: translateY(-3px);
  }
}
@keyframes strike {
  25%,
  75% {
    transform: translateX(-8px);
    filter: brightness(2);
  }
  50% {
    transform: translateX(7px);
  }
}
@media (max-width: 600px) {
  #dock button {
    padding: 3px 7px;
    font-size: 12px;
  }
  #partyRail {
    right: 8px;
    padding: 4px;
  }
  #partyRail {
    --slot-width: 38px;
    --slot-height: clamp(27px, 8dvh, 42px);
  }
  .turnName,
  .turn {
    padding: 5px 8px;
  }
  .intro {
    padding: 20px;
  }
  .system {
    right: 8px;
    top: 8px;
  }
  .vitals {
    font-size: 11px;
    min-width: 105px;
  }
  .unit.foe {
    top: 63%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
  }
}
#lobby {
  grid-template-columns: 1fr;
  gap: 0;
}

.cinematic {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #10243be8;
  color: #ffe3a2;
  text-align: center;
  padding: 30px;
  animation: reveal 0.35s ease;
}
.cinematic strong {
  font:
    32px Gloock,
    serif;
  max-width: 650px;
}
.locationScene {
  background: linear-gradient(#89bcca, #b4d58b);
  padding: 30px 12px;
  color: #263d44;
  text-align: center;
}
.landmarks {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 30px 0;
}
.landmarks button {
  background: #f4dfae;
  border-bottom: 12px solid #a37463;
  padding: 16px 8px;
}
.fainting {
  animation: faint 0.6s forwards !important;
}
progress {
  transition: all 0.25s ease;
}
#map button:focus-visible {
  outline: 2px solid white;
}
@keyframes reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes faint {
  to {
    opacity: 0;
    translate: 0 65px;
  }
}

:is(#overlay,#personalOverlay).visit {
  width: min(94vw, 1020px);
  max-height: 90dvh;
}
.destination {
  position: relative;
  height: min(68dvh, 540px);
  min-height: 240px;
  background: #95b970 url(town.png) center/100% 100%;
  image-rendering: pixelated;
}
.destination h2,
.destination > small {
  position: absolute;
  left: 3%;
  top: 4%;
  background: #18283ceb;
  border: 1px solid #c5ad81;
  padding: 5px 12px;
  border-radius: 4px;
}
.destination > small {
  top: calc(4% + 50px);
}
.destination footer {
  position: absolute;
  bottom: 2%;
  left: 2%;
  right: 2%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.destination .building {
  position: absolute;
  width: 18%;
  height: 34%;
  top: 33%;
  background: transparent;
  border: 0;
  display: grid;
  align-items: end;
  justify-items: center;
}
.building b {
  background: #1b3048ed;
  color: #ffe6a6;
  padding: 3px 8px;
  border: 1px solid #e2c995;
  border-radius: 4px;
  white-space: nowrap;
}
.building.heal {
  left: 11%;
}
.building.enterShop {
  left: 41%;
}
.building.gym {
  left: 71%;
}
.destination .building:hover {
  background: #fff2;
}
.ending {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: #17283a;
}
.ending .field {
  bottom: 0;
}
.unit .fighter.fall {
  animation: fall 0.7s ease-in forwards;
}
@keyframes fall {
  to {
    transform: translateY(75%);
    opacity: 0;
  }
}
.resultBox {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  background: #192d42f7;
  color: #fff3cb;
  border: 2px solid #d5b875;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  width: min(90%, 480px);
}
.destination {
  background-size: 100% 100%;
  background-position: center;
}
.destination.village .heal {
  left: 12%;
  width: 29%;
}
.destination.village .enterShop {
  left: 54%;
  width: 33%;
}
.destination.town .building {
  height: 45%;
  top: 24%;
  align-items: end;
  padding-bottom: 0;
}
.destination.city .heal {
  left: 5%;
  width: 26%;
}
.destination.city .enterShop {
  left: 36%;
  width: 27%;
}
.destination.city .gym {
  left: 68%;
  width: 27%;
}
.destination .building b {
  box-shadow: 0 2px 8px #10233499;
}
.destination footer {
  background: linear-gradient(transparent, #152132ae);
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 6px 10px;
}
.destination.wild {
  background-size: cover;
}

:is(#overlay,#personalOverlay).widePhase {
  inset: 0;
  transform: none;
  width: 100%;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: linear-gradient(120deg, #253e50, #14233a);
  z-index: 12;
}
.widePhase :is(#content,#personalContent) {
  max-width: 1350px;
  margin: auto;
  padding: 2vh 3vw;
}
.trainerGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr));
  gap: 12px;
  margin: 12px 0;
}
.trainerCard {
  border: 1px solid #768894;
  border-radius: 10px;
  background: #203145;
  overflow: hidden;
}
.trainerCard header {
  display: flex;
  position: static;
  height: auto;
  padding: 10px;
  color: #ffdda0;
  gap: 8px;
}
.cardScroll {
  height: clamp(160px, 32vh, 340px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 8px;
}
.cardScroll h4 {
  margin: 5px 0;
  color: #bcd4ca;
}
.cardMon,
.cardItem {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.cardMon img,
.itemArt {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.monToken {
  display: inline-grid;
  position: relative;
  place-items: center;
  height: 100%;
  max-width: 100%;
}
.monToken small,
.combatStatus {
  position: absolute;
  bottom: 0;
  left: 0;
  font: 9px sans-serif;
  color: white;
  background: #573473;
  border-radius: 3px;
  padding: 2px;
}
.knocked img {
  filter: grayscale(1);
  opacity: 0.42;
}
.psn img,
.tox img {
  filter: drop-shadow(0 0 5px orchid);
}
.brn img {
  filter: drop-shadow(0 0 4px coral);
}
.balance {
  display: grid;
  background: linear-gradient(120deg, #36534e, #263b49);
  padding: 18px;
  border: 1px solid #b9a37b;
  border-radius: 9px;
  margin-bottom: 15px;
}
.balance strong {
  font: 36px Georgia;
  color: #ffda92;
}
.badgeCase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.badgeCase figure {
  text-align: center;
  padding: 4px;
  background: #122237;
  border-radius: 7px;
}
.badgeCase img {
  width: 48px;
  image-rendering: pixelated;
}
.badgeCase figcaption {
  display: block;
  padding: 0;
  font-size: 12px;
}
.badgeCase .locked img {
  filter: grayscale(1);
  opacity: 0.3;
}
:is(#overlay,#personalOverlay).pc {
  width: min(640px, 90vw);
  max-height: 85dvh;
}
.pcGrid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 7px 0 12px;
}
.pcSlot {
  height: clamp(36px, 6.5vh, 62px);
  min-width: 0;
  padding: 2px;
  background: #294353;
  color: #e8eed9;
  display: grid;
  place-items: center;
  border-color: #577283;
}
.pcSlot img {
  height: 32px;
  width: 40px;
  max-width: 100%;
  object-fit: scale-down;
}
.pcSlot > small {
  font: 10px sans-serif;
  max-width: 100%;
  overflow: hidden;
}
.pcSlot > * { pointer-events: none; }
.pcNav,
.pcMenu {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pcMenu {
  padding: 8px;
  background: #314457;
}
.gymHint {
  display: none;
  position: absolute;
  z-index: 2;
  bottom: 90%;
  width: max-content;
  max-width: 200px;
  color: #fff3cf;
  background: #172b40;
  padding: 6px;
  border-radius: 4px;
  font-size: 14px;
}
.gym:hover .gymHint,
.gym:focus-visible .gymHint {
  display: block;
}
.world-trainer {
  position: absolute;
  z-index: 2;
  width: clamp(23px, 5%, 40px);
  transform: translate(-50%, -75%);
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 0 #183834b8);
  pointer-events: none;
}
.trainer-preview {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  vertical-align: middle;
}
.avatar-picker, .facility-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.avatar-picker button[aria-pressed="true"] {
  outline: 2px solid #e4b460;
  background: #285b51;
  color: #fff3d5;
}
.destination .facility-menu {
  flex-basis: 100%;
  justify-content: center;
  background: #172b3aeb;
  color: #fff3d5;
  padding: 6px;
  border-radius: 5px;
}
.facility-menu p { margin: 0; }
.destination.town .building.center { left: 12%; width: 29%; }
.destination.town .building.store { left: 54%; width: 33%; }
.destination.city .building.center { left: 40%; top: 22%; width: 19%; height: 24%; }
.destination.city .building.store { left: 22%; top: 35%; width: 16%; height: 24%; }
.destination.city .building.post { left: 61%; top: 37%; width: 17%; height: 22%; }
.destination.city .building.gym { left: 71%; top: 18%; width: 11%; height: 18%; }
.destination .building b { white-space: normal; text-align: center; }
.avatar-picker label {
  display: inline-flex;
  position: relative;
  padding: 0;
}
.avatar-picker label input {
  position: absolute;
  opacity: 0;
  width: 1px;
}
.avatar-picker label span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #55766d;
  border-radius: 4px;
  padding: 2px 8px 2px 2px;
  cursor: pointer;
}
.avatar-picker label input:checked + span {
  background: #285b51;
  color: #fff3d5;
  outline: 2px solid #e4b460;
}
.avatar-picker label input:focus-visible + span {
  outline: 2px solid #2e7db0;
}
.shop-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.shop-item label { flex: 1; min-width: 0; }
.itemArt { vertical-align: middle; }
.item-fallback { display: inline-grid; place-items: center; }
.job-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 6px;
  width: 100%;
  max-height: min(24dvh, 215px);
  overflow: auto;
}
.job-board article {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 6px 8px;
  background: #203d4f;
  border-radius: 4px;
}
.job-board article span, .job-board article small { font-size: 0.82rem; }
.job-board article button { justify-self: start; }

/* Expedition interface */
#lobby {
  grid-template-columns: 1fr;
  background: linear-gradient(90deg,#102824d9,transparent 74%),url(scenes/city-pixel.png) center/cover;
  justify-items: start;
  padding-inline: clamp(16px,7vw,120px);
}
.intro,:is(#overlay,#personalOverlay),#gameHead,#dock,#partyRail {
  background: linear-gradient(145deg,#203b3bfa,#11272dfc);
  border: 1px solid #73877b;
  box-shadow: 0 12px 32px #091c2580, inset 0 1px #fbedd41a;
}
.intro { width: min(438px,100%); padding: clamp(16px,3vw,32px); border-top: 3px solid #deb978; }
.avatar-picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 0; padding: 6px 0; }
#gateAvatars[hidden] { display: none; }
.avatar-picker label span,.avatar-picker button { display:grid; justify-items:center; width:100%; padding:4px; font-size:13px; }
.avatar-picker button { min-width:0; }
button:focus-visible { outline:3px solid #ffe8a3; outline-offset:2px; }
button:not(:disabled):active { filter:brightness(.88); }
#dock { gap:3px; padding:5px; border-radius:15px; }
#dock button { display:grid; justify-items:center; gap:2px; min-height:44px; border:0; border-radius:9px; }
#dock button[aria-pressed=true],#dock button:hover { background:#315450; color:#ffdf9c; }
.game-icon { display:inline-block; width:22px; height:22px; background:currentColor; mask:var(--icon) center/contain no-repeat; }
#dock i { background-color:#e6c183; }
#partyRail[hidden] { display:none; }
#roundCard {
  background:#fbf0d7; color:#1a3936; width:min(364px,90vw); padding:0; max-height:90dvh;
  border:2px solid #dbba78; border-radius:18px; box-shadow:0 24px 90px #061c24aa;
}
#roundCard::backdrop { background:#0d2129c4; backdrop-filter:blur(4px); }
.card-art { height:clamp(90px,24dvh,190px); background-position:center; background-size:cover; padding:13px; }
.card-round { font-size:13px; font-weight:bold; }
.card-round { background:#173837ed; color:#ffdfa1; border-radius:20px; padding:5px 12px; }
.card-copy { text-align:center; padding:0 24px 22px; }
.card-seal { display:grid; width:46px; height:46px; margin:-23px auto 8px; position:relative; place-items:center; color:#f6d797; background:#1d4841; border:2px solid #c5a566; border-radius:50%; }
.card-copy h2 { font: bold 32px/1.1 Georgia,serif; color:#183e37; margin:6px 0 10px; }
.card-copy p { color:#35514b; margin-bottom:17px; line-height:1.5; }
.card-copy button { width:100%; min-height:44px; background:#215848; color:#fff4d6; border:1px solid #386c5c; }
@media(max-width:640px) {
  #lobby { justify-items:center; padding-inline:12px; }
  .intro { max-height:88dvh; }
  #dock { bottom:max(9px,env(safe-area-inset-bottom)); }
  #dock button { padding:4px 8px; }
  #gameHead { top:8px; left:8px; }
}
@media(prefers-reduced-motion:reduce) {
  #lobby:after,.cinematic { animation:none; }
}
button:disabled { cursor:default; }
#roomPanel button:disabled { opacity:.52; }
.destination .gym:disabled small { border-radius:4px; padding:2px 4px; background:#152c31e8; color:#f5eacb; font:11px/1.2 system-ui; }
.icon-library { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
.hud-icon { display:block; width:24px; height:24px; flex:none; color:currentColor; }
#dock { padding:5px; gap:4px; background:#122e32f7; border:1px solid #849991; box-shadow:0 5px 18px #071d2780; }
#dock button { display:flex; align-items:center; justify-content:center; gap:8px; min-width:76px; padding:8px 14px; }
#dock .hud-icon { width:23px; height:23px; color:#f6d597; }
.card-seal .hud-icon { color:#f9d99b; }
:is(#overlay,#personalOverlay).visit { position:fixed; inset:0; transform:none; margin:0; width:100%; height:100dvh; max-height:none; overflow:hidden; border:none; border-radius:0; }
:is(#overlay,#personalOverlay).visit :is(#dismiss,#dismissPersonal) { position:absolute; float:none; right:max(12px,env(safe-area-inset-right)); top:max(10px,env(safe-area-inset-top)); z-index:4; width:44px; height:44px; border:1px solid #c2c4a5; border-radius:50%; }
:is(#overlay,#personalOverlay).visit :is(#content,#personalContent),:is(#overlay,#personalOverlay).visit .destination { width:100%; height:100%; min-height:0; }
.destination { background-size:100% 100%; }
.destination footer { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
button:is(.primary,[data-action],[data-facility="close"],[data-combat]),.system button,:is(#dismiss,#dismissPersonal) {
  border-radius:8px; font-weight:700; line-height:1.2; transition:background-color .12s,box-shadow .12s;
}
.panel button:not(.building),.destination footer button,.console button,.system button,#gate button,#roomPanel button {
  min-height:40px; padding:7px 12px; border:1px solid #688981;
  background:#244544; color:#fff5dd; box-shadow:inset 0 1px #ffffff15;
}
:is(.panel,.destination footer,.console,#gate,#roomPanel) button:not(:disabled):hover { background-color:#345b56; }
:is(#gate,#roomPanel,.panel,.console,.destination footer) button.primary,
.destination footer button:is([data-action="work"],[data-action="explore"],[data-action="heal"]) {
  background:#edd09a;color:#183431;border-color:#ffdfa7;
}
button:focus-visible { outline:3px solid #ffda8d; outline-offset:2px; }
.facility-menu > b:empty { display:none; }
@media(max-width:650px){
  #dock { width:max-content; max-width:calc(100vw - 12px); }
  #dock button { flex-direction:column; gap:3px; padding:5px 8px; min-width:54px; font-size:12px; }
  #dock .hud-icon { width:22px; height:22px; }
  :is(#overlay,#personalOverlay).visit .destination { background-size:cover; }
  .destination.town { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:center; gap:8px; padding:0 14px 10dvh; }
  .destination.town .building:is(.center,.store,.post,.gym) { position:static; width:auto; height:auto; min-height:46px; padding:5px; align-content:center; justify-content:center; background:#173b3be8; border:1px solid #c3b082; border-radius:8px; }
  .destination.town .building b { border:none; padding:0; box-shadow:none; background:transparent; }
  #roomPanel .avatar-picker button { padding:3px; }
}
@media(prefers-reduced-motion:reduce){ button { transition:none!important; } }
body:has(:is(#overlay,#personalOverlay).visit:not([hidden])) .system { visibility:hidden; }
#roundCard::backdrop { background:rgba(13,33,41,.88); }
#sessionEnded { border:1px solid #9fac91; border-radius:12px; color:#153b37; padding:20px; }
.job-board article { align-content:start; gap:6px; }
.job-board article button { margin-top:auto; }
.job-panel {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(62rem, 94vw);
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 2vw, 20px);
  background: #142d32;
  border: 1px solid #769189;
  border-radius: 14px;
  box-shadow: 0 16px 48px #091c24b0;
}
.job-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; }
.job-panel-heading h3 { margin: 0; }
.job-panel-heading button { width: 44px; height: 44px; padding: 0; font-size: 26px; }
.job-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  max-width: 52rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.job-panel .job-board { max-width: none; min-height: 0; max-height: 55dvh; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.job-board article { padding: 12px; overflow-wrap: anywhere; }
.job-board article small { font: inherit; font-size: .82rem; color: #ced6c7; letter-spacing: normal; }
@media (max-width: 760px) { .job-panel .job-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .job-panel .job-board { grid-template-columns: minmax(0, 1fr); } }
.job-panel {
  color:#f5ebd1;
  background:#18382d;
  border:2px solid #b79a61;
  box-shadow:0 0 0 4px #18382d, 0 24px 64px #101c16c9;
}
.job-panel-heading { display:grid; grid-template-columns:44px 1fr 44px; }
.job-panel-heading h3 { grid-column:2; text-align:center; color:#f4dfad; font:700 clamp(1.15rem,3vw,1.75rem)/1.15 Georgia,serif; }
.job-panel-heading button { background:#254936; border:1px solid #a58b57; color:#f4dfad; }
.job-panel-heading button:hover { background:#386049; }
.job-board { gap:10px; scrollbar-color:#ae935f #244435; }
.job-board article {
  display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:0 10px 12px; gap:6px; overflow:hidden;
  color:#20392b; background:#f2e4c3; border:1px solid #bba575; border-radius:9px;
}
.job-art { width:calc(100% + 20px); height:58px; flex:none; background:url(scenes/city-pixel.png) center 55%/cover; border-bottom:1px solid #bba575; }
.job-board [data-job="lenhador"] .job-art { background-image:url(scenes/floresta-pixel.png); }
.job-board [data-job="minerador"] .job-art { background-image:url(scenes/cave-pixel.png); }
.job-board article b { font:700 1rem/1.15 Georgia,serif; }
.job-board article span,.job-board article small { color:#455847; line-height:1.25; }
.job-pay { color:#5c431e; font-size:.88rem; }
.job-board article button[data-action="hire"] {
  align-self:center; margin-top:auto; min-height:40px; min-width:90px;
  color:#fff4d6; background:#275740; border:1px solid #426b49;
}
.job-board article button[data-action="hire"]:hover { background:#38684e; }
.facility-panel { width:min(29rem, 90vw); }
.facility-actions {
  display:flex; flex-direction:column; align-items:center; gap:10px;
  overflow-y:auto; min-height:0; padding:10px; text-align:center;
  background:#254535; border:1px solid #907a50; border-radius:8px;
}
.facility-actions > button {
  min-height:44px; padding:8px 18px; border:1px solid #e7cd91;
  border-radius:8px; background:#eed39b; color:#20392b; font-weight:700;
}
.facility-actions > button:hover { background:#ffe3a6; }
.facility-panel .job-board { grid-template-columns:minmax(0,1fr); width:min(100%,18rem); }
:is(#overlay,#personalOverlay).facility-full {
  position:fixed; inset:0; width:100%; height:100dvh; max-height:none;
  transform:none; border:0; border-radius:0; z-index:9;
}
body:has(:is(#overlay,#personalOverlay).facility-full:not([hidden])) .system { visibility:hidden; }
.facility-screen {
  --surface:#132f29; --raised:#244837; --edge:#66816b;
  --accent:#f3d59b; --ink:#f6e7c6; --on-accent:#213b2d;
  display:grid;
  grid-template-columns:minmax(120px, 22%) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) auto;
  height:100%; gap:10px; padding:10px;
  background:var(--surface); color:var(--ink);
}
.shop-screen {
  --surface:#11263a; --raised:#20425d; --edge:#527895;
  --accent:#b8e0ff; --ink:#eef7ff; --on-accent:#132d44;
}
.facility-screen[data-theme="center"] {
  --surface:#3c202c; --raised:#5d3042; --edge:#a5677c;
  --accent:#ffd0d9; --ink:#fff1f4; --on-accent:#431d30;
}
.facility-screen[data-theme="gym"] {
  --surface:#332a14; --raised:#504225; --edge:#95804a;
  --accent:#ffe29a; --ink:#fff3cf; --on-accent:#3b2e11;
}
.facility-screen aside { min-height:0; overflow:auto; }
.facility-screen h2,.facility-screen h3 { color:var(--accent); }
.npc-portrait {
  height:clamp(65px, 23dvh, 220px); margin-bottom:8px;
  background:var(--raised) center/cover no-repeat;
  border:1px solid var(--edge); border-radius:8px;
}
.facility-screen[data-theme="store"] .npc-portrait { height:100%; margin:0; }
.facility-body { min-height:0; min-width:0; display:flex; flex-direction:column; gap:8px; }
.facility-list,.catalog,.facility-body .job-board {
  overflow:auto; min-height:0; scrollbar-gutter:stable;
  scrollbar-color:var(--edge) var(--surface);
}
.facility-body .job-board { max-height:none; grid-template-columns:repeat(3,minmax(0,1fr)); }
.catalog-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(8rem,auto); gap:6px; }
.catalog-tools :is(input,select) { min-width:0; padding:6px 8px; }
.catalog { display:grid; align-content:start; gap:4px; }
.catalog button,.facility-mon {
  display:grid; grid-template-columns:40px minmax(0,1fr) auto; gap:8px; align-items:center;
  padding:5px 8px; text-align:left; color:var(--ink); background:var(--raised);
  border:1px solid var(--edge); border-radius:7px;
}
.catalog button[aria-pressed=true],.facility-footer button.primary {
  background:var(--accent); color:var(--on-accent); border-color:var(--accent);
}
.catalog button small,.facility-mon span { display:block; font-size:.83rem; }
.catalog button small { color:inherit; letter-spacing:normal; }
.facility-mon { margin-bottom:6px; }
.facility-mon .fighter { position:static; width:40px; height:40px; object-fit:contain; transform:none; animation:none; }
.facility-mon progress { width:min(100%,24rem); height:12px; accent-color:#83b276; }
.facility-footer {
  grid-column:1/-1; display:flex; flex-wrap:wrap; justify-content:center; align-items:center;
  text-align:center; gap:6px 10px; padding:6px 0 0;
  border-top:1px solid var(--edge);
}
.facility-footer:empty { display:none; }
.facility-footer label { margin:0; color:var(--ink); }
.facility-footer button {
  min-height:40px; padding:6px 12px; border:1px solid var(--edge);
  color:var(--ink); background:var(--raised);
}
.facility-footer button:disabled { opacity:.55; }
.facility-footer button:not(:disabled):hover,.catalog button:hover { filter:brightness(1.12); }
.shop-quantity label { display:block; font-size:.8rem; }
.quantity-control { display:flex; align-items:stretch; }
.quantity-control input { width:3.4rem; margin:0; padding:4px; appearance:textfield; border-radius:6px 0 0 6px; text-align:center; }
.quantity-control input::-webkit-inner-spin-button,.quantity-control input::-webkit-outer-spin-button { appearance:none; margin:0; }
.quantity-control span { display:grid; grid-template-rows:1fr 1fr; }
.facility-footer .quantity-control button { min-height:22px; min-width:32px; padding:0; line-height:1; border-radius:0 5px 0 0; }
.facility-footer .quantity-control button + button { border-radius:0 0 5px 0; }
@media(max-width:650px) {
  .facility-screen { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; gap:6px; padding:6px; }
  .facility-screen aside { display:grid; grid-template-columns:48px 1fr; column-gap:8px; }
  .npc-portrait { grid-row:span 2; height:48px; margin:0; }
  .facility-screen h2 { font-size:1.15rem; }
  .facility-screen[data-theme="store"] aside { display:block; height:48px; }
  .facility-body .job-board { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .catalog-tools { grid-template-columns:minmax(0,1fr) minmax(0, 46%); }
}

/* Shared panel surfaces and controls. Establishments supply their own palette. */
:is(#overlay,#personalOverlay) {
  --surface:#142f29;
  --raised:#224638;
  --edge:#708e7b;
  --accent:#f3d69c;
  --ink:#f9f0da;
  --on-accent:#20382d;
  color:var(--ink);
  background:var(--surface);
  scrollbar-color:var(--edge) var(--surface);
}
:is(#overlay,#personalOverlay).widePhase { background:var(--surface); }
:is(#overlay,#personalOverlay):not(.visit):not(.facility-full) :is(#content,#personalContent) { padding:10px; }
:is(#overlay,#personalOverlay):not(.visit):not(.facility-full) .panel { padding:6px; }
:is(#overlay,#personalOverlay) .panel > h3 { text-align:center; color:var(--accent); margin-bottom:8px; }
:is(#overlay,#personalOverlay) .panel :is(label,small,.muted,.note,summary) { color:var(--ink); }
:is(#overlay,#personalOverlay) :is(.panel,.facility-screen) :is(input,select,textarea):not([type="radio"]):not([type="checkbox"]) {
  color:#162b31; background:#f7fbff; border-color:var(--edge);
}
:is(#overlay,#personalOverlay) :is(.panel,.facility-screen) :is(input,textarea)::placeholder { color:#506577; opacity:1; }
:is(#overlay,#personalOverlay) :is(.panel,.facility-screen) option { color:#162b31; background:#f7fbff; }
:is(#overlay,#personalOverlay) .panel :is(.slot,.roster,.balance,.badgeCase figure,.trainerCard,.pcMenu) {
  background:var(--raised); color:var(--ink); border:1px solid var(--edge);
  border-radius:8px;
}
:is(#overlay,#personalOverlay) .panel .slot { padding:8px; margin-block:6px; }
:is(#overlay,#personalOverlay) .panel .roster { padding:6px 8px; margin-bottom:4px; }
:is(#overlay,#personalOverlay) .panel .balance { padding:10px; justify-items:center; text-align:center; margin-bottom:10px; }
:is(#overlay,#personalOverlay) .panel .balance strong { color:var(--accent); }
:is(#overlay,#personalOverlay) .panel .btnline,
:is(#overlay,#personalOverlay) .panel :is(.pcNav,.pcMenu) {
  justify-content:center; align-items:center; gap:6px 10px;
}
:is(#overlay,#personalOverlay) .panel :is(.pcNav,.pcMenu) { padding:5px; }
:is(#overlay,#personalOverlay) .panel button:not(.pcSlot) {
  min-height:38px; padding:6px 11px;
  color:var(--ink); background:var(--raised); border:1px solid var(--edge);
}
:is(#overlay,#personalOverlay) .panel button.primary {
  background:var(--accent); border-color:var(--accent); color:var(--on-accent);
}
:is(#overlay,#personalOverlay) .panel button:not(:disabled):hover { filter:brightness(1.15); }
:is(#overlay,#personalOverlay) .panel button:disabled { opacity:.65; }
:is(#overlay,#personalOverlay) .panel .pcSlot { background:var(--raised); color:var(--ink); border-color:var(--edge); }
:is(#overlay,#personalOverlay) .panel .trainerCard header {
  padding:7px 8px; color:var(--accent); background:var(--surface); border-bottom:1px solid var(--edge);
}
:is(#overlay,#personalOverlay) .panel .cardScroll { scrollbar-color:var(--edge) var(--surface); }
:is(#overlay,#personalOverlay) .panel .cardScroll h4 { color:var(--ink); }
@media(max-width:650px) {
  :is(#overlay,#personalOverlay):not(.visit):not(.facility-full) :is(#content,#personalContent) { padding:6px; }
  :is(#overlay,#personalOverlay):not(.visit):not(.facility-full) .panel { padding:6px; }
  :is(#overlay,#personalOverlay) .panel .pcNav { justify-content:space-between; }
}
#game:has(:is(#overlay,#personalOverlay).visit:not([hidden])) #dock {
  z-index: 11;
}
#game:has(:is(#overlay,#personalOverlay).facility-full:not([hidden])) #dock {
  display: none;
}
:is(#overlay,#personalOverlay).visit :is(.job-panel,.facility-panel) {
  max-height: min(75dvh, calc(100dvh - 110px));
}
#game:has(:is(#overlay,#personalOverlay).visit:not([hidden])) #dock > button:first-of-type {
  max-width: min(42vw, 15rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.destination.league {
  background: #15678a url("scenes/league-island.png") center / cover no-repeat;
}
.destination.league .league-entrance {
  left: 50%;
  top: 29%;
  width: max(31%, 30vh);
  height: 26%;
  transform: translateX(-50%);
}
.destination.league .league-entrance:disabled {
  opacity: 1;
  cursor: not-allowed;
}
#league-entry-reason {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #152c31ed;
  color: #fff5d4;
  text-align: center;
}

#game:has(:is(#overlay,#personalOverlay).visit:not([hidden]) .destination.league) #dock {
  visibility: hidden;
}
:is(#overlay,#personalOverlay):not([hidden]) { display:flex; flex-direction:column; overflow:hidden; }
:is(#overlay,#personalOverlay) :is(#content,#personalContent) { min-height:0; overflow:auto; }
:is(#overlay,#personalOverlay).facility-full :is(#content,#personalContent), :is(#overlay,#personalOverlay).visit :is(#content,#personalContent) { flex:1; overflow:hidden; }
:is(#overlay,#personalOverlay) .panel-toolbar {
  flex:none; display:flex; justify-content:flex-end; padding:3px 6px;
  border-bottom:1px solid #ffffff24; background:#112b26;
}
:is(#overlay,#personalOverlay).visit .panel-toolbar {
  position:absolute; top:max(10px, env(safe-area-inset-top));
  right:max(10px, env(safe-area-inset-right)); z-index:4;
  padding:0; border:0; background:transparent;
}
:is(#overlay,#personalOverlay).visit .panel-toolbar :is(#dismiss,#dismissPersonal) {
  background:#142e37; color:#fff5dd; border:1px solid #f4d18a;
  box-shadow:0 3px 10px #0a2027a6;
}
:is(#overlay,#personalOverlay).visit .panel-toolbar :is(#dismiss,#dismissPersonal):hover { background:#355360; }
:is(#overlay,#personalOverlay).facility-full:has([data-theme="store"]) .panel-toolbar { background:#11263a; }
:is(#overlay,#personalOverlay).facility-full:has([data-theme="center"]) .panel-toolbar { background:#3c202c; }
:is(#overlay,#personalOverlay).facility-full:has([data-theme="gym"]) .panel-toolbar { background:#332a14; }
:is(#overlay,#personalOverlay) .panel-toolbar :is(#dismiss,#dismissPersonal) {
  position:static; float:none; width:42px; height:42px; margin:0; padding:0;
  background:transparent; border:1px solid transparent; border-radius:7px; color:#fff7e4;
  font:500 26px/1 system-ui;
}
:is(#overlay,#personalOverlay) .panel-toolbar :is(#dismiss,#dismissPersonal):hover { background:#ffffff19; border-color:#ffffff35; }
:is(#overlay,#personalOverlay).visit :is(.job-panel,.facility-panel) { max-height:min(72dvh, calc(100% - 84px)); }

/* Shared visual rhythm for the game screens. */
:root { --ui-gap:8px; --ui-radius:10px; }
.intro,:is(#overlay,#personalOverlay),#gameHead,#dock,#partyRail,.console,.vitals {
  border-radius:var(--ui-radius);
  box-shadow:0 8px 28px #081a2390, inset 0 1px #ffffff16;
}
:is(#overlay,#personalOverlay):is(.facility-full,.visit,.widePhase) { border-radius:0; }
.intro { background:#142e2cf5; }
#roomPanel .roster { border-bottom:1px solid #bed1c62b; }
#dock button[aria-pressed="true"] { box-shadow:inset 0 -2px #edcc89; }
#partyRail .rail-empty {
  border:1px dashed #668887;
  background:#10282bc2;
}
#partyRail,.pcGrid,.badgeCase { gap:6px; }
:is(#overlay,#personalOverlay) .panel-toolbar { padding-block:0; }
:is(#overlay,#personalOverlay) .panel-toolbar :is(#dismiss,#dismissPersonal) { width:44px; height:44px; }
:is(#overlay,#personalOverlay) .panel > h3 { font:700 1.2rem/1.2 Georgia,serif; letter-spacing:.01em; }
:is(#overlay,#personalOverlay) .panel .trainerCard header { min-height:42px; }
:is(#overlay,#personalOverlay) .trainerGrid { gap:var(--ui-gap); }
:is(#overlay,#personalOverlay) .panel .balance { border-radius:var(--ui-radius); }
:is(#overlay,#personalOverlay) .panel :is(button,.slot,.pcSlot) { border-radius:7px; }
.facility-screen {
  gap:var(--ui-gap); padding:8px;
  background:radial-gradient(ellipse at 0 0,var(--raised),var(--surface) 60%);
}
.facility-screen .npc-portrait {
  height:100%; max-height:none; margin:0;
  background:linear-gradient(155deg,var(--raised),var(--surface));
}
.facility-list:is(.healing-team,.gym-team) {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  align-content:start; gap:var(--ui-gap);
}
.facility-list:is(.healing-team,.gym-team) .facility-mon {
  display:grid; grid-template-columns:minmax(0,1fr); justify-items:center;
  min-width:0; min-height:120px; margin:0; padding:8px; text-align:center;
  background:linear-gradient(155deg,var(--raised),var(--surface));
}
.facility-list .facility-mon > div { width:100%; min-width:0; overflow-wrap:anywhere; }
.facility-list .facility-mon.vacant {
  border-style:dashed;
  background:color-mix(in srgb,var(--raised) 42%,var(--surface));
}
.facility-mon .fighter { height:50px; width:50px; }
.catalog button { min-height:44px; }
.console { background:#122a2e; }
.console .moves button { border-radius:7px; }
.battleTabs button[aria-pressed="true"] { border-bottom:2px solid #edcc89; }
@media(max-width:650px){
  .facility-screen aside:not(:has(h2)) { display:none; }
  .facility-screen { grid-template-rows:minmax(0,1fr) auto; }
  .facility-list:is(.healing-team,.gym-team) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .facility-list:is(.healing-team,.gym-team) .facility-mon { min-height:94px; }
}
.facility-screen:is([data-theme="center"],[data-theme="gym"],[data-theme="post"]) {
  background:
    linear-gradient(115deg, color-mix(in srgb,var(--surface) 91%,transparent), var(--surface)),
    url("scenes/city-pixel.png") center / cover;
}
.facility-screen:is([data-theme="center"],[data-theme="gym"]) .facility-body { justify-content:center; }
.facility-screen:is([data-theme="center"],[data-theme="gym"]) aside { align-self:center; }
.facility-screen:is([data-theme="center"],[data-theme="gym"]) .npc-portrait {
  height:auto; aspect-ratio:4/5; max-height:min(400px,55dvh);
}
.facility-list:is(.healing-team,.gym-team) {
  width:min(100%, 760px); max-height:100%; margin-inline:auto;
}
.facility-list.gym-team { grid-template-columns:repeat(2,minmax(0,1fr)); width:min(100%, 520px); }
.facility-list:is(.healing-team,.gym-team) .facility-mon {
  border-radius:12px;
  box-shadow:inset 0 1px #fff1dd15;
}
.facility-list .facility-mon.vacant { box-shadow:inset 0 0 0 4px #0f11121a; }
:is(#overlay,#personalOverlay) .panel-toolbar :is(#dismiss,#dismissPersonal):focus-visible { outline-offset:-3px; }
:is(#overlay,#personalOverlay) .panel details > summary { padding-block:5px; cursor:pointer; }
:is(#overlay,#personalOverlay) .panel :is(.btnline,.pcNav) > button { flex-shrink:0; }

#personalOverlay { z-index: 10; }

.capture-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: #10243b24;
}
.capture-ball {
  position: absolute;
  left: var(--capture-x);
  top: var(--capture-y);
  width: clamp(34px, 5vw, 54px);
  aspect-ratio: 1;
  margin: 0;
  translate: -50% -50%;
  transform-origin: 50% 85%;
  z-index: 1;
}
.capture-ball span,
.capture-ball img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.capture-ball span {
  transition: transform .13s ease-out;
}
.capture-ball span:first-child img { clip-path: inset(0 0 50% 0); }
.capture-ball span:last-child img { clip-path: inset(50% 0 0 0); }
.capture-ball.open span:first-child { transform: translateY(-21%) rotate(-25deg); }
.capture-ball.open span:last-child { transform: translateY(10%); }
.capture-flash {
  position: absolute;
  left: var(--capture-x);
  top: var(--capture-y);
  translate: -50% -50%;
  width: clamp(85px, 16vw, 190px);
  aspect-ratio: 1;
  opacity: 0;
  background: radial-gradient(circle, #fff 4%, #fffbc8 14%, #ffd86ca8 30%, transparent 68%);
}
.capture-stars {
  position: absolute;
  left: var(--capture-x);
  opacity: 0;
  color: #fff19d;
  text-shadow: 0 0 14px #ffd154;
  font-size: clamp(20px, 4vw, 42px);
  white-space: nowrap;
}
.capture-stars b { vertical-align: .45em; }
.capture-result {
  position: absolute;
  left: 50%;
  bottom: max(24%, 48px);
  transform: translateX(-50%);
  padding: 8px 16px;
  color: #fff2c6;
  background: #182c42;
  border: 1px solid #d5b875;
  border-radius: 8px;
  white-space: nowrap;
}

#arena {
  --battle-console-height: clamp(190px, 30dvh, 258px);
}
.field {
  inset: 0 0 var(--battle-console-height, 0px);
  background-size: cover;
  background-position: center;
}
.arenaTitle {
  max-width: calc(100vw - 112px);
  background: #143139f2;
  border: 1px solid #cfb374;
  color: #ffe4aa;
  font-weight: 700;
}
.unit.own { left: 24%; top: 87%; }
.unit.foe { left: 69%; top: 63%; }
.unit { height: 36%; }
.vitals {
  bottom: auto;
  width: min(33%, 245px);
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #cbb17a;
  background: #102d34f5;
  color: #fbebc9;
}
.foe-hud { left: clamp(12px, 6vw, 90px); top: max(64px, 14%); }
.own-hud { right: clamp(12px, 6vw, 90px); bottom: 9%; }
.vitals-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
}
.vitals-heading strong { font-size: clamp(13px, 1.8vw, 19px); overflow-wrap: anywhere; }
.vitals-heading > span { color: #ebd09d; white-space: nowrap; }
.vitals .bars {
  margin: 5px 0 0;
  gap: 6px;
  color: #e7eae0;
  font-variant-numeric: tabular-nums;
}
.vitals .bars progress { min-width: 0; accent-color: #6cc985; }
.vitals .bars .xp { accent-color: #81c9ed; }
.vitals .combatStatus {
  position: static;
  display: inline-block;
  margin-top: 3px;
  padding: 2px 5px;
  font: 600 10px system-ui;
}
.console {
  height: var(--battle-console-height);
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.6fr);
  gap: 14px;
  padding: 12px clamp(12px, 4vw, 60px) max(12px, env(safe-area-inset-bottom));
  border-top: 2px solid #c3ab72;
  border-radius: 0;
  background: #122c32;
}
.console .message {
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid #547c79;
  border-radius: 8px;
  background: #0e242b;
  color: #fff0d0;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.4;
}
.battle-controls {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.battleTabs {
  flex: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 0 7px;
}
.console .battleTabs button {
  min-height: 33px;
  padding: 4px 11px;
  background: #21454c;
  color: #f3e6c7;
  white-space: nowrap;
}
.console .battleTabs button[aria-pressed="true"] {
  background: #356263;
  border-bottom-color: #f0cc80;
}
.console .moves {
  min-height: 0;
  overflow: auto;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
.console .moves p { grid-column: 1 / -1; margin: 6px 0; }
.console .moves button {
  min-width: 0;
  min-height: 40px;
  padding: 5px 9px;
  overflow-wrap: anywhere;
  border: 1px solid #527e78;
  background: #244b50;
  color: #fff1d2;
}
.console .moves .battle-move {
  --move-color: #b4bcc8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  border-color: color-mix(in srgb, var(--move-color) 70%, #192530);
  background: color-mix(in srgb, var(--move-color) 38%, #17242b);
  color: #fff;
  text-align: start;
}
.console .moves .battle-move:hover,
.console .moves .battle-move:focus-visible {
  background: color-mix(in srgb, var(--move-color) 50%, #17242b);
}
.battle-move span { color: #fff; font-size: 11px; white-space: nowrap; }
.console .moves .battle-move[data-type="Fire"] { --move-color: #ff754b; }
.console .moves .battle-move[data-type="Water"] { --move-color: #5f9dff; }
.console .moves .battle-move[data-type="Electric"] { --move-color: #f5d044; }
.console .moves .battle-move[data-type="Grass"] { --move-color: #73c971; }
.console .moves .battle-move[data-type="Ice"] { --move-color: #79e1ea; }
.console .moves .battle-move[data-type="Fighting"] { --move-color: #da4e51; }
.console .moves .battle-move[data-type="Poison"] { --move-color: #b969cb; }
.console .moves .battle-move[data-type="Ground"] { --move-color: #d39861; }
.console .moves .battle-move[data-type="Flying"] { --move-color: #a2a8f1; }
.console .moves .battle-move[data-type="Psychic"] { --move-color: #ff6d9e; }
.console .moves .battle-move[data-type="Bug"] { --move-color: #b1c34e; }
.console .moves .battle-move[data-type="Rock"] { --move-color: #a9925a; }
.console .moves .battle-move[data-type="Ghost"] { --move-color: #8266a9; }
.console .moves .battle-move[data-type="Dragon"] { --move-color: #7764f4; }
.console .moves .battle-move[data-type="Dark"] { --move-color: #846c64; }
.console .moves .battle-move[data-type="Steel"] { --move-color: #829ca9; }
.console .moves .battle-move[data-type="Fairy"] { --move-color: #f0a8de; }
.battle-move-tooltip {
  position: absolute;
  z-index: 4;
  right: clamp(10px, 4vw, 60px);
  bottom: calc(var(--battle-console-height, 0px) + 8px);
  max-width: calc(100% - 20px);
  padding: 8px 12px;
  border: 1px solid #cfb374;
  border-radius: 7px;
  background: #10262ef5;
  color: #fff3d0;
  font-size: .85rem;
  pointer-events: none;
}
#game:has(#overlay.visit:not([hidden])) #partyRail {
  z-index: 9;
}
@media (max-width: 650px) {
  #arena { --battle-console-height: clamp(176px, 34dvh, 230px); }
  .console { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(38px, auto) minmax(0, 1fr); gap: 7px; padding: 7px 9px; }
  .console .message { padding: 5px 9px; max-height: 56px; }
  .vitals { width: min(42%, 190px); padding: 6px 8px; }
  .field { background-size: 100% 100%; }
  .unit { width: min(34vw, 175px); }
  .own-hud { bottom: 6%; }
}
@media (max-height: 430px) {
  #partyRail { --slot-height: 25px; }
  #arena { --battle-console-height: 44dvh; }
  .foe-hud { top: 48px; }
}

#overlay.widePhase:not([hidden]) + #personalOverlay {
  z-index: 13;
}
.widePhase #content {
  width: min(100%, 1350px);
  margin: 0 auto;
}
.trainerGrid {
  grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr));
  align-items: start;
}
.trainerCard header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
}
.trainerCard header strong { overflow-wrap: anywhere; }
.trainerCard header b { font-size: .84rem; white-space: nowrap; }
.summary-avatar {
  width: 30px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.trainerCard .cardScroll {
  height: auto;
  max-height: min(53dvh, 420px);
}
.summary-mons {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px;
  display: grid;
  gap: 4px;
}
.summary-mons .cardMon {
  padding: 4px 6px;
  border-radius: 6px;
  background: #102b29;
}
.summary-mons .cardMon .monToken { width: 46px; height: 42px; flex: 0 0 46px; }
.summary-mons .cardMon img { width: 100%; height: 100%; object-fit: contain; }
.summary-mons .cardMon div { min-width: 0; }
.summary-mons .cardMon strong { display: block; overflow-wrap: anywhere; }
.summary-mons .cardMon div small { font-variant-numeric: tabular-nums; }
.trainerCard details { border-top: 1px solid #718e785c; margin-top: 5px; }
.summary-empty { margin: 5px 0 9px; font-size: .85rem; color: #c4d1bd; }
.summary-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }

.shop-cart {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--raised);
}
.shop-cart :is(h3, p) { margin: 0; }
.shop-cart-lines {
  min-height: 0;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}
.shop-cart-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--edge);
  overflow-wrap: anywhere;
}
.shop-cart-lines small { display: block; }
.shop-cart-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.shop-cart-totals strong { margin-left: auto; }
.shop-cart-lines button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--ink);
}

#moveLesson {
  width: min(460px, calc(100% - 28px));
  padding: 18px;
  border: 1px solid #b59d68;
  border-radius: 12px;
  color: #f8ecd0;
  background: #142f29;
}
#moveLesson::backdrop { background: #0b1f24b8; }
#moveLesson h2 { margin-top: 0; color: #f3d69c; }
#moveLesson p { line-height: 1.45; }
.move-lesson-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
#moveLesson button {
  min-height: 44px;
  padding: 7px 9px;
  overflow-wrap: anywhere;
  border: 1px solid #708e7b;
  background: #244a3e;
  color: #fff0cd;
}
#moveLesson button:hover { background: #345c4b; }
#moveLesson footer { margin-top: 12px; text-align: right; }
@media (max-width: 360px) {
  .move-lesson-options { grid-template-columns: minmax(0, 1fr); }
}

#evolutionScene {
  width: min(520px, calc(100% - 24px));
  overflow: hidden;
  padding: 14px 16px 16px;
  border: 1px solid #a4c0bb;
  border-radius: 12px;
  background: #142e37;
  color: #fff0c6;
  text-align: center;
}
#evolutionScene::backdrop { background: #081821db; }
#evolutionScene h2 { margin: 12px 0; font-size: clamp(18px, 4vw, 26px); }
#evolutionScene button {
  min-height: 42px;
  padding-inline: 18px;
  border: 1px solid #f5deb0;
  background: #f4d78f;
  color: #183038;
}
.evolution-backdrop {
  position: relative;
  display: grid;
  place-items: center;
  height: min(42dvh, 270px);
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 60%, #409584, #204850 51%, #0e2332 86%);
}
.evolution-backdrop > div {
  position: absolute;
  grid-area: 1 / 1;
}
.evolution-before,
.evolution-after {
  width: min(52%, 190px);
  height: 85%;
}
.evolution-backdrop .fighter {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.evolution-after { opacity: 0; }
.evolution-ring {
  width: min(70%, 270px);
  height: 24%;
  bottom: 12%;
  border: 2px solid #c7fff1;
  border-radius: 50%;
  box-shadow: 0 0 15px #82f4d999, inset 0 0 14px #56d9c3aa;
  opacity: .55;
}
.evolution-flash {
  width: 100%;
  height: 100%;
  z-index: 2;
  background: radial-gradient(circle, #fff 10%, #d4fff6 36%, #96ffdb55 65%, transparent 80%);
  opacity: 0;
}
.evolving .evolution-before {
  animation: evolution-charge var(--evolution-duration) ease-in forwards;
}
.evolving .evolution-ring {
  animation: evolution-ring var(--evolution-duration) ease-in forwards;
}
.evolving .evolution-flash {
  animation: evolution-flash var(--evolution-duration) ease-in forwards;
}
.evolved .evolution-before { opacity: 0; }
.evolved .evolution-after {
  opacity: 1;
  animation: evolution-reveal .45s ease-out;
}
@keyframes evolution-charge {
  0%, 20% { filter: none; transform: scale(1); }
  35%, 58% { filter: brightness(0) invert(1) drop-shadow(0 0 12px #9ffbe9); transform: scale(1.1); }
  47%, 68% { filter: brightness(1.55); transform: scale(.95); }
  84%, 100% { filter: brightness(0) invert(1); transform: scale(1.2); }
}
@keyframes evolution-ring {
  0% { transform: scale(.85); opacity: .45; }
  72% { transform: scale(1.4); opacity: .95; }
  100% { transform: scale(2); opacity: .4; }
}
@keyframes evolution-flash {
  0%, 58% { opacity: 0; }
  74% { opacity: .4; }
  80% { opacity: .2; }
  100% { opacity: 1; }
}
@keyframes evolution-reveal {
  from { filter: brightness(1.85) drop-shadow(0 0 18px #bcffef); transform: scale(1.12); }
  to { filter: none; transform: scale(1); }
}
#minigameScreen,#roundDraw { position:fixed; inset:0; overflow:auto; }
#minigameScreen {
  z-index:24; display:grid; place-items:center; padding:clamp(12px,3vw,36px);
  color:#f6eedf; background:linear-gradient(120deg,#142728f5,#253838e8),
    url("scenes/city-pixel.png") center/cover;
}
#minigameScreen[data-game="auction"] {
  background:linear-gradient(120deg,#19192cf5,#33304be8),url("scenes/city-pixel.png") center/cover;
}
#minigameScreen[data-game="darkAuction"] { background:radial-gradient(ellipse at 50% 18%, #332943, #111321 74%); }
.auction-silhouette .fighter { filter:brightness(0) blur(1.7px); }
.auction-lot.auction-silhouette { background:radial-gradient(ellipse, #b8a5bc, #52405c 64%, #302739); }
#auctionClock { float:right; font-variant-numeric:tabular-nums; }
.auction-summary { width:min(100%, 600px); margin:auto; }
.auction-purchase { display:grid; grid-template-columns:52px 1fr auto; gap:8px; align-items:center; }
.auction-purchase .fighter { position:static; transform:none; animation:none; width:48px; height:48px; object-fit:contain; }
#minigameScreen[data-game="wires"] {
  background:radial-gradient(ellipse at 50% 0%, #253930, #101820 66%);
}
#minigameScreen[data-game="guess"] {
  background:radial-gradient(ellipse at 50% 0%, #4a3452, #1d192d 70%);
}
.pair-mini {
  width:min(100%, 670px);
  margin:auto;
  padding:clamp(12px,3vw,24px);
  border:1px solid #927b56;
  border-radius:14px;
  background:#172333;
  box-shadow:0 14px 42px #0005;
}
.pair-status,.pair-results li { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.pair-status { padding-bottom:9px; border-bottom:1px solid #ffffff24; color:#ebdec2; }
#pairClock { color:#edca7f; font-size:1.35rem; font-variant-numeric:tabular-nums; }
#pairClock.urgent { color:#ffa5a1; }
.pair-mini h3 { margin:8px 0; color:#ffe2a2; font-size:clamp(1.2rem,4vw,1.55rem); }
.pair-pokemon { display:grid; place-items:center; height:90px; }
.pair-pokemon .fighter {
  position:static; transform:none; animation:none;
  width:110px; height:86px; object-fit:contain;
}
.pair-live .fighter { filter:drop-shadow(0 0 12px #e9de83a0); }
.pair-progress { color:#bfe9c7; margin:0 0 8px; }
.wire-board {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:3px;
  padding:7px 3px;
  background:linear-gradient(#242e3b,#121921);
  border:1px solid #88939b;
  border-radius:8px;
}
.wire-slot { min-width:0; text-align:center; }
#minigameScreen .wire-slot button {
  position:relative;
  display:block;
  width:100%;
  height:clamp(74px,18dvh,120px);
  border:1px solid transparent;
  background:#10141c;
}
#minigameScreen .wire-slot button:hover,#minigameScreen .wire-slot button:focus-visible {
  border-color:var(--wire);
}
.wire-slot button i {
  position:absolute;
  top:11%;
  bottom:20%;
  left:50%;
  width:var(--thickness);
  transform:translateX(-50%);
  border-radius:9px;
  background:var(--wire);
  box-shadow:0 0 8px var(--wire);
}
.wire-slot button span { position:absolute; bottom:1px; inset-inline:0; font-size:.7rem; }
.wire-slot small { display:block; padding-top:3px; font-size:clamp(.55rem,2.1vw,.74rem); overflow-wrap:anywhere; }
.wire-cut button i {
  transform:translateX(-50%) rotate(-7deg);
  background:linear-gradient(var(--wire) 38%,transparent 38% 63%,var(--wire) 63%);
  box-shadow:none;
  animation:wire-sever .34s ease-out;
}
@keyframes wire-sever { from { opacity:.35; transform:translateX(-50%) rotate(14deg); } }
.wire-checklist,.pair-messages { padding-inline-start:24px; }
.wire-checklist li,.pair-messages li { margin-bottom:7px; padding:8px; border-radius:6px; background:#ffffff0d; }
.wire-checklist li[data-step="current"] { border:1px solid #ddba6a; }
.wire-checklist li[data-step="done"] { color:#a8e8b3; }
.wire-checklist button { display:block; margin-top:6px; }
.pair-results { list-style:none; padding:0; }
.pair-results li { padding:7px; border-bottom:1px solid #ffffff24; }
.pair-shock { animation:pair-shock .42s ease-out both; }
@keyframes pair-shock {
  0% { transform:translateX(-3px); box-shadow:0 0 18px #fff092; }
  35% { transform:translateX(4px); box-shadow:0 0 10px #fff092; }
  65% { transform:translateX(-3px); }
}
.paper-field {
  position:relative;
  height:clamp(125px,28dvh,225px);
  overflow:hidden;
  border:1px solid #9d82a1;
  border-radius:10px;
  background:radial-gradient(ellipse at 75% 10%, #593d64, #292942 72%);
}
.paper-field > i {
  position:absolute; inset:22% 4% auto; height:29%;
  border-top:1px dashed #d5b3d651; border-radius:50%;
  transform:rotate(-11deg); pointer-events:none;
}
.paper-field > i:nth-child(2) { top:68%; transform:rotate(8deg); }
.paper-flight { position:absolute; animation:paper-flight 3.8s var(--paper-delay) infinite ease-in-out alternate; }
#minigameScreen .flying-paper {
  width:84px;
  padding:4px;
  line-height:1.1;
  color:#30243a;
  background:#f5e4ba;
  border-color:#bc9c69;
  box-shadow:2px 4px 0 #362c51;
}
@keyframes paper-flight {
  0% { top:14%; left:5%; transform:rotate(-11deg); }
  40% { top:57%; left:36%; transform:rotate(11deg); }
  69% { top:11%; left:55%; transform:rotate(-7deg); }
  100% { top:43%; left:calc(100% - 92px); transform:rotate(12deg); }
}
.paper-flight:focus-within { animation-play-state:paused; }
.butterfree-grove {
  --ribbon:clamp(112px,24vw,154px);
  position:relative;
  min-height:clamp(305px,48dvh,440px);
  overflow:hidden;
  border:1px solid #a4b788;
  border-radius:12px;
  background:linear-gradient(#17263048,#0c2b21bb),url("scenes/floresta-pixel.png") center/cover;
}
.butterfree-flight {
  position:absolute;
  width:var(--ribbon);
  animation:butterfree-flight var(--speed) var(--phase) ease-in-out infinite alternate;
}
.butterfree-flight[data-course="1"] { animation-direction:alternate-reverse; }
.butterfree-flight[data-course="2"] { animation-name:butterfree-cross; }
.butterfree-flight[data-course="3"] { animation-name:butterfree-cross; animation-direction:alternate-reverse; }
.butterfree-flight:hover { z-index:2; }
.butterfree-flight:focus-within { z-index:3; }
#minigameScreen .butterfree-clue {
  display:grid;
  justify-items:center;
  width:100%;
  padding:0;
  border-color:transparent;
  background:none;
}
.butterfree-sprite {
  width:54px;
  height:46px;
  object-fit:contain;
  image-rendering:pixelated;
  pointer-events:none;
}
.butterfree-clue > span {
  padding:4px 7px;
  border:1px solid #b7a382;
  border-radius:4px;
  background:#f1e5ca;
  color:#292323;
  font-size:.72rem;
  line-height:1.18;
  box-shadow:0 2px 4px #0008;
}
.butterfree-caught .butterfree-sprite { width:38px; height:36px; vertical-align:middle; margin-inline-end:6px; }
@keyframes butterfree-flight {
  0% { left:3%; top:12%; transform:rotate(-8deg); }
  35% { left:calc((100% - var(--ribbon)) * .42); top:55%; transform:rotate(7deg); }
  68% { left:calc((100% - var(--ribbon)) * .69); top:19%; transform:rotate(-5deg); }
  100% { left:calc(98% - var(--ribbon)); top:53%; transform:rotate(8deg); }
}
@keyframes butterfree-cross {
  0% { left:calc(98% - var(--ribbon)); top:8%; transform:rotate(10deg); }
  42% { left:calc((100% - var(--ribbon)) * .6); top:58%; transform:rotate(-9deg); }
  72% { left:calc((100% - var(--ribbon)) * .21); top:33%; transform:rotate(8deg); }
  100% { left:2%; top:58%; transform:rotate(-7deg); }
}
@media(prefers-reduced-motion:reduce) {
  .butterfree-grove { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:8px; padding:8px; }
  .butterfree-flight { position:static; width:auto; animation:none; }
}
#pairGuessForm > div { display:flex; flex-wrap:wrap; gap:8px; }
#pairGuessName { flex:1; min-width:min(100%, 180px); }
@media(prefers-reduced-motion:reduce) {
  .wire-cut button i,.pair-shock,.paper-flight { animation:none; }
  .paper-flight { top:38%; left:calc(50% - 42px); }
}
#minigameScreen[hidden],#roundDraw[hidden] { display:none; }
.mini-shell { width:min(100%,860px); }
.mini-heading { text-align:center; margin-bottom:18px; }
.mini-heading > span,.auction-price small {
  color:#f1cc85; font:700 .75rem/1.4 system-ui; letter-spacing:.1em; text-transform:uppercase;
}
.mini-heading h2,.draw-card h2 {
  color:#ffe4ab; font:700 clamp(1.6rem,4vw,2.7rem)/1.12 Georgia,serif; margin:4px 0;
}
.market-ticket,.mini-result,.auction-board,.auction-lot {
  background:#1e2437; border:1px solid #8b806a; border-radius:12px;
  padding:clamp(12px,2vw,22px);
}
.market-ticket,.mini-result { width:min(100%,380px); margin:auto; text-align:center; }
.market-question { padding:10px 0; border-bottom:1px solid #ffffff2b; margin-bottom:10px; }
.market-question strong,.auction-price strong { color:#ffdfa3; font:700 clamp(2rem,6vw,3.6rem)/1 Georgia,serif; }
.auction-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:12px; }
.auction-lot {
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:7px;
  background:radial-gradient(ellipse,#494164,#222237 75%);
}
.auction-lot .fighter { position:static; transform:none; animation:none; width:clamp(110px,24vw,210px); height:clamp(100px,20vw,175px); object-fit:contain; }
.auction-lot strong { font:700 1.4rem Georgia,serif; }
.auction-price { display:grid; gap:6px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid #ffffff2b; }
.auction-players { display:grid; gap:4px; }
.auction-players > div { display:flex; justify-content:space-between; gap:8px; padding:5px 8px; background:#ffffff09; border-radius:4px; }
.auction-players span,.auction-lot span { color:#d7cde3; }
.auction-actions { display:flex; align-items:end; flex-wrap:wrap; gap:6px 8px; margin-top:12px; }
.auction-actions label { flex:1; min-width:95px; margin:0; }
.auction-actions > strong { width:100%; }
#minigameScreen label { color:#f6eedf; }
#minigameScreen input { color:#172635; background:#fff9eb; }
#minigameScreen button { min-height:42px; border:1px solid #9b8c71; background:#30384d; color:#f6eedf; border-radius:7px; }
#minigameScreen button.primary { background:#f1d49b; color:#222b38; }
#minigameScreen button:hover { filter:brightness(1.12); }
#roundDraw {
  display:grid; place-items:center; z-index:29; padding:12px;
  color:#f8ecd7; background:#111a29ed; text-align:center;
}
.draw-card { width:min(100%,480px); padding:18px; background:#222c40; border:1px solid #b49866; border-radius:12px; }
.draw-reel { height:2rem; overflow:hidden; animation:reel-out 1.15s both; }
.draw-reel div { animation:reel-spin .16s linear infinite alternate; }
.draw-reel span { display:block; min-height:2rem; }
.pair-reveal { display:block; animation:draw-in .38s 1.1s both; }
.roulette-card {
  padding:clamp(14px,4vw,28px);
  background:radial-gradient(ellipse at 50% 40%, #303b52, #1a2232 75%);
  box-shadow:0 18px 60px #0007;
}
.roulette {
  position:relative;
  width:min(100%, 310px, 56vh);
  aspect-ratio:1;
  margin:24px auto 16px;
}
.roulette-wheel {
  position:absolute;
  inset:0;
  overflow:hidden;
  border:5px solid #e3bd7c;
  border-radius:50%;
  background:conic-gradient(from -45deg, #1c5c47 0deg 90deg, #753d5a 90deg 180deg, #285573 180deg 270deg, #79521f 270deg);
  box-shadow:0 0 0 4px #152035, inset 0 0 22px #080e1d70;
  transform:rotate(var(--stop));
  animation:roulette-spin var(--spin-duration) cubic-bezier(.17,.78,.22,1) both;
}
.roulette-sector { position:absolute; inset:0; transform:rotate(var(--angle)); }
.roulette-sector span {
  position:absolute;
  top:18%;
  left:50%;
  width:46%;
  transform:translateX(-50%);
  font-size:clamp(.75rem,3vw,1rem);
  font-weight:750;
  line-height:1.15;
  text-wrap:balance;
}
.roulette-pointer {
  position:absolute;
  z-index:1;
  top:-11px;
  left:50%;
  width:25px;
  height:27px;
  transform:translateX(-50%);
  background:#ffdfa3;
  clip-path:polygon(0 0,100% 0,50% 100%);
}
.roulette-hub {
  position:absolute;
  inset:43%;
  border:3px solid #f6d696;
  border-radius:50%;
  background:radial-gradient(circle at 35% 25%, #ffdfa3, #a9763f 75%);
  box-shadow:0 2px 8px #0008;
}
.roulette-result { min-height:2.5rem; display:grid; place-items:center; }
.roulette-settled .roulette-wheel { box-shadow:0 0 0 4px #152035, 0 0 28px #ffd89260; }
.roulette-settled .roulette-result {
  color:#ffdfa3;
  font-size:clamp(1.1rem,4vw,1.5rem);
  font-weight:750;
  animation:draw-in .35s both;
}
.million-board {
  width:min(100%, 660px);
  margin:0 auto;
  padding:clamp(14px, 4vw, 28px);
  border:1px solid #9b8054;
  border-radius:14px;
  background:#202b40;
}
.million-board h3 { margin:12px 0 18px; color:#ffe5b3; font-size:clamp(1.2rem,4vw,1.65rem); }
.million-status { display:flex; justify-content:space-between; gap:12px; color:#f1d49b; }
#millionClock { font-weight:750; font-variant-numeric:tabular-nums; }
.million-choices { display:grid; gap:8px; }
#minigameScreen[data-game="pokemonQuiz"] .million-choices {
  grid-template-columns:repeat(auto-fit,minmax(min(100%, 125px),1fr));
}
#minigameScreen[data-game="pokemonQuiz"] .million-choices button {
  padding:5px 8px;
  overflow-wrap:anywhere;
}
.pokemon-quiz-stage {
  position:relative;
  width:min(100%, 220px, 34dvh);
  aspect-ratio:1;
  margin:10px auto 14px;
  overflow:hidden;
  border:1px solid #f5bd83;
  border-radius:50%;
  background:radial-gradient(circle, #ffe7a9 0%, #f2a761 66%, #bd624c 100%);
}
.pokemon-quiz-art {
  position:absolute;
  inset:20%;
  transform:rotate(var(--angle)) scale(var(--flip-x), var(--flip-y));
}
.pokemon-quiz-art .fighter,.pokemon-quiz-answer .fighter {
  position:static;
  width:100%;
  height:100%;
  object-fit:contain;
  animation:none;
  transform:none;
}
.pokemon-quiz-art .fighter { filter:brightness(0); }
.pokemon-quiz-stage > i {
  position:absolute;
  left:var(--x);
  top:var(--y);
  width:var(--size);
  aspect-ratio:1.35;
  transform:translate(-50%,-50%) rotate(var(--tilt));
  border-radius:49% 51% 37% 63% / 57% 32% 68% 43%;
  background:#090607;
}
.pokemon-quiz-answer { display:inline-block; width:44px; height:44px; margin-inline-end:6px; vertical-align:middle; }
#minigameScreen .million-choices button { padding:9px 14px; text-align:left; }
.million-ranking { padding-inline-start:2.2rem; }
.million-ranking li { padding:8px; border-bottom:1px solid #ffffff25; }
.million-ranking li > span { margin-inline:8px; }
.million-ranking li > b { color:#ffe5b3; }
.million-you { background:#ffffff12; }
.million-board details { margin:16px 0; }
.million-board summary { cursor:pointer; }
.million-board details li { margin-block:8px; }
.million-reveal { width:min(100%, 880px); }
.million-check { min-height:3em; color:#ffe5b3; font-weight:700; }
.million-players {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%, 112px),1fr));
  gap:8px;
  margin-bottom:14px;
}
.million-player {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:4px;
  min-width:0;
  padding:6px;
  border:1px solid #ffffff22;
  border-radius:8px;
  background:#172234;
}
.million-character,.million-player > strong { grid-column:1 / -1; }
.million-player > strong,.million-ranking strong { overflow-wrap:anywhere; }
.million-character { position:relative; display:grid; place-items:center; }
.million-avatar { width:48px; height:48px; object-fit:contain; image-rendering:pixelated; }
.million-stamp {
  position:absolute;
  top:55%;
  left:50%;
  transform:translate(-50%,-50%) rotate(-8deg);
  border:2px solid currentColor;
  border-radius:4px;
  padding:2px 4px;
  background:#441820;
  color:#ffacaa;
  font-size:.65rem;
  font-weight:900;
  white-space:nowrap;
}
.million-stamp[data-correct="true"] { background:#103c24; color:#a8f7a8; }
.million-progress { display:block; height:8px; overflow:hidden; border-radius:9px; background:#ffffff20; }
.million-progress i { display:block; height:100%; background:#73dc99; transition:width .32s ease-out; }
.million-score { font-size:.8rem; font-variant-numeric:tabular-nums; }
.million-ranking li { list-style-position:outside; }
.million-ranking li > .million-avatar { width:34px; height:34px; vertical-align:middle; margin-inline-end:6px; }
.million-ranking li > .million-progress { display:inline-block; width:clamp(36px,13vw,100px); margin-inline-start:8px; }
@media(prefers-reduced-motion:reduce) {
  .million-progress i { transition:none; }
}
@keyframes roulette-spin { from { transform:rotate(-18deg); } to { transform:rotate(var(--stop)); } }
.pair-reveal p { display:grid; grid-template-columns:1fr 2rem 1fr; align-items:center; gap:8px; margin-top:6px; padding:6px; background:#ffffff0c; border-radius:5px; }
.pair-reveal span { color:#ffdfa3; font-size:.72rem; }
@keyframes reel-spin { to { transform:translateY(calc(-100% + 2rem)); } }
@keyframes reel-out { 85%{opacity:1} to{opacity:0;height:0} }
@keyframes draw-in { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@media(max-width:600px) {
  .auction-grid { grid-template-columns:1fr; }
  .auction-lot { padding:8px; }
}
@media(prefers-reduced-motion:reduce) {
  .draw-reel { display:none; }
  .pair-reveal,.roulette-wheel,.roulette-settled .roulette-result { animation:none; }
}
#game:has(#minigameScreen:not([hidden])) :is(#dock,#map,#gameHead,#partyRail,#personalOverlay),
body:has(#minigameScreen:not([hidden])) .system { visibility:hidden; }


#finalScoreboard {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: auto;
  color: #f5efde;
  background:
    radial-gradient(ellipse at 50% 0%, #27534b 0%, transparent 58%),
    linear-gradient(155deg, #122e32, #081b27 82%);
  animation: results-darken .7s ease-out both;
}
#finalScoreboard[hidden] { display: none; }
#game:has(#finalScoreboard:not([hidden])) :is(#gameHead, #partyRail, #dock) {
  visibility: hidden;
}
body:has(#finalScoreboard:not([hidden])) .system { z-index: 36; }
.results-layout {
  width: min(100%, 1220px);
  margin-inline: auto;
  padding: clamp(26px, 6dvh, 60px) clamp(12px, 4vw, 36px) 24px;
  animation: results-arrive .4s .62s both ease-out;
}
.results-heading {
  margin: 0 auto 18px;
  padding-inline: 12px;
  text-align: center;
}
.results-heading h1 {
  margin: 0;
  color: #fff1c9;
  font: 700 clamp(26px, 5vw, 52px)/1.1 Georgia, serif;
  text-wrap: balance;
}
.results-current {
  min-height: 62px;
  margin-top: 13px;
  color: #bde3d8;
}
.results-current h2 {
  margin: 0 0 4px;
  color: #f8daa0;
  font-size: clamp(18px, 3vw, 26px);
  text-wrap: balance;
  animation: results-arrive .3s ease-out both;
}
.results-current p { margin: 0; color: #d9e9de; }
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(238px, 100%), 1fr));
  align-items: start;
  gap: 12px;
  margin-inline: auto;
}
.results-grid:not(:has(.results-trainer:nth-child(3))) { max-width: 720px; }
.results-trainer {
  min-width: 0;
  padding: 12px;
  border: 1px solid #507b74;
  border-radius: 12px;
  background: linear-gradient(148deg, #234b48f5, #142e36f7);
  box-shadow: 0 6px 24px #06192577;
}
.results-trainer header {
  position: static;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
}
.results-trainer header:has(.results-rank:not([hidden])) {
  grid-template-columns: auto auto minmax(0, max-content) auto;
}
.results-trainer h2 {
  min-width: 0;
  margin: 0;
  font-size: clamp(13px, 1.6vw, 18px);
  overflow-wrap: anywhere;
}
.results-avatar {
  width: 39px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 8px;
  background: #10232cb0;
}
.results-total {
  display: grid;
  justify-items: end;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.results-total strong { font-size: clamp(21px, 3vw, 32px); color: #ffe0a0; }
.results-total small { margin-top: 3px; color: #c3d8cc; }
.results-categories:not(:has(.results-category:not([hidden]))) { display: none; }
.results-categories { margin-top: 10px; }
.results-category {
  --score-color: #78e4be;
  padding: 6px 0;
}
.results-category[data-score="riqueza"] { --score-color: #f4cd76; }
.results-category[data-score="liga"] { --score-color: #a2c7ff; }
.results-category:not([hidden]) { animation: results-arrive .28s ease-out both; }
.results-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 3px 9px;
  font-size: .87rem;
}
.results-row strong { color: var(--score-color); white-space: nowrap; font-variant-numeric: tabular-nums; }
.results-track {
  height: 9px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 8px;
  background: #081b23;
  box-shadow: inset 0 1px 3px #0008;
}
.results-track div {
  height: 100%;
  scale: 0 1;
  transform-origin: left;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--score-color) 46%, #274d54), var(--score-color));
}
.results-category > small:not([hidden]) { display: block; margin-top: 3px; color: #c4d9d0; }
.results-rank {
  padding: 4px 5px;
  border: 1px solid #648c86;
  border-radius: 5px;
  color: #dcefe5;
  font-weight: 700;
  font-size: .78rem;
}
.results-winner {
  border-color: #edcd82;
  background: radial-gradient(ellipse at top right, #67623d, transparent 66%), #254640;
  box-shadow: 0 0 0 1px #f1cb7770, 0 0 28px #e8bc6633;
  animation: results-champion .65s ease-out both;
}
.results-winner .results-rank { background: #f3d17c; border-color: #f3d17c; color: #262a24; }
.results-complete .results-current h2 { color: #ffe4a2; }
.results-footer:not([hidden]) { display: grid; justify-items: center; margin-top: 20px; }
.results-footer button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #ffe1a0;
  border-radius: 7px;
  background: #f3d17c;
  color: #172b2d;
}
@keyframes results-darken { from { opacity: 0; } to { opacity: 1; } }
@keyframes results-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes results-champion { 40% { box-shadow: 0 0 0 2px #f1cb7795, 0 0 42px #edbc686b; } }
@media (max-width: 550px) {
  .results-layout { padding-top: 62px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .results-trainer { padding: 7px; }
  .results-trainer header { gap: 4px; }
  .results-trainer header:has(.results-rank:not([hidden])) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .results-trainer .results-rank { grid-column: 1 / -1; justify-self: start; }
  .results-avatar { width: 29px; height: 36px; }
  .results-row, .results-category > small { font-size: .72rem; }
}
.mini-tutorial {
  width:min(100%,460px); margin:auto; display:grid; gap:12px;
  color:#fff1d5; background:#202c36; padding:16px; border:1px solid #a39170; border-radius:12px;
}
#minigameScreen[data-game="race"] {
  background:linear-gradient(135deg,#112b27f5,#193d33ed),url("scenes/campo-pixel.png") center/cover;
}
.race-track {
  position:relative; overflow:hidden;
  background:linear-gradient(#14352c88,#14352c88),url("scenes/campo-pixel.png") repeat-x center/auto 100%;
  border:1px solid #9d8b5a; border-radius:12px;
}
.race-lane {
  position:relative; height:clamp(39px,8dvh,64px); overflow:hidden;
  background:linear-gradient(transparent 65%,#b18e52aa 65%,#806741bb 90%,transparent 90%);
}
.race-lane + .race-lane { border-top:1px solid #ffeac02f; }
.runner-name { position:absolute; z-index:2; left:6px; top:3px; color:#fff0c7; background:#102721cf; padding:0 4px; border-radius:3px; font-size:.72rem; }
.race-runner { position:absolute; z-index:2; left:24%; bottom:12%; width:36px; height:36px; image-rendering:pixelated; transform:translateX(-50%); transition:transform .11s; }
.race-lane[data-pose="jump"] .race-runner { transform:translate(-50%,-20px); }
.race-lane[data-pose="duck"] .race-runner { transform:translateX(-50%) scaleY(.52); transform-origin:bottom; }
.race-lane.eliminated .race-runner { opacity:.28; filter:grayscale(1); }
.race-mark { position:absolute; left:24%; top:4px; bottom:4px; border-left:1px dashed #ffe0a0; opacity:.8; }
.race-obstacles { position:absolute; inset:0; pointer-events:none; }
.race-obstacle { position:absolute; transform:translateX(-50%); border:2px solid #40271b; border-radius:4px; }
.race-obstacle[data-type="jump"] { bottom:10%; height:16px; background:repeating-linear-gradient(90deg,#895333 0 8px,#653b27 8px 12px); }
.race-obstacle[data-type="duck"] { top:15%; height:12px; background:repeating-linear-gradient(125deg,#f5cd70 0 7px,#463629 7px 13px); }
#raceCountdown:not(:empty) { position:absolute; z-index:3; inset:0; display:grid; place-items:center; background:#10272168; color:#ffe5a4; font:700 clamp(2.5rem,12vw,5rem) Georgia,serif; pointer-events:none; }
.race-controls { display:flex; justify-content:center; gap:8px; margin-top:10px; }
.race-controls button { flex:0 1 150px; touch-action:manipulation; }

#minigameScreen[data-game="race"] { padding:clamp(8px,2vw,24px); }
#minigameScreen[data-game="race"] .mini-shell { width:min(100%,1500px); }
.race-track {
  --race-landscape:0px; --race-ground:0px;
  background:linear-gradient(180deg,#183c3225,#17342f91),
    url("scenes/campo-pixel.png") repeat-x var(--race-landscape) 43% / auto max(360px,120%);
  border:2px solid #b49863;
  box-shadow:0 12px 30px #071914ac, inset 0 0 0 2px #fff0b92b;
}
.race-lane {
  height:clamp(43px,10dvh,92px);
  background:
    repeating-linear-gradient(105deg,#f0cb8724 0 2px,transparent 2px 42px) var(--race-ground) 88% / auto 25% repeat-x,
    linear-gradient(transparent 62%,#6c5039de 63%,#aa8055ed 69%,#6c5039ed 94%,transparent 95%);
}
.race-lane + .race-lane { border-top-color:#ffe3a83d; }
.runner-name { left:8px; top:4px; padding:1px 5px; }
.race-runner {
  width:clamp(32px,6dvh,54px); height:clamp(32px,6dvh,54px); bottom:9%;
  filter:drop-shadow(0 4px 2px #211b167e);
}
.race-ready .race-lane:not(.eliminated)[data-pose=""] .race-runner {
  animation:race-stride .25s ease-in-out infinite alternate;
}
.race-lane[data-pose="jump"] .race-runner { animation:race-jump .36s cubic-bezier(.25,.72,.63,.95) both; }
.race-lane[data-pose="duck"] .race-runner { animation:race-duck .36s ease-out both; }
.race-obstacle { width:clamp(25px,5vw,62px); box-shadow:0 3px 4px #25160cb0; }
.race-obstacle[data-type="jump"] {
  height:clamp(13px,2.7dvh,23px);
  background:repeating-linear-gradient(8deg,#885332 0 4px,#ba7f4d 4px 6px);
  border-color:#593721; border-radius:5px 4px 6px 4px;
}
.race-obstacle[data-type="duck"] {
  top:10%; height:clamp(11px,2dvh,17px);
  background:repeating-linear-gradient(125deg,#f5cf74 0 8px,#50382b 8px 15px);
}
.race-mark { border-color:#fff0bb; opacity:.65; }
.hazard-near .race-mark { border-color:#ffe095; border-width:2px; opacity:1; box-shadow:0 0 8px #ffe095; }
.race-keys { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.race-keys > div { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:2px 8px; background:#304136; border:1px solid #829178; padding:8px; border-radius:7px; }
.race-keys kbd { grid-row:span 2; border:1px solid #c3ae79; border-radius:5px; padding:1px 6px; font:700 1.15rem system-ui; }
.race-keys span,.race-touch-hint { font-size:.82rem; color:#e2dbc5; }
@keyframes race-stride { from{transform:translate(-50%,0) rotate(-3deg)} to{transform:translate(-50%,-4px) rotate(3deg)} }
@keyframes race-jump { 0%,100%{transform:translate(-50%,0)} 35%,65%{transform:translate(-50%,clamp(-32px,-4dvh,-15px))} }
@keyframes race-duck { 0%,100%{transform:translateX(-50%)} 15%,85%{transform:translateX(-50%) scaleY(.55);transform-origin:bottom} }
@media(max-width:600px) { .race-lane { height:clamp(39px,8dvh,60px); } }
@media(prefers-reduced-motion:reduce) {
  .race-ready .race-runner { animation:none!important; }
}

#overlay.facility-full:has(.center-screen) > .panel-toolbar {
  position: absolute;
  z-index: 2;
  top: max(8px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  padding: 0;
  border: 0;
  background: transparent;
}
.center-screen {
  height: 100%;
  overflow: auto;
  padding: clamp(24px, 5dvh, 52px) clamp(14px, 4vw, 52px) 24px;
  color: #fff3eb;
  background:
    radial-gradient(ellipse at 50% 0%, #a0515d55, transparent 60%),
    linear-gradient(145deg, #321b2cf4, #261923ed),
    url("scenes/city-pixel.png") center / cover;
}
.center-heading, .center-layout, .center-work { width: min(100%, 1290px); margin-inline: auto; }
.center-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 32px 14px;
  margin-bottom: clamp(14px, 4dvh, 32px);
  border-bottom: 1px solid #e892a56e;
  text-align: center;
}
.center-heading h2 {
  margin: 0;
  color: #fff7ee;
  font: 700 clamp(24px, 4vw, 48px)/1.05 Georgia, serif;
  text-shadow: 0 0 24px #ed778f68;
}
.center-emblem {
  display: grid;
  flex: none;
  place-items: center;
  width: clamp(34px, 4vw, 52px);
  aspect-ratio: 1;
  border: 1px solid #ffd1cc;
  border-radius: 12px;
  background: linear-gradient(145deg, #d95775, #8d3652);
  box-shadow: 0 0 18px #e954786b;
  font: 700 clamp(25px, 4vw, 38px)/1 system-ui;
}
.center-layout {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(0, 3fr);
  gap: clamp(12px, 2vw, 26px);
  align-items: start;
}
.center-reception {
  overflow: hidden;
  border: 1px solid #d9849a;
  border-radius: 15px;
  background: #482b3a;
  box-shadow: 0 10px 28px #140c1c80;
}
.center-reception img {
  display: block;
  width: 100%;
  max-height: min(48dvh, 400px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center 42%;
}
.center-reception p {
  margin: 0;
  padding: clamp(8px, 1.3vw, 16px);
  border-top: 1px solid #d48497;
  background: #fff1e8;
  color: #5a2838;
  font-weight: 600;
  line-height: 1.35;
}
.center-care { min-width: 0; }
.center-team-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.center-team-heading h3 {
  margin: 0;
  color: #ffe1dd;
  font-size: clamp(17px, 2.2vw, 25px);
}
.center-team-heading > span { color: #f5c8cd; font-size: .86rem; }
.center-team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: clamp(7px, 1vw, 12px);
  list-style: none;
  border: 1px solid #d98a9d57;
  border-radius: 14px;
  background: #68374866;
}
.center-mon {
  min-width: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #e9a3b0;
  border-radius: 11px;
  color: #3e2131;
  background: linear-gradient(145deg, #fff9ed, #f8e5e2);
  box-shadow: 0 2px 7px #2811205e;
}
.center-mon-main {
  display: grid;
  grid-template-columns: minmax(0, 39%) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: clamp(52px, 12dvh, 90px);
}
.center-mon-main img {
  display: block;
  width: 100%;
  height: clamp(49px, 11dvh, 84px);
  object-fit: contain;
}
.center-mon-main strong { display: block; overflow-wrap: anywhere; line-height: 1.2; }
.center-mon-main span {
  display: inline-block;
  margin: 3px 3px 0 0;
  padding: 1px 6px;
  border-radius: 5px;
  color: #fff;
  background: #735969;
  font-size: .76rem;
  font-weight: 700;
}
.center-mon-main .center-status { background: #8e405c; }
.center-hp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #a45a6c42;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.center-hp progress { display: block; width: 100%; min-width: 0; height: 13px; }
.center-hp span { white-space: nowrap; }
.center-vacant {
  display: grid;
  place-items: center;
  min-height: calc(clamp(52px, 12dvh, 90px) + 44px);
  border-style: dashed;
  border-color: #c8809533;
  background: #311d2b65;
  color: #e1b8c2;
  box-shadow: none;
  font-size: .8rem;
}
.center-treatment { display: grid; justify-items: center; margin-top: clamp(10px, 3dvh, 24px); }
.center-heal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1vw, 13px);
  min-width: min(260px, 100%);
  min-height: 52px;
  padding: 8px 17px;
  border: 1px solid #ffd1d0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(#bd365c, #8e244b);
  box-shadow: 0 0 18px #d7537580, inset 0 1px #ffc0c79e;
}
.center-heal:not(:disabled):hover { background: #ad2e58; }
.center-heal:disabled { opacity: .62; box-shadow: none; }
.center-heal > span { font: 700 24px/1 system-ui; }
.center-heal > small { color: #ffe4e9; white-space: nowrap; }
.center-work {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 22px;
  margin-top: clamp(10px, 3dvh, 24px);
  padding: 9px 14px;
  border: 1px solid #ba6d86;
  border-radius: 10px;
  background: #542f44b5;
}
.center-work p { margin: 0; }
.center-work button {
  min-height: 40px;
  padding: 5px 14px;
  border: 1px solid #e899aa;
  color: #fff;
  background: #873e57;
}
.center-work button:hover { background: #a04865; }
@media (max-width: 740px) {
  .center-layout { grid-template-columns: minmax(0, 1fr); }
  .center-reception {
    display: grid;
    grid-template-columns: clamp(68px, 18vw, 102px) minmax(0, 1fr);
    align-items: stretch;
  }
  .center-reception img { height: 94px; aspect-ratio: auto; object-position: center 24%; }
  .center-reception p { display: grid; align-items: center; border-top: 0; border-left: 1px solid #d48497; }
}
@media (max-width: 490px) {
  .center-team { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .center-mon { padding: 6px; }
  .center-hp { gap: 4px; font-size: .73rem; }
}
.race-lane[data-pose="jump"] .race-runner,
.race-lane[data-pose="duck"] .race-runner { animation-delay:var(--pose-delay,0ms); }
.race-lane[data-pose="fall"] .race-runner {
  opacity:1;
  filter:none;
  animation:race-fall .72s var(--pose-delay,0ms) cubic-bezier(.25,.66,.62,1) both;
}
.race-lane[data-pose="fall"]::after {
  content:""; position:absolute; z-index:1; left:24%; bottom:22%;
  width:30px; height:18px; border:2px solid #ffe0a0; border-radius:50%;
  animation:race-impact .35s var(--pose-delay,0ms) ease-out both;
}
@keyframes race-fall {
  0% { transform:translateX(-50%); filter:brightness(1.8); }
  30% { transform:translate(-86%,-17px) rotate(-35deg); }
  70% { opacity:1; }
  100% { transform:translate(-135%,9px) rotate(-96deg) scale(.7); opacity:.22; filter:grayscale(1); }
}
@keyframes race-impact {
  from { opacity:1; transform:translate(-50%,0) scale(.25); }
  to { opacity:0; transform:translate(-50%,0) scale(1.7); }
}
@media(prefers-reduced-motion:reduce) {
  .race-lane[data-pose="fall"]::after { display:none; }
}

@media (max-width: 490px) {
  .center-heading { margin-bottom: 14px; }
  .center-mon-main {
    min-height: 56px;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
  }
  .center-mon-main img { height: 56px; }
  .center-mon-main strong { font-size: .86rem; }
  .center-vacant { min-height: 94px; }
}

#overlay.facility-full:has(.shop-screen) > .panel-toolbar {
  position: absolute;
  z-index: 2;
  top: max(clamp(7px, 1.15dvh, 12px), env(safe-area-inset-top));
  right: max(clamp(12px, 1.15vw, 22px), env(safe-area-inset-right));
  padding: 0;
  border: 0;
  background: transparent;
}
#overlay.facility-full:has(.shop-screen) #dismiss {
  width: clamp(38px, 3.2vw, 56px);
  height: clamp(38px, 6.25dvh, 56px);
  border: 1px solid #88bce9;
  border-radius: 12px;
  background: linear-gradient(#28527d, #102f52);
  color: #edf7ff;
  font-size: clamp(28px, 2.5vw, 44px);
}
.shop-screen {
  --surface: #112f50;
  --raised: #21466b;
  --edge: #527fa8;
  --ink: #eef7ff;
  --shop-button: linear-gradient(#2b527b, #143354);
  --shop-active: linear-gradient(#39b4ed, #0876b9 65%, #118dca);
  --shop-gap: clamp(8px, 1.55dvh, 15px);
  --shop-radius: clamp(10px, 1vw, 18px);
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--shop-gap);
  overflow: auto;
  padding: 1px clamp(8px, .65vw, 14px) var(--shop-gap);
  color: var(--ink);
  background: linear-gradient(150deg, #081b31, #0b2747);
  font: 500 clamp(14px, 1.24vw, 22px)/1.2 "Trebuchet MS", system-ui, sans-serif;
}
.shop-heading, .shop-screen .shop-footer, .shop-screen .shop-work {
  flex: none;
  border: 1px solid #58a9e8;
  border-radius: var(--shop-radius);
  background: linear-gradient(115deg, #205486, #15395e 36%, #112d50 80%, #1a4975);
  box-shadow: inset 0 1px #c1e7ff25;
}
.shop-heading {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.4vw, 44px);
  min-height: clamp(56px, 8.65dvh, 78px);
  padding: 6px clamp(53px, 5vw, 84px) 6px clamp(12px, 2.3vw, 42px);
  overflow: hidden;
  background: linear-gradient(145deg, #3c9ae6 0 2%, transparent 2% 6%, #287dc7 6% 7%, transparent 7%),
    linear-gradient(110deg, #17487b, #102b51);
}
.shop-heading::after, .shop-speech::after, .shop-work::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: var(--ball-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 16%, var(--ball-ink) 17% 24%, transparent 25%),
    linear-gradient(0deg, var(--ball-ink) 0 46%, transparent 46% 54%, var(--ball-ink) 54%);
  pointer-events: none;
}
.shop-heading::after {
  --ball-size: clamp(82px, 9vw, 160px);
  --ball-ink: #76aaff32;
  right: 7%;
  transform: rotate(-16deg);
}
.shop-heading h2 { margin: 0; color: #f0f8ff; font: 800 clamp(22px, 2.55vw, 46px)/1.05 system-ui, sans-serif; }
.shop-heading > .hud-icon { width: clamp(29px, 2.9vw, 52px); height: auto; stroke-width: 3; }
.shop-heading .action-balance {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding: .42em .8em;
  border: 1px solid #ffce37;
  border-radius: 999px;
  background: #0c2849;
  color: #ffda55;
  font: 750 clamp(12px, 1.1vw, 20px)/1.15 system-ui, sans-serif;
}
.shop-heading .action-balance .hud-icon { width: 1.2em; height: 1.2em; }
.shop-layout {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 21fr) minmax(0, 50fr) minmax(0, 28.5fr);
  min-height: min(390px, 56dvh);
  gap: var(--shop-gap);
}
.shop-reception, .shop-catalog-panel, .shop-cart-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #5087bb;
  border-radius: var(--shop-radius);
  background: linear-gradient(135deg, #0b2038, #133353);
}
.shop-reception {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #234c8a;
}
.shop-reception img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 42% center; }
.shop-speech {
  position: relative;
  isolation: isolate;
  margin: 6px;
  padding: .42em 1em .6em;
  border: 1px solid #72dfff;
  border-radius: 12px;
  background: linear-gradient(120deg, #edf8ff, #b9d5f5);
  color: #08152f;
  box-shadow: 0 0 7px #56dbff90;
}
.shop-speech::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 30%;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #d9ebfc;
  border: solid #72dfff;
  border-width: 1px 0 0 1px;
}
.shop-speech::after { --ball-size: 3.2em; --ball-ink: #4c86bf45; right: 0; bottom: 0; }
.shop-speech strong { font-size: 1.28em; }
.shop-speech p { margin: .12em 0 0; }
.shop-catalog-panel, .shop-cart-panel { display: flex; flex-direction: column; gap: clamp(6px, 1.25dvh, 14px); padding: clamp(6px, .64vw, 13px); }
.shop-filter-chips, .shop-modes { display: grid; gap: clamp(3px, .36vw, 7px); flex: none; }
.shop-filter-chips { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.shop-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shop-screen :is(.shop-filter-chips, .shop-modes, .shop-footer, .shop-work) button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .48em;
  min-width: 0;
  border: 1px solid #5687b7;
  border-radius: clamp(7px, .72vw, 13px);
  background: var(--shop-button);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  box-shadow: inset 0 1px 2px #d0e8ff38;
}
.shop-screen .hud-icon { flex-shrink: 0; }
.shop-screen :is(.shop-filter-chips, .shop-modes, .shop-footer, .shop-work) button .hud-icon { width: 1.4em; height: 1.4em; }
.shop-screen .shop-filter-chips button {
  flex-direction: column;
  gap: .25em;
  min-height: clamp(46px, 8.4dvh, 75px);
  padding: 3px 0;
  font-size: clamp(10px, 1.01vw, 18px);
  color: #e1efff;
}
.shop-screen .shop-filter-chips .hud-icon { color: #bddbf5; }
.shop-screen .shop-modes button { min-height: clamp(36px, 7dvh, 62px); padding: .3em; font-size: 1.15em; }
.shop-screen :is(.shop-filter-chips, .shop-modes) button[aria-pressed="true"],
.shop-screen .shop-footer [data-cart-add="buy"] {
  border-color: #90ebff;
  background: var(--shop-active);
  color: #fff;
  box-shadow: inset 0 1px 4px #dcfaff9c, 0 0 8px #43caff48;
}
.shop-screen .shop-filter-chips button[aria-pressed="true"] .hud-icon { color: #fff; }
.shop-screen :is(.shop-filter-chips, .shop-modes) button:hover { filter: brightness(1.16); }
.shop-screen .catalog-tools { grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 5%; }
.shop-screen .catalog-tools label { position: relative; display: block; margin: 0; font-size: inherit; }
.shop-screen .catalog-tools .hud-icon {
  position: absolute;
  top: 50%;
  left: .6em;
  width: 1.15em;
  height: 1.15em;
  transform: translateY(-50%);
  color: #d3e8ff;
  pointer-events: none;
}
.shop-screen .catalog-tools :is(input, select) {
  width: 100%;
  min-height: clamp(34px, 5dvh, 45px);
  margin: 0;
  padding: .28em .45em .28em 2.3em;
  border: 1px solid #78a8d7;
  border-radius: clamp(7px, .72vw, 13px);
  background: linear-gradient(#1b3c61, #153355);
  color: var(--ink);
  font: inherit;
  font-size: .88em;
  color-scheme: dark;
}
.shop-screen .catalog-tools input::placeholder { color: #aec8e2; }
.shop-screen .catalog {
  flex: 1;
  gap: 2px;
  padding: 1px 4px 3px 1px;
  scrollbar-color: #a8caeb #254c74;
}
.shop-screen .catalog button {
  grid-template-columns: minmax(32px, 2.8em) minmax(0, 1fr) auto;
  gap: .8em;
  min-height: clamp(42px, 6.2dvh, 56px);
  padding: 2px .55em;
  border: 1px solid #f5faff;
  border-radius: clamp(7px, .65vw, 12px);
  background: linear-gradient(115deg, #e8f2fd, #c8dbee);
  color: #08172f;
  font: inherit;
}
.shop-screen .catalog button[aria-pressed="true"] {
  border-color: #c3f3ff;
  background: linear-gradient(115deg, #83d0f7, #56b1ec);
  box-shadow: inset 0 0 5px #e8fbff, 0 0 6px #4cc9ff60;
}
.shop-screen .catalog button b { overflow-wrap: anywhere; }
.shop-screen .catalog button small { font: 500 .83em/1.15 "Trebuchet MS", system-ui, sans-serif; color: #24415f; }
.shop-screen .catalog button .itemArt {
  width: 100%;
  height: clamp(30px, 5dvh, 46px);
  padding: 2px;
  border-radius: 9px;
  background: #6295bf2b;
}
.shop-screen .catalog button[aria-pressed="true"] .itemArt { background: #188be06b; }
.shop-screen .catalog button > strong {
  min-width: 4.75em;
  padding: .25em .45em;
  border-radius: .55em;
  background: linear-gradient(#284c71, #173557);
  color: #f3f9ff;
  text-align: center;
  white-space: nowrap;
}
.shop-screen .catalog button[aria-pressed="true"] > strong { box-shadow: inset -7px 0 9px #28d8f199; }
.shop-screen .shop-cart {
  flex: 1;
  padding: clamp(6px, .65vw, 12px);
  border-color: #507fae;
  border-radius: calc(var(--shop-radius) - 3px);
  background: linear-gradient(135deg, #1a3b61, #133152 55%, #17385d);
}
.shop-screen .shop-cart h3 {
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .15em .27em .45em;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #26d9fb 50%, #3b6d9c 50%) 1;
  color: #cae6ff;
  font: 750 1.2em/1.2 system-ui, sans-serif;
}
.shop-cart h3 .hud-icon { width: 1.4em; height: 1.4em; }
.shop-screen .shop-cart-lines li { grid-template-columns: 30px minmax(0, 1fr) auto; }
.shop-screen .shop-cart-lines .itemArt { width: 28px; height: 28px; }
.shop-empty-cart {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .65em;
  min-height: 76px;
  color: #e1efff;
  text-align: center;
}
.shop-empty-cart .hud-icon { width: clamp(38px, 4.1vw, 75px); height: auto; color: #97c5ef; }
.shop-screen .shop-cart-totals { margin-top: auto; font-size: .93em; }
.shop-screen .shop-cart-totals > strong {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5em;
  width: 100%;
  padding: .4em .8em;
  border: 1px solid #71a0cc;
  border-radius: .55em;
  background: linear-gradient(#1c4169, #163457);
}
.shop-cart-totals strong span { font-size: 1.15em; white-space: nowrap; }
.shop-cart-message { color: #ffd3bb; font-size: .86em; }
.shop-screen .shop-footer {
  display: grid;
  grid-template-columns: minmax(max-content, 1.05fr) minmax(0, .8fr) minmax(max-content, .7fr) 1.05fr 1.2fr 1.15fr;
  gap: clamp(5px, 1vw, 18px);
  min-height: clamp(72px, 11.5dvh, 103px);
  padding: 5px clamp(8px, 1.2vw, 22px);
}
.shop-balance, #selectedShopItem, .shop-work p {
  display: flex;
  align-items: center;
  gap: .55em;
}
.shop-balance {
  padding: .46em .6em;
  border: 1px solid #427caf;
  border-radius: .65em;
  background: linear-gradient(#153c62, #0b2442);
  white-space: nowrap;
}
.shop-balance span { margin-left: auto; }
#selectedShopItem { min-width: 0; padding-left: .65em; border-left: 1px solid #6594be; text-align: left; }
#selectedShopItem b { overflow-wrap: anywhere; }
#selectedShopItem .itemArt { width: 1.85em; height: 1.85em; flex: none; }
.shop-quantity label { margin-bottom: 3px; font-size: .8em; }
.shop-screen .quantity-control { justify-content: center; }
.shop-screen .quantity-control input {
  width: clamp(42px, 4.9vw, 88px);
  padding: 0 3px;
  border: 1px solid #98bee5;
  border-radius: 4px;
  background: linear-gradient(#c9def5, #eff7ff);
  color: #08172f;
  font: inherit;
  font-weight: 750;
}
.shop-screen .shop-footer .quantity-control button {
  min-width: clamp(28px, 2.8vw, 50px);
  min-height: clamp(29px, 5dvh, 46px);
  padding: 0;
  border-radius: .4em 0 0 .4em;
  font-size: 1.28em;
}
.shop-screen .shop-footer .quantity-control button:last-child { border-radius: 0 .4em .4em 0; }
.shop-screen .shop-footer > button { min-height: clamp(42px, 7dvh, 65px); padding: .28em .45em; }
.shop-screen .shop-footer [data-checkout] {
  border-color: #ffe28e;
  background: linear-gradient(#ffe294, #f2b638 68%, #ecaa29);
  color: #221806;
  box-shadow: inset 0 1px 3px #fff1bc, 0 3px 4px #05162980;
}
.shop-screen .shop-footer > button:disabled { opacity: .68; }
.shop-screen .shop-work {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 5px clamp(10px, 1.7vw, 30px);
  min-height: clamp(48px, 8dvh, 74px);
  padding: 5px 8px;
  background: linear-gradient(-36deg, #2c71b342 0 5%, transparent 5% 6%, #2c71b342 6% 7%, transparent 7%),
    linear-gradient(115deg, #1b4670, #112d50 75%, #1b4670);
}
.shop-work::before { --ball-size: 4.25em; --ball-ink: #7eb8ef29; left: .7em; transform: rotate(-12deg); }
.shop-work p { margin: 0; }
.shop-screen .shop-work button { min-height: clamp(36px, 5.7dvh, 54px); }
@media (max-width: 1000px), (max-height: 550px) {
  .shop-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(260px, 1fr);
    flex: none;
  }
  .shop-reception { grid-column: 1/-1; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: auto; }
  .shop-reception img { min-height: 76px; max-height: 105px; }
  .shop-speech { align-content: center; }
  .shop-speech::before { display: none; }
  .shop-screen .catalog { max-height: 48dvh; }
  .shop-screen .shop-cart-lines { max-height: 30dvh; }
  .shop-screen .shop-footer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  #overlay.facility-full:has(.shop-screen) > .panel-toolbar { right: max(24px, env(safe-area-inset-right)); }
  #overlay.facility-full:has(.shop-screen) #dismiss { width: 38px; height: 38px; }
  .shop-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .shop-screen .catalog { max-height: 38dvh; }
  .shop-filter-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shop-screen .shop-filter-chips button { min-height: 48px; font-size: 12px; }
  .shop-screen .catalog-tools { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 5px; }
  .shop-screen .shop-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-screen :is(.shop-quantity, [data-checkout]) { grid-column: 1/-1; }
}
.race-track { background:#244b39; }
.race-landscape {
  position:absolute; inset:0; display:flex; pointer-events:none;
  transform:translate3d(var(--race-landscape,0px),0,0); will-change:transform;
}
.race-landscape i {
  flex:0 0 100%; display:block;
  background:linear-gradient(#183c3225,#17342f91),
    url("scenes/campo-pixel.png") center 43% / cover no-repeat;
}
.race-landscape i:nth-child(even) { transform:scaleX(-1); }

.center-treatment {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
}
.center-balance {
  padding: 7px 10px;
  border: 1px solid #ba6d86;
  border-radius: 8px;
  background: #482b3a;
  white-space: nowrap;
}
.center-balance-warning {
  width: 100%;
  margin: 0;
  color: #ffd1cf;
  text-align: center;
  font-size: .85rem;
}
#itemTooltip {
  position:fixed; z-index:35; pointer-events:none;
  width:max-content; max-width:min(310px,calc(100vw - 16px));
  padding:8px 11px; color:#eef7ff; background:#10283bf5;
  border:1px solid #78abc9; border-radius:8px;
  box-shadow:0 4px 16px #091c2c88; font-size:.86rem; line-height:1.4;
}
#itemTooltip strong { display:block; margin-bottom:2px; color:#bfe4ff; }
[data-item-summary][tabindex]:focus-visible { outline:2px solid #f0ce88; outline-offset:-2px; }

#partyRail button[draggable="true"] { cursor: grab; }
#partyRail button[draggable="true"]:active { cursor: grabbing; }
#partyRail button > * { pointer-events: none; }
:is(#partyRail [data-slot], .pcSlot).pokemon-drop-target {
  outline: 2px solid #f6d490;
  outline-offset: -2px;
}
.battle-chips,.battle-field-effects { display:flex; flex-wrap:wrap; gap:3px; }
.battle-chips { margin-top:4px; max-height:76px; overflow:auto; }
.battle-chip { padding:1px 5px; border:1px solid #82939b; border-radius:4px; background:#213d4d; color:#f5f4de; font:700 .68rem/1.35 system-ui; }
.battle-chip.buff { background:#224a39; border-color:#69a987; color:#c7f9d4; }
.battle-chip.debuff { background:#572d37; border-color:#ca7683; color:#ffd3d4; }
.battle-chip.side { background:#3c334d; border-color:#9e87b9; color:#f0e3ff; }
.battle-types { color:#d7e2e5; font:600 .68rem/1.3 system-ui; }
.battle-field-effects {
  position:absolute; z-index:7; top:44px; left:50%; transform:translateX(-50%);
  width:min(95%,34rem); justify-content:center; pointer-events:none;
}
.battle-report {
  min-height: 0; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  gap: 5px; padding: 8px; border: 1px solid #547c79; border-radius: 10px; background: #0e242b;
}
.battle-report h3 { margin: 0; color: #ffe0a2; font: 700 .82rem system-ui; }
.battle-report .message { padding: 4px 0; border: 0; font-size: .85rem; }
#battleLog {
  min-height: 0; overflow-y: auto; margin: 0; padding: 5px 8px 5px 25px;
  border-top: 1px solid #35575a; color: #dbe9e4; font-size: .78rem;
  scrollbar-color: #89aaa1 #142d34;
}
#battleLog li + li { margin-top:4px; }
.console .battleTabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; overflow: visible; }
.console .battleTabs button { min-width: 0; padding-inline: 4px; text-align: center; }
.console .battleTabs button:disabled { opacity: .46; }
.console .battle-controls { width: 100%; max-width: 800px; justify-self: center; }
.console .moves#groupControls { grid-template-columns: minmax(0, 1fr); }
@media(max-width:650px) {
  #arena .console { grid-template-rows: minmax(62px, .65fr) minmax(0, 1fr); }
  .battle-report { grid-template-rows: auto minmax(0, 1fr); }
  .battle-report .message { display: none; }
  .battle-field-effects { top:34px; }
  .battle-chips { max-height:45px; }
  .battle-chip { font-size:.6rem; }
}
.battle-chip.confused { color:#ffe6b4; background:#594421; border-color:#d5aa59; }

.shiny-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border: 1px solid #997845;
  border-radius: 5px;
  background: #4e3a28;
  color: #ffe4a3;
  font-size: .72rem;
  font-weight: 700;
}
.shiny-sparkles {
  position: absolute;
  z-index: 2;
  inset: -8% 0 0;
  pointer-events: none;
}
.shiny-sparkles i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: #ffed99;
  text-shadow: 0 0 9px #ffe882, 0 0 18px #ffa94f;
  font: 700 clamp(17px, 3vw, 34px)/1 system-ui;
  opacity: 0;
  animation: shiny-sparkle .85s var(--delay) ease-out both;
}
.shiny-sparkles i:nth-child(1) { --x: 7%; --y: 37%; --delay: .06s; }
.shiny-sparkles i:nth-child(2) { --x: 25%; --y: 8%; --delay: .13s; }
.shiny-sparkles i:nth-child(3) { --x: 70%; --y: 5%; --delay: .24s; }
.shiny-sparkles i:nth-child(4) { --x: 88%; --y: 32%; --delay: .13s; }
.shiny-sparkles i:nth-child(5) { --x: 79%; --y: 69%; --delay: .29s; }
@keyframes shiny-sparkle {
  0% { opacity: 0; transform: translateY(6px) scale(.2) rotate(-35deg); }
  36% { opacity: 1; transform: translateY(0) scale(1.25) rotate(10deg); }
  100% { opacity: 0; transform: translateY(-10px) scale(.6) rotate(30deg); }
}
.results-category[data-score="shinys"] { --score-color: #edb9ff; }

.gym-opponent { text-align: center; }
.gym-opponent h2 { margin: 0; font-size: clamp(19px, 3vw, 31px); }
.facility-list.gym-team:has(.facility-mon:nth-child(3)) { width: min(100%, 760px); }
@media (min-width: 651px) {
  .facility-list.gym-team:has(.facility-mon:nth-child(3)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.facility-screen:is([data-theme="gym"],[data-theme="post"]) .npc-portrait {
  width: min(100%, 320px, 44dvh);
  margin-inline: auto;
  overflow: hidden;
}
.facility-screen:is([data-theme="gym"],[data-theme="post"]) .npc-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}
@media (max-width: 650px) {
  .facility-screen:is([data-theme="gym"],[data-theme="post"]):has(.npc-portrait img) {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .facility-screen:is([data-theme="gym"],[data-theme="post"]) > aside:has(img) {
    display: block;
    overflow: visible;
  }
  .facility-screen:is([data-theme="gym"],[data-theme="post"]) .npc-portrait { width: min(82px, 11dvh); }
}

#postSound { display: none; }
#overlay.facility-full:has(.post-screen) > .panel-toolbar {
  position: absolute;
  z-index: 3;
  top: max(18px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
#overlay.facility-full:has(.post-screen) :is(#postSound, #dismiss) {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  color: #fff2cb;
  background: linear-gradient(#315c43, #15382d);
  border: 1px solid #e7c57d;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #fff1b743, 0 3px 8px #091d18;
  font: 700 1.4rem/1 system-ui, sans-serif;
}
#overlay.facility-full:has(.post-screen) :is(#postSound, #dismiss):hover { background: #437452; }
.post-screen {
  --post-gold: #e6c47a;
  --post-cream: #fff4d6;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 30px;
  gap: clamp(10px, 2dvh, 22px);
  overflow: hidden;
  padding: clamp(14px, 2vw, 30px);
  color: var(--post-cream);
  background: radial-gradient(ellipse at 55% 40%, #2b5c43a8, #102f28f5),
    url(region.png) center / cover;
}
.post-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px clamp(9px, 1.35vw, 24px);
  justify-content: flex-start;
  margin-right: clamp(110px, 15vw, 260px);
  padding: 7px clamp(10px, 1.7vw, 28px);
  border: 2px solid var(--post-gold);
  border-radius: 16px;
  background: linear-gradient(110deg, #142f27, #23563b 55%, #152f27);
  box-shadow: inset 0 0 0 2px #fff0aa27, 0 5px 12px #091e19a6;
}
.post-heading h2 { margin: 0; color: var(--post-cream); font: 700 clamp(20px, 3vw, 49px)/1.05 Georgia, serif; }
.post-medallion {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 2px solid var(--post-gold);
  border-radius: 50%;
  color: var(--post-gold);
  background: radial-gradient(circle at top, #557752, #173b2c 76%);
  box-shadow: inset 0 0 0 3px #fff2be2d, 0 2px 5px #0e241b;
}
.post-heading .post-medallion { width: clamp(34px, 4.5vw, 66px); }
.post-medallion .hud-icon { width: 56%; height: 56%; }
.post-heading .post-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 10px;
  border-inline: 1px solid #e6c47a85;
  color: #ffe6ac;
  font-size: clamp(.78rem, 1.4vw, 1.2rem);
  font-weight: 700;
}
.post-location .hud-icon { width: 1.2em; height: 1.2em; color: var(--post-gold); }
.post-heading .action-balance { background: #19382b; box-shadow: 0 2px 0 #d9a83f; }
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 3fr);
  min-height: 0;
  gap: 10px;
}
.post-reception, .post-vacancies {
  min-width: 0;
  min-height: 0;
  padding: 5px;
  border: 2px solid var(--post-gold);
  border-radius: 18px;
  background: linear-gradient(145deg, #28583e, #17382d);
  box-shadow: inset 0 0 0 2px #fff3b747, 0 5px 12px #0c211b80;
}
.post-reception { position: relative; }
.post-reception img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  object-position: center 43%;
}
.post-reception .post-medallion { position: absolute; bottom: -9px; left: 50%; translate: -50% 0; }
.post-vacancies { display: grid; padding: clamp(6px, 1vw, 14px); border-color: #b2c777; }
.post-screen .job-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* Reserve room for the tallest card, including wrapped requirements and its action. */
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 0;
  max-height: none;
  gap: clamp(6px, .8vw, 12px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 5px 2px 0;
  overflow: hidden auto;
  scrollbar-color: #e8c375 #304f3c;
  scrollbar-gutter: stable;
}
.post-screen .job-board article {
  padding: clamp(6px, .7vw, 11px);
  gap: clamp(5px, 1dvh, 10px);
  min-width: 0;
  min-height: var(--post-job-card-min, clamp(228px, 36dvh, 350px));
  overflow: visible;
  color: #202c25;
  background: radial-gradient(ellipse at 30% 0%, #fff9e5, #eddfbb);
  border: 2px solid #d9bc7c;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px #fff5d8, inset 0 -8px 22px #d6b87938;
}
.post-job-title { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.post-job-title .hud-icon { flex: none; width: 22px; height: 22px; }
.post-screen .post-job-title {
  justify-content: start;
  align-self: stretch;
  gap: clamp(5px, .9vw, 15px);
  min-height: 44px;
  padding: clamp(5px, .6vw, 10px);
  border: 1px solid #42634b;
  border-radius: 9px;
  text-align: start;
  color: var(--post-cream);
  background: linear-gradient(120deg, #1b3f31, #356344);
  box-shadow: inset 0 1px 1px #fff4ce36;
}
.post-screen .post-job-title .hud-icon { width: clamp(19px, 2.4vw, 40px); height: auto; color: #f3c968; }
.post-screen .post-job-title b { font-size: clamp(.92rem, 1.5vw, 1.65rem); }
.post-screen .job-board article .job-pay {
  padding: 2px 14px;
  border: 1px solid #dbb567;
  border-radius: 999px;
  color: #59331b;
  background: linear-gradient(#fff0c6, #f2da98);
  font: 700 clamp(19px, 2.1vw, 36px)/1.15 Georgia, serif;
}
.post-screen .job-board article :is(span, small) { color: #25352b; }
.post-screen .post-requirement { display: grid; gap: 4px; width: 100%; }
.post-screen .post-requirement progress { display: block; width: 100%; height: 6px; accent-color: #507a51; }
.post-ornament {
  display: grid;
  position: relative;
  align-items: center;
  justify-items: center;
}
.post-ornament::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--post-gold) 20% 80%, transparent);
}
.post-ornament .post-medallion { z-index: 1; width: 30px; }
.job-team-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 4px 0; }
.job-team-slots :is(.monToken, .job-team-empty) {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 5px;
  color: #59614d; background: #f6ead6; border: 1px solid #b8a683;
}
.job-team-slots .fighter { position: static; transform: none; animation: none; width: 28px; height: 28px; object-fit: contain; }
.post-screen .job-board article button {
  width: 100%;
  min-height: 37px;
  margin-top: auto;
  border-radius: 9px;
  font-weight: 700;
}
.post-screen .job-board article button[data-action="hire"] {
  background: linear-gradient(#436d36, #214624);
  border: 2px solid #dbb05c;
  box-shadow: inset 0 0 0 1px #fff0bd7a, 0 2px 2px #71572c5e;
}
.post-screen .job-board article button[data-action="hire"]:hover { background: #497747; }
.post-screen .job-board article button:disabled {
  background: #d8ccb1;
  color: #514b3e;
  opacity: 1;
  border: 1px solid #a89a7e;
}
.post-screen .post-current { margin-top: auto; padding-block: 7px; font-weight: 700; }
@media (max-width: 840px) {
  .post-screen .job-board { grid-template-columns: repeat(2, minmax(0, 1fr)); --post-job-card-min: 220px; }
}
@media (max-width: 580px) {
  .post-screen { padding: 10px; gap: 8px; grid-template-rows: auto minmax(0, 1fr); }
  #overlay.facility-full:has(.post-screen) > .panel-toolbar { top: 13px; right: 10px; gap: 5px; }
  #overlay.facility-full:has(.post-screen) :is(#postSound, #dismiss) { min-width: 34px; height: 38px; }
  .post-heading { height: auto; min-height: 76px; margin-right: 83px; padding: 6px 8px; }
  .post-heading .post-location { padding-inline: 0; border: 0; }
  .post-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: clamp(60px, 15dvh, 130px) minmax(0, 1fr); }
  .post-reception img { object-position: center 23%; }
  .post-reception .post-medallion, .post-ornament { display: none; }
  .post-screen .job-board { grid-template-columns: minmax(0, 1fr); --post-job-card-min: 215px; }
}
#overlay.facility-full:has(.elite-screen) > .panel-toolbar {
  position: absolute;
  z-index: 3;
  top: clamp(8px, 1.5vw, 24px);
  right: clamp(8px, 2vw, 34px);
  padding: 0;
  border: 0;
  background: transparent;
}
#overlay.facility-full:has(.elite-screen) #dismiss {
  border: 1px solid #f3cd80;
  border-radius: 50%;
  background: #0a2533;
  color: #ffe2a5;
}
.elite-screen {
  --elite-gold: #eac583;
  --elite-cream: #fff0d4;
  position: relative;
  isolation: isolate;
  height: 100%;
  overflow: auto;
  padding: clamp(12px, 2.3vw, 38px);
  background: #102f3a;
  color: var(--elite-cream);
}
.elite-screen::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -8px;
  background: linear-gradient(#0a283482, #0524348c), url("scenes/league-island.png") center / cover;
  filter: blur(5px);
}
.elite-frame {
  position: relative;
  width: min(100%, 1640px);
  margin: auto;
  padding: clamp(13px, 2.2vw, 37px);
  border: 2px solid var(--elite-gold);
  border-radius: 24px 14px;
  background: linear-gradient(135deg, #0c2237e8, #0c2632ec 59%, #0a2130f4);
  box-shadow: 0 0 0 1px #6d512e, 0 14px 35px #051927a8;
}
.elite-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #c597616b;
  border-radius: 18px 10px;
  pointer-events: none;
}
.elite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  padding: 0 28px 12px 0;
  border-bottom: 1px solid #c3a47259;
}
.elite-heading { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.elite-header h2 {
  margin: 0;
  color: #ffe4aa;
  font: italic 700 clamp(32px, 5.2vw, 76px)/1 Georgia, serif;
  text-shadow: 0 2px #916b38, 0 5px 12px #070f18;
}
.elite-header small, .elite-match-heading small {
  display: block;
  color: #f1d398;
  font: italic 700 clamp(13px, 1.7vw, 24px)/1.2 Georgia, serif;
  letter-spacing: .025em;
}
.elite-heading small::before, .elite-match-heading small::before { content: "◆"; margin-right: 8px; font-size: .6em; vertical-align: middle; }
.elite-crest {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(45px, 6vw, 87px);
  height: clamp(58px, 7.6vw, 109px);
  border: 1px solid #efcc8d;
  border-bottom: 3px double #efcc8d;
  border-radius: 5px 5px 37% 37%;
  background: linear-gradient(150deg, #274a6d, #10283d);
  box-shadow: inset 0 0 0 4px #0f293b, 0 4px 15px #0009;
}
.elite-crest i {
  width: 55%;
  aspect-ratio: 1;
  border: 2px solid #f9dc9e;
  border-radius: 50%;
  background: radial-gradient(circle, #f8d592 0 12%, #182d42 13% 24%, transparent 25%), linear-gradient(#dbb778 44%, #182d42 45% 56%, #c89a58 57%);
  box-shadow: 0 0 0 3px #b38d574d;
}
.elite-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.4vw, 22px);
  margin: 11px 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid #ad976342;
  list-style: none;
}
.elite-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(5px, 1vw, 13px);
  min-width: 0;
  padding: 7px 9px;
  border: 2px solid #71829d;
  border-radius: 13px 9px;
  background: linear-gradient(150deg, #2a405a, #122c3a 70%);
  box-shadow: inset 0 0 0 1px #b6b7a323, 0 3px 8px #030e197a;
}
.elite-step:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: calc(-1 * clamp(8px, 1.45vw, 23px));
  top: 50%;
  translate: 0 -50%;
  color: #edbf70;
  font: 700 clamp(14px, 1.7vw, 23px)/1 Georgia, serif;
}
.elite-step.current {
  border-color: #f6cf7a;
  background: linear-gradient(145deg, #87643b, #3d3226 70%);
  box-shadow: inset 0 0 8px #f2bd5e76, 0 0 10px #e7a94864;
}
.elite-step.won { border-color: #7faf89; background: linear-gradient(145deg, #28544b, #123b36 75%); }
.elite-step-number {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(22px, 3vw, 43px);
  aspect-ratio: 1;
  border: 1px solid #ffd486;
  border-radius: 50%;
  color: #ffe3aa;
  font: 700 clamp(13px, 1.8vw, 23px)/1 Georgia, serif;
}
.elite-step.won .elite-step-number, .elite-step.won small { color: #c0ebae; border-color: #a8d69b; }
.elite-step b { display: block; overflow-wrap: anywhere; font: 700 clamp(12px, 1.55vw, 22px)/1.12 Georgia, serif; }
.elite-step small { display: block; margin-top: 4px; color: #f1dfc1; font: italic clamp(11px, 1.34vw, 18px)/1.1 Georgia, serif; }
.elite-match {
  display: grid;
  grid-template-columns: minmax(105px, .96fr) minmax(0, 3fr);
  gap: clamp(9px, 2vw, 26px);
  align-items: stretch;
}
.elite-portrait {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 4px double #edc584;
  border-radius: 16px 9px;
  background: #182a42;
  box-shadow: 0 5px 15px #04131c;
}
.elite-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 53dvh;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 34%;
}
.elite-lineup { display: flex; flex-direction: column; min-width: 0; }
.elite-match-heading { margin-bottom: 10px; }
.elite-match-heading h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  color: #ffe1a4;
  font: italic 700 clamp(23px, 3.7vw, 55px)/1.08 Georgia, serif;
}
.elite-match-heading h3::after {
  content: "";
  flex: 1;
  height: 1px;
  align-self: end;
  margin-bottom: 5px;
  background: linear-gradient(90deg, #e8bd76, #e8bd7600);
}
.elite-screen .gym-team { flex: 1; width: 100%; max-height: none; overflow: visible; gap: 9px; align-content: stretch; }
.elite-screen .gym-team .facility-mon {
  position: relative;
  isolation: isolate;
  min-height: clamp(86px, 15dvh, 155px);
  margin: 0;
  padding: 6px;
  align-content: center;
  gap: 2px;
  border: 3px double #dfb974;
  border-radius: 15px 9px;
  color: #fff0cf;
  background: radial-gradient(ellipse at top left, #375068, #142d40 65%);
  box-shadow: 0 3px 8px #07152099;
}
.elite-screen .gym-team .facility-mon::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 9px;
  right: 9px;
  width: clamp(28px, 4vw, 57px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #34556b 0 12%, #152f42 13% 24%, transparent 25%), linear-gradient(#34556b 44%, #152f42 45% 57%, #34556b 58%);
  opacity: .48;
}
.elite-screen .gym-team .fighter { width: clamp(40px, 6vw, 79px); height: clamp(39px, 8dvh, 77px); }
.elite-screen .gym-team .facility-mon b { font-size: clamp(13px, 1.6vw, 22px); }
.elite-screen .gym-team .facility-mon span {
  display: table;
  margin: 2px auto 0;
  padding: 0 9px;
  border: 1px solid #aa8950;
  border-radius: 10px;
  color: #ffefd1;
  font: 700 clamp(11px, 1.2vw, 16px)/1.15 Georgia, serif;
}
.elite-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dfb777;
}
.elite-actions > div { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.elite-actions p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #f1dcb7;
  font: italic clamp(13px, 1.4vw, 20px) Georgia, serif;
}
.elite-actions .hud-icon { flex: none; width: 19px; height: 19px; color: #f5cc84; }
.elite-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px clamp(8px, 1.35vw, 18px);
  border: 3px double #d5ad70;
  border-radius: 9px 6px;
  color: #fff0cc;
  background: linear-gradient(#304359, #12293b);
  font: 700 clamp(13px, 1.45vw, 20px)/1.1 Georgia, serif;
}
.elite-actions button:hover { filter: brightness(1.17); }
.elite-actions button.primary {
  background: linear-gradient(#ffdf88, #c99244 51%, #f3c475);
  border-color: #fff3c5;
  box-shadow: 0 0 10px #eeba6277;
  color: #2a2015;
}
.elite-complete { margin: 22px 0 4px; padding: 14px; border: 1px solid #b69360; border-radius: 9px; }
@media (max-width: 650px) {
  .elite-header { flex-wrap: wrap; padding-right: 29px; }
  .elite-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .elite-step::after { display: none; }
  .elite-match { grid-template-columns: minmax(0, 1fr); }
  .elite-portrait { max-width: 110px; justify-self: center; }
  .elite-portrait img { max-height: 130px; }
  .elite-screen .gym-team .facility-mon { min-height: 75px; }
  .elite-actions > div { margin-left: 0; }
}

.elite-screen .elite-lineup .facility-list.gym-team { width: 100%; }

.map-marker {
  position: absolute;
  z-index: 2;
  translate: -50% -50%;
  width: 3.4%;
  height: 5.4%;
}
.map-marker button {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.map-hint {
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: min(340px, calc(100% - 12px));
  padding: 9px 11px;
  border: 1px solid #a9c6b5;
  border-radius: 8px;
  background: #102e34f7;
  color: #fff3d3;
  box-shadow: 0 5px 14px #102c38a8;
  font: 600 12px/1.35 system-ui;
  pointer-events: none;
}
.map-hint > strong { display: block; margin-bottom: 4px; color: #ffe0a0; font-size: 14px; }
.map-hint-services { display: flex; flex-wrap: wrap; gap: 4px 9px; }
.map-hint-facility { display: flex; align-items: flex-start; gap: 5px; }
.map-hint-icon {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-hint-icon.store { color: #9ad1ff; }
.map-hint-icon.center { color: #ffaeb8; }
.map-hint-icon.post { color: #bce6ad; }
.map-hint-icon.gym { color: #ffd384; }
.map-hint-gym { margin-top: 6px; padding-top: 5px; border-top: 1px solid #73909578; }
.map-hint small { display: block; color: #c9ded7; font: 11px/1.35 system-ui; }
.map-hint-note { margin-top: 4px; }

.map-hint-icon.lab { color: #9be6ec; }
.destination .building.lab {
  left: 43%;
  top: 57%;
  width: 20%;
  height: 14%;
}
.destination .building.lab b {
  border-color: #8ed4d5;
  background: #153e49f2;
  color: #d7f9f3;
}
#overlay.facility-full:has(.lab-screen) > .panel-toolbar {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.lab-screen {
  height: 100%;
  overflow: auto;
  padding: clamp(16px, 3vw, 34px);
  color: #edfffb;
  background: radial-gradient(ellipse at top, #255369, #122a39 79%);
}
.lab-heading, .lab-layout, .lab-footer { width: min(100%, 1060px); margin-inline: auto; }
.lab-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 15px;
  padding: 0 38px 12px 0;
  border-bottom: 1px solid #77bac5;
}
.lab-heading h2 { margin: 0; color: #c5ffef; font: 700 clamp(24px, 4vw, 43px)/1.12 Georgia, serif; }
.lab-heading span { color: #b7dadd; }
.lab-layout {
  display: grid;
  grid-template-columns: minmax(140px, .9fr) minmax(0, 2.5fr);
  align-items: start;
  gap: 12px;
  margin-top: 12px;
}
.lab-layout aside, .lab-editor {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #79abb8;
  border-radius: 10px;
  background: #163343;
}
.lab-layout aside img {
  display: block;
  width: 100%;
  max-height: 49dvh;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 32%;
}
.lab-layout aside p { margin: 0; padding: 9px 12px; color: #ffdbb7; background: #214657; }
.lab-editor { padding: 12px; }
.lab-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lab-editor label { display: grid; gap: 3px; margin: 0 0 8px; color: #e6fcf8; }
.lab-editor :is(input, select) {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 6px;
  color: #173446;
  background: #f0fbfb;
  border: 1px solid #8ebbc1;
}
.lab-stat-list table { width: 100%; border-collapse: collapse; }
.lab-stat-list tr { border-bottom: 1px solid #52828e6f; }
.lab-stat-list :is(td, th) { padding: 4px 6px; text-align: right; }
.lab-stat-list th:first-child { text-align: left; }
.lab-stat-list td:has(input) { width: 20%; }
.lab-stat-list input { text-align: center; font-variant-numeric: tabular-nums; }
#labFields p { margin: 7px 0 0; color: #c4e6df; }
.lab-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #6ba8b4;
}
.lab-footer p { margin: 0; color: #ffd5af; }
.lab-footer button {
  min-height: 42px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid #a7e7d8;
  color: #122f37;
  background: #92dccd;
}
.lab-footer button:disabled { opacity: .55; }
@media (max-width: 650px) {
  .lab-layout { grid-template-columns: minmax(0, 1fr); }
  .lab-layout aside { display: grid; grid-template-columns: 85px minmax(0, 1fr); align-items: stretch; }
  .lab-layout aside img { height: 92px; aspect-ratio: auto; }
  .lab-layout aside p { align-content: center; }
  .destination.town .building.lab {
    position: static;
    width: auto;
    height: auto;
    min-height: 46px;
    padding: 5px;
    align-content: center;
    background: #153e49f2;
    border: 1px solid #8ed4d5;
  }
}

#overlay.visit .destination.lab-village {
  background-color: #143e43;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.lab-village-buildings {
  position: absolute;
  inset: 0;
}
.destination.lab-village .building {
  left: var(--building-x);
  top: var(--building-y, 36%);
  width: var(--building-width, 18%);
  height: var(--building-height, 30%);
  transform: translateX(-50%);
}
.destination.lab-village .building.center { --building-x: 21.5%; }
.destination.lab-village .building.lab { --building-x: 50%; }
.destination.lab-village .building.store { --building-x: 78%; }
@media (max-width: 650px) and (orientation: portrait) {
  #overlay.visit .destination.lab-village { background-size: 100% auto; }
  .lab-village-buildings {
    inset: 50% 0 auto;
    transform: translateY(-50%);
    aspect-ratio: 16 / 9;
  }
  .destination.lab-village .building b {
    padding: 3px;
    font-size: clamp(9px, 2.4vw, 12px);
  }
}

.destination.lab-village[data-village="village4"] .building { --building-y: 39%; }

@media (min-width: 651px) {
  .destination.town.village .building:is(.center, .store) {
    top: 36%;
    width: 19%;
    height: 30%;
  }
  .destination.town.village .building.center { left: 16.5%; }
  .destination.town.village .building.store { left: 61.5%; }
}
.world-trainer[data-direction="left"] { scale:-1 1; }

.biome-actions {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  width: max-content;
  max-width: calc(100% - 24px);
}
.biome-actions .biome-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: clamp(118px, 16vw, 185px);
  min-height: 54px;
  padding: 9px 13px;
  border: 1px solid #e7cc91;
  border-radius: 10px;
  box-shadow: 0 5px 15px #12262099, inset 0 1px #ffffff45;
  font: 700 clamp(15px, 2.15vw, 22px)/1.1 system-ui;
}
.biome-actions .hud-icon { width: 20px; height: 20px; flex: none; }
.biome-actions .biome-explore { color: #23382d; background: linear-gradient(#ffe8af, #e2bd79); }
.biome-actions .biome-work { color: #f9e8bd; background: linear-gradient(#346052, #1b3935); }
.biome-actions .biome-action:not(:disabled):hover { filter: brightness(1.12); }
.biome-work-locked { position: relative; display: inline-flex; border-radius: 10px; cursor: not-allowed; }
.biome-actions .biome-work:disabled {
  pointer-events: none;
  border-color: #b0b4a4;
  color: #e5e4d7;
  background: #354342;
}
.biome-work-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(200px, 43vw);
  padding: 7px 9px;
  border: 1px solid #c6a772;
  border-radius: 6px;
  background: #162c2a;
  color: #ffefcd;
  font: 600 12px/1.35 system-ui;
  visibility: hidden;
  pointer-events: none;
}
.biome-work-locked:is(:hover, :focus) .biome-work-hint { visibility: visible; }
.roulette-wheel { background:var(--wheel); }
.roulette-wheel-dense .roulette-sector span {
  top:13%;
  width:29%;
  font-size:clamp(.56rem, 2.5vw, .77rem);
  overflow-wrap:anywhere;
}
.roulette-wheel-numbered .roulette-sector span { top:10%; width:17%; font-size:.85rem; }

.arcade-panel {
  width:min(100%, 720px);
  margin:auto;
  padding:clamp(12px,3vw,26px);
  border:1px solid #9d8761;
  border-radius:14px;
  background:#1b2639;
  box-shadow:0 14px 42px #0005;
}
#minigameScreen[data-game="magnetic"] { background:radial-gradient(ellipse at top,#284650,#101b26 72%); }
#minigameScreen[data-game="rhythm"] { background:radial-gradient(ellipse at top,#412845,#151329 72%); }
#minigameScreen[data-game="sorter"] { background:radial-gradient(ellipse at top,#314655,#171f28 72%); }
#minigameScreen:is([data-game="elements"],[data-game="twentyOne"],[data-game="claim"]) {
  background:radial-gradient(ellipse at top,#284539,#142321 72%);
}
.arcade-hud {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  padding-bottom:12px;
  color:#ffe0a3;
  font-variant-numeric:tabular-nums;
}
.arcade-hud .urgent { color:#ffafae; }
.arcade-grid {
  position:relative;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:3px;
  width:min(100%, 365px, 50dvh);
  aspect-ratio:1;
  margin:auto;
}
.arcade-grid > i { background:#263d4b; border:1px solid #78959e55; border-radius:4px; }
.arcade-grid > i.arcade-danger {
  background:repeating-linear-gradient(135deg,#7b303b 0 7px,#ab4650 7px 12px);
  border-color:#ff8f81;
}
.arcade-trainer {
  position:absolute;
  display:grid;
  place-items:center;
  width:15%;
  height:15%;
  transform:translate(-50%,-58%);
  pointer-events:none;
}
.arcade-trainer[hidden],.arcade-ball[hidden],.arcade-lane > i[hidden] { display:none; }
.arcade-trainer img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
.arcade-self { z-index:1; filter:drop-shadow(0 0 4px #ffe588); }
.arcade-keys { display:flex; flex-wrap:wrap; gap:7px; justify-content:center; margin-top:12px; }
#minigameScreen .arcade-keys button { min-width:48px; padding:5px 11px; touch-action:manipulation; }
.arcade-rhythm {
  position:relative;
  overflow:hidden;
  height:clamp(156px,42dvh,330px);
  border:1px solid #a989ae;
  border-radius:10px;
  background:#171329;
}
.arcade-hit-line { position:absolute; z-index:1; top:83%; width:100%; border-top:3px solid #f8dfa6; pointer-events:none; }
.arcade-lane {
  position:absolute;
  inset-block:0;
  left:calc(var(--lane) * 25%);
  width:25%;
  border-inline:1px solid #b699be30;
  background:linear-gradient(0deg,#56375599,transparent);
}
.arcade-lane > i {
  position:absolute;
  left:15%;
  width:70%;
  height:13px;
  transform:translateY(-50%);
  border-radius:8px;
  background:#f79bdf;
  box-shadow:0 0 12px #e7a1ff80;
}
.arcade-lane:nth-of-type(3) > i { background:#a9a0ff; }
.arcade-lane:nth-of-type(4) > i { background:#7dddff; }
.arcade-lane:nth-of-type(5) > i { background:#f8ba78; }
.arcade-belt {
  position:relative;
  overflow:hidden;
  min-height:90px;
  border:3px solid #82939b;
  border-radius:42px;
  background:repeating-linear-gradient(110deg,#26343d 0 18px,#3d4c54 18px 21px);
}
.arcade-ball {
  position:absolute;
  top:50%;
  transform:translate(-50%,-50%);
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  border:1px solid #e1cf9d;
  border-radius:50%;
  background:#19222c;
  box-shadow:0 3px 8px #0008;
}
.arcade-ball img { width:38px; height:38px; object-fit:contain; }
.arcade-cards { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.arcade-cards > :is(div,button) { display:grid; justify-items:center; gap:3px; }
#minigameScreen .arcade-cards > button { padding:6px; min-width:82px; }
#minigameScreen .arcade-cards > button[aria-pressed="true"] { border-color:#ffe3a5; background:#58503e; }
.arcade-card {
  display:grid;
  place-items:center;
  width:clamp(65px,15vw,92px);
  aspect-ratio:4/5;
  padding:4px;
  border:1px solid #ffe3a599;
  border-radius:7px;
  background:radial-gradient(ellipse at top,#81554d,#542831);
  color:#fff2cf;
}
.arcade-card[data-type="Água"] { background:radial-gradient(ellipse at top,#4d7181,#243956); }
.arcade-card[data-type="Planta"] { background:radial-gradient(ellipse at top,#557753,#243f32); }
.arcade-card b { font-size:1.3rem; }
.arcade-hands,.arcade-results { display:grid; gap:6px; margin:0 0 12px; }
.arcade-hands > div,.arcade-results > li {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  padding:6px;
  border-radius:5px;
  background:#ffffff10;
}
.arcade-hands i {
  display:inline-grid;
  place-items:center;
  width:25px;
  height:30px;
  margin-inline-end:3px;
  border-radius:3px;
  background:#fbecd0;
  color:#302334;
  font-style:normal;
}
.arcade-results { padding:0; }
.arcade-results img { width:36px; height:36px; object-fit:contain; image-rendering:pixelated; }
.arcade-results b { flex:1; }

#minigameScreen[data-game="magnetic"] {
  --arcade-accent:#85f3ee;
  background:radial-gradient(ellipse at 50% 0%,#1a5561,#0a1b32 62%,#080e20);
}
#minigameScreen[data-game="rhythm"] {
  --arcade-accent:#fac0f5;
  background:radial-gradient(ellipse at 50% 0%,#64285d,#241637 60%,#130c23);
}
#minigameScreen[data-game="sorter"] {
  --arcade-accent:#ffe08b;
  background:radial-gradient(ellipse at 50% 0%,#444e53,#202b34 56%,#101821);
}
#minigameScreen[data-game="elements"] {
  --arcade-accent:#ffdfac;
  background:radial-gradient(ellipse at 50% 0%,#574135,#252032 60%,#161323);
}
#minigameScreen[data-game="twentyOne"] {
  --arcade-accent:#ffe4a1;
  background:radial-gradient(ellipse at 50% 0%,#384c45,#162e29 57%,#111a1e);
}
#minigameScreen[data-game="claim"] {
  --arcade-accent:#f8dcff;
  background:radial-gradient(ellipse at 50% 0%,#513c63,#26263f 60%,#17172a);
}
.arcade-panel {
  border-color:color-mix(in srgb,var(--arcade-accent) 35%,transparent);
  background:linear-gradient(145deg,#f2f2ff10,#090e191f),#131e30;
  box-shadow:0 20px 50px #0006,inset 0 1px #ffffff16;
}
.arcade-hud { min-height:44px; align-items:center; color:var(--arcade-accent); }
.arcade-hud > span {
  min-width:3.7rem;
  padding:4px 8px;
  border-radius:6px;
  background:#080f1e9c;
  text-align:center;
}
.arcade-feedback {
  margin-inline-start:auto;
  color:#ffab9e;
  font-weight:800;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .18s,transform .18s;
}
.arcade-feedback[data-hit="true"] { color:#a8f6c5; }
.arcade-feedback.visible { opacity:1; transform:none; }
#minigameScreen .arcade-keys button.arcade-key-pressed {
  border-color:var(--arcade-accent);
  box-shadow:0 0 10px color-mix(in srgb,var(--arcade-accent) 45%,transparent);
}
.arcade-grid { border:1px solid #62dbd474; border-radius:10px; background:#071b29; box-shadow:0 0 22px #55e9dd26; }
.arcade-grid > i {
  background:radial-gradient(circle at 50% 35%,#346677,#193649 80%);
  box-shadow:inset 0 -3px #0c2638;
}
.arcade-grid > i.arcade-danger {
  background:repeating-linear-gradient(135deg,#783e36 0 7px,#b27143 7px 10px);
  border-color:#ffd18a;
  box-shadow:inset 0 0 8px #ffc07999;
}
.arcade-grid > i.arcade-strike { background:#ffe8ab; box-shadow:0 0 18px #ffd988; }
.arcade-trainer { transition:left 120ms ease-out,top 120ms ease-out,opacity 220ms ease-out; }
.arcade-trainer img { filter:drop-shadow(0 4px 2px #08111b); }
.arcade-trainer small {
  position:absolute;
  bottom:0;
  max-width:120%;
  overflow:hidden;
  padding:1px 3px;
  border-radius:3px;
  background:#071523de;
  color:#f3feff;
  font-size:clamp(.5rem,2vw,.68rem);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.arcade-trainer.arcade-eliminated { opacity:0; }
.arcade-rhythm {
  background:repeating-linear-gradient(0deg,#ffffff0b 0 1px,transparent 1px 31px),#1c142e;
  box-shadow:0 0 22px #d988f527;
}
.arcade-hit-line { box-shadow:0 0 12px #e8b2ff; transition:box-shadow .18s; }
.arcade-beat .arcade-hit-line { box-shadow:0 0 22px 4px #ffd9fc; }
.arcade-lane::after {
  content:attr(data-key);
  position:absolute;
  inset:auto 0 3%;
  color:#f1cef5;
  text-align:center;
  font-weight:800;
}
.arcade-lane > i { height:15px; border:1px solid #fff9; box-shadow:inset 0 2px #fff7,0 0 12px #e7a1ff80; }
.arcade-machine {
  position:relative;
  overflow:hidden;
  padding:12px 0;
  border-block:3px solid #7f8b91;
  background:linear-gradient(#18222b,#283745);
}
.arcade-belt {
  min-height:105px;
  overflow:visible;
  border-radius:6px;
  background:repeating-linear-gradient(110deg,#364650 0 18px,#4d616d 18px 21px);
  animation:arcade-belt-run .48s linear infinite;
}
@keyframes arcade-belt-run { to { background-position:45px 0; } }
.arcade-chute {
  position:absolute;
  inset:0 0 0 auto;
  width:8%;
  border-left:3px solid #e3b064;
  background:repeating-linear-gradient(130deg,#17212c 0 7px,#745833 7px 10px);
  pointer-events:none;
}
.arcade-ball {
  z-index:1;
  transform:translate(-50%,calc(-50% + var(--drop,0px)));
  opacity:var(--fade,1);
  background:radial-gradient(circle at 50% 34%,#606f7e,#19222c 73%);
}
.arcade-ball > span { display:none; }
.arcade-ball[data-lane="0"] > span:nth-child(1),
.arcade-ball[data-lane="1"] > span:nth-child(2),
.arcade-ball[data-lane="2"] > span:nth-child(3) { display:block; }
.arcade-ball img { transform:rotate(var(--roll,0deg)); }
.arcade-ball[data-active="true"] { border-color:#ffe08b; box-shadow:0 0 11px #ffdb7466; }
.arcade-keys button img { width:20px; height:20px; vertical-align:middle; margin-inline-end:5px; }
.arcade-cards { justify-content:center; }
#minigameScreen .arcade-cards > button { border:1px solid transparent; background:#070d1a55; transition:transform .16s,border-color .16s,background .16s; }
#minigameScreen .arcade-cards > button[aria-pressed="true"] { transform:translateY(-4px); border-color:var(--arcade-accent); background:#ffffff19; }
.arcade-card {
  position:relative;
  width:clamp(62px,20vw,106px);
  grid-template-rows:auto 1fr auto;
  padding:6px;
  border-radius:9px;
  outline:1px solid #fff4;
  outline-offset:-4px;
  box-shadow:0 6px 12px #05081280,inset 0 0 24px #140a1d38;
}
.arcade-card b { justify-self:start; line-height:1; }
.arcade-card img { width:clamp(25px,8vw,49px); height:auto; image-rendering:pixelated; }
.arcade-card small { font-weight:750; }
.arcade-reveal > div,.arcade-dealt { animation:arcade-deal .36s var(--deal,0ms) cubic-bezier(.2,.7,.24,1) both; }
.arcade-reveal [data-contested="true"] .arcade-card { border-color:#f5afff; box-shadow:0 0 16px #d893ff75; }
@keyframes arcade-deal { from { opacity:0; transform:translateY(12px) rotateX(-42deg) scale(.93); } }
.arcade-hands { padding:8px; border:1px solid #756c47; border-radius:12px; background:radial-gradient(ellipse at top,#2a5545,#15352d); }
.arcade-hands > div[data-bust="true"] { background:#9a413c60; }
.arcade-hands i { position:relative; height:39px; width:29px; background:#fcf1d5; box-shadow:0 2px 4px #0005; font-weight:700; }
.arcade-hands i small { position:absolute; right:2px; bottom:0; color:#994247; font-size:.55rem; }
.arcade-finish { animation:arcade-deal .32s ease-out both; }
.arcade-results > li[data-winner="true"] { background:#aa88382b; border:1px solid var(--arcade-accent); }
#arcadeStage { position:relative; }
.arcade-countdown:not([hidden]) {
  position:absolute;
  z-index:3;
  inset:44px 0 0;
  display:grid;
  place-items:center;
  border-radius:0 0 14px 14px;
  background:#0d1329dc;
  color:var(--arcade-accent);
  font:800 clamp(3rem,18vw,7rem)/1 system-ui;
}
@media(prefers-reduced-motion:reduce) {
  .arcade-feedback,.arcade-trainer,#minigameScreen .arcade-cards > button { transition:none; }
  .arcade-reveal > div,.arcade-dealt,.arcade-finish,.arcade-belt { animation:none; }
  #minigameScreen .arcade-cards > button[aria-pressed="true"] { transform:none; }
}
.group-field .unit { height:26%; }
.group-field .unit.own.group-slot-0 { left:20%; top:89%; }
.group-field .unit.own.group-slot-1 { left:40%; top:93%; }
.group-field .unit.foe.group-slot-0 { left:64%; top:47%; }
.group-field .unit.foe.group-slot-1 { left:82%; top:51%; }
.group-field .vitals { width:min(22%,215px); padding:5px 7px; }
.group-field .foe-hud { top:12%; left:auto; }
.group-field .foe-hud.group-slot-0 { right:25%; }
.group-field .foe-hud.group-slot-1 { right:2%; }
.group-field .own-hud { bottom:36%; right:auto; }
.group-field .own-hud.group-slot-0 { left:2%; }
.group-field .own-hud.group-slot-1 { left:25%; }
.group-battle-actions {
  width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 8px;
}
.group-battle-actions label { margin:0; min-width:0; color:#fbeac8; }
.group-battle-actions select { padding:5px; }
.group-battle-actions button { grid-column:1/-1; justify-self:center; }
.dual-commands { display: grid; gap: 8px; width: 100%; }
.dual-command-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr)); gap: 6px; }
.dual-command-grid button { min-height: 42px; text-align: left; overflow-wrap: anywhere; }
.dual-command-grid button small { display: block; color: #d6e8e7; font-size: .75rem; letter-spacing: normal; }
.dual-command-grid button[aria-pressed="true"] { border-color: #f1d483; background: #345a60; }
.dual-command-grid.dual-moves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dual-active-name { margin: 0; color: #ffdf9c; font: 700 .85rem system-ui; }

#minigameScreen[data-game="fog"] .mini-shell { width: min(100%, 1150px); }
#minigameScreen[data-game="fog"] .mini-heading { margin-bottom: 10px; }
.fog-stage { width: min(100%, 840px, calc(100dvh - 130px)); margin: 0 auto; display: grid; gap: 8px; }
.fog-hud {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 6px 12px; padding: 8px 12px; background: #142934; border: 1px solid #476872; border-radius: 10px;
}
.fog-hud output { color: #ffe0a4; font-weight: 750; font-variant-numeric: tabular-nums; }
.fog-board {
  position: relative; overflow: hidden; isolation: isolate; width: var(--fog-scale, 100%);
  aspect-ratio: 1; margin: auto; border: 2px solid #9ab9a2; border-radius: 12px;
  background: linear-gradient(150deg, #122f3540, #091f26a0), url(scenes/campo-pixel.png) center / cover;
  box-shadow: 0 12px 36px #061415a6, inset 0 0 60px #071d23a8;
  transition: width .44s ease-in-out;
}
.fog-units { position: absolute; inset: 0; z-index: 2; }
.fog-mist {
  position: absolute; inset: -35%; z-index: 1; pointer-events: none;
  transition: opacity .75s ease-out, transform .9s ease-out;
}
.fog-mist::before, .fog-mist::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 40%, #b1d7d8ea, transparent 44%),
    radial-gradient(ellipse at 74% 66%, #bbdbe2e0, transparent 58%),
    radial-gradient(ellipse at 58% 24%, #d5e9e6da, transparent 45%);
  filter: blur(15px);
  animation: fog-drift 7s ease-in-out infinite alternate;
}
.fog-mist::after { opacity: .7; animation: fog-drift 11s ease-in-out infinite alternate-reverse; rotate: -22deg; }
.fog-board[data-clearing="true"] .fog-mist { opacity: 0; transform: translate(25%, -14%) scale(1.18); }
.fog-dragon {
  position: absolute; width: 100%; height: 0; pointer-events: none;
  transition: left .045s linear, top .045s linear;
}
.fog-sprite {
  position: absolute; left: 0; top: 0; width: clamp(28px, 6vmin, 60px); aspect-ratio: 1;
  transform: translate(-50%, -56%);
  background: url(fog-dragonite.png) 0 calc(var(--fog-row) * 100% / 3) / 400% 400%;
  image-rendering: pixelated; animation: fog-flap .42s steps(4, end) infinite;
}
.fog-dragon b {
  position: absolute; top: 17px; left: 0; translate: -50% 0; white-space: nowrap;
  color: #f7efce; background: #142831e8; border-radius: 4px; padding: 2px 4px; font: 700 .63rem system-ui;
}
.fog-dragon[data-self="true"] b { color: #ffdf90; }
.fog-aim {
  position: absolute; left: 0; top: 0; width: var(--beam-length); height: 2px;
  transform: rotate(var(--aim-angle)); transform-origin: left center;
  background: #ff373f; box-shadow: 0 0 7px #ff3839;
}
.fog-board[data-revealed="true"] .fog-aim {
  height: 10px; background: linear-gradient(0deg, #ff8131, #fff9df 50%, #ff8131);
  box-shadow: 0 0 12px 4px #ff5f37, 0 0 25px 5px #ffac54;
  animation: fog-beam 1.05s .36s ease-out both;
}
.fog-board[data-revealed="true"] .fog-dragon[data-hit="true"] :is(.fog-sprite, b) {
  animation: fog-hit .65s .52s ease-out both;
}
@keyframes fog-flap {
  from { background-position-x: 0; }
  to { background-position-x: calc(100% * 4 / 3); }
}
@keyframes fog-drift { from { transform: translate(-10%, 8%) scale(1.05); } to { transform: translate(12%, -8%) scale(1.18); } }
@keyframes fog-beam { 0% { opacity: 0; } 12%, 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fog-hit { 30% { filter: brightness(3); } 100% { opacity: 0; translate: 0 12px; } }
@media (prefers-reduced-motion: reduce) {
  .fog-mist::before,.fog-mist::after,.fog-sprite { animation: none; }
  .fog-dragon { transition: none; }
}
@media (min-width: 651px) {
  #arena:has(.group-field) { --battle-console-height: clamp(252px, 32dvh, 324px); }
}
#arena [data-battle-unit][hidden], #arena [data-battle-position][hidden],
.ending [data-battle-unit][hidden], .ending [data-battle-position][hidden] { display: none; }

#pokemonDetails {
  width: min(750px, calc(100% - 24px)); max-height: 90dvh;
  overflow: auto; padding: 0; border: 1px solid #7b9b8b; border-radius: 18px;
  background: #102b33; color: #f7ecd4; box-shadow: 0 22px 70px #020a0ce0;
  scrollbar-color: #759d92 #122f35;
}
#pokemonDetails::backdrop { background: #08191bb8; }
#pokemonDetails header {
  display: flex; position: relative; inset: auto; align-items: center; gap: clamp(12px, 3vw, 24px);
  height: auto; min-height: 0; width: 100%; margin: 0;
  padding: 17px 20px; border-bottom: 1px solid #759d8b;
  background: radial-gradient(ellipse at 10% 5%, #416e61, transparent 72%), #183b43;
}
#pokemonDetails header form { margin-left: auto; align-self: start; }
#pokemonDetails header button { width: 39px; height: 39px; padding: 0; color: #fff1d6; border: 1px solid #759b8c; background: #19343c; }
#pokemonDetails h2, #pokemonDetails h3, #pokemonDetails p { margin: 0; }
#pokemonDetails h2, #pokemonDetails h3 { color: #ffdda0; }
#pokemonDetails h2 { font-size: clamp(1.45rem, 5vw, 2.3rem); overflow-wrap: anywhere; }
#pokemonDetails h3 { font-size: .95rem; margin: 0 0 8px; }
.pokemon-details-sprite {
  display: grid; place-items: center; flex: 0 0 auto; width: clamp(70px, 14vw, 125px); aspect-ratio: 1;
  border: 1px solid #6f9985; border-radius: 14px; background: radial-gradient(circle, #437b6e, #23454b 73%);
}
.pokemon-details-sprite .fighter { position: static; width: 100%; height: 100%; max-height: 118px; object-fit: scale-down; transform: none; animation: none; }
.pokemon-details-sprite small { display: none; }
.pokemon-summary-identity { min-width: 0; flex: 1; }
.pokemon-summary-identity p { color: #d6e7df; font-size: .8rem; }
.pokemon-summary-types { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 8px; }
.pokemon-summary-types span { padding: 2px 8px; border: 1px solid #8eac9d; border-radius: 999px; font-size: .74rem; background: #285152; }
.pokemon-summary-types [data-type="fire"] { background: #964236; }
.pokemon-summary-types [data-type="water"] { background: #235c83; }
.pokemon-summary-types [data-type="grass"] { background: #3b6943; }
.pokemon-summary-types [data-type="electric"] { background: #745c27; }
.pokemon-summary-health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; font-size: .75rem; }
.pokemon-summary-health progress { width: min(100%, 200px); height: 10px; accent-color: #79cf9d; }
.pokemon-details-info { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 10px; padding: 12px; }
.pokemon-summary-panel { min-width: 0; padding: 10px; border: 1px solid #436768; border-radius: 10px; background: #17353d; }
.pokemon-detail-stats, .pokemon-details-info ul { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; }
.pokemon-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pokemon-detail-stats div, .pokemon-details-info li { padding: 6px 8px; border-radius: 6px; background: #224650; }
.pokemon-detail-stats dt { font-size: .75rem; color: #c2dcd7; }
.pokemon-detail-stats dd { margin: 2px 0 0; font-weight: 750; overflow-wrap: anywhere; }
.pokemon-summary-traits { grid-template-columns: minmax(0, 1fr); }
.pokemon-summary-traits div { display: flex; justify-content: space-between; gap: 6px; }
.pokemon-summary-traits dd { margin: 0; text-align: right; }
.pokemon-summary-equipment { padding: 8px; border: 1px solid #648176; border-radius: 7px; background: #193941; }
.pokemon-summary-equipment > div { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pokemon-summary-moves li:has(> small:first-child) { display: flex; align-items: center; gap: 8px; }
.pokemon-summary-moves li > small:first-child { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: #15333d; }
.pokemon-summary-evolutions li { border-left: 2px solid #b49964; }
.pokemon-details-info li small { display: block; color: #d3e3da; }
.pokemon-details-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 12px 12px; }
.pokemon-held-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.pokemon-held-controls label { flex: 1 1 100%; margin: 0; min-width: 0; color: #d7eae0; }
.pokemon-held-controls select { width: 100%; }
@media (max-width: 470px) { .pokemon-details-info { grid-template-columns: minmax(0, 1fr); } }
.dual-commands footer { display: flex; justify-content: space-between; gap: 8px; }
.dual-target-panel { display: grid; gap: 8px; width: 100%; justify-items: center; }
.dual-target-panel p { margin: 0; text-align: center; }
.dual-target-panel footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.dual-target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: min(100%, 210px); }
.dual-target-grid .dual-target {
  display: grid; align-content: center; gap: 4px; min-width: 0; aspect-ratio: 1;
  padding: 4px; border: 1px solid #86baca; border-radius: 8px; background: #1a424f;
  color: #fff0cf; overflow-wrap: anywhere;
}
.dual-target small { color: #e0ebe6; font-size: .68rem; letter-spacing: normal; }
.dual-target-grid .dual-target:disabled { border-color: #52656d; background: #192b34; opacity: .55; }
.dual-target-grid:not(.fixed-range) .dual-target:is(:hover, :focus-visible):not(:disabled),
.dual-target-grid.fixed-range:has(.dual-target:is(:hover, :focus-visible):not(:disabled)) .dual-target:not(:disabled) {
  border-color: #ffda82; background: #416562; box-shadow: inset 0 0 0 1px #ffda82;
}
#arena .vitals.target-preview { outline: 2px solid #ffdb81; outline-offset: 2px; }
@media (max-width:650px) {
  .group-field .vitals { width:min(28%,170px); }
  .group-field .foe-hud.group-slot-0 { right:32%; }
  .group-field .own-hud.group-slot-1 { left:32%; }
  .group-field .foe-hud { top:16%; }
}


#duelTeamScreen:not([hidden]) {
  --lineup-gold: #ffdfa0;
  --lineup-paper: #fff2cf;
  --lineup-green: #84e9ab;
  position: fixed;
  inset: 0;
  z-index: 24;
  overflow: auto;
  padding: clamp(10px, 1.25vw, 22px);
  color: var(--lineup-paper);
  background: radial-gradient(ellipse at 50% 50%, #13443e55, transparent 74%), #05272a;
}
#game:has(#duelTeamScreen:not([hidden])) :is(#dock,#map,#gameHead,#partyRail) { visibility:hidden; }
body:has(#duelTeamScreen:not([hidden])) .system { display:none; }
#duelTeamScreen[data-format="multi"] {
  background: linear-gradient(140deg, #1353485c 9%, transparent 9% 82%, #1353485c 82%),
    radial-gradient(ellipse at 50% 53%, #064637, #032a27 58%, #032724);
}
.duel-team-shell { width: min(100%, 1740px); min-height: 100%; margin: auto; display: flex; flex-direction: column; gap: clamp(13px, 3dvh, 30px); }
.duel-team-heading {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: auto;
  gap: clamp(9px, 1.4vw, 24px);
  padding: 9px clamp(12px, 1.7vw, 30px);
  background: linear-gradient(140deg, #14574a, #073430 40%, #06272b);
  border: 2px solid #cdbb7e;
  border-radius: clamp(13px, 1.65vw, 28px);
  box-shadow: inset 0 2px 12px #9be2a728;
}
.duel-team-heading > .hud-icon { color: var(--lineup-gold); width: clamp(35px, 4vw, 66px); height: auto; aspect-ratio: 1; flex: none; }
.duel-team-heading > div { border-left: 2px solid #efd38c; padding-left: clamp(10px, 1.4vw, 24px); }
.duel-team-heading h2 { margin: 0; color: var(--lineup-paper); font: 700 clamp(1.55rem, 3.4vw, 3.65rem)/1.02 Georgia, serif; }
.duel-team-heading p { margin: 5px 0 0; color: var(--lineup-gold); font: 650 clamp(.76rem, 1.3vw, 1.33rem)/1.2 system-ui, sans-serif; }
.duel-team-heading > strong {
  margin-left: auto;
  flex: none;
  padding: clamp(6px, .75vw, 13px) clamp(10px, 1.3vw, 23px);
  background: #062728;
  color: var(--lineup-paper);
  border: 1px solid #92a59a;
  border-radius: clamp(10px, 1.35vw, 23px);
  font: 750 clamp(.95rem, 1.65vw, 1.7rem)/1 system-ui, sans-serif;
}
[data-format="multi"] .duel-team-heading {
  justify-content: center;
  background: none;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  align-items: start;
  padding: 7px 92px 3px;
  text-align: center;
}
[data-format="multi"] .duel-team-heading > div { border: 0; padding: 0; }
[data-format="multi"] .duel-team-heading > .hud-icon { width: clamp(29px, 3.1vw, 53px); margin-top: 3px; }
[data-format="multi"] .duel-team-heading p {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #ddd9a6;
  border-radius: 20px;
  color: var(--lineup-paper);
}
[data-format="multi"] .duel-team-heading > strong { position: absolute; top: 8px; right: 8px; border-color: #eee1a6; }
.lineup-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(60px, 12vw, 215px) minmax(0, 1fr);
  align-items: stretch;
  width: min(100%, 1600px);
  margin-inline: auto;
}
[data-format="multi"] .lineup-match { width: min(94%, 1460px); grid-template-columns: minmax(0, 1fr) clamp(52px, 8.3vw, 146px) minmax(0, 1fr); }
.lineup-side {
  --lineup-side-edge: #83e0a6;
  --lineup-side-fill: #174d40;
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: clamp(10px, 1.6vw, 27px);
  border: 2px solid var(--lineup-side-edge);
  border-radius: clamp(13px, 1.65vw, 27px);
  background: linear-gradient(155deg, #164538ad, #08292b 66%);
  box-shadow: inset 0 3px 14px #9ffbc512;
}
.lineup-rivals { --lineup-side-edge: #d5bb83; --lineup-side-fill: #524a23; background: linear-gradient(155deg, #123836, #08292b 66%); }
[data-format="multi"] .lineup-side { margin-top: 11px; padding-top: clamp(19px, 2.1vw, 36px); box-shadow: inset 0 0 18px #97e8a62b; }
[data-format="multi"] .lineup-rivals { --lineup-side-edge: #ffe083; }
.lineup-banner {
  margin: 0;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%,-50%);
  padding: 4px clamp(18px, 3.2vw, 52px);
  border: 2px solid var(--lineup-side-edge);
  border-radius: 40px;
  color: var(--lineup-paper);
  background: linear-gradient(#146047, #06382e);
  font: 700 clamp(1rem, 2vw, 2rem)/1.15 Georgia, serif;
  white-space: nowrap;
}
[data-format="multi"] .lineup-trainer { padding: clamp(7px, 1.2vw, 20px); border: 1px solid var(--lineup-side-edge); border-radius: clamp(11px, 1.6vw, 24px); background: #052c27; }
.lineup-person { display: flex; align-items: center; gap: clamp(6px, 1vw, 16px); min-width: 0; padding: 0 0 9px; border-bottom: 1px solid var(--lineup-side-edge); }
[data-format="multi"] .lineup-person { padding-bottom: 5px; border: 0; }
.lineup-person .hud-icon, .lineup-limit .hud-icon, .duel-team-footer .hud-icon { color: var(--lineup-gold); width: clamp(17px, 2.05vw, 35px); height: auto; aspect-ratio: 1; flex: none; }
.lineup-person h3 { margin: 0; min-width: 0; color: var(--lineup-paper); font: 700 clamp(1rem, 2vw, 2.03rem)/1.12 Georgia, serif; overflow-wrap: anywhere; }
.lineup-status {
  margin-left: auto;
  flex: none;
  border-radius: 18px;
  padding: .22em .7em;
  background: var(--lineup-side-fill);
  color: #fff0ba;
  font: 750 clamp(.65rem, 1.12vw, 1.1rem)/1.2 system-ui, sans-serif;
}
.lineup-side:not(.lineup-rivals) .lineup-status { color: #062c26; background: #83dca4; }
.lineup-limit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--lineup-paper);
  font: 700 clamp(.84rem, 1.6vw, 1.67rem)/1.1 Georgia, serif;
}
.lineup-limit span {
  margin-left: auto;
  flex: none;
  padding: .3em .65em;
  border: 1px solid #71978c;
  border-radius: 18px;
  background: #0b3837;
  font: 650 clamp(.68rem, 1.04vw, 1.03rem)/1.15 system-ui, sans-serif;
}
[data-format="multi"] .lineup-limit { justify-content: center; margin: 4px 0 8px; }
[data-format="multi"] .lineup-limit span { margin: 0; }
.lineup-limit span b { color: #ffdf88; }
.lineup-roster { display: grid; gap: clamp(4px, .67vw, 10px); margin: 0; padding: 0; list-style: none; }
[data-format="multi"] .lineup-roster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lineup-slot { position: relative; min-width: 0; }
.lineup-slot :is([data-duel-pick], .lineup-static) {
  display: flex;
  align-items: center;
  gap: clamp(4px, .8vw, 12px);
  width: 100%;
  min-height: clamp(36px, 6.7dvh, 60px);
  padding: 4px clamp(5px, 1vw, 17px);
  border: 1px solid #56807b;
  border-radius: clamp(7px, .9vw, 15px);
  background: #103333;
  color: #e6efdb;
  text-align: left;
}
[data-format="multi"] .lineup-slot :is([data-duel-pick], .lineup-static) {
  gap: 4px;
  min-height: clamp(35px, 5.8dvh, 57px);
  padding-inline: 5px;
  border-style: dashed;
  background: #07362e;
}
.lineup-slot .lineup-static.empty { color: #a5c0b7; }
.lineup-slot-mark { display: grid; place-items: center; flex: none; min-width: 1.9em; min-height: 1.55em; border: 1px solid #719287; border-radius: 6px; color: var(--lineup-paper); font-weight: 750; }
[data-format="multi"] .lineup-slot-mark { border: 0; min-width: 0; }
[data-format="multi"] .lineup-slot:has(.monToken) .lineup-slot-mark { display: none; }
.lineup-slot .hud-icon { width: clamp(13px, 1.5vw, 24px); height: clamp(13px, 1.5vw, 24px); }
.lineup-slot .monToken { flex: none; width: clamp(22px, 2.65vw, 44px); height: clamp(22px, 2.65vw, 44px); }
.lineup-slot .monToken img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lineup-slot .monToken small { display: none; }
.lineup-slot-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: clamp(.72rem, 1.22vw, 1.2rem)/1.15 system-ui, sans-serif; }
[data-format="multi"] .lineup-slot-name { font-size: clamp(.61rem, 1vw, .98rem); }
.lineup-slot-name b { font-weight: 650; }
.lineup-slot-own [data-duel-pick] { padding-right: 30px; }
[data-format="multi"] .lineup-slot-own [data-duel-pick] { padding-right: 22px; }
.lineup-order { margin-left: auto; min-width: 1.35em; flex: none; border-radius: 9px; background: #89e4a7; color: #0b3327; text-align: center; font: 750 .72rem/1.4 system-ui, sans-serif; }
.lineup-slot .lineup-summary { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); display: grid; place-items: center; min-height: 24px; padding: 2px; border: 0; background: transparent; color: #9ac0ab; }
.lineup-slot .lineup-summary .hud-icon { width: 15px; height: 15px; }
#duelTeamScreen .lineup-slot :is([aria-pressed="true"], .picked) {
  border: 1px solid #a6ffbb;
  background: #165741;
  box-shadow: inset 0 0 9px #6bf6a46b, 0 0 7px #75ffa646;
  color: #ecffe5;
  opacity: 1;
}
.lineup-slot [data-duel-pick]:hover:not(:disabled) { border-color: #a6ffbb; background: #174b40; }
.lineup-versus {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.lineup-versus::before { content: ""; position: absolute; z-index: -1; inset: 4% auto; width: 1px; background: linear-gradient(transparent, #598a79, transparent); }
.lineup-versus b {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(47px, 6.2vw, 108px);
  aspect-ratio: 1;
  border: 3px solid var(--lineup-gold);
  border-radius: 50%;
  background: radial-gradient(#1e4c43, #082f2c 70%);
  color: var(--lineup-paper);
  box-shadow: 0 0 0 10px #6fc8a316, 0 0 26px #86dca43d;
  font: 750 clamp(1.25rem, 3.2vw, 3.55rem)/1 Georgia, serif;
}
.lineup-versus b::before, .lineup-versus b::after {
  content: "";
  position: absolute;
  width: 47%;
  height: 20%;
  top: 40%;
  inset-inline-end: 103%;
  background: repeating-linear-gradient(to bottom, #ffdc82 0 19%, transparent 19% 41%);
  clip-path: polygon(0 50%, 38% 0, 100% 0, 100% 100%, 38% 100%);
}
.lineup-versus b::after { inset-inline: 103% auto; transform: scaleX(-1); }
.duel-team-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(100%, 1600px); margin-inline: auto; padding: 8px 11px; border: 1px solid #d9c68a; border-radius: 14px; background: #0b3636; }
.duel-team-footer div, .duel-team-footer p { display: flex; align-items: center; gap: 7px; }
.duel-team-footer p { margin: 0; font: 550 clamp(.72rem, 1.15vw, 1.12rem)/1.25 system-ui, sans-serif; }
.duel-team-footer button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 5px clamp(10px, 1.4vw, 24px); border: 1px solid #ddd0a0; border-radius: 11px; background: #143f39; color: #ffedbd; font-weight: 750; white-space: nowrap; }
.duel-team-footer button.primary { background: linear-gradient(#ffe9aa, #f7cc75); color: #092f29; }
.duel-team-footer button.primary .hud-icon { color: inherit; }
.duel-team-footer button:disabled { opacity: .6; cursor: default; }
[data-format="multi"] .duel-team-footer { flex-direction: column; padding: 0; background: transparent; border: 0; gap: clamp(8px, 2dvh, 20px); }
[data-format="multi"] .duel-team-footer p { justify-content: center; width: 100%; padding: 7px; border: 1px solid #b4bd93; border-radius: 13px; background: #082f2b; }
[data-format="multi"] .duel-team-footer button { min-width: min(80vw, 310px); }
#duelTeamScreen button:focus-visible { outline: 2px solid var(--lineup-gold); outline-offset: 2px; }
@media (max-width: 780px) {
  [data-format="multi"] .lineup-match { width: 100%; grid-template-columns: minmax(0, 1fr) 45px minmax(0, 1fr); }
  .lineup-side { padding-inline: 8px; }
}
@media (max-width: 560px) {
  [data-format] .lineup-match, [data-format="multi"] .lineup-match { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lineup-versus { padding-block: 4px; }
  .lineup-versus::before { display: none; }
  [data-format="multi"] .duel-team-heading { padding-inline: 0 55px; text-align: left; }
  [data-format="multi"] .duel-team-heading > strong { right: 0; top: 7px; padding-inline: 6px; }
  .duel-team-footer { flex-wrap: wrap; }
  .duel-team-footer div { margin-left: auto; }
  [data-format="multi"] .duel-team-footer div { margin-left: 0; }
}

.exchange {
  --exchange-line: #54736e;
  display: grid;
  gap: 12px;
  color: #edf4eb;
}
.exchange > header {
  border-bottom: 1px solid #ae9465;
  padding: 4px 0 12px;
}
.exchange h2, .exchange h3, .exchange h4, .exchange p { margin: 0; }
.exchange h2 { color: #ffe3a7; font-size: clamp(1.45rem, 3vw, 2.05rem); }
.exchange h3 { font-size: 1rem; color: #ffe3a7; }
.exchange h4 { font-size: .85rem; color: #dbeee6; }
.exchange button {
  background: #244642;
  color: #fff1d5;
  border-color: #728d83;
}
.exchange button:not(:disabled):hover { background: #365d55; }
.exchange button.primary {
  background: #f1d49b;
  color: #24271e;
}
.exchange button.primary:not(:disabled):hover { background: #ffe2a8; }
.exchange button:disabled {
  background: #344a46;
  color: #cedad4;
  opacity: 1;
}
.exchange :is(button, input, select):focus-visible {
  outline: 2px solid #ffe3a7;
  outline-offset: 2px;
}
.exchange button[aria-pressed="true"] { border-color: #e6c687; background: #355651; }
.exchange-offer > header, .exchange > footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.exchange-terms { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.exchange-side {
  min-width: 0;
  background: #1e393a;
  padding: 8px;
  border: 1px solid #496560;
  border-radius: 8px;
}
.exchange-add { display: grid; grid-template-columns: minmax(0,1fr) 55px; gap: 5px; }
.exchange-add label { min-width: 0; font-size: .76rem; color: #dbeee6; }
.exchange-add :is(select,input), .exchange-add option {
  color: #183430;
  background: #fffdf3;
}
.exchange-add :is(select,input) { min-width: 0; width: 100%; }
.exchange-add button { grid-column: 1 / -1; }
.exchange-assets { display: grid; gap: 4px; padding: 0; margin: 6px 0; list-style: none; }
.exchange-asset {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
  min-width: 0;
  padding: 5px;
  background: #0d282b;
  border-radius: 6px;
  font-size: .79rem;
  overflow-wrap: anywhere;
}
.exchange-asset img { object-fit: contain; width: 32px; height: 32px; image-rendering: pixelated; }
.exchange-asset button { margin-left: auto; font-size: .7rem; padding: 3px 5px; }
.exchange-asset summary { cursor: pointer; font-weight: bold; }
.exchange-tabs, .exchange-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.exchange-tabs button, .exchange-buttons button { font-size: .76rem; padding: 5px 7px; }
.exchange-offer {
  display: grid;
  gap: 8px;
  background: #1e393a;
  border: 1px solid #496560;
  border-radius: 8px;
  padding: 7px;
}
.exchange-offer > header span { color: #ddd0a5; font-size: .78rem; }
.exchange-review { display: grid; gap: 6px; padding: 6px; border: 1px solid #b89960; border-radius: 6px; }
.exchange-warning { color: #ffe1a0; font-size: .8rem; }
.exchange-empty { color: #c8dcd4; padding: 8px 0; }
.exchange > footer { border-top: 1px solid #54736e; padding-top: 8px; }
@media (max-width: 390px) {
  .exchange-add { grid-template-columns: minmax(0,1fr); }
}
.destination::before,#arena .field::before {
  content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:
    linear-gradient(145deg, rgb(28 39 110 / var(--world-night,0)), rgb(9 27 67 / var(--world-night,0))),
    linear-gradient(150deg, rgb(255 167 81 / var(--world-warm,0)), rgb(235 110 52 / var(--world-warm,0)));
}
.destination > :is(h2,small,.building,.lab-village-buildings,footer) { z-index:2; }
.destination > :is(.job-panel,.facility-panel) { z-index:3; }
#arena .field::before { z-index:0; }
.world-period { white-space:nowrap; }
.world-period i { color:#f8d48e; font-style:normal; }
.player-guide-link { display:inline-block; margin:6px 0 10px; color:#ffe2a3; text-underline-offset:3px; }
.lobby-links { display:flex; flex-wrap:wrap; column-gap:16px; }
.lab-jobs .job-board { max-height:none; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.lab-jobs { margin-top:12px; }
.lab-jobs summary { cursor:pointer; }
.action-balance {
  display: inline-block;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid #bd9e60;
  border-radius: 999px;
  background: #172e32;
  color: #ffe5ad;
  font: 700 .8rem/1.25 system-ui, sans-serif;
  white-space: nowrap;
}
.post-heading > .action-balance, .lab-heading > .action-balance { color: #ffe5ad; }
.shop-heading { flex-wrap: wrap; }

.move-lesson-options article {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid #56776a;
  border-radius: 8px;
  background: #1b3b32;
}
.move-lesson-options small { color: #cbd9cb; }
.lesson-move {
  color: #ffe2a3;
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  cursor: help;
}
.battle-move:disabled { opacity: .6; cursor: not-allowed; }

#minigameScreen[data-game="guess"] .mini-shell { width: min(100%, 1260px); }
#minigameScreen[data-game="guess"] .butterfree-grove {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(115px, 1fr); align-items: center;
  min-height: 440px; gap: 8px 12px; padding: 12px 22px;
}
#minigameScreen[data-game="guess"] .butterfree-flight {
  position: relative; width: 100%; min-width: 0;
  animation: clue-hover var(--speed) var(--phase) ease-in-out infinite alternate;
}
#minigameScreen[data-game="guess"] .butterfree-flight:is(:hover, :focus-within) { animation-play-state: paused; }
#minigameScreen[data-game="guess"] .butterfree-clue span { max-width: 100%; overflow-wrap: anywhere; }
@keyframes clue-hover { from { transform: translate(-5px, -6px); } to { transform: translate(5px, 6px); } }
@media (max-width: 680px) {
  #minigameScreen[data-game="guess"] .butterfree-grove { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px; }
}
@media (max-width: 430px) {
  #minigameScreen[data-game="guess"] .butterfree-grove { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  #minigameScreen[data-game="guess"] .butterfree-flight { animation: none; }
}

#overlay.facility-full:has(.center-screen) > .panel-toolbar { top: clamp(12px, 5dvh, 48px); right: clamp(12px, 4vw, 58px); }
#overlay.facility-full:has(.center-screen) #dismiss {
  background: #603044; color: #fff4e9; border: 1px solid #ffb5b5;
  border-radius: 12px; box-shadow: 0 0 12px #ffa3a675; width: 46px; height: 46px;
}
.center-screen[data-theme="center"] {
  display: flex; flex-direction: column;
  padding: clamp(12px, 3dvh, 34px) clamp(10px, 2vw, 34px) clamp(8px, 2dvh, 20px);
  background: radial-gradient(ellipse at 50% 0, #ed697353, transparent 43%),
    linear-gradient(#301827d9, #231521ee), url(scenes/city-pixel.png) center / cover;
}
.center-screen :is(.center-heading, .center-layout, .center-work) { width: min(100%, 1580px); }
.center-screen .center-heading {
  flex: none;
  width: min(95%, 1500px); position: relative; margin-bottom: 0;
  padding: clamp(7px, 1.8dvh, 18px) 54px; border: 1px solid #e6a0a58c; border-bottom: 0; border-radius: 44px 44px 0 0;
  background: radial-gradient(ellipse at 50% 0, #cb555a70, transparent 64%), linear-gradient(#4a2537, #552737);
}
.center-screen .center-heading > .center-ball-seal {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -54%);
  color: #ffd2aa; background-color: #a3394e; box-shadow: 0 0 24px #ff987e;
}
.center-ball-seal {
  display: inline-block; position: relative; flex: 0 0 auto; width: 32px; aspect-ratio: 1;
  border: 4px solid currentColor; border-radius: 50%; color: #efadac;
  background: linear-gradient(transparent 44%, currentColor 44% 56%, transparent 56%);
}
.center-ball-seal::after {
  content: ""; position: absolute; inset: 28%; border-radius: 50%; background: #502838; border: 2px solid currentColor;
}
.center-screen .center-layout {
  flex: 1 1 auto; min-height: 0;
  align-items: stretch; grid-template-columns: minmax(190px, .92fr) minmax(0, 2.4fr);
  gap: clamp(10px, 1.3vw, 20px); padding: clamp(9px, 1.5vw, 22px);
  border: 1px solid #ffc4b5; border-radius: 22px;
  background: linear-gradient(130deg, #472332ed, #502738f2);
  box-shadow: 0 0 22px #fa917654, inset 0 0 18px #ffa68b35;
}
.center-screen .center-reception { display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #582c3e; }
.center-screen .center-reception img { height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; object-position: center 35%; }
.center-screen .center-reception p {
  position: relative; margin: 0; padding: clamp(12px, 2vw, 26px);
  color: #592639; background: linear-gradient(145deg, #fff0e5, #f7cabc);
  font: 750 clamp(.9rem, 1.65vw, 1.45rem)/1.35 system-ui; border-top: 1px solid #ffd3c4;
}
.center-screen .center-care { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.center-screen .center-team-heading {
  align-items: center; margin: 0; padding: 8px 12px; border: 1px solid #d77b8d;
  border-radius: 12px 12px 0 0; background: linear-gradient(115deg, #a9465b, #552a3a 72%);
}
.center-screen .center-team-heading h3 { display: flex; align-items: center; gap: 9px; color: #fff0e4; }
.center-screen .center-team-heading > span {
  white-space: nowrap; padding: 4px 10px; border: 1px solid #f295a3; border-radius: 999px; background: #482330; color: #fff0e4;
}
.center-screen .center-team {
  flex: 1 1 auto; min-height: 0; grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(5px, 1dvh, 12px); padding: clamp(6px, 1.3dvh, 14px);
  border-radius: 0 0 12px 12px; background: #2d1a27a8;
}
.center-screen .center-mon {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: 0; color: #ffe6dd;
  border-color: #b96178; background: linear-gradient(145deg, #633044, #472433);
  box-shadow: inset 0 0 16px #ef889817;
}
.center-screen .center-mon-main { width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.center-screen .center-mon-main, .center-screen .center-mon-main img { min-height: 0; height: clamp(30px, 9dvh, 84px); }
.center-screen .center-mon-main:hover { background: #ffffff0f; }
.center-screen .center-mon-main .fighter {
  position: static; transform: none; animation: none; object-fit: scale-down;
}
.center-screen .center-vacant { align-items: center; gap: 8px; }
.center-screen .center-vacant::before {
  content: "+"; position: absolute; inset: 0 auto auto 0; padding: 2px 0 0 9px; width: 45px; height: 45px;
  clip-path: polygon(0 0, 100% 0, 0 100%); background: #ac5066; font: 750 1.35rem system-ui;
}
.center-screen .center-vacant::after {
  content: ""; position: absolute; inset: 7px; border: 1px dashed #e299a97a; border-radius: 7px; pointer-events: none;
}
.center-screen .center-treatment {
  margin-top: 6px; padding: 8px; border: 1px solid #ad6076; border-radius: 11px; background: #4e2637;
}
.center-screen .center-work {
  flex: none; margin-top: 6px; padding: 4px 8px; gap: 5px 10px;
}
.center-screen .center-heal {
  flex: 1 1 190px; min-width: 0; color: #fff0e4; border: 1px solid #ffc5b9;
  background: linear-gradient(#d75973, #9c314c); box-shadow: 0 0 13px #ff889677;
}
@media (max-width: 760px) {
  .center-screen .center-heading { padding-inline: 37px; gap: 7px; }
  .center-screen .center-heading h2 { font-size: clamp(17px, 5vw, 26px); }
  .center-screen .center-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .center-screen .center-reception { grid-template-columns: minmax(85px, 25%) minmax(0, 1fr); grid-template-rows: auto; }
  .center-screen .center-reception img { min-height: 0; height: 70px; object-position: center 30%; }
  .center-screen .center-reception p { display: grid; align-items: center; border-top: 0; }
  .center-screen .center-team { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .center-screen .center-mon-main, .center-screen .center-mon-main img { height: clamp(25px, 6dvh, 50px); }
  .center-screen .center-vacant { gap: 3px; }
  .center-screen .center-ball-seal { width: 24px; }
  .center-screen .center-treatment { gap: 4px 7px; padding: 5px; }
}

/* Sound remains reachable above full-screen phases and facility panels. */
body .system:has(#sound) { z-index: 56; }
#sound { visibility: visible; }
body:has(#overlay:not([hidden]) .post-screen) #sound { visibility: hidden; }
#soundSettings {
  width: min(22rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 1.2rem;
  border: 1px solid #87a99d;
  border-radius: 14px;
  background: #193631;
  color: #fff3d3;
  box-shadow: 0 14px 44px #101d25a8;
}
#soundSettings::backdrop { background: #0d2129a8; }
#soundSettings h2 { margin: 0 0 1rem; }
#soundSettings label {
  display: flex;
  justify-content: space-between;
  color: inherit;
}
#soundSettings .sound-mute {
  justify-content: flex-start;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1rem;
}
#soundSettings input { accent-color: #f6d589; }
#soundSettings input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; }
#soundSettings input[type="range"] { display: block; width: 100%; margin: .25rem 0 1rem; padding: 0; }
#soundSettings output { font-variant-numeric: tabular-nums; }
#soundSettings form { text-align: right; }

#minigameScreen[data-game="alphabet"] {
  background:radial-gradient(ellipse at 50% 30%,#154b4466,#071519ec 76%),url("scenes/floresta-pixel.png") center/cover;
}
.abc-panel { width:min(100%,620px); margin:auto; text-align:center; color:#f6edd8; }
.abc-board {
  position:relative;
  isolation:isolate;
  width:min(96%,440px,51dvh);
  aspect-ratio:1;
  margin:16px auto;
}
.abc-ring {
  position:absolute;
  inset:0;
  border:1px solid #b1e6b869;
  border-radius:50%;
  background:radial-gradient(circle,#173d36eb 0 31%,#234941bb 32% 62%,#112b2cac 63% 100%);
  box-shadow:inset 0 0 0 10px #b3ffca0e,0 0 35px #0f6e514c;
}
.abc-ring::before {
  content:"";
  position:absolute;
  inset:9%;
  border:1px dashed #d2fccb7d;
  border-radius:50%;
}
.abc-seat {
  position:absolute;
  left:var(--x);
  top:var(--y);
  width:clamp(30px,9vw,56px);
  aspect-ratio:1;
  display:grid;
  place-items:center;
  transform:translate(-50%,-50%);
  border:1px solid #adcac79c;
  border-radius:50%;
  background:linear-gradient(#31584a,#142a2d);
  transition:opacity .25s,box-shadow .25s;
}
.abc-seat img { width:80%; height:80%; object-fit:contain; image-rendering:pixelated; }
.abc-seat > span {
  position:absolute;
  top:86%;
  max-width:138%;
  overflow:hidden;
  padding:1px 4px;
  border-radius:4px;
  background:#081b1e;
  font-size:clamp(.53rem,2vw,.72rem);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.abc-seat[data-status="active"] { z-index:1; border-color:#ffe19c; box-shadow:0 0 16px #ffc668; }
.abc-seat[data-status="out"] { opacity:.34; filter:grayscale(1); }
.abc-center {
  position:absolute;
  inset:23%;
  display:grid;
  place-content:center;
  gap:3px;
  pointer-events:none;
}
.abc-letter {
  color:#ffe8ac;
  font:700 clamp(2.5rem,12vw,5.4rem)/1 Georgia,serif;
  text-shadow:0 3px #8c5939,0 0 25px #ffa86b70;
  animation:abc-reveal .24s ease-out both;
}
@keyframes abc-reveal { from { opacity:.3; transform:scale(.82); } }
#abcTimer { font-weight:800; font-variant-numeric:tabular-nums; color:#c9f1ca; }
#abcTimer.abc-countdown { color:#ffe8ac; font-size:clamp(1.7rem,8vw,3.2rem); }
.abc-center:has(.abc-countdown) .abc-letter { display:none; }
.abc-letters { display:flex; flex-wrap:wrap; justify-content:center; gap:5px; }
.abc-letters > span { min-width:1.65rem; padding:3px; border:1px solid #97c9a759; border-radius:5px; background:#182c2d; }
.abc-letters > span[aria-current="true"] { background:#ffe8ac; color:#233b2e; font-weight:800; }
.abc-last { min-height:1.35em; margin:8px 0; color:#dbf1c9; }
#alphabetForm > div { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:5px; }
#alphabetName { width:min(100%,255px); }
@media(prefers-reduced-motion:reduce) {
  .abc-letter { animation:none; }
  .abc-seat { transition:none; }
}

#tradeAlert {
  position: fixed;
  z-index: 60;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(80px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 8px 10px;
  border: 1px solid #d5b775;
  border-radius: 12px;
  background: #182f31;
  color: #fff0cc;
  box-shadow: 0 6px 22px #071d2780;
}
#tradeAlert[hidden] { display: none; }
#tradeAlert button { min-height: 40px; }
#tradeDialog {
  inset: 12px 12px 12px auto;
  width: min(610px, calc(100vw - 24px));
  height: fit-content;
  max-height: calc(100dvh - 24px);
  margin: auto 0;
  padding: 0;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid #769487;
  border-radius: 16px;
  background: #122c30;
  box-shadow: 0 16px 60px #08131399;
}
#tradeDialog:not([open]) { display: none; }
#tradeDialog::backdrop { background: #06191c77; }
#tradeDialog > .trade-dialog-head, #tradeDialog > .trade-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
#tradeDialog > .trade-dialog-footer { justify-content: flex-end; }
#tradeDialog > .trade-dialog-footer[hidden] { display: none; }
.trade-dialog-head button, .trade-dialog-footer button { min-height: 44px; }
.trade-dialog-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 16px;
}
.trade-dialog-body button { min-height: 40px; }
#tradeFeedback { padding: 0 16px 10px; color: #ffe1a0; }
#tradeFeedback:empty { display: none; }
@media (max-width: 820px) {
  #tradeAlert { bottom: 85px; }
}
@media (max-width: 560px) {
  #tradeDialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  #tradeDialog .exchange-terms { grid-template-columns: minmax(0, 1fr); }
  #tradeDialog > .trade-dialog-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .trade-roster-label { display: none; }
}

/* Expedition HUD */
#game {
  --hud-gold: #fff0b6;
  --hud-ink: #032526;
  --hud-line: #99cac0;
  --hud-surface: linear-gradient(160deg, #185e54 0%, #073637 34%, #032526 68%, #063837 100%);
  --hud-edge: linear-gradient(145deg, #ffe7a3 0%, #abecbd 28%, #fff0bc 55%, #ffe5a6 100%);
  --hud-shadow: inset 0 4px 13px #83ffd847, inset 0 -3px 11px #82e7ba25, 0 12px 28px #001923a1;
  --hud-rail-width: clamp(78px, 10vw, 170px);
}
#game :is(#expeditionHud, #partyRail, #dock) {
  border: 2px solid transparent;
  background: var(--hud-surface) padding-box, var(--hud-edge) border-box;
  box-shadow: var(--hud-shadow);
  color: var(--hud-gold);
}
#expeditionHud {
  position: absolute;
  z-index: 5;
  inset: 0 auto auto 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(1050px, 100%);
  display: grid;
  grid-template-columns: auto auto minmax(0, max-content) auto;
  align-items: center;
  justify-content: normal;
  gap: clamp(9px, 1.04vw, 18px);
  padding: clamp(7px, .76vw, 13px) clamp(10px, 1.05vw, 18px);
  height: auto;
  min-height: clamp(62px, 5.65vw, 94px);
  border-radius: 0 0 clamp(16px, 1.55vw, 24px) clamp(16px, 1.55vw, 24px);
}
.fighting #expeditionHud,
#game:has(:is(#minigameScreen, #duelTeamScreen, #finalScoreboard):not([hidden])) #expeditionHud,
#game:has(:is(#overlay,#personalOverlay):is(.visit,.facility-full):not([hidden])) #expeditionHud {
  visibility: hidden;
}
body.playing:not(.fighting):not(:has(
  :is(#minigameScreen, #duelTeamScreen, #finalScoreboard):not([hidden]),
  :is(#overlay, #personalOverlay):is(.visit, .facility-full):not([hidden])
)) .system { display: none; }
#expeditionHud .hud-icon, #partyRail .party-heading .hud-icon, #partyRail .rail-empty .hud-icon, #dock .dock-crest .hud-icon,
:is(#sound, #postSound) .hud-icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.expedition-mark, .party-heading > span, .dock-crest {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffe7a3;
}
.expedition-mark {
  width: clamp(35px, 3.55vw, 61px);
  aspect-ratio: 1;
  border: 2px solid #83c8b7;
  background: #032526;
  box-shadow: inset 0 3px 7px #67c5ae63;
  font-size: clamp(24px, 2.6vw, 45px);
}
#gameHead {
  position: static;
  padding: 0;
  align-self: stretch;
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  background: #012327b0;
  color: #fff4ce;
}
#gameHead .turn, #gameHead .turnName { padding: 0 clamp(9px, 1.4vw, 24px); gap: 3px; }
#gameHead .turn { border-color: #97beb1; }
#gameHead .turnName { min-width: 0; }
#gameHead .turn small { font: 650 clamp(.74rem, 1.1vw, 1.2rem)/1.1 system-ui, sans-serif; letter-spacing: 0; }
#gameHead .turn b { font: 750 clamp(1.25rem, 2.12vw, 2.25rem)/1.1 system-ui, sans-serif; white-space: nowrap; }
#gameHead .turn sub { font: inherit; font-size: .67em; }
#gameHead .turnName > b { font: 750 clamp(.95rem, 1.47vw, 1.55rem)/1.12 system-ui, sans-serif; }
#gameHead .turnName span { font-size: clamp(.66rem, 1.03vw, 1.1rem); color: #fff2d1; }
#gameHead .turnName > span:first-of-type { white-space: nowrap; }

#tradeRoster {
  display: grid;
  align-self: stretch;
  align-content: center;
  min-width: 0;
  padding: 0 clamp(8px, 1.5vw, 26px);
  border-inline: 1px solid #9fbdb1;
}
#tradeRoster[hidden], #hudOffers[hidden] { display: none; }
.trade-roster-players {
  --trainer-gap: clamp(5px, .85vw, 15px);
  display: flex;
  align-items: stretch;
  gap: var(--trainer-gap);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.trade-trainer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: clamp(2px, .55vw, 10px);
  min-height: clamp(34px, 3.3vw, 56px);
  padding: 2px clamp(4px, .74vw, 13px);
  border: 1px solid #528684;
  border-radius: clamp(8px, .85vw, 14px);
  background: #012629;
  color: #fff3cf;
  font: 650 clamp(.68rem, 1.05vw, 1.08rem)/1.2 system-ui, sans-serif;
}
.trade-trainer .trainer-preview { width: clamp(23px, 2.15vw, 38px); height: clamp(23px, 2.15vw, 38px); flex: none; }
.trade-trainer > span:last-child { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tradeRoster button.trade-trainer:hover { border-color: #fff1ba; background: #064542; box-shadow: inset 0 0 8px #8cffe8a8; }
.trade-roster-scroll { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.trade-roster-scroll[hidden] { display: none; }
.trade-roster-scroll button {
  min-height: 15px;
  border: 0;
  background: transparent;
  color: #fff1c7;
  padding: 0 3px;
  font: 1.4rem/.75 system-ui, sans-serif;
}
.trade-roster-scroll button:disabled { opacity: .55; }
#tradeScrollTrack { height: 6px; border-radius: 8px; background: #52848399; position: relative; overflow: hidden; }
#tradeScrollTrack span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #f9f2c9; }

#expeditionTools { display: flex; justify-content: flex-end; align-items: center; gap: clamp(5px, 1vw, 17px); grid-column: -2; }
#expeditionTools button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: clamp(4px, .5vw, 9px);
  min-width: clamp(34px, 3.45vw, 59px);
  height: clamp(34px, 3.4vw, 58px);
  border: 1px solid #82ac9d;
  border-radius: clamp(8px, .76vw, 13px);
  background: linear-gradient(#174942, #032527);
  color: #ffe4a4;
  font: 750 clamp(.72rem, 1.25vw, 1.33rem)/1 system-ui, sans-serif;
}
#expeditionTools button[hidden] { display: none; }
#expeditionTools .hud-icon { font-size: clamp(17px, 1.87vw, 31px); }
#expeditionTools #hudOffers {
  padding-inline: clamp(7px, 1vw, 18px);
  color: #07312d;
  background: linear-gradient(#fff1c7, #ffe0a0);
  border-color: #ffffdd;
  white-space: nowrap;
  margin-right: clamp(0px, .4vw, 7px);
}
#expeditionTools button:hover { box-shadow: inset 0 0 10px #87ffe465; }

#game #partyRail {
  --slot-width: auto;
  --slot-height: auto;
  inset: clamp(82px, 7vw, 116px) 0 auto auto;
  transform: none;
  width: var(--hud-rail-width);
  height: min(62dvh, 590px);
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  gap: clamp(4px, .52vw, 9px);
  padding: clamp(7px, 1.2vw, 20px);
  border-radius: 16px 0 0 16px;
}
.party-heading { display: grid; justify-items: center; gap: 4px; padding-bottom: clamp(3px, .6vw, 10px); }
.party-heading > span { display: flex; width: 100%; justify-content: center; gap: 6px; font-size: clamp(18px, 2.05vw, 34px); }
.party-heading > span::before, .party-heading > span::after {
  content: "";
  width: 31%;
  height: 4px;
  align-self: center;
  background: linear-gradient(90deg, transparent, #ffe9a9);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.party-heading > span::after { transform: scaleX(-1); }
#partyRail .party-heading small { font: 750 clamp(.68rem, 1.2vw, 1.27rem)/1.05 system-ui, sans-serif; letter-spacing: .13em; text-transform: uppercase; color: #ffe6ae; }
#game #partyRail :is(button, .rail-empty) {
  width: 100%;
  height: 100%;
  border: 1px solid #528481;
  border-radius: clamp(8px, 1.15vw, 19px);
  background: #092f32;
}
#partyRail .rail-empty { display: grid; place-items: center; color: #5f8f90; font-size: clamp(15px, 1.9vw, 32px); }

#game #dock {
  bottom: 0;
  z-index: 6;
  gap: 0;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 20px);
  min-height: clamp(57px, 5.55vw, 94px);
  padding: clamp(7px, .8vw, 13px) clamp(8px, 1vw, 16px) max(7px, env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
}
.dock-crest {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 0;
  transform: translate(-50%, -77%);
  width: clamp(42px, 5.6vw, 95px);
  aspect-ratio: 1.85;
  border: 2px solid #f8edb9;
  border-bottom: 0;
  border-radius: 100px 100px 0 0;
  background: linear-gradient(#15675b, #073537);
  box-shadow: inset 0 4px 7px #70e9c87d;
  font-size: clamp(19px, 2.1vw, 36px);
  pointer-events: none;
}
.dock-crest::before, .dock-crest::after {
  content: "";
  position: absolute;
  top: 62%;
  width: clamp(42px, 14vw, 235px);
  height: 6px;
  inset-inline-end: 100%;
  background: linear-gradient(90deg, transparent, #f9ebae);
  clip-path: ellipse(100% 100% at 100% 50%);
}
.dock-crest::after { inset-inline: 100% auto; transform: scaleX(-1); }
#game #dock button {
  flex-direction: row;
  padding: 0 clamp(9px, 1.8vw, 31px);
  gap: clamp(5px, .9vw, 16px);
  min-width: 0;
  min-height: 42px;
  color: #fff3cb;
  font: 750 clamp(.7rem, 1.38vw, 1.5rem)/1 system-ui, sans-serif;
}
#game #dock button + button { border-left: 1px solid #7aa29a; border-radius: 0; }
#game #dock .hud-icon { width: clamp(19px, 2.3vw, 39px); height: clamp(19px, 2.3vw, 39px); }
#expeditionHud button:focus-visible, #game #dock button:focus-visible, #game #partyRail button:focus-visible { outline: 2px solid #ffe7a0; outline-offset: 2px; }

@media (max-width: 820px) {
  #game { --hud-rail-width: 72px; }
  #expeditionHud { grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px 8px; }
  #tradeRoster { grid-area: 2 / 1 / 3 / -1; padding: 0; border: 0; }
  #expeditionTools { grid-area: 1 / 3; }
  #game #partyRail { top: 110px; height: min(49dvh, 410px); }
}
@media (max-width: 520px) {
  #game { --hud-rail-width: 51px; }
  #expeditionHud { grid-template-columns: minmax(0, 1fr) auto; padding: 6px; }
  .expedition-mark { display: none; }
  #expeditionTools { grid-column: 2; gap: 4px; }
  #expeditionTools button { min-width: 31px; height: 33px; }
  #expeditionTools #hudOffers { padding-inline: 5px; margin: 0; }
  #expeditionTools #hudOffers .hud-icon { display: none; }
  #gameHead .turn, #gameHead .turnName { padding-inline: 5px; }
  #gameHead .turnName > span { white-space: normal; }
  #game #partyRail { top: 105px; height: min(44dvh, 328px); padding: 4px; gap: 4px; }
  #partyRail .party-heading small { font-size: .52rem; }
  .party-heading > span { font-size: 15px; }
  .party-heading > span::before, .party-heading > span::after { height: 2px; }
  #game #dock button { gap: 4px; padding-inline: clamp(5px, 2.3vw, 12px); }
}

/* Personal panels share the expedition HUD materials and controls. */
#personalOverlay[data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  z-index: 7;
  width: min(660px, calc(100% - 28px));
  max-height: calc(100dvh - 200px);
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: clamp(16px, 1.55vw, 26px);
  background: var(--hud-surface) padding-box, var(--hud-edge) border-box;
  box-shadow: var(--hud-shadow), 0 18px 40px #00161db5;
  color: #fff3cf;
  scrollbar-color: #6eaca1 #082e30;
}
#personalOverlay[data-view="box"]:not([hidden]) {
  width: min(660px, calc(100% - 2 * var(--hud-rail-width) - 16px));
}
#personalOverlay[data-view="bag"]:not([hidden]) { width: min(720px, calc(100% - 28px)); }
#personalOverlay .personal-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  min-height: 62px;
  padding: 7px clamp(12px, 2vw, 22px);
  border-bottom: 1px solid #adccab6e;
  background: linear-gradient(110deg, #175b51, #062b2d 72%);
}
#personalTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--hud-gold);
  font: 750 clamp(1.12rem, 2vw, 1.65rem)/1.2 system-ui, sans-serif;
}
#personalTitle .hud-icon {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 5px;
  border: 1px solid #86b2a2;
  border-radius: 8px;
  background: #06292d;
}
#personalOverlay .personal-toolbar #dismissPersonal {
  position: static;
  flex: none;
  margin: 0;
  border: 1px solid #82ac9d;
  border-radius: 10px;
  background: linear-gradient(#174942, #032527);
  color: var(--hud-gold);
}
#personalOverlay #personalContent {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(12px, 2vw, 22px);
}
#personalOverlay button:focus-visible, #personalOverlay select:focus-visible,
#personalOverlay [tabindex="0"]:focus-visible, #personalOverlay summary:focus-visible {
  outline: 2px solid var(--hud-gold);
  outline-offset: 2px;
}
.personal-body { display: grid; gap: 14px; }
.personal-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 8px;
}
.personal-section-head h3 { margin: 0; color: var(--hud-gold); font: 700 1rem/1.25 system-ui, sans-serif; }
.personal-section-head > span {
  color: #c0d8c9;
  font: 650 .78rem/1.2 system-ui, sans-serif;
  white-space: nowrap;
}
.personal-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 13px;
  border: 1px solid #72a093;
  border-radius: 14px;
  background: linear-gradient(105deg, #226457, #092e31 68%);
}
.personal-identity .trainer-preview {
  flex: none;
  width: 53px;
  height: 53px;
  border-radius: 10px;
  background-color: #032629;
}
.personal-identity h3 { margin: 0; overflow-wrap: anywhere; color: #fff4d2; font: 750 1.4rem/1.15 system-ui, sans-serif; }
.profile-facts { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; margin: 0; }
.profile-facts > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #547c73;
  border-radius: 11px;
  background: #082e30;
}
.profile-facts dt { display: flex; align-items: center; gap: 6px; color: #c6dbd0; font-size: .78rem; }
.profile-facts dt .hud-icon { width: 17px; height: 17px; }
.profile-facts dd { margin: 2px 0 0; color: var(--hud-gold); font: 750 clamp(.95rem, 2vw, 1.4rem)/1.2 system-ui, sans-serif; }
.profile-facts dd.profile-job-place { color: #c1d8ca; font: .76rem/1.4 system-ui, sans-serif; }
#personalOverlay .badgeCase { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
#personalOverlay .badgeCase figure {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  margin: 0;
  min-height: 70px;
  border: 1px solid #486d68;
  border-radius: 10px;
  background: #092f32;
}
#personalOverlay .badgeCase .earned { background: linear-gradient(150deg, #1d5149, #0b3334); border-color: #baa768; }
#personalOverlay .badgeCase img { width: clamp(24px, 3vw, 42px); aspect-ratio: 1; object-fit: contain; }
#personalOverlay .badgeCase figcaption { color: #ede4be; font-size: .72rem; }
#personalOverlay .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.box-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid #527d73;
  border-radius: 13px;
  background: #072d30;
}
#personalOverlay .pcNav {
  flex-wrap: nowrap;
  margin-top: 8px;
  padding: 3px;
  font-size: .8rem;
  color: var(--hud-gold);
}
#personalOverlay :is(.pcNav, #bagUse) button {
  min-height: 34px;
  border: 1px solid #6e9b90;
  border-radius: 8px;
  background: linear-gradient(#194a43, #092e31);
  color: #fff0c7;
  font-weight: 700;
}
#personalOverlay button:disabled { opacity: .5; }
#personalOverlay :is(.pcNav, #bagUse) button:not(:disabled):hover { background: #235c50; }
#personalOverlay .pcGrid { gap: 4px; margin: 6px 0 0; }
#personalOverlay .pcSlot {
  width: 100%;
  min-width: 0;
  height: clamp(37px, 5.9dvh, 57px);
  min-height: 0;
  padding: 2px;
  border: 1px solid #4d7c77;
  border-radius: 8px;
  color: #fff1c8;
  background: #0b3839;
}
#personalOverlay .pcSlot .hud-icon { width: 16px; height: 16px; color: #79a5a3; }
#personalOverlay .pcSlot[data-mon] {
  grid-template-rows: minmax(0, 1fr) auto;
  background: #154b43;
  border-color: #7ea093;
}
#personalOverlay .pcSlot .monToken { min-height: 0; }
#personalOverlay .pcSlot img { max-height: 100%; }
#personalOverlay .pcSlot > small { white-space: nowrap; text-overflow: ellipsis; }
#personalOverlay .pcSlot:hover, #personalOverlay .pcSlot.pokemon-drop-target {
  border-color: #ffe9a9;
  background: #21594f;
  box-shadow: inset 0 0 7px #65caaa65;
}
.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 167px), 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.bag-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid #527d73;
  border-radius: 11px;
  background: linear-gradient(130deg, #194d44, #092f31 70%);
}
.bag-item:hover, .bag-item:focus-visible { border-color: #e6cb8b; }
.bag-item strong { overflow-wrap: anywhere; color: #fff1ca; font-size: .83rem; line-height: 1.2; }
.bag-item-art { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; background: #07282a; }
.bag-item-art .itemArt { width: 29px; height: 29px; margin: 0; object-fit: contain; }
.bag-quantity { color: var(--hud-gold); font: 700 .75rem/1 system-ui, sans-serif; white-space: nowrap; }
.personal-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
  padding: 22px 10px;
  border: 1px dashed #60877d;
  border-radius: 12px;
  background: #082d30;
  color: #c9e0d1;
}
.personal-empty .hud-icon { width: 28px; height: 28px; color: #e7c787; }
#personalOverlay #bagUse {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #6a998c;
  border-radius: 10px;
  background: #092f32;
}
#personalOverlay #bagUse summary { color: var(--hud-gold); font-weight: 700; cursor: pointer; }
#personalOverlay #bagUse label { display: grid; gap: 3px; margin-block: 8px; color: #e4f1dc; font-size: .79rem; }
#personalOverlay #bagUse select { max-width: 100%; background: #0f423c; color: #fff4d4; border: 1px solid #81a99a; border-radius: 7px; }
@media (max-width: 600px) {
  #personalOverlay[data-view]:not([hidden]) {
    inset: auto 7px max(86px, calc(env(safe-area-inset-bottom) + 80px));
    transform: none;
    width: auto;
    max-height: min(72dvh, calc(100dvh - 155px));
  }
  #personalOverlay .personal-toolbar { min-height: 51px; padding-block: 3px; }
  #personalOverlay #personalContent { padding: 9px; }
  .personal-body { gap: 9px; }
  .box-group { padding: 7px; }
  #personalOverlay[data-view="box"]:not([hidden]) {
    inset-inline-end: calc(var(--hud-rail-width) + 5px);
    width: auto;
  }
  #personalOverlay .pcSlot { height: 39px; }
  #personalOverlay .pcSlot img { height: 24px; }
  .bag-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
}

#tradeDialog[data-view="profile"] {
  inset: 8px 12px;
  width: min(394px, calc(100vw - 24px));
  height: fit-content;
  max-height: calc(100dvh - 16px);
  margin: auto;
  border: 2px solid transparent;
  border-radius: 16px;
  background: linear-gradient(155deg, #17574c, #092f32 36%, #062729) padding-box,
    linear-gradient(135deg, #d2edb9, #ffe4a6) border-box;
  box-shadow: inset 0 3px 12px #70e9c839, 0 14px 42px #00171dc2;
}
#tradeDialog[data-view="profile"] > :is(.trade-dialog-head, .trade-dialog-footer) {
  height: auto;
  padding: 7px 11px;
  background: #0a3435;
}
#tradeDialog[data-view="profile"] .trade-dialog-head h2 { font-size: 1.06rem; }
#tradeDialog[data-view="profile"] .trade-dialog-head button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
}
#tradeDialog[data-view="profile"] .trade-dialog-footer button { min-height: 39px; }
#tradeDialog[data-view="profile"] .trade-dialog-body { padding: 9px 11px; }
.trainer-profile { display: grid; gap: 7px; min-width: 0; }
.trainer-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 8px;
  background: #0b3938;
  border: 1px solid #568278;
  border-radius: 9px;
}
.trainer-identity .trainer-preview { flex: none; width: 39px; height: 39px; }
.trainer-identity h3 { font-size: 1rem; overflow-wrap: anywhere; }
.trainer-identity p, .trainer-badges { color: #c3d9c9; font-size: .73rem; }
.trainer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.trainer-facts > div { padding: 4px 8px; border-radius: 7px; background: #082d2f; border: 1px solid #456e65; }
.trainer-facts dt { font-size: .72rem; color: #c6dbce; }
.trainer-facts dd { margin: 0; color: #ffe7aa; font-size: .88rem; font-weight: 750; }
.trainer-badges { overflow-wrap: anywhere; }
.trainer-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#tradeDialog .trainer-tabs button { min-height: 36px; padding: 3px; }
.trainer-tabs button span { padding-inline-start: 2px; color: #ffe0a5; font-size: .68rem; }
.trainer-collection { padding: 6px; border: 1px solid #4d756e; border-radius: 9px; background: #072b2e; }
.trainer-collection .pcNav { flex-wrap: nowrap; gap: 4px; font-size: .76rem; color: #ffe6ae; }
#tradeDialog .trainer-collection .pcNav button { min-height: 34px; padding: 3px 6px; font-size: .73rem; }
#tradeDialog .trainer-collection button:disabled { opacity: .55; }
.trainer-collection .pcGrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 5px 0 0; }
.trainer-collection .trainer-team { margin: 0; }
.trainer-slot {
  display: grid;
  place-items: center;
  min-width: 0;
  height: clamp(30px, 5.1dvh, 44px);
  border: 1px solid #527d75;
  border-radius: 6px;
  background: #0b3839;
  color: #759f9f;
}
.trainer-slot > .hud-icon { width: 15px; height: 15px; }
.trainer-slot-occupied { grid-template-rows: minmax(0, 1fr) auto; padding: 1px; background: #16463f; color: #ffecc0; }
.trainer-slot .monToken { min-height: 0; align-self: stretch; }
.trainer-slot .monToken img { display: block; width: 29px; height: 100%; object-fit: contain; }
.trainer-slot .monToken small { display: none; }
.trainer-slot > small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: .62rem/1.15 system-ui, sans-serif; }
.trainer-items { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.trainer-items li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  background: #113d3a;
  border-radius: 6px;
  font-size: .8rem;
  overflow-wrap: anywhere;
}
.trainer-items .itemArt { width: 24px; height: 24px; margin: 0; object-fit: contain; }
.trainer-items li > span:last-child { color: #ffe5a8; white-space: nowrap; }
