:root {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #e9f0e6;
  background: #0e211c;
  font-synthesis: none;
  --ink: #17352d;
  --green: #bfe68a;
  --cream: #f2f0d8;
  --muted: #98afa4;
  --line: #385247;
  --yellow: #f8d66d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #213e34;
  color: #edf4e7;
  padding: 10px 14px;
  border-radius: 5px;
  font-weight: 650;
  font-size: 14px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover {
  background: #365641;
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #183526;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
button.primary:hover {
  background: #d3f5a8;
}
button.outline {
  background: transparent;
  color: var(--ink);
  border-color: #a5b698;
}
.quiet,
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 5px 0;
  font-size: 13px;
}
.text-button:hover,
.quiet:hover {
  background: none;
  color: var(--green);
}
[hidden] {
  display: none !important;
}
.campus-invitation {
  background: #fff4cf;
  color: #334a57;
  border-left: 4px solid #d09a38;
  padding: 10px 14px;
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.4;
}
.campus-invitation p {
  margin: 6px 0 0;
  font-size: 16px;
}
.mobile-game #campus-invitation {
  display: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.7px;
}
h3 {
  font-size: 17px;
}
p {
  font-size: 15px;
  line-height: 1.6;
}
small {
  font-size: 12px;
  line-height: 1.5;
}
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-bottom: 7px;
}
.topbar {
  height: 76px;
  max-width: 1456px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 40px;
  border-bottom: 1px solid #ffffff0f;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--cream);
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 900;
}
.brand b {
  color: var(--green);
  font-size: 10px;
  letter-spacing: 3px;
  display: block;
  margin-top: 1px;
}
.brand-ball {
  color: var(--green);
  font-size: 42px;
  line-height: 1;
}
.server-label {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 7px;
  align-items: center;
}
#connection-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b5985f;
}
#connection-light.connected {
  background: #abe279;
  box-shadow: 0 0 10px #abec7933;
}
.game-layout {
  max-width: 1456px;
  margin: 0 auto;
  padding: 30px 40px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
}
.world-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 0;
  color: var(--cream);
}
.world-heading .eyebrow {
  font-size: 9px;
}
.world-badges {
  display: flex;
  flex-direction: column;
  text-align: right;
  gap: 5px;
  font-size: 12px;
  color: #cfdfc6;
}
.weather {
  color: var(--muted);
  font-size: 11px;
}
.game-frame {
  position: relative;
  background: #345548;
  border: 6px solid #405e4d;
  border-radius: 8px;
  box-shadow:
    0 5px 0 #081a12,
    0 18px 40px #06120e66;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  image-rendering: pixelated;
  outline: none;
  touch-action: none;
}
.location-hint {
  position: absolute;
  top: 16px;
  left: 16px;
  max-width: calc(100% - 32px);
  background: #11251ceb;
  color: #f1eed6;
  padding: 8px 12px;
  border-left: 3px solid var(--green);
  border-radius: 2px;
  font-size: 12px;
  pointer-events: none;
}
.interaction {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}
.interaction button {
  color: #152a1c;
  background: var(--cream);
  border: 2px solid #233e2f;
  box-shadow: 0 3px #0006;
  display: flex;
  gap: 18px;
  align-items: center;
}
.connection-cover {
  position: absolute;
  inset: 0;
  background: #10291fd9;
  display: grid;
  place-content: center;
  padding: 20px;
  text-align: center;
}
.world-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 17px 0 22px;
}
.controls-help {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.controls-help > span {
  display: flex;
  align-items: center;
  gap: 3px;
}
kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 2px 4px;
  color: #d6dfcf;
  border: 1px solid #466050;
  border-bottom: 2px solid #466050;
  border-radius: 3px;
}
.interaction kbd {
  color: var(--ink);
  border-color: #abb29e;
}
.trainer-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.trainer-strip strong {
  font-size: 15px;
}
.trainer-strip .eyebrow {
  font-size: 8px;
  letter-spacing: 1.3px;
}
.mode-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #dfe5d8;
}
.mode-control small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.mode-control input {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gym-card {
  color: var(--ink);
  background: var(--cream);
  border-radius: 7px;
  padding: 24px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px;
}
.gym-card .eyebrow {
  font-size: 8px;
  letter-spacing: 1px;
  color: #658068;
  margin: 0;
}
.status-tag {
  font-size: 8px;
  border: 1px solid #a6b59c;
  padding: 4px 5px;
  font-weight: 800;
  letter-spacing: 1px;
}
.gym-card h2 {
  font-size: 24px;
  line-height: 1.16;
  margin-bottom: 20px;
}
.leader-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #213c2722;
  border-bottom: 1px solid #213c2722;
  margin-bottom: 14px;
}
.leader-display span:not(.crown) {
  font-size: 10px;
  display: block;
  color: #647863;
}
.leader-display strong {
  font-size: 16px;
  display: block;
  margin-top: 3px;
}
.crown {
  font-size: 33px;
  color: #657f43;
  line-height: 1;
}
.gym-card p {
  font-size: 12px;
  line-height: 1.65;
  color: #5b715c;
  margin-bottom: 17px;
}
.gym-card .primary {
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.gym-card .primary:hover {
  background: #34533d;
}
.gym-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
  font-size: 10px;
  color: #637b5c;
}
.gym-progress .achieved {
  color: #1c6b34;
  font-weight: 700;
}
.gym-actions {
  display: grid;
  gap: 8px;
}
.pending-info {
  font-size: 12px;
  padding: 12px 0;
  margin-bottom: 12px;
  border-top: 1px solid #213c2722;
  line-height: 1.6;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 17px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel h2 {
  font-size: 14px;
  letter-spacing: 0;
  margin: 0;
}
.panel .text-button {
  font-size: 11px;
  color: #bcdaaa;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.team-slot {
  background: #1e352b;
  border-radius: 5px;
  text-align: center;
  padding: 3px 0 7px;
}
.team-slot img {
  width: 57px;
  height: 57px;
  image-rendering: pixelated;
  display: block;
  margin: auto;
}
.team-slot strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}
.team-slot small {
  font-size: 9px;
  color: var(--muted);
}
.team-note {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-top: 12px;
  gap: 6px;
}
.count {
  font-size: 11px;
  color: var(--green);
}
.empty {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.player-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #ffffff0a;
}
.player-row strong {
  font-size: 12px;
  display: block;
}
.player-row small {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.player-row button {
  margin-left: auto;
  font-size: 11px;
  padding: 7px 8px;
}
.player-icon {
  width: 22px;
  height: 28px;
  object-fit: none;
  object-position: 0 0;
  image-rendering: pixelated;
}
.invite-box {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 10px;
}
.invite-box p {
  font-size: 12px;
}
.invite-box button {
  font-size: 12px;
  margin-right: 7px;
}
#challenge-dialog {
  width: min(520px, calc(100vw - 24px));
}
#challenge-dialog .invite-box p,
#challenge-dialog .invite-box button {
  font-size: 16px;
}
.invite-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#challenge-dialog .invite-actions button {
  min-height: 44px;
  margin: 0;
}
.duel-level-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.duel-level-options button {
  min-height: 72px;
  padding: 10px;
  text-align: left;
}
.duel-level-options button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--green);
  border-color: var(--green);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--green);
}
.duel-level-options strong,
.duel-level-options small {
  display: block;
}
.duel-level-options small {
  margin-top: 5px;
  line-height: 1.25;
}
.level-terms {
  padding: 10px;
  background: #edf3e7;
  border-left: 3px solid var(--green);
  font-size: 12px;
  line-height: 1.45;
}
.invite-protection {
  background: #eef2d1;
  padding: 10px;
  border-left: 3px solid #658456;
}
#challenge-feedback {
  color: #904829;
}
.page-footer {
  max-width: 1456px;
  margin: 0 auto;
  padding: 18px 40px 25px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #789184;
  font-size: 9px;
  letter-spacing: 0.6px;
}
.touch-controls {
  display: none;
}
dialog {
  color: var(--ink);
  background: var(--cream);
  border: 1px solid #adc29f;
  border-radius: 10px;
  padding: 34px;
  max-width: min(470px, calc(100vw - 26px));
  max-height: 92dvh;
  box-shadow: 0 20px 90px #0008;
}
dialog::backdrop {
  background: #071911ba;
  backdrop-filter: blur(3px);
}
dialog .eyebrow {
  color: #667c5e;
  font-size: 10px;
}
dialog h2 {
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -1px;
}
dialog p {
  color: #5d715d;
  font-size: 14px;
}
dialog label {
  font-size: 13px;
  font-weight: 600;
}
input:not([type='checkbox']):not([type='radio']),
select {
  display: block;
  border: 1px solid #a5b89d;
  border-radius: 5px;
  background: #fcfbed;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 15px;
  width: 100%;
  margin-top: 7px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 19px 0;
}
legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.avatar-choice {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-right: 20px;
}
.avatar-crop {
  display: inline-block;
  width: 16px;
  height: 32px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.avatar-crop.red {
  background-image: url('/assets/red.png');
}
.avatar-crop.green {
  background-image: url('/assets/green.png');
}
.starter-choices {
  display: flex;
  gap: 8px;
}
.journey-mode-choices,
.journey-city-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.journey-mode-choices label,
.journey-city-choices label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #9aa68c;
  border-radius: 5px;
  cursor: pointer;
}
.journey-mode-choices label:has(input:checked),
.journey-city-choices label:has(input:checked) {
  border-color: #48793d;
  background: #d5e6b9;
}
.journey-mode-choices small,
.journey-city-choices small {
  grid-column: 2;
  color: #566050;
}
.journey-city-choices p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}
.starter-pack-dialog {
  width: min(720px, calc(100vw - 28px));
  text-align: center;
  overflow: hidden;
}
.starter-pack-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.starter-pack-cards article {
  display: grid;
  justify-items: center;
  padding: 10px 4px;
  background: #fff8d8;
  border: 2px solid #93a07c;
  border-radius: 8px;
  animation: pack-reveal 420ms both;
}
.starter-pack-cards article:nth-child(2) {
  animation-delay: 90ms;
}
.starter-pack-cards article:nth-child(3) {
  animation-delay: 180ms;
}
.starter-pack-cards article:nth-child(4) {
  animation-delay: 270ms;
}
.starter-pack-cards article:nth-child(5) {
  animation-delay: 360ms;
}
.starter-pack-cards article:nth-child(6) {
  animation-delay: 450ms;
}
.starter-pack-cards img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  image-rendering: pixelated;
}
.starter-pack-cards small {
  color: #52614d;
}
.starter-pack-dialog .primary {
  width: 100%;
}
@keyframes pack-reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.84);
  }
}
@media (prefers-reduced-motion: reduce) {
  .starter-pack-cards article {
    animation: none;
  }
}
.starter-choices label {
  position: relative;
  background: #e2e7cb;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  padding: 8px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}
.starter-choices label:has(input:checked) {
  border-color: #48793d;
  background: #d5e6b9;
}
.starter-choices img {
  width: 70px;
  height: 70px;
  image-rendering: pixelated;
}
.starter-choices input {
  position: absolute;
  top: 5px;
  left: 5px;
  accent-color: #537e40;
}
#welcome-form > .primary {
  width: 100%;
  margin-bottom: 15px;
}
#welcome-form > small {
  display: block;
  color: #7b8a70;
  font-size: 11px;
}
.error {
  color: #ab392f;
  font-size: 12px;
  margin: 6px 0;
}
.wide-dialog {
  max-width: min(850px, calc(100vw - 26px));
  width: 850px;
}
.close {
  position: absolute;
  right: 12px;
  top: 9px;
  border: 0;
  background: none;
  color: #6a7a60;
  font-size: 25px;
  padding: 4px 8px;
}
.close:hover {
  background: #dde4ce;
}
.gym-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.gym-modes article {
  border: 1px solid transparent;
  border-top: 2px solid #a9ba90;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.gym-step-heading {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.mode-number {
  font-size: 12px;
  color: #80956b;
}
.gym-step-status {
  border: 1px solid #879777;
  padding: 3px 6px;
  color: #526348;
  background: #f4f2dc;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
}
.gym-modes article.is-complete {
  border-color: #7f9b72;
  background: #edf2dc;
}
.gym-modes article.is-complete .gym-step-status {
  border-color: #567750;
  color: #31532e;
  background: #dcebc9;
}
.gym-modes article.is-current {
  border: 2px solid #bd7142;
  padding: 15px 11px 11px;
  background: #fff3c9;
  box-shadow: 3px 3px 0 #d6c291;
}
.gym-modes article.is-current .gym-step-status {
  border-color: #a95731;
  color: #713016;
  background: #ffe2a1;
}
.gym-modes article.is-locked {
  opacity: 0.68;
}
.gym-modes article.is-waiting {
  border-color: #9aa8b5;
  background: #edf0e6;
}
.gym-modes h3 {
  font-size: 16px;
}
.gym-modes p {
  font-size: 12px;
  flex: 1;
}
.gym-modes small {
  font-size: 10px;
  display: block;
  color: #6f815e;
  margin-bottom: 13px;
}
.gym-modes button {
  font-size: 12px;
}
.defense-team {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #b8c4a3;
  padding-top: 14px;
}
.defense-team figure {
  margin: 0;
  text-align: center;
  font-size: 10px;
  flex: 1;
  min-width: 70px;
}
.defense-team img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}
#gym-history {
  font-size: 12px;
  margin-top: 20px;
  color: #647557;
}
#team-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.edit-mon {
  border: 1px solid #bdcba6;
  border-radius: 6px;
  padding: 12px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
}
.edit-mon > img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}
.edit-mon select {
  font-size: 12px;
  padding: 7px;
}
.edit-moves {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.edit-moves label {
  font-size: 10px;
  font-weight: 500;
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 15px;
}
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 28px;
}
.rules-grid p {
  font-size: 13px;
}
.pilot-note {
  font-size: 11px !important;
  border-top: 1px solid #bdcba6;
  padding-top: 15px;
}
#toasts {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(500px, 90vw);
}
.toast {
  background: #eef1db;
  border-left: 4px solid #80ae5b;
  color: var(--ink);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: 0 5px 18px #0004;
  border-radius: 4px;
  animation: toast-in 0.18s ease-out;
}
@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.battle-dialog {
  padding: 0;
  max-width: min(740px, calc(100vw - 20px));
  width: 740px;
  background: #eaf0d2;
  border: 5px solid #58754e;
  border-radius: 9px;
}
.battle-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #18372c;
  color: #d7e8c5;
  font-size: 11px;
  letter-spacing: 1px;
}
.battle-top button {
  font-size: 11px;
  color: #c8d8be;
}
.battle-scene {
  height: 280px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    #e8edc5 0%,
    #f8f5df 40%,
    #e3ebba 41%,
    #e3ebba 42%,
    #f1f0d7 43%,
    #e9edca 100%
  );
}
.battle-scene::before,
.battle-scene::after {
  content: '';
  position: absolute;
  width: 230px;
  height: 32px;
  border-radius: 50%;
  background: #b2c586;
  box-shadow: 0 7px #718f5544;
  right: 40px;
  top: 118px;
}
.battle-scene::after {
  left: 35px;
  top: 250px;
  width: 240px;
}
.monster-info {
  position: absolute;
  z-index: 2;
  background: #fbfbe4;
  border: 2px solid #6b8356;
  border-radius: 7px 2px 7px 2px;
  padding: 10px 12px;
  min-width: 205px;
  box-shadow: 3px 4px #34592925;
}
.monster-info > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.monster-info strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.monster-info span {
  font-size: 11px;
}
.monster-info small {
  font-size: 10px;
  display: block;
  text-align: right;
  margin-top: 3px;
}
.enemy-info {
  left: 28px;
  top: 25px;
}
.own-info {
  right: 30px;
  bottom: 30px;
}
.hp-track {
  height: 7px;
  border-radius: 6px;
  background: #c9ceb2;
  margin-top: 8px;
  overflow: hidden;
}
.hp-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: #5daa62;
  transition: width 0.4s;
}
.hp-track i.low {
  background: #d2684f;
}
.own-sprite,
.enemy-sprite {
  position: absolute;
  width: 180px;
  height: 180px;
  object-fit: contain;
  image-rendering: pixelated;
  z-index: 1;
}
.enemy-sprite {
  right: 60px;
  top: 0;
}
.own-sprite {
  left: 62px;
  bottom: -10px;
}
.battle-console {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  min-height: 210px;
  background: #16372e;
  color: #eff3dc;
  border-top: 4px solid #77916a;
}

#battle-controls {
  padding: 15px;
}
#battle-question {
  font-size: 12px;
  color: #d8e5c8;
  margin-bottom: 10px;
}
.move-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.move-buttons button {
  background: #edf1d5;
  color: var(--ink);
  border-color: #b4c494;
  text-align: left;
  padding: 9px 10px;
  font-size: 12px;
}
.move-buttons small {
  display: block;
  font-size: 9px;
  color: #7d8c67;
  margin-top: 2px;
}
.battle-secondary {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.battle-secondary button {
  font-size: 10px;
  padding: 7px;
}
.battle-secondary button:first-child {
  flex: 1;
}
#switch-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 8px;
}
#switch-options button {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
  padding: 4px;
}
#switch-options img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
#battle-finish {
  width: 100%;
  border-radius: 0;
  padding: 17px;
}
dialog .text-button {
  color: #3b6b37;
}
@media (min-width: 1600px) {
  .game-layout {
    padding-top: 42px;
  }
  .world-heading {
    margin-bottom: 23px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 24px;
  }
  .game-layout {
    padding: 25px 24px;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
  }
  .gym-card {
    padding: 19px;
  }
  .gym-card h2 {
    font-size: 21px;
  }
  .trainer-strip {
    flex-wrap: wrap;
  }
  .controls-help {
    gap: 8px;
  }
  .controls-help > span:last-child {
    display: none;
  }
  .page-footer {
    padding: 12px 24px;
  }
  .world-heading .weather {
    display: none;
  }
}
@media (max-width: 820px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
    gap: 15px;
  }
  .brand {
    font-size: 17px;
  }
  .server-label {
    font-size: 10px;
  }
  .quiet {
    font-size: 11px;
  }
  .game-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 22px;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .sidebar .gym-card {
    grid-row: span 2;
  }
  .trainer-strip {
    padding: 15px 0;
  }
  .world-footer {
    margin-bottom: 12px;
  }
  .page-footer {
    padding: 10px 16px;
    flex-direction: column;
    gap: 6px;
  }
  .touch-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
  }
  .dpad {
    display: flex;
    gap: 6px;
  }
  .dpad button {
    width: 43px;
    height: 40px;
    padding: 4px;
  }
  h1 {
    font-size: 26px;
  }
  .touch-controls > button {
    font-size: 12px;
  }
  .game-frame {
    border-width: 4px;
  }
  .gym-modes {
    gap: 12px;
  }
  .world-footer .text-button {
    font-size: 12px;
  }
}
@media (max-width: 540px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar .gym-card {
    grid-row: auto;
  }
  .gym-card h2 br {
    display: none;
  }
  .gym-card h2 {
    font-size: 23px;
  }
  .gym-card .section-title {
    margin-bottom: 13px;
  }
  .team-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
  }
  .team-slot img {
    width: 45px;
    height: 45px;
  }
  .team-slot strong {
    font-size: 8px;
  }
  .world-heading {
    margin-bottom: 12px;
  }
  .world-badges {
    font-size: 11px;
  }
  .location-hint {
    font-size: 10px;
    left: 8px;
    top: 8px;
    padding: 6px 8px;
  }
  .server-label #connection {
    max-width: 88px;
    line-height: 1.3;
  }
  .trainer-strip .eyebrow {
    font-size: 8px;
  }
  .trainer-strip strong {
    font-size: 13px;
  }
  .mode-control {
    width: 100%;
  }
  .mode-control small {
    display: inline;
    margin-left: 9px;
  }
  .world-footer .controls-help {
    font-size: 9px;
  }
  .world-footer .controls-help > span:nth-child(2) {
    display: none;
  }
  dialog {
    padding: 25px 20px;
  }
  dialog h2 {
    font-size: 28px;
  }
  .gym-modes {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .gym-modes article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px;
  }
  .gym-step-heading {
    grid-column: 1/-1;
    margin-bottom: 2px;
  }
  .gym-modes .mode-number {
    display: none;
  }
  .gym-step-status {
    justify-self: start;
  }
  .gym-modes h3,
  .gym-modes p {
    grid-column: 1/-1;
    margin-bottom: 4px;
  }
  .gym-modes p {
    font-size: 12px;
  }
  .gym-modes small {
    grid-column: 1/-1;
    margin: 0 0 5px;
    align-self: center;
  }
  .gym-modes button {
    grid-column: 1/-1;
    width: 100%;
  }
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .edit-mon {
    padding: 9px;
  }
  .edit-moves {
    grid-template-columns: 1fr;
  }
  .edit-mon > img {
    width: 30px;
    height: 30px;
  }
  .edit-mon {
    grid-template-columns: 30px 1fr;
    gap: 5px;
  }
  .edit-mon select {
    font-size: 11px;
  }
  .battle-scene {
    height: 225px;
  }
  .monster-info {
    min-width: 152px;
    padding: 8px;
  }
  .monster-info strong {
    font-size: 11px;
  }
  .enemy-info {
    left: 10px;
    top: 18px;
  }
  .own-info {
    right: 10px;
    bottom: 18px;
  }
  .own-sprite,
  .enemy-sprite {
    width: 135px;
    height: 135px;
  }
  .enemy-sprite {
    right: 10px;
    top: 15px;
  }
  .own-sprite {
    left: 12px;
    bottom: 0;
  }
  .battle-scene::before {
    right: 0;
    top: 115px;
    width: 150px;
  }
  .battle-scene::after {
    left: 0;
    top: 212px;
    width: 170px;
  }
  .battle-console {
    grid-template-columns: 1fr;
  }

  #battle-controls {
    padding: 12px;
  }
  .battle-top {
    padding: 10px 12px;
  }
  .battle-dialog {
    padding: 0;
  }
  .battle-secondary button {
    font-size: 11px;
  }
  .move-buttons button {
    font-size: 13px;
  }
  .touch-controls button {
    touch-action: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.battle-top .text-button {
  color: #edf0d0;
}

/* Expedition cards stay usable with touch and the shared D-pad / A / B. */
#expedition-list {
  display: grid;
  gap: 18px;
  margin: 18px 0;
}
.expedition-card {
  padding: 16px;
  border: 3px double #708379;
  border-left: 7px solid #478364;
  background: #f4f3d9;
}
.expedition-card[data-theme='desert'] {
  border-left-color: #b78040;
}
.expedition-card[data-theme='snow'] {
  border-left-color: #5b91ad;
}
.expedition-card[data-theme='island'] {
  border-left-color: #398e9e;
}
.expedition-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.2em;
}
.expedition-heading span {
  white-space: nowrap;
  font-size: 0.8em;
}
.expedition-card p {
  margin: 10px 0;
}
.expedition-card > button {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
}
.expedition-pokemon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.expedition-pokemon span {
  display: grid;
  justify-items: center;
  min-width: 64px;
}
.expedition-pokemon img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}
.expedition-deep {
  padding-top: 12px;
  border-top: 1px dashed #8b987b;
}
@media (max-width: 600px) {
  .expedition-card {
    padding: 10px;
  }
  .expedition-heading {
    flex-wrap: wrap;
  }
}

/* A compact portfolio, separate from permanent adventure badges. */
#badges-dialog {
  width: min(760px, calc(100vw - 26px));
  max-width: min(760px, calc(100vw - 26px));
}
.badges-help {
  margin-bottom: 14px;
}
.badge-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.badge-filters button {
  min-height: 38px;
  padding: 7px 11px;
  border-color: #9eac8c;
  background: #e5e8ce;
  color: #52624f;
}
.badge-filters button:hover {
  background: #d7dfbd;
}
.badge-filters button[aria-pressed='true'] {
  border-color: #315b43;
  background: #315b43;
  color: #fffced;
  box-shadow: inset 0 -3px #1c3f2d;
}
.badge-filters button span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: #ffffff8f;
  color: #34513d;
  font-size: 11px;
}
.badge-filters button[aria-pressed='true'] span {
  background: #fff5;
  color: inherit;
}
.badge-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 12px;
  color: #60705b;
  font-size: 11px;
}
.badge-legend b {
  font-size: 18px;
  line-height: 0;
  vertical-align: -2px;
}
.earned-star {
  color: #b47722;
}
.leader-star {
  color: #326c86;
}
#badges-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  max-height: min(52dvh, 580px);
  padding: 2px 4px 2px 2px;
  overflow-y: auto;
  scrollbar-color: #82937a transparent;
}
.badge-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 0 12px;
  min-height: 108px;
  padding: 9px;
  overflow: hidden;
  border: 2px solid #a5ae91;
  background: #e5e8d2;
}
.badge-card.earned {
  border-color: #9b7a42;
  background: #f5edcc;
}
.badge-card.leader {
  border-color: #477d8f;
  background: #dfeaec;
  box-shadow: inset 0 0 0 2px #f2f0d8;
}
.badge-monument {
  position: relative;
  grid-row: 1 / span 2;
  display: grid;
  min-height: 88px;
  place-items: center;
  overflow: visible;
  border: 1px solid #a2ad91;
  background:
    linear-gradient(#ffffffb8, #f0edcfb8),
    repeating-linear-gradient(45deg, #aab79b 0 3px, transparent 3px 7px);
}
.badge-monument img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  filter: grayscale(1) sepia(0.12);
  image-rendering: pixelated;
}
.badge-card:is(.earned, .leader) .badge-monument img {
  filter: none;
}
.badge-monument-placeholder {
  color: #74816c;
  font-size: 42px;
}
.badge-star {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #fff9df;
  border-radius: 50%;
  color: #fff9df;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 1px #0004;
  box-shadow: 0 2px 0 #0002;
}
.badge-star.earned-star {
  background: #b47722;
}
.badge-star.leader-star {
  background: #326c86;
  font-size: 24px;
}
.badge-copy {
  min-width: 0;
  align-self: center;
}
.badge-copy > span {
  display: block;
  color: #74816b;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 1px;
}
.badge-card.earned .badge-copy > span {
  color: #916223;
}
.badge-card.leader .badge-copy > span {
  color: #326c86;
}
.badge-copy strong {
  display: block;
  margin: 4px 0 3px;
  overflow: hidden;
  color: #2d4037;
  font-size: 22px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #687661;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.badge-result {
  align-self: end;
  margin-top: 7px;
  color: #667161;
  font-size: 11px;
  font-weight: 750;
}
.badge-result.earned-result {
  color: #8b5e22;
}
.badge-result.leader-result {
  color: #285e74;
}
.badge-result small {
  display: block;
  margin-top: 2px;
  color: #8b5e22;
  font-size: 9px;
}
.badges-empty {
  padding: 28px 12px;
  border: 1px dashed #9eaa8f;
  text-align: center;
}
#badges-dialog > button:not(.close) {
  margin-top: 10px;
}
@media (max-width: 600px) {
  #badges-list {
    grid-template-columns: 1fr;
  }
  .badge-card {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 96px;
  }
  .badge-monument {
    min-height: 76px;
  }
  .badge-monument img {
    height: 74px;
  }
  .badge-copy strong {
    font-size: 20px;
  }
}
#gym-agenda-dialog {
  width: min(620px, 94vw);
}
.gym-call-dialog {
  width: min(520px, 92vw);
}
.gym-call-place {
  margin: 4px 0 14px;
  color: #52657a;
  font-weight: 800;
  text-transform: uppercase;
}
.gym-call-rivals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.gym-call-rivals div {
  min-height: 72px;
  padding: 10px;
  border: 2px solid #788a78;
  background: #edf1da;
}
.gym-call-rivals small,
.gym-call-rivals strong {
  display: block;
}
.gym-call-rivals small {
  margin-bottom: 7px;
  color: #657265;
  font-size: 9px;
  letter-spacing: 1px;
}
.gym-call-rivals strong {
  overflow-wrap: anywhere;
}
.gym-call-rivals > b {
  color: #a24a31;
  font-size: 18px;
}
.gym-call-question {
  padding: 10px;
  border-left: 4px solid #b36a34;
  background: #fff4cf;
  font-weight: 800;
}
.gym-call-dialog > button:not(.close) {
  width: 100%;
  margin-top: 7px;
}
#gym-agenda-dialog input:not([type='checkbox']):not([type='radio']),
#gym-agenda-dialog select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#gym-agenda-dialog button {
  margin: 5px 0;
}
#agenda-status {
  white-space: pre-line;
  padding: 12px;
  background: #edf1da;
}
#agenda-checkin {
  padding: 4px 12px;
  border-left: 4px solid #927637;
  background: #fff4cf;
}
#agenda-countdown {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
#agenda-presence {
  white-space: pre-line;
}
#agenda-slots {
  display: grid;
  gap: 8px;
  max-height: 40dvh;
  overflow: auto;
}
.agenda-slot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #82937a;
  background: #fff9e9;
}
.agenda-slot input {
  width: auto;
  flex: 0 0 auto;
}
.agenda-slot small {
  display: block;
  font-size: 14px;
  color: #52646a;
}
#agenda-settings {
  margin-top: 16px;
  border-top: 2px solid #82937a;
  padding-top: 12px;
}
#agenda-settings summary {
  cursor: pointer;
  font-weight: bold;
}
#gyms-pending {
  display: grid;
  gap: 10px;
}
#gyms-pending h3 {
  margin-bottom: 0;
}
#gyms-owned {
  display: grid;
  gap: 10px;
  max-height: 42dvh;
  overflow-y: auto;
}
.gym-title-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 2px solid #82937a;
  background: #edf1da;
}
.gym-title-card strong {
  font-size: 26px;
}
.gym-title-card span {
  color: #426543;
}
.gym-title-card.disputed {
  border-color: #b47842;
  background: #fff1ce;
}
.gym-title-card.disputed span {
  color: #98522f;
}
#gyms-dialog > button:not(.close) {
  margin-top: 10px;
}

/* Separate the first destination, deeper cave and return journey. */
.expedition-card button {
  width: 100%;
  min-height: 46px;
  margin: 10px 0;
}
.expedition-itinerary {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid #708379;
  color: #3b5862;
}
.expedition-requirements {
  background: #e6ead0;
  padding: 8px;
}
.expedition-lock {
  color: #7c352b;
}
.expedition-species {
  margin: 12px 0;
}
.expedition-species button {
  font-size: 0.85em;
}
.expedition-pokemon[hidden] {
  display: none;
}
.expedition-return {
  border-top: 2px solid #708379;
  padding-top: 12px;
}

/* Thai vowels and tone marks need a real Thai font and natural word wrapping. */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/noto-sans-thai-700.ttf') format('truetype');
}
html:lang(th) {
  font-family: 'Noto Sans Thai', Tahoma, sans-serif;
}
html:lang(th) :is(h1, h2, h3, p, button, label, input, select, .eyebrow, small) {
  letter-spacing: normal;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}
html:lang(th) #welcome-heading {
  font-size: clamp(1.55rem, 5vw, 2.2rem);
}

html:lang(th)
  #battle-dialog
  :is(
    #battle-message,
    #battle-question,
    .battle-commands button,
    .move-buttons button,
    #move-details p
  ) {
  font-family: 'Noto Sans Thai', Tahoma, sans-serif;
  letter-spacing: normal;
  line-height: 1.35;
  text-shadow: none;
}
html:lang(th) #battle-dialog :is(#battle-message, #battle-question) {
  font-size: clamp(14px, 3.6cqw, 28px);
}
html:lang(th) #battle-dialog :is(.battle-commands button, .move-buttons button) {
  font-size: clamp(14px, 3.8cqw, 30px);
}
html:lang(th) #battle-dialog #move-details p {
  font-size: clamp(12px, 2.8cqw, 22px);
  white-space: normal;
}

/* Han glyphs use the operating system's native CJK family and wrapping rules. */
html:lang(zh) {
  font-family:
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
}
html:lang(zh) :is(h1, h2, h3, p, button, label, input, select, .eyebrow, small) {
  letter-spacing: normal;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: anywhere;
}
html:lang(zh)
  #battle-dialog
  :is(
    #battle-message,
    #battle-question,
    .battle-commands button,
    .move-buttons button,
    #move-details p
  ) {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  letter-spacing: normal;
  line-height: 1.35;
  text-shadow: none;
}

.language-selector {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
}
.language-selector a {
  font-weight: 700;
}

.language-menu-button {
  align-items: center;
  gap: 10px;
}
.classic-menu > .language-menu-button {
  display: flex;
}
.language-menu-button small {
  margin-left: auto;
  color: #667c91;
  font-size: 0.65em;
}
.language-flag {
  font-family: system-ui, sans-serif;
  font-size: 1.05em;
  line-height: 1;
}
.language-dialog {
  width: min(430px, calc(100vw - 26px));
}
.language-dialog h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.language-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.language-options > button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  position: relative;
}
.language-options .language-flag {
  font-size: 30px;
}
.language-options strong,
.language-options small {
  display: block;
}
.language-options small {
  margin-top: 3px;
  color: #667c91;
}
.language-options > button[aria-pressed='true'] {
  background: #e9eddf;
  border-color: #537e40;
  box-shadow: inset 0 0 0 2px #fffbea;
}
.language-options > button[aria-pressed='true']::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 9px;
  color: #446a36;
  font-weight: 800;
}
.language-dialog > [data-close] {
  width: 100%;
}

@media (max-width: 430px) {
  .language-options {
    grid-template-columns: 1fr;
  }
  .language-options > button {
    min-height: 58px;
  }
}

html:lang(zh) #welcome-heading {
  font-size: clamp(1.55rem, 5vw, 2.2rem);
}
html:lang(zh) #battle-dialog :is(#battle-message, #battle-question) {
  font-size: clamp(14px, 3.6cqw, 28px);
}
html:lang(zh) #battle-dialog :is(.battle-commands button, .move-buttons button) {
  font-size: clamp(14px, 3.8cqw, 30px);
}
html:lang(zh) #battle-dialog #move-details p {
  font-size: clamp(12px, 2.8cqw, 22px);
  white-space: normal;
}

/* This independent edition keeps the original renderer and removes unrelated competition UI. */
.story-edition #arena-entry,
.story-edition .gym-card,
.story-edition .mode-control,
.story-edition .controller-competitive,
.story-edition #menu-arena,
.story-edition #menu-tournaments,
.story-edition #towns-button,
.story-edition #menu-ranking,
.story-edition [data-open='gyms'],
.story-edition [data-open='expeditions'],
.story-edition [data-open-stations],
.story-edition [data-open-airport] {
  display: none !important;
}
#story-dialog {
  max-width: 720px;
}
.story-narrative {
  line-height: 1.75;
}
#story-body button {
  margin: 6px 6px 6px 0;
}
#story-code {
  font: inherit;
  letter-spacing: 0.1em;
  max-width: 100%;
}
#story-shortcut {
  max-width: 38vw;
}

.story-edition [data-invite] {
  display: none !important;
}
#story-battle-status {
  background: #ffe780;
  color: #202831;
  padding: 12px;
}

#edition-choice {
  width: min(680px, calc(100vw - 32px));
}
html:has(#edition-choice[open]),
body:has(#edition-choice[open]) {
  overflow: hidden;
}
#edition-choice button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 20px;
  margin-top: 16px;
}
#edition-choice strong,
#edition-choice span {
  display: block;
}
#edition-choice span {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}
#edition-choice .edition-language-choice {
  padding: 12px;
  margin-bottom: 20px;
  border: 2px solid #8b9a78;
  border-radius: 10px;
  background: #eef1e3;
}
#edition-choice .edition-language-choice h3 {
  margin: 0 0 10px;
  font-size: 21px;
}
#edition-choice .edition-language-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
#edition-choice .edition-language-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  padding: 6px 2px;
  margin: 0;
  border: 2px solid #9aa99c;
  border-radius: 7px;
  background: #fffdf0;
  text-align: center;
}
#edition-choice .edition-language-options button[aria-pressed='true'] {
  border-color: #397d78;
  background: #dceee7;
  box-shadow: inset 0 0 0 2px #fffdf0;
}
#edition-choice .edition-language-options span {
  margin: 0;
  line-height: 1.1;
}
#edition-choice .edition-language-options .language-flag {
  font-size: 27px;
}
#edition-choice .edition-language-options .edition-language-code {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 800;
}

.arena-training-entry {
  display: block;
  padding: 18px;
  margin: 18px 0;
  border: 2px solid #eacb80;
  border-radius: 10px;
  background: #152a35;
  color: #f5f3de;
  text-decoration: none;
  line-height: 1.5;
}
.arena-training-entry:hover {
  background: #203c46;
}
.arena-training-entry:focus-visible {
  outline: 3px solid #498784;
  outline-offset: 4px;
}
.arena-training-art {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.arena-training-art img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}
.arena-training-entry .arena-training-badge {
  display: block;
  color: #a7d9c8;
  font-size: 11px;
  letter-spacing: 1px;
}
.arena-training-entry .arena-training-title {
  display: block;
  color: #ffe09a;
  font-size: 21px;
  line-height: 1.3;
  margin: 6px 0;
}
.arena-training-entry .arena-training-detail {
  color: #f5f3de;
  font-size: 14px;
  margin: 10px 0;
}
.arena-training-entry .arena-training-note {
  display: block;
  color: #b9d9d0;
  font-size: 12px;
}

.edition-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.edition-links a {
  padding: 10px;
  border: 2px solid #303b52;
  color: #303b52;
  text-decoration: none;
}
.edition-links a[aria-current] {
  background: #ffe780;
}

#edition-choice button:disabled {
  opacity: 1;
  background: #e5e4db;
  color: #555b60;
  cursor: default;
}
#edition-play-guide {
  display: block;
  padding: 18px 4px;
  color: #253f46;
}
.edition-links span[aria-disabled] {
  padding: 10px;
  border: 2px dashed #8c928e;
  color: #555b60;
}
