@charset "UTF-8";
.game-loader { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:22px; background:radial-gradient(ellipse at 50% 30%,#17304c,#060d18 72%); color:#dcecf8; }
.game-loader[hidden] { display:none; }
.loader-card { width:min(100%,350px); padding:28px 23px; text-align:center; border:1px solid #527a94; border-radius:10px; background:linear-gradient(#102236ed,#0b1728f5); box-shadow:0 0 0 5px #46607836,0 18px 60px #0009; }
.loader-card img { display:block; margin:0 auto 15px; object-fit:contain; }
.loader-card h1 { margin:0 0 24px; font:700 25px Consolas,monospace; letter-spacing:5px; color:#eef6ff; }
.loader-card p { font-size:12px; margin:0 0 13px; min-height:18px; }
.loader-card progress { display:block; appearance:none; width:100%; height:10px; border:1px solid #406781; border-radius:6px; overflow:hidden; background:#081521; }
.loader-card progress::-webkit-progress-bar { background:#081521; }.loader-card progress::-webkit-progress-value { background:linear-gradient(90deg,#367ba3,#8fe4ed); border-radius:5px; }.loader-card progress::-moz-progress-bar { background:#8fe4ed; }
.loader-card small { display:block; min-height:30px; margin:10px 0 0; font-size:10px; line-height:1.5; color:#9ab9cd; }
.loader-card .button { margin-top:15px; width:100%; }.load-error .loader-card { border-color:#d4a36d; }
.game-loading > .app-shell,.game-loading > .topbar,.game-loading > .console-caption { visibility:hidden; }
.noscript-error { position:fixed; inset:0; z-index:10001; display:grid; place-items:center; padding:30px; background:#081321; color:#e6f0f8; font:16px Consolas,monospace; text-align:center; }
:root {
  color-scheme: dark;
  --paper: #11151e;
  --white: #1b202b;
  --ink: #f1f0f4;
  --muted: #b0b6c3;
  --line: #525b6e;
  --green: #a13241;
  --green-light: #4b202b;
  --gold: #ffcb68;
  --rust: #ff976e;
  --serif: "Courier New", monospace;
  --sans: "Consolas", "Lucida Console", "Courier New", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: #080c14;
  font-synthesis: none;
}

/* Local account terminal and six-species registration. */
.auth-mode .sidebar { display: none; }
.auth-mode .app-shell { grid-template-columns: minmax(0, 1fr); }
.auth-mode #main { width: 100%; }
.auth-panel { padding: 24px; }
.auth-tabs { display: flex; gap: 12px; margin-bottom: 24px; }
.auth-tabs .button { flex: 1; }
.auth-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.auth-fields .field-label { display: flex; flex-direction: column; gap: 9px; margin: 0; }
.auth-fields .text-input { width: 100%; min-width: 0; margin: 0; }
.registration-fighters { border: 0; padding: 0; margin: 28px 0 20px; min-width: 0; }
.registration-fighters legend { color: var(--gold); font-size: 18px; font-weight: bold; }
.registration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.registration-fighter { position: relative; display: flex; flex-direction: column; padding: 12px;
  border: 1px solid #52647b; background: #101d30; cursor: pointer; min-width: 0; }
.registration-fighter:has(input:checked) { border-color: var(--gold); box-shadow: inset 0 0 0 2px #ffcb6840; background: #28313d; }
.registration-fighter:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.registration-fighter input { position: absolute; top: 12px; left: 12px; accent-color: var(--gold); z-index: 1; }
.registration-portrait { display: block; height: 175px; margin-bottom: 10px;
  background: radial-gradient(ellipse at 50% 80%, #577b9d35, transparent 65%); }
.registration-portrait .sprite-canvas { width: 100%; height: 100%; }
.registration-fighter b { color: #ffd5ad; font-size: 19px; }
.registration-description { color: var(--muted); font-size: 11px; line-height: 1.65; margin-top: 8px; }
.registration-role { color: var(--gold); font-size: 11px; margin-top: 5px; }
.registration-starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.registration-starts > span { border: 1px solid #52647b; padding: 5px 3px; font-size: 9px; white-space: nowrap; }
.registration-starts b { font-size: 11px; color: var(--gold); }
.stat-row .stat-origin { color: #d9c08d; margin-top: 4px; }
.registration-mark { display: none; position: absolute; right: 12px; top: 10px; color: var(--gold); font-size: 22px; }
.registration-fighter:has(input:checked) .registration-mark { display: block; }
.auth-note { color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-error { color: #ffb5b7; padding: 12px; border: 1px solid #a94856; background: #4b202b; }
.auth-submit { margin-top: 14px; width: 100%; }
.arena-lobby { padding: 28px; }
.arena-lobby-heading { max-width: 580px; }
.arena-lobby-heading h2 { color: #ffd5ad; font-size: 26px; }
.arena-lobby-heading p { color: var(--muted); line-height: 1.8; }
.arena-mode-buttons { display: grid; gap: 14px; max-width: 520px; margin-top: 26px; }
.arena-mode-buttons .button { justify-content: space-between; min-height: 58px; }
@media (max-width: 600px) {
  .auth-panel, .arena-lobby { padding: 16px; }
  .auth-fields { grid-template-columns: 1fr; gap: 15px; }
  .registration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .registration-portrait { height: 145px; }
  .registration-description { font-size: 10px; }
  .auth-tabs { gap: 8px; }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 1px 1px, #626e803b 1px, transparent 1.4px) 0 0/7px
      7px,
    radial-gradient(ellipse at 50% 0, #293e5f 0, #080c14 65%);
  font-size: 13px;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
a {
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.46;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #ffcf75;
  outline-offset: 3px;
}
button,
a {
  touch-action: manipulation;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  left: 8px;
  top: -80px;
  z-index: 100;
  background: #9e2f3d;
  padding: 12px;
}
.skip-link:focus {
  top: 8px;
}
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar {
  max-width: 1040px;
  height: 89px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand > span {
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  text-shadow:
    0 2px #000,
    0 0 20px #cf405b66;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.6px;
  margin-top: 5px;
  color: #aab5c8;
  font-weight: 400;
}
.brand img {
  width: 39px;
  height: 43px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.local-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aab6c7;
  font-size: 10px;
}
.local-status i,
.signal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9ae591;
  box-shadow: 0 0 7px #78e9a7;
  border-radius: 50%;
}
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #808b9d;
  background: linear-gradient(#465368, #242d40);
  display: grid;
  place-items: center;
  border-radius: 3px;
  box-shadow: inset 0 1px #ffffff36;
}
.app-shell {
  max-width: 1000px;
  margin: 0 auto;
  border: 3px solid #bac1cc;
  padding: 9px;
  background: linear-gradient(
    135deg,
    #c3c8d1 0,
    #707989 18%,
    #c0c5cd 46%,
    #535d6b 80%,
    #bac1cc 100%
  );
  box-shadow:
    0 0 0 3px #05070c,
    0 15px 60px #0008;
  clip-path: polygon(
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px),
    0 18px
  );
}
main {
  padding: 18px 24px 22px;
  background:
    radial-gradient(circle at 1px 1px, #ffffff0a 1px, transparent 1px) 0 0/5px
      5px,
    #0e121b;
  min-height: 610px;
  min-width: 0;
  border: 2px solid #05080e;
  border-top-color: #d0d6df36;
}
.sidebar {
  background: #151c29;
  border: 2px solid #090b11;
  border-bottom: 0;
  padding: 8px;
}
.sidebar nav {
  display: flex;
  gap: 5px;
}
.app-shell[data-screen="camp"] .sidebar {
  display: none;
}
.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  text-decoration: none;
  font-size: 11px;
  border: 1px solid #758094;
  background: linear-gradient(#404b60, #242c3b);
  box-shadow: inset 0 1px #ffffff26;
}
.nav-link.active {
  background: linear-gradient(#bb4855, #7f2232);
  border-color: #df9aa3;
}
.nav-link:hover {
  filter: brightness(1.15);
}
.nav-link .icon {
  width: 15px;
  height: 15px;
}
.page-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 0 0 19px;
  border-top: 1px solid #c9d1dc;
  border-bottom: 2px solid #080a10;
  background: linear-gradient(#647182, #394355 48%, #2c3443 49%, #3f4c61);
  box-shadow:
    inset 1px 0 #d2dae74d,
    inset -1px 0 #d2dae733;
}
.page-top h1 {
  font-size: 20px;
  letter-spacing: 0.5px;
  margin: 4px 0 0;
  text-shadow: 1px 2px #111;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #b7c3d2;
  margin: 0;
  font-weight: 400;
}
.day-marker {
  font-size: 9px;
  color: #d1dcdf;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.panel {
  border: 2px solid #778292;
  border-top-color: #c1c8d1;
  border-left-color: #b3bdc9;
  background: #171c27;
  box-shadow: inset 0 0 0 2px #05080e;
  border-radius: 0;
  overflow: hidden;
}
.panel-title {
  font-size: 11px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(#67323e, #421d2b);
  border-bottom: 2px solid #06090f;
  line-height: 1.5;
}
.panel-title > span {
  font-size: 10px;
  color: #ffc5c0;
}
.console-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 25px;
  max-width: 820px;
  margin: 0 auto;
}
.pet-bay {
  align-self: start;
}
.pet-viewport {
  height: 257px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background:
    linear-gradient(#10253708, #101c2928),
    url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") 45% 45% / cover;
  overflow: hidden;
}
.pet-viewport:after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 3px,
    #070e2112 4px
  );
  pointer-events: none;
}
.pet-viewport > img {
  height: 243px;
  width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 7px 2px #0005);
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}
.scan-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 8px;
  letter-spacing: 1px;
  color: #a7e8ed;
}
.pet-species {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: #d8e9f1;
  font-size: 8px;
  z-index: 2;
}
.pet-readings {
  padding: 11px 15px 15px;
  background: #10141e;
}
.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  margin: 7px 0 5px;
}
.health-row b {
  font-weight: 400;
}
.healthbar,
.xpbar {
  display: block;
  width: 100%;
  height: 12px;
  border: 1px solid #080d18;
  appearance: none;
  -webkit-appearance: none;
  background: #333a4a;
  box-shadow: inset 0 2px 3px #0009;
}
.healthbar::-webkit-progress-bar,
.xpbar::-webkit-progress-bar {
  background: #333a4a;
  box-shadow: inset 0 2px 3px #0009;
}
.healthbar::-webkit-progress-value {
  background: linear-gradient(#ef6d6f, #b23146 50%, #8a2033 51%, #b23146);
}
.healthbar::-moz-progress-bar {
  background: linear-gradient(#ef6d6f, #b23146);
}
.xpbar {
  height: 8px;
}
.xpbar::-webkit-progress-value {
  background: linear-gradient(#65dbed, #287f9e);
}
.xpbar::-moz-progress-bar {
  background: #45b2cf;
}
.pet-wallet {
  padding: 11px 15px;
  border-top: 1px solid #3f4859;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b7c4d4;
  font-size: 10px;
}
.currency {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffdc7f;
  font-size: 13px;
}
.coin {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid #e8b950;
  border-radius: 50%;
  color: #ffdc7f;
  font-size: 10px;
  background: #65492b;
}
.console-menu-frame {
  padding: 10px;
  background: linear-gradient(
    135deg,
    #c0c5cc,
    #6c788b 36%,
    #c9d0da 56%,
    #6b7686
  );
  clip-path: polygon(
    13px 0,
    calc(100% - 13px) 0,
    100% 13px,
    100% calc(100% - 13px),
    calc(100% - 13px) 100%,
    13px 100%,
    0 calc(100% - 13px),
    0 13px
  );
  box-shadow: inset 0 0 0 2px #d0d7df;
  align-self: start;
}
.console-menu-title {
  text-align: center;
  background: linear-gradient(#843c48, #501c2b);
  padding: 9px;
  border: 2px solid #080c15;
  border-bottom: 1px solid #c76975;
  font-size: 12px;
  letter-spacing: 2px;
  color: #fff2ed;
}
.console-menu {
  padding: 9px 8px 12px;
  background: linear-gradient(100deg, #6f1d2c, #8a2636 55%, #5b1625);
  border-left: 2px solid #090a10;
  border-right: 2px solid #090a10;
}
.console-menu-row {
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-bottom-color: #ffbcc515;
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  font-size: 14px;
  line-height: 1.25;
  min-height: 48px;
  background: transparent;
  text-align: left;
  color: #fff1f2;
  text-shadow: 1px 1px #42121d;
  font-weight: 700;
}
.console-menu-row small {
  display: block;
  color: #dfafb6;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1px;
  margin-top: 5px;
  text-shadow: none;
}
.console-menu-row.selected {
  background: linear-gradient(#c37883, #9e4c5b);
  border-color: #eeafba87;
  box-shadow: inset 0 1px #e6b8c366;
}
.console-menu:hover .selected {
  background: transparent;
  border-color: transparent;
  border-bottom-color: #ffbcc515;
  box-shadow: none;
}
.console-menu-row:hover,
.console-menu:hover .console-menu-row:hover {
  background: linear-gradient(#d17c84, #9a4357);
  border: 1px solid #e6a0ae;
  box-shadow: inset 0 1px #f2cad05e;
}
.console-menu-row.unavailable {
  opacity: 0.38;
}
.menu-number {
  width: 21px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: #f0b5bf;
}
.menu-chevron,
.menu-lock {
  margin-left: auto;
  font-size: 23px;
  color: #f9c6cf;
  font-weight: 400;
}
.menu-lock {
  font-size: 13px;
}
.console-menu-hint {
  text-align: center;
  font-size: 7px;
  letter-spacing: 0.8px;
  background: #2d1724;
  border: 2px solid #080c15;
  border-top: 1px solid #7d3346;
  padding: 8px;
  color: #c3a9bd;
}
.planet-transmission {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #3c4a60;
  background: #131e2e;
  padding: 12px 16px;
  margin: 20px auto 18px;
  max-width: 820px;
}
.planet-transmission p {
  font-size: 10px;
  line-height: 1.7;
  color: #aabbd4;
  margin: 0;
}
.planet-transmission b {
  color: #dae6f5;
  letter-spacing: 0.8px;
  font-size: 9px;
  font-weight: 400;
}
.transmission-icon {
  color: #82d8e9;
  font-size: 30px;
}
.console-softkeys {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 19px;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  padding: 10px 18px;
  border: 2px solid #a1acbc;
  border-top-color: #e3e5eb;
  border-left-color: #d5dbe3;
  background: linear-gradient(#596579, #2b3548 48%, #202a3c 49%, #39475b);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1px #111726,
    1px 2px #030710;
  border-radius: 1px;
  text-shadow: 1px 1px #071019;
}
.button.primary,
.button.gold {
  border-color: #bd828d;
  border-top-color: #f3bec6;
  border-left-color: #e7a4b1;
  background: linear-gradient(#ba5461, #9a2e42 48%, #6c172f 49%, #8a2940);
}
.button:hover:not(:disabled) {
  filter: brightness(1.2);
}
.button .icon {
  width: 16px;
  height: 16px;
}
.button.small {
  min-height: 33px;
  font-size: 10px;
  padding: 7px 11px;
}
.button.ghost {
  background: linear-gradient(#525e70, #2d384a);
}
.button.danger {
  background: linear-gradient(#a74d50, #682b36);
  color: #fff;
}
.text-link {
  background: none;
  border: 0;
  text-decoration: none;
  color: #9cdae8;
  font-size: 11px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 0;
}
.text-link:hover {
  text-decoration: underline;
}
.badge {
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.6px;
  color: #ffcf79;
  background: #352635;
  border: 1px solid #6d556a;
  padding: 5px 8px;
  display: inline-block;
  text-decoration: none;
}
.subtle {
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
  margin: 0 0 12px;
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(200px, 0.85fr) minmax(0, 1.2fr);
  gap: 20px;
}
.full-character {
  position: relative;
  min-height: 390px;
  background:
    linear-gradient(#15233318, #10172666),
    url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.full-character .panel-title {
  width: 100%;
  align-self: start;
  position: absolute;
  top: 0;
  left: 0;
}
.full-character > img {
  height: 285px;
  width: 88%;
  object-fit: contain;
  margin: 28px 0 45px;
}
.hero-nameplate {
  position: absolute;
  bottom: 15px;
  left: 12px;
  right: 12px;
  text-align: center;
}
.hero-nameplate h2 {
  font-size: 20px;
  margin: 0 0 6px;
  color: #fff;
}
.hero-nameplate p {
  margin: 0;
  font-size: 9px;
}
.details-panel {
  padding: 0 17px 17px;
}
.details-panel .panel-title {
  margin: 0 -17px 13px;
  padding: 10px 17px;
}
.details-panel > .subtle {
  font-size: 10px;
  margin: 10px 0 5px;
}
.stat-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #3d4556;
}
.stat-emblem {
  font-size: 22px;
  color: #db737b;
  text-align: center;
}
.stat-row h3 {
  font-size: 12px;
  margin: 0 0 4px;
}
.stat-row p {
  font-size: 9px;
  line-height: 1.6;
  margin: 0;
  color: #a5b3c7;
}
.stat-value {
  font-size: 23px;
  color: #fff;
}
.stat-plus {
  width: 29px;
  min-height: 29px;
  height: 29px;
  padding: 0;
  font-size: 18px;
}
.details-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.hero-health {
  margin-top: 15px;
}
.profile-equipment {
  margin-top: 22px;
}
.profile-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.profile-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(#2d414a, #192c35);
  border: 2px solid #7e9a9e;
  text-decoration: none;
  font-size: 11px;
}
.profile-slot small {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  color: #bbced5;
  line-height: 1.5;
}
.slot-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #698b92;
  color: #a1e6e5;
  font-size: 23px;
  background: #132d35;
}
.equipment-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
}
.equipment-slots {
  padding: 17px;
  align-self: start;
}
.equipment-slots h2 {
  font-size: 14px;
  margin: 0 0 12px;
}
.equipped-slot {
  padding: 15px 0;
  border-top: 1px solid #465266;
}
.equipped-slot > span {
  font-size: 9px;
  color: #b0bed3;
}
.equipped-slot h3 {
  font-size: 12px;
  line-height: 1.7;
  margin: 7px 0;
  color: #fff;
}
.equipped-slot p {
  font-size: 10px;
  line-height: 1.6;
  color: #eaa5b3;
  margin: 0;
}
.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 17px;
  border-bottom: 2px solid #637187;
  padding-bottom: 6px;
}
.section-tab {
  border: 1px solid #6f7f98;
  background: linear-gradient(#35445a, #1b2639);
  padding: 10px 17px;
  color: #c0d0e7;
  font-size: 11px;
}
.section-tab.active {
  background: linear-gradient(#9a4557, #632036);
  border-color: #c68396;
  color: #fff;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.item-card {
  padding: 17px;
  display: flex;
  flex-direction: column;
}
.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.item-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 25px;
  color: #89d8ed;
  border: 2px solid #658390;
  background: linear-gradient(#213f52, #112635);
}
.item-card h3 {
  font-size: 14px;
  line-height: 1.5;
  margin: 15px 0 9px;
  color: #ffccd3;
}
.item-card > p {
  font-size: 10px;
  line-height: 1.8;
  color: #b3bbcc;
  margin: 0;
  min-height: 52px;
}
.item-bonuses {
  font-size: 10px;
  line-height: 1.7;
  color: #9cdbce;
  margin: 14px 0;
}
.item-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.item-action .currency {
  font-size: 11px;
}
.opponent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.opponent-card .portrait {
  height: 210px;
  background:
    linear-gradient(#12223940, #111e374d),
    url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") center 75% / cover;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #60738d;
}
.opponent-card .portrait img {
  height: 220px;
  width: 100%;
  object-fit: contain;
}
.opponent-card .details {
  padding: 17px;
}
.opponent-card h2 {
  font-size: 22px;
  margin: 10px 0;
  color: #ffb6c1;
}
.opponent-card p {
  font-size: 10px;
  line-height: 1.8;
  color: #b8c4d8;
  min-height: 55px;
  margin: 0 0 14px;
}
.opponent-card .button {
  width: 100%;
  margin-top: 17px;
  font-size: 11px;
}
.reward-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #ffd690;
  border-top: 1px solid #4d5c72;
  padding-top: 12px;
}
.battle-rule {
  font-size: 10px;
  line-height: 1.9;
  color: #a3b3cc;
  margin: 18px 0 0;
}
.arena-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 330px;
  border: 3px solid #8b9caf;
  border-top-color: #cedbe8;
  background: #121e36 url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") center 75% / cover;
  box-shadow: inset 0 0 30px #020b18;
}
.arena-scene:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#06122770, #15232e00 55%, #07112224);
  z-index: -1;
}
.combatants {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 15px;
  padding: 38px 33px 0;
  align-items: end;
}
.combatant {
  text-align: center;
  min-width: 0;
}
.combatant h2 {
  font-size: 17px;
  line-height: 1.5;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 2px 2px #071228;
}
.combatant .health-row {
  font-size: 10px;
  text-shadow: 1px 1px #000;
}
.combatant .healthbar {
  height: 11px;
}
.combatant .fighter {
  height: 237px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 2px #02091e66);
  animation: float 3s ease-in-out infinite;
}
.combatant.enemy .fighter {
  transform: scaleX(-1);
  animation-delay: -1.4s;
}
.versus {
  font-size: 28px;
  color: #ffb375;
  text-align: center;
  padding-bottom: 130px;
  text-shadow: 1px 2px #0c1528;
}
.round-label {
  position: absolute;
  left: 50%;
  top: 13px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ffda87;
  letter-spacing: 1.5px;
  white-space: nowrap;
  text-shadow: 1px 1px #102039;
}
.battle-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.battle-controls,
.battle-log {
  padding: 20px;
}
.battle-controls h2,
.battle-log h2 {
  font-size: 13px;
  margin: 0 0 10px;
  color: #ffbdc7;
}
.battle-controls > p {
  font-size: 10px;
  color: #b4c3d9;
  line-height: 1.8;
  margin: 0 0 18px;
}
.choice-group {
  border: 0;
  padding: 0;
  margin: 0 0 17px;
  min-width: 0;
}
.choice-group legend {
  font-size: 9px;
  color: #bdc9de;
  margin-bottom: 9px;
  line-height: 1.6;
}
.guard-count {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #7b8ca8;
  background: #26354b;
  color: #ffd687;
}
.zone-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.zone-choice {
  min-height: 44px;
  padding: 9px 5px;
  font-size: 10px;
  color: #bdcbe1;
  border: 2px solid #6a7a94;
  background: linear-gradient(#374861, #1b283d);
  box-shadow: inset 0 1px #bdcfe233;
}
.zone-choice[aria-pressed="true"] {
  border-color: #e7acb4;
  color: #fff;
  background: linear-gradient(#b6576b, #6f273e);
  box-shadow:
    inset 0 1px #f3bec433,
    0 0 5px #d7445e66;
}
.battle-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.battle-submit .button {
  min-width: 150px;
}
.battle-log {
  max-height: 344px;
  overflow: auto;
  scrollbar-color: #805267 #1b2030;
}
.log-entry {
  font-size: 10px;
  line-height: 1.8;
  color: #b7c5dd;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px dotted #5b6172;
}
.log-entry.critical {
  color: #ffd07d;
}
.log-entry.dodge {
  color: #9fcbe9;
}
.log-entry.block {
  color: #a6d6ca;
}
.log-entry.victory {
  color: #ffe7b3;
  font-weight: 700;
}
.log-entry.round {
  font-size: 9px;
  color: #ed8d9e;
  padding: 13px 0 4px;
  border: 0;
}
.battle-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 2px solid #9d7180;
  background: linear-gradient(#442535, #201b2d);
  margin-top: 18px;
}
.battle-result h2 {
  font-size: 22px;
  color: #ffd587;
  margin: 0 0 10px;
}
.battle-result p {
  font-size: 11px;
  color: #d8c9d9;
  line-height: 1.8;
  margin: 0;
}
.result-log {
  margin-top: 18px;
  max-height: 250px;
}
.world-hero {
  height: 255px;
  background: #172d4c url("/art/optimized/ad76ba7dbb4eaeb0a28d19fa.webp?v=ad76ba7dbb4eaeb0") center 60% / cover;
  border: 2px solid #8e9eae;
}
.world-text {
  padding: 22px 8px;
  font-size: 12px;
  line-height: 1.9;
}
.world-text h2 {
  font-size: 20px;
  color: #ffc2cf;
  margin: 24px 0 16px;
  line-height: 1.6;
}
.world-text h3 {
  font-size: 14px;
  color: #ffd18e;
  margin: 26px 0 12px;
}
.world-text > p {
  color: #c2cce0;
}
.guide-tabs {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.guide-creatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.guide-creatures > div {
  padding: 13px;
  border: 1px solid #5e728d;
  background: #1a263a;
  text-align: center;
}
.guide-creatures img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
}
.guide-creatures b {
  font-size: 14px;
  color: #febec9;
}
.guide-creatures p {
  font-size: 10px;
  line-height: 1.7;
  color: #b8c6dc;
  margin: 8px 0 0;
}
.records-panel {
  padding: 24px;
  text-align: center;
}
.records-avatar {
  height: 170px;
}
.records-avatar img {
  height: 100%;
  object-fit: contain;
}
.records-panel > h2 {
  font-size: 22px;
  color: #ffc9d4;
}
.records-panel > .subtle {
  max-width: 480px;
  margin: 0 auto 22px;
}
.records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.record {
  padding: 18px 10px;
  border: 1px solid #73849c;
  background: linear-gradient(#344156, #20293b);
}
.record b {
  font-size: 27px;
  color: #ffe2a5;
  display: block;
}
.record span {
  font-size: 10px;
  color: #c0cce0;
  display: block;
  margin-top: 8px;
}
.console-caption {
  max-width: 1000px;
  margin: 17px auto 20px;
  text-align: center;
  color: #8996b0;
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1.8;
  padding: 0 15px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 28px);
  padding: 15px 20px;
  border: 2px solid #a6bed0;
  background: #263a52;
  color: #f4f6ff;
  box-shadow: 0 5px 25px #0009;
  font-size: 11px;
  line-height: 1.8;
}
.toast.error {
  background: #652e40;
  border-color: #dc9aa7;
}
.storage-warning {
  max-width: 1000px;
  margin: 0 auto 15px;
  padding: 12px;
  border: 1px solid #cd9851;
  background: #4e382b;
  color: #ffdfac;
  font-size: 11px;
  line-height: 1.8;
}
dialog {
  color: var(--ink);
  border: 4px solid #a4afbf;
  background: #171e2b;
  padding: 27px;
  max-width: 480px;
  width: calc(100% - 26px);
  box-shadow:
    inset 0 0 0 2px #050911,
    0 15px 70px #000a;
}
dialog::backdrop {
  background: #030813c9;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 20px;
  color: #ffc3cf;
  line-height: 1.6;
  margin: 0 35px 15px 0;
}
dialog p {
  font-size: 11px;
  color: #b8c6df;
  line-height: 1.9;
}
.modal-x {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 22px;
  width: 29px;
  height: 29px;
}
.field-label {
  display: block;
  font-size: 11px;
  margin-top: 18px;
}
.text-input {
  display: block;
  width: 100%;
  margin: 9px 0 15px;
  padding: 12px;
  border: 2px solid #8799b0;
  background: #090e1c;
  color: #fff;
  box-shadow: inset 1px 2px 6px #0007;
}
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.modal-divider {
  border-top: 1px solid #506079;
  margin-top: 22px;
  padding-top: 14px;
}
.file-input {
  display: none;
}
@keyframes float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}
@media (min-width: 1450px) {
  .topbar {
    height: 105px;
  }
  .app-shell {
    max-width: 1040px;
  }
  main {
    padding: 22px 32px 25px;
    min-height: 660px;
  }
  .console-home {
    gap: 32px;
    max-width: 850px;
  }
  .pet-viewport {
    height: 286px;
  }
  .pet-viewport > img {
    height: 270px;
  }
  .console-menu-row {
    min-height: 54px;
    font-size: 15px;
  }
  .console-menu-row small {
    font-size: 9px;
  }
  .console-caption {
    margin-top: 21px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 77px;
    padding: 0 19px;
  }
  .app-shell {
    margin: 0 12px;
  }
  .console-home {
    gap: 17px;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  }
  main {
    padding: 14px;
  }
  .console-menu-row {
    font-size: 12px;
    padding: 10px 7px;
    gap: 7px;
  }
  .console-menu-row small {
    font-size: 7px;
  }
  .console-menu-title {
    font-size: 11px;
  }
  .menu-number {
    width: 15px;
    font-size: 10px;
  }
  .pet-viewport {
    height: 251px;
  }
  .pet-viewport > img {
    height: 236px;
  }
  .pet-wallet {
    font-size: 8px;
    gap: 6px;
    padding: 10px;
  }
  .pet-readings {
    padding: 10px;
  }
  .hero-layout {
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
  }
  .equipment-layout {
    grid-template-columns: 175px 1fr;
    gap: 13px;
  }
  .equipment-slots {
    padding: 14px;
  }
  .item-card {
    padding: 14px;
  }
  .item-action {
    flex-wrap: wrap;
  }
  .item-action .button {
    width: 100%;
  }
  .opponent-grid {
    gap: 12px;
  }
  .opponent-card .details {
    padding: 14px;
  }
  .opponent-card .portrait {
    height: 180px;
  }
  .opponent-card .portrait img {
    height: 186px;
  }
  .reward-line {
    flex-wrap: wrap;
  }
  .opponent-card .button {
    padding: 10px 5px;
    font-size: 10px;
  }
  .battle-bottom {
    gap: 13px;
    grid-template-columns: 1.1fr 1fr;
  }
  .battle-controls,
  .battle-log {
    padding: 16px;
  }
  .zone-options {
    gap: 5px;
  }
  .zone-choice {
    font-size: 9px;
  }
  .battle-submit {
    flex-wrap: wrap;
  }
  .battle-submit .button {
    min-width: 145px;
  }
  .profile-slot {
    gap: 8px;
    padding: 10px;
  }
  .slot-glyph {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 20px;
  }
}
@media (max-width: 520px) {
  body {
    font-size: 12px;
  }
  .topbar {
    height: 72px;
    padding: 0 16px;
  }
  .brand {
    gap: 8px;
  }
  .brand img {
    width: 30px;
    height: 36px;
  }
  .brand > span {
    font-size: 24px;
    letter-spacing: 3px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .topbar-right {
    gap: 14px;
  }
  .local-status {
    font-size: 0;
    gap: 0;
  }
  .local-status i {
    width: 7px;
    height: 7px;
  }
  .icon-button {
    width: 32px;
    height: 32px;
  }
  .app-shell {
    margin: 0 7px;
    padding: 5px;
    border-width: 2px;
    clip-path: polygon(
      11px 0,
      calc(100% - 11px) 0,
      100% 11px,
      100% calc(100% - 11px),
      calc(100% - 11px) 100%,
      11px 100%,
      0 calc(100% - 11px),
      0 11px
    );
  }
  main {
    min-height: 550px;
    padding: 10px 10px 15px;
  }
  .page-top {
    padding: 9px 10px;
    margin-bottom: 14px;
    gap: 8px;
  }
  .page-top h1 {
    font-size: 17px;
    margin-top: 4px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .day-marker {
    font-size: 0;
    gap: 0;
  }
  .day-marker .signal-dot {
    width: 6px;
    height: 6px;
  }
  .badge {
    font-size: 7px;
    padding: 4px 6px;
  }
  .console-home {
    gap: 12px;
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    align-items: start;
  }
  .pet-bay .panel-title {
    font-size: 8px;
    padding: 8px 6px;
    letter-spacing: 0;
    line-height: 1.7;
    display: block;
    min-height: 43px;
  }
  .pet-bay .panel-title > span {
    display: block;
    font-size: 8px;
  }
  .pet-viewport {
    height: 205px;
    background-position: 50% 45%;
  }
  .pet-viewport > img {
    height: 182px;
    width: 120%;
    max-width: 120%;
    margin-left: -2%;
  }
  .scan-label {
    font-size: 5px;
    top: 7px;
    left: 5px;
    letter-spacing: 0.4px;
  }
  .pet-species {
    font-size: 6px;
    right: 5px;
    bottom: 8px;
  }
  .pet-readings {
    padding: 6px 7px 10px;
  }
  .health-row {
    font-size: 8px;
    margin: 7px 0 5px;
    gap: 3px;
  }
  .healthbar {
    height: 9px;
  }
  .xpbar {
    height: 6px;
  }
  .pet-wallet {
    display: block;
    font-size: 8px;
    padding: 9px 7px;
  }
  .pet-wallet .currency {
    font-size: 12px;
    margin-bottom: 8px;
  }
  .pet-wallet > span:last-child {
    display: block;
  }
  .coin {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }
  .console-menu-frame {
    padding: 6px;
    clip-path: polygon(
      9px 0,
      calc(100% - 9px) 0,
      100% 9px,
      100% calc(100% - 9px),
      calc(100% - 9px) 100%,
      9px 100%,
      0 calc(100% - 9px),
      0 9px
    );
  }
  .console-menu-title {
    font-size: 9px;
    letter-spacing: 0.7px;
    padding: 8px 4px;
  }
  .console-menu {
    padding: 6px 4px 9px;
  }
  .console-menu-row {
    font-size: 11px;
    min-height: 45px;
    padding: 9px 4px;
    gap: 6px;
  }
  .console-menu-row small {
    font-size: 6px;
    line-height: 1.6;
    margin-top: 4px;
  }
  .menu-number {
    width: 12px;
    font-size: 9px;
  }
  .menu-chevron {
    font-size: 18px;
  }
  .console-menu-hint {
    font-size: 5px;
    letter-spacing: 0;
    padding: 7px 2px;
  }
  .planet-transmission {
    padding: 10px;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 14px;
  }
  .planet-transmission p {
    font-size: 8px;
    line-height: 1.8;
  }
  .planet-transmission b {
    font-size: 7px;
    letter-spacing: 0.3px;
  }
  .transmission-icon {
    font-size: 24px;
  }
  .console-softkeys {
    gap: 12px;
    margin-top: 16px;
  }
  .console-softkeys > .button {
    min-width: 100px;
    min-height: 40px;
    font-size: 10px;
    padding: 10px 13px;
  }
  .console-caption {
    font-size: 6px;
    letter-spacing: 0.4px;
    margin: 13px auto 15px;
  }
  .sidebar {
    padding: 5px;
  }
  .sidebar nav {
    gap: 4px;
  }
  .nav-link {
    padding: 8px 4px;
    font-size: 8px;
    gap: 4px;
    flex-direction: column;
  }
  .nav-link .icon {
    width: 14px;
    height: 14px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .full-character {
    min-height: 295px;
  }
  .full-character > img {
    height: 225px;
    margin: 34px 0 37px;
    width: 80%;
  }
  .hero-nameplate {
    bottom: 11px;
  }
  .hero-nameplate h2 {
    font-size: 17px;
    margin-bottom: 4px;
  }
  .hero-nameplate p {
    font-size: 8px;
  }
  .details-panel {
    padding: 0 15px 16px;
  }
  .details-panel .panel-title {
    margin-left: -15px;
    margin-right: -15px;
  }
  .stat-row {
    padding: 12px 0;
    gap: 9px;
  }
  .stat-row h3 {
    font-size: 12px;
  }
  .stat-row p {
    font-size: 9px;
  }
  .stat-value {
    font-size: 23px;
  }
  .hero-health .health-row {
    font-size: 11px;
  }
  .hero-health .healthbar {
    height: 12px;
  }
  .profile-slots {
    gap: 7px;
  }
  .profile-slot {
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    gap: 9px;
    font-size: 9px;
    text-align: center;
  }
  .profile-slot small {
    font-size: 7px;
    line-height: 1.7;
  }
  .slot-glyph {
    width: 37px;
    height: 37px;
    flex-basis: 37px;
    font-size: 23px;
  }
  .section-title {
    font-size: 12px;
  }
  .equipment-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .equipment-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 13px;
  }
  .equipment-slots h2 {
    grid-column: 1/-1;
    font-size: 12px;
    margin-bottom: 0;
  }
  .equipped-slot {
    padding: 12px 0 0;
    min-width: 0;
  }
  .equipped-slot > span {
    font-size: 8px;
  }
  .equipped-slot h3 {
    font-size: 9px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  .equipped-slot p {
    font-size: 8px;
  }
  .equipped-slot .text-link {
    font-size: 9px;
  }
  .section-tab {
    font-size: 10px;
    padding: 10px 12px;
  }
  .item-grid {
    gap: 10px;
  }
  .item-card {
    padding: 12px;
  }
  .item-card h3 {
    font-size: 12px;
    line-height: 1.7;
    margin: 12px 0 7px;
  }
  .item-card > p {
    font-size: 9px;
    line-height: 1.8;
    min-height: 66px;
  }
  .item-bonuses {
    font-size: 8px;
    line-height: 1.7;
    margin: 11px 0;
  }
  .item-glyph {
    height: 34px;
    width: 34px;
    font-size: 22px;
  }
  .item-top .badge {
    font-size: 6px;
    padding: 3px 4px;
  }
  .item-action .button {
    font-size: 9px;
    min-height: 35px;
    padding: 8px 4px;
  }
  .opponent-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .opponent-card {
    display: grid;
    grid-template-columns: 39% minmax(0, 1fr);
  }
  .opponent-card .portrait {
    height: 100%;
    min-height: 203px;
    border-right: 1px solid #60738d;
    border-bottom: 0;
  }
  .opponent-card .portrait img {
    height: 197px;
    width: 128%;
    max-width: 128%;
  }
  .opponent-card .details {
    padding: 15px;
  }
  .opponent-card h2 {
    font-size: 22px;
    margin: 9px 0;
  }
  .opponent-card p {
    font-size: 9px;
    line-height: 1.9;
    min-height: 0;
    margin-bottom: 12px;
  }
  .reward-line {
    font-size: 9px;
    gap: 7px;
  }
  .opponent-card .button {
    margin-top: 12px;
    min-height: 36px;
    font-size: 10px;
  }
  .arena-scene {
    min-height: 268px;
    border-width: 2px;
  }
  .combatants {
    padding: 30px 10px 0;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  }
  .combatant h2 {
    font-size: 13px;
    margin-bottom: 7px;
    overflow-wrap: anywhere;
  }
  .combatant .health-row {
    font-size: 7px;
  }
  .combatant .healthbar {
    height: 8px;
  }
  .combatant .fighter {
    height: 190px;
    max-width: 115%;
    margin-left: -7.5%;
  }
  .versus {
    font-size: 20px;
    padding-bottom: 103px;
  }
  .round-label {
    font-size: 8px;
    top: 10px;
  }
  .battle-bottom {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
  }
  .battle-controls,
  .battle-log {
    padding: 16px;
  }
  .battle-controls h2,
  .battle-log h2 {
    font-size: 12px;
  }
  .battle-controls > p {
    font-size: 9px;
    margin-bottom: 16px;
  }
  .choice-group legend {
    font-size: 8px;
  }
  .zone-options {
    gap: 6px;
  }
  .zone-choice {
    min-height: 42px;
    font-size: 9px;
    padding: 9px 3px;
  }
  .battle-submit {
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 19px;
  }
  .battle-submit .button {
    min-width: 140px;
    font-size: 11px;
  }
  .battle-submit .text-link {
    font-size: 10px;
  }
  .battle-log {
    max-height: 260px;
  }
  .log-entry {
    font-size: 9px;
    line-height: 1.8;
  }
  .battle-rule {
    font-size: 9px;
  }
  .battle-result {
    padding: 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .battle-result h2 {
    font-size: 22px;
  }
  .battle-result p {
    font-size: 10px;
  }
  .world-hero {
    height: 200px;
    background-position: 45% center;
  }
  .world-text {
    padding: 18px 3px;
    font-size: 11px;
    line-height: 1.95;
  }
  .world-text h2 {
    font-size: 17px;
    line-height: 1.7;
    margin-top: 22px;
  }
  .world-text h3 {
    font-size: 13px;
  }
  .guide-tabs {
    gap: 6px;
  }
  .guide-creatures {
    gap: 8px;
  }
  .guide-creatures > div {
    padding: 9px 6px;
  }
  .guide-creatures img {
    height: 95px;
  }
  .guide-creatures b {
    font-size: 12px;
  }
  .guide-creatures p {
    font-size: 8px;
    line-height: 1.7;
  }
  .records-panel {
    padding: 18px;
  }
  .records-panel > h2 {
    font-size: 20px;
  }
  .records {
    gap: 9px;
  }
  .record {
    padding: 15px 6px;
  }
  .record b {
    font-size: 25px;
  }
  .record span {
    font-size: 8px;
  }
  .subtle {
    font-size: 10px;
  }
  .toast {
    bottom: 15px;
    padding: 12px 16px;
    font-size: 10px;
  }
  dialog {
    padding: 24px 18px;
  }
  dialog h2 {
    font-size: 18px;
  }
  dialog p {
    font-size: 10px;
  }
  .modal-actions .button {
    font-size: 10px;
    padding: 10px 12px;
    flex: 1;
  }
  .storage-warning {
    font-size: 10px;
    padding: 10px;
    margin: 0 7px 10px;
  }
}
@media (max-width: 355px) {
  main {
    padding: 9px;
  }
  .console-home {
    gap: 8px;
    grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
  }
  .console-menu-row {
    font-size: 10px;
  }
  .menu-number {
    display: none;
  }
  .pet-viewport {
    height: 205px;
  }
  .pet-viewport > img {
    height: 169px;
  }
  .pet-wallet {
    font-size: 7px;
  }
  .planet-transmission b {
    font-size: 6px;
  }
  .console-softkeys > .button {
    font-size: 9px;
    padding: 9px;
  }
  .item-card {
    padding: 10px;
  }
  .zone-choice {
    font-size: 8px;
  }
  .guide-creatures {
    grid-template-columns: 1fr;
  }
  .guide-creatures img {
    height: 150px;
  }
}
/* Battle targeting follows the fighter's SVG coordinate space at every size. */
.arena-turn-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 47px;
  padding: 10px;
  background: linear-gradient(#0d1728e6, #0d17285c);
}
.arena-turn-strip .round-label {
  position: static;
  transform: none;
  font-size: 10px;
}
.phase-badge {
  border: 1px solid #e2b36f;
  background: #6c3037dc;
  color: #ffe4a3;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: 1px;
}
.phase-badge[data-phase="defense"] {
  background: #26485fe3;
  border-color: #8bd7e8;
  color: #c6f1fc;
}
.phase-badge.finished {
  background: #303b4c;
  border-color: #9caac0;
}
.arena-scene .combatants {
  padding-top: 7px;
  align-items: start;
}
.arena-scene .versus {
  align-self: center;
  padding-bottom: 0;
}
.fighter-stage {
  position: relative;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 400 / 520;
  margin: 0 auto;
  isolation: isolate;
}
.combatant .fighter-stage .fighter {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: contain;
  animation: none;
}
.body-zones {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.body-zone {
  position: absolute;
  left: 11%;
  width: 78%;
  height: 21.25%;
  border: 1px solid #f5df749e;
  border-radius: 0;
  background-color: #e6cb4d2d;
  background-image:
    repeating-linear-gradient(60deg, transparent 0 7px, #f8df6a20 7px 8px),
    repeating-linear-gradient(-60deg, transparent 0 7px, #f8df6a20 7px 8px);
  color: #fff6bf;
  padding: 0;
  pointer-events: auto;
  box-shadow: inset 0 0 8px #e8c65018;
  text-shadow: 1px 1px 2px #0b1229;
}
.body-zone-1 {
  top: 6%;
}
.body-zone-2 {
  top: 27.25%;
}
.body-zone-3 {
  top: 48.5%;
}
.body-zone-4 {
  top: 69.75%;
}
.body-zone:hover:not(:disabled) {
  background-color: #f9dd644d;
  border-color: #fff3ac;
}
.body-zone[aria-pressed="true"] {
  border: 2px solid #fff3a6;
  background-color: #ffce5a7a;
  box-shadow:
    inset 0 0 10px #fff6bc38,
    0 0 6px #ffe2747a;
  z-index: 1;
}
.body-zone:disabled {
  opacity: 1;
  cursor: wait;
}
.body-zone-number {
  position: absolute;
  left: 5px;
  top: 4px;
  font-size: 9px;
}
.body-zone-mark {
  font-size: 22px;
  font-weight: 700;
  opacity: 0;
}
.body-zone[aria-pressed="true"] .body-zone-mark {
  opacity: 1;
}
.hit-feedback {
  position: absolute;
  left: 50%;
  top: 1%;
  transform: translateX(-50%);
  font-size: 20px;
  color: #fff2be;
  font-weight: 700;
  text-shadow:
    1px 2px #091226,
    0 0 8px #091226;
  pointer-events: none;
  white-space: nowrap;
  z-index: 3;
}
.hit-feedback.critical {
  color: #ffbd72;
}
.hit-feedback.block,
.hit-feedback.dodge {
  color: #b9f0f1;
}
.battle-turn-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 14px;
  padding: 17px 20px;
}
.phase-title {
  font-size: 14px;
  color: #ffd7ac;
  margin: 0 0 8px;
}
.turn-instructions > p {
  font-size: 10px;
  line-height: 1.8;
  color: #b7c9df;
  margin: 0 0 7px;
}
.turn-instructions > .selection-summary {
  color: #ffe4a1;
  margin-bottom: 0;
}
.battle-turn-controls .battle-submit {
  margin-top: 0;
}
.battle-turn-controls .battle-submit .button {
  min-width: 155px;
}
.phase-log {
  margin-top: 14px;
  max-height: 190px;
}
@media (max-width: 760px) {
  .battle-turn-controls {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 16px;
  }
  .battle-turn-controls .battle-submit {
    flex-wrap: nowrap;
  }
}
@media (max-width: 520px) {
  .arena-turn-strip {
    min-height: 38px;
    gap: 13px;
    padding: 8px;
  }
  .arena-turn-strip .round-label {
    font-size: 8px;
  }
  .phase-badge {
    font-size: 8px;
    padding: 5px 8px;
  }
  .fighter-stage {
    width: 180px;
  }
  .body-zone-number {
    font-size: 7px;
    left: 4px;
    top: 3px;
  }
  .body-zone-mark {
    font-size: 16px;
  }
  .hit-feedback {
    font-size: 14px;
  }
  .phase-title {
    font-size: 12px;
  }
  .turn-instructions > p {
    font-size: 9px;
  }
  .battle-turn-controls {
    padding: 14px;
    gap: 14px;
  }
  .battle-turn-controls .battle-submit .button {
    min-width: 142px;
    font-size: 11px;
  }
  .phase-log {
    max-height: 170px;
    padding: 14px;
  }
}
/* Raster pilot: square atlas cells fit naturally without stretching. */
.sprite-canvas {
  display: block;
  max-width: 100%;
}
.fighter-stage.raster-fighter {
  aspect-ratio: 1 / 1;
}
.combatant .fighter-stage.raster-fighter canvas.fighter {
  position: absolute;
  left: -50%;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
  pointer-events: none;
}
.combatant.enemy canvas.fighter {
  transform: none;
}
.pet-viewport > .sprite-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 7px 2px #0005);
}
.full-character > .sprite-canvas {
  width: 88%;
  height: 285px;
  margin: 32px 0 48px;
}
.opponent-card .portrait > .sprite-canvas {
  width: 100%;
  height: 210px;
}
.guide-creatures .sprite-canvas {
  width: 100%;
  height: 140px;
  margin-bottom: 8px;
}
.records-avatar > .sprite-canvas {
  width: 100%;
  height: 100%;
}
@media (max-width: 520px) {
  .full-character > .sprite-canvas {
    height: 225px;
    margin: 34px 0 37px;
  }
  .guide-creatures .sprite-canvas {
    height: 95px;
  }
  .opponent-card .portrait > .sprite-canvas {
    height: 197px;
  }
}
.fighter-choice-link {
  margin-top: 4px;
  font-size: 10px;
}
.full-character > .sprite-canvas,
.full-character > img {
  margin-bottom: 90px;
}
.fighter-choice-note {
  color: #becde1;
  font-size: 11px;
  line-height: 1.9;
  margin: 0 0 20px;
}
.fighter-choice-lock {
  padding: 12px 15px;
  margin: 0 0 17px;
  border: 1px solid #b88663;
  background: #49312d;
  color: #ffe0aa;
  font-size: 11px;
  line-height: 1.8;
}
.fighter-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fighter-choice-card.selected {
  border-color: #dcc18b;
  box-shadow: inset 0 0 0 2px #ad794240;
}
.fighter-choice-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  background:
    linear-gradient(#12223940, #111e374d),
    url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") center 75% / cover;
  border-bottom: 1px solid #627288;
}
.fighter-choice-portrait > .sprite-canvas,
.fighter-choice-portrait > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fighter-choice-details {
  padding: 18px;
}
.fighter-choice-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.fighter-choice-heading h2 {
  color: #ffd5ad;
  font-size: 23px;
  margin: 0;
}
.fighter-choice-details > p {
  color: #bac8dc;
  font-size: 10px;
  line-height: 1.8;
  min-height: 56px;
  margin: 15px 0;
}
.fighter-choice-details > .button {
  width: 100%;
}
@media (max-width: 760px) {
  .fighter-choice-grid {
    gap: 12px;
  }
  .fighter-choice-portrait {
    height: 205px;
  }
  .fighter-choice-details {
    padding: 14px;
  }
}
@media (max-width: 520px) {
  .full-character > .sprite-canvas,
  .full-character > img {
    margin-bottom: 80px;
  }
  .fighter-choice-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .fighter-choice-card {
    display: grid;
    grid-template-columns: 40% minmax(0, 1fr);
  }
  .fighter-choice-portrait {
    height: 100%;
    min-height: 200px;
    border-bottom: 0;
    border-right: 1px solid #627288;
  }
  .fighter-choice-portrait > .sprite-canvas,
  .fighter-choice-portrait > img {
    height: 200px;
  }
  .fighter-choice-heading h2 {
    font-size: 21px;
  }
  .fighter-choice-details > p {
    min-height: 0;
    font-size: 9px;
    margin: 13px 0;
  }
  .fighter-choice-details > .button {
    font-size: 10px;
    padding: 10px 6px;
  }
  .fighter-choice-note,
  .fighter-choice-lock {
    font-size: 10px;
  }
}
/* The strike steps toward the opponent; the obsolete backward wind-up is gone. */
.arena-scene .fighter-stage[data-motion="strike"][data-facing="right"] {
  animation: strike-forward-player 0.667s ease-in-out;
}
.arena-scene .fighter-stage[data-motion="strike"][data-facing="left"] {
  animation: strike-forward-enemy 0.667s ease-in-out;
}
@keyframes strike-forward-player {
  0%,
  100% {
    translate: 0 0;
  }
  50%,
  65% {
    translate: 10px 0;
  }
}
@keyframes strike-forward-enemy {
  0%,
  100% {
    translate: 0 0;
  }
  50%,
  65% {
    translate: -10px 0;
  }
}
.arena-scene.critical-impact {
  --shake-x: 4px;
  --shake-y: 2px;
  animation: critical-camera 0.32s ease-out;
}
@keyframes critical-camera {
  0%,
  100% {
    translate: 0 0;
  }
  16% {
    translate: calc(-1 * var(--shake-x)) var(--shake-y);
  }
  32% {
    translate: var(--shake-x) calc(-1 * var(--shake-y));
  }
  48% {
    translate: calc(-0.75 * var(--shake-x)) var(--shake-y);
  }
  64% {
    translate: calc(0.5 * var(--shake-x)) calc(-0.5 * var(--shake-y));
  }
  82% {
    translate: calc(-0.25 * var(--shake-x)) 0;
  }
}
@media (max-width: 520px) {
  .arena-scene.critical-impact {
    --shake-x: 3px;
    --shake-y: 1.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Phone-first terminal: the same compact column is used on desktop. */
.topbar { max-width: 480px; height: 64px; padding: 9px 12px; }
.brand { gap: 8px; }
.brand > span { font-size: 21px; letter-spacing: 2px; }
.brand small { font-size: 7px; letter-spacing: 1px; margin-top: 3px; }
.brand img { width: 29px; height: 32px; }
.topbar-right { gap: 8px; }
.local-status { display: none; }
.app-shell { width: calc(100% - 16px); max-width: 480px; padding: 6px; margin: 0 auto; }
main { min-height: 0; padding: 10px; }
.page-top { gap: 8px; padding: 4px 8px; margin-bottom: 10px; min-height: 54px; }
.page-top h1 { flex: 1; margin: 0; font-size: 19px; letter-spacing: 0; }
.page-extra { display: flex; align-items: center; flex-shrink: 0; }
.page-extra .badge { padding: 5px; font-size: 9px; }
.back-button { min-width: 65px; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: #ffe0b5; font-size: 14px; text-align: left; }
.button { min-height: 52px; font-size: 14px; }
.page-return { margin-top: 12px; }
.page-return .button { width: 100%; }
.console-caption { max-width: 480px; margin: 12px auto; padding: 0 12px; font-size: 7px; line-height: 1.5; }
.console-menu-frame { width: 100%; margin: 0; }
.console-menu-title { padding: 14px; margin: 0; font-size: 20px; letter-spacing: 1px; }
.console-menu { padding: 4px; }
.console-menu-row { min-height: clamp(58px, calc((100svh - 210px) / 9), 80px); padding: 12px 13px; gap: 12px; font-size: 18px; }
.console-menu-row small { display: inline; margin-left: 8px; font-size: 11px; }
.menu-number { min-width: 24px; font-size: 14px; }
.menu-chevron { font-size: 22px; }
.compact-fighter { padding: 12px; }
.fighter-overview { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 14px; align-items: center; }
.fighter-summary { text-align: center; min-width: 0; }
.compact-avatar { position: relative; height: 156px; width: 100%; }
.compact-avatar > .sprite-canvas { position: absolute; width: 140px; height: 156px; max-width: none; left: 50%; transform: translateX(-50%); bottom: 0; }
.fighter-summary > b { display: block; font-size: 15px; color: #ffd5ad; }
.fighter-summary > small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.free-points { font-size: 12px; color: var(--muted); margin: 0 0 3px; }
.compact-stats { min-width: 0; }
.compact-stats .stat-row { grid-template-columns: minmax(0, 1fr) 22px 36px; gap: 6px; padding: 2px 0; min-height: 39px; }
.stat-label { display: block; padding: 0; min-height: 34px; border: 0; color: var(--ink); background: transparent; font-size: 12px; text-align: left; }
.stat-label:active { color: var(--gold); }
.compact-stats .stat-value { font-size: 22px; text-align: center; }
.compact-stats .stat-plus { width: 36px; height: 42px; min-height: 42px; font-size: 18px; }
.fighter-vitals { margin-top: 12px; }
.fighter-vitals .health-row { font-size: 13px; margin-top: 6px; }
.fighter-vitals .healthbar { height: 10px; }
.fighter-vitals .xpbar { height: 7px; }
.fighter-wallet { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.equipment-entry { display: flex; width: 100%; justify-content: center; gap: 12px; margin-top: 10px; }
.equipment-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; margin-bottom: 10px; }
.equipment-slots h2 { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.equipped-slot { padding: 7px 0 0; min-width: 0; }
.equipped-slot > span { font-size: 9px; }
.equipped-slot h3 { font-size: 12px; line-height: 1.4; margin: 5px 0; min-height: 29px; overflow-wrap: anywhere; }
.equipped-slot .text-link { min-height: 40px; font-size: 13px; }
.item-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.item-card { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; padding: 14px; }
.item-copy { min-width: 0; }
.item-card h3 { font-size: 14px; line-height: 1.5; margin: 0 0 4px; }
.item-bonuses { font-size: 12px; line-height: 1.6; margin: 4px 0; }
.item-action { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; margin: 0; border: 0; padding: 0; text-align: center; }
.item-action .button { min-height: 44px; padding: 8px 5px; font-size: 13px; }
.item-action .subtle { font-size: 10px; }
.item-info { font-size: 12px; color: var(--muted); }
.item-info summary { min-height: 36px; padding: 8px 0; cursor: pointer; }
.item-info p { margin: 3px 0; line-height: 1.6; }
.arena-lobby { padding: 18px; min-height: clamp(320px, 57svh, 520px); display: flex; flex-direction: column; }
.lobby-note { margin: 0 0 18px; font-size: 15px; color: var(--muted); line-height: 1.6; }
.arena-mode-buttons { margin: 0; max-width: none; gap: 16px; flex: 1; grid-template-rows: repeat(3, minmax(64px, 1fr)); }
.arena-mode-buttons .button { min-height: 64px; padding: 16px; font-size: 17px; }
.compact-help { margin: 12px 0; font-size: 13px; color: var(--muted); }
.compact-help summary { min-height: 44px; padding: 10px; cursor: pointer; }
.compact-help p { line-height: 1.65; margin: 0; padding: 0 10px 10px; }
.arena-scene { min-height: 0; }
.arena-turn-strip { min-height: 36px; padding: 6px; gap: 12px; }
.phase-badge { padding: 5px 8px; font-size: 9px; }
.arena-scene .combatants { padding: 8px 10px 12px; gap: 8px; }
.combatant h2 { font-size: 12px; margin: 4px 0; }
.combatant .health-row { font-size: 9px; }
.combatant .fighter-stage { width: 100%; max-width: 180px; }
.battle-turn-controls { margin-top: 10px; padding: 10px; gap: 8px; }
.battle-turn-controls .phase-title { font-size: 14px; margin: 0 0 4px; }
.turn-instructions > p { font-size: 10px; margin: 4px 0; line-height: 1.5; }
.phase-log { max-height: 110px; margin-top: 10px; padding: 9px; }
.battle-log h2 { font-size: 12px; margin: 0 0 6px; }
.battle-log p, .battle-log li { font-size: 10px; line-height: 1.5; }
.battle-result { padding: 12px; margin-top: 10px; gap: 8px; }
.battle-result h2 { font-size: 17px; }
.battle-result p { font-size: 11px; line-height: 1.6; }
.records-panel { padding: 22px 16px; min-height: min(62svh, 560px); display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.records-panel > h2 { font-size: 22px; margin: 0 0 16px; }
.records-panel > .subtle { margin: 12px 0 0; font-size: 14px; line-height: 1.7; }
.records { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.record { padding: 24px 4px; }
.record b { font-size: 36px; }
.record span { font-size: 12px; }
.settings-panel { padding: 18px; margin-bottom: 14px; }
.settings-panel h2 { margin: 0 0 18px; font-size: 18px; }
.settings-panel .text-input { width: 100%; font-size: 16px; margin: 8px 0; }
.settings-panel .subtle { font-size: 14px; line-height: 1.6; }
.settings-panel .equipment-entry { margin-top: 8px; }
.guide-section { margin-bottom: 8px; }
.guide-section > summary { min-height: 64px; padding: 18px 14px; cursor: pointer; color: #ffd5ad; font-size: 16px; }
.guide-section > div { padding: 0 12px 12px; }
.guide-section p, .guide-section li { font-size: 14px; line-height: 1.7; color: var(--muted); }
.guide-section ul { padding-left: 18px; margin: 0; }
.auth-panel { padding: 12px; }
.auth-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.auth-fields .text-input { font-size: 16px; }
.registration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.registration-fighter { padding: 10px; }
.registration-portrait { height: 130px; }
.registration-fighter > b { font-size: 16px; }
.registration-description { font-size: 10px; line-height: 1.5; }
.registration-fighters { margin-top: 20px; }
.registration-fighters legend { font-size: 15px; }
.auth-tabs { gap: 8px; margin-bottom: 16px; }
.auth-tabs .button { padding: 10px 6px; font-size: 12px; }
@media (max-width: 360px) {
  main { padding: 8px; }
  .fighter-overview { grid-template-columns: 86px minmax(0, 1fr); gap: 9px; }
  .compact-avatar > .sprite-canvas { width: 126px; }
  .compact-fighter { padding: 9px; }
  .compact-stats .stat-row { gap: 4px; grid-template-columns: minmax(0, 1fr) 20px 32px; }
  .stat-label { font-size: 11px; }
  .page-top h1 { font-size: 17px; }
}
.phase-log h2 { position: sticky; top: -9px; z-index: 1; padding: 7px 0; margin: -7px 0 4px; background: #1b202b; border-bottom: 1px solid #465266; }
.phase-log .log-entry { padding: 5px 0; }
/* More room for the fighter, with the existing planetary landscape behind it. */
.fighter-overview { grid-template-columns: minmax(110px, 0.95fr) minmax(0, 1.1fr); gap: 14px; }
.compact-avatar { height: clamp(236px, 31svh, 292px); border: 1px solid #536a83; background: #172d4c; overflow: hidden; }
.compact-avatar > .fighter-backdrop { position:absolute; inset:0; width:100%; height:100%; border-radius:inherit; pointer-events:none; }
.compact-avatar > .sprite-canvas { width: 110%; height: 100%; }
.compact-stats .stat-row { min-height: clamp(52px, 6.8svh, 62px); }
.fighter-summary > b { margin-top: 10px; font-size: 17px; }
.fighter-summary > small { margin-top: 6px; font-size: 12px; }
.fighter-vitals { margin-top: 18px; }
.fighter-wallet { margin-top: 12px; }
.recovery-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.medbay-entry small { color: var(--muted); font-size: 12px; font-weight: normal; }
@media (max-width: 360px) {
  .fighter-overview { grid-template-columns: 86px minmax(0, 1fr); gap: 9px; }
  .compact-avatar > .sprite-canvas { width: 110%; height: 100%; }
  .compact-avatar { height: 236px; }
  .compact-stats .stat-row { min-height: 52px; }
}

/* Short lists grow into the phone height instead of remaining tiny at the top. */
.compact-guide { min-height: min(66svh, 570px); display: flex; flex-direction: column; gap: 12px; }
.guide-section { flex: 1; margin: 0; }
.guide-section[open] { flex: 0 0 auto; }
.guide-section > summary { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.guide-section > summary::after { content: "+"; font-size: 22px; color: var(--gold); margin-left: 10px; }
.guide-section[open] > summary::after { content: "−"; }
.app-shell[data-screen="settings"] main { min-height: calc(100svh - 125px); display: flex; flex-direction: column; }
.app-shell[data-screen="settings"] .page-top { flex-shrink: 0; }
.app-shell[data-screen="settings"] .settings-panel:first-of-type { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.app-shell[data-screen="settings"] .settings-panel:last-of-type { margin-bottom: 0; }
.settings-panel .text-input { min-height: 50px; }
@media (min-width: 420px) { .stat-label { font-size: 13px; } }
/* Keep enlarged accordion titles vertically centered in their tap area. */
.guide-section > summary { height: auto; min-height: clamp(64px, calc((66svh - 36px) / 4), 132px); }
.guide-section[open] > summary { min-height: 64px; }
.settings-panel .field-label { font-size: 14px; }
.settings-panel .text-input { font-size: 18px; }
.records-panel > h2 { overflow-wrap: anywhere; }
/* Fit the visible phone viewport. Long lists scroll inside their own panels. */
html, body { height: 100%; min-height: 0; overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
.topbar { flex: 0 0 44px; height: 44px; width: 100%; padding: 5px 12px; }
.brand > span { font-size: 20px; }
.brand small { font-size: 6px; }
.brand img { width: 27px; height: 30px; }
.console-caption { display: none; }
.app-shell { flex: 1; min-height: 0; height: auto; display: flex; margin: 0 auto 6px; padding: 5px; width: calc(100% - 12px); overflow: hidden; }
.app-shell main, .app-shell[data-screen="settings"] main { flex: 1; height: 100%; min-height: 0; padding: 8px; display: flex; flex-direction: column; overflow: hidden; gap: 0; }
.page-top { flex: 0 0 44px; min-height: 44px; padding: 3px 7px; margin: 0 0 8px; }
.page-top h1 { font-size: 16px; line-height: 1.2; }
.back-button { min-width: 58px; min-height: 36px; font-size: 12px; }
.page-extra .currency { font-size: 12px; }
.button { min-height: 40px; font-size: 13px; padding: 9px 10px; }
.console-menu-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.console-menu-title { flex: 0 0 auto; padding: 10px; font-size: 18px; }
.console-menu-heading { flex:0 0 auto; position:relative; }
.console-menu-heading .console-menu-title { padding-left:60px; padding-right:60px; }
.admin-entry { position:absolute; right:8px; top:50%; transform:translateY(-50%); min-height:32px; padding:7px; font-size:10px; color:#ffdf9b; }
.admin-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin-bottom:8px; }
.admin-summary > div { display:flex; flex-direction:column; align-items:center; gap:5px; padding:8px 3px; }
.admin-summary b { font-size:18px; color:#ffe0a6; }
.admin-summary span { font-size:9px; color:#9fc0d8; }
.admin-menu { flex:1; min-height:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:minmax(50px,1fr); overflow:auto; gap:7px; }
.admin-menu .button { min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; }
.admin-menu small { font-size:9px; line-height:1.4; color:#a7bdcc; font-weight:normal; }
.admin-note { flex:0 0 auto; margin:6px 0; color:#9db7c9; font-size:10px; line-height:1.4; }
.admin-error { flex:0 0 auto; color:#ffd0b5; font-size:11px; margin:5px 0 9px; }
.admin-refresh { flex:0 0 auto; margin-top:7px; }
.admin-search { flex:0 0 auto; display:flex; gap:5px; margin-bottom:6px; }
.admin-search .text-input { min-width:0; flex:1; }
.admin-scroll { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:7px; }
.admin-player { flex:0 0 auto; display:flex; align-items:center; gap:8px; padding:9px; }
.admin-player .fighter-mini { flex:0 0 40px; width:40px; height:40px; }
.admin-player > div { min-width:0; display:flex; flex-direction:column; gap:4px; }
.admin-player b { font-size:12px; overflow-wrap:anywhere; }
.admin-player small { font-size:10px; color:#a9c2d5; overflow-wrap:anywhere; }
.admin-battle { flex:0 0 auto; padding:10px; display:flex; flex-direction:column; gap:6px; overflow-wrap:anywhere; }
.admin-battle b { font-size:12px; }.admin-battle span { font-size:11px; }.admin-battle small { font-size:9px; color:#a2b8c9; }
.admin-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.admin-edit { flex:0 0 auto; min-width:0; padding:10px; display:flex; flex-direction:column; gap:9px; }
form.admin-scroll { flex:1; }
.admin-edit h2,.admin-subheading { margin:4px 0; font-size:14px; }
.admin-edit .field-label,#admin-command-form .field-label { display:flex; flex-direction:column; gap:5px; font-size:11px; margin:4px 0; }
.admin-edit .text-input,.admin-search select,#admin-command-form .text-input { width:100%; min-width:0; font-size:13px; }
.admin-edit textarea { height:160px; min-height:100px; resize:vertical; }
.admin-edit .button,.admin-battle .button { font-size:12px; }
button.admin-player { width:100%; color:inherit; text-align:left; cursor:pointer; }
.admin-edit [hidden] { display:none; }
.guide-page p { white-space:pre-wrap; }
.admin-search select { flex:0 1 110px; min-width:68px; }
.admin-search .button { flex:0 0 auto; padding:7px; font-size:11px; }
.admin-search { align-items:center; }
.admin-search .text-input { height:40px; min-height:40px; margin:0; font-size:12px; }
.admin-online { color:#97efb8; }
.admin-player b>span { display:block; font-size:9px; font-weight:normal; margin-top:3px; }
.admin-player .item-icon { flex:0 0 48px; width:48px; height:48px; }
.admin-icon-preview { display:flex; gap:12px; align-items:center; }
.admin-icon-preview>.item-icon { width:80px; height:80px; flex:0 0 80px; }
.admin-icon-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin-top:8px; }
.admin-icon-grid .button { padding:2px; }
.admin-icon-grid .item-icon { display:block; width:100%; height:44px; }
.console-menu { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(9, minmax(0, 1fr)); padding: 3px; }
.console-menu-row { min-height: 0; padding: 5px 10px; font-size: 16px; }
.console-menu-row small { font-size: 10px; }
.menu-number { font-size: 12px; }
.compact-fighter { flex: 1; min-height: 0; max-height: 400px; padding: 10px; display: flex; flex-direction: column; }
.fighter-overview { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 10px; align-items: center; }
.fighter-summary { min-height: 0; width: 100%; }
.compact-avatar { width: 100%; height: auto; aspect-ratio: 1; min-height: 0; overflow: visible; background-position: 61% 65%; }
.compact-avatar > .sprite-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; transform: none; }
.fighter-summary > b { font-size: 15px; margin-top: 6px; }
.fighter-summary > small { font-size: 10px; margin-top: 3px; }
.compact-stats { height: 100%; min-height: 0; max-height: 230px; display: flex; flex-direction: column; }
.free-points { flex: 0 0 auto; font-size: 10px; margin-bottom: 4px; }
.compact-stats .stat-row { flex: 1; min-height: 30px; grid-template-columns: minmax(0, 1fr) 20px 30px; gap: 4px; padding: 1px 0; }
.stat-label { min-height: 28px; font-size: 11px; }
.compact-stats .stat-value { font-size: 19px; }
.compact-stats .stat-plus { width: 30px; height: 30px; min-height: 30px; font-size: 17px; }
.fighter-vitals { flex: 0 0 auto; margin-top: 8px; }
.fighter-vitals .health-row { font-size: 11px; margin: 3px 0; }
.fighter-vitals .healthbar { height: 7px; }
.fighter-vitals .xpbar { height: 4px; }
.fighter-wallet { margin-top: 6px; }
.recovery-note { font-size: 10px; line-height: 1.4; margin-top: 6px; }
.equipment-entry { flex: 0 0 40px; min-height: 40px; margin-top: 8px; }
.medbay-entry small { font-size: 10px; }
.slot-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot-tile { min-width: 0; min-height: 0; padding: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #182436; color: var(--ink); }
.slot-tile b { font-size: 13px; }
.slot-tile small { font-size: 10px; line-height: 1.3; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.item-icon { display: block; width: 64px; height: 64px; object-fit: contain; }
.slot-tile .item-icon { width: clamp(40px, 10dvh, 78px); height: clamp(40px, 10dvh, 78px); }
.impulse-symbol { font-size: 44px; height: 64px; color: #a0e0ff; }
.catalog-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-right: 3px; scrollbar-color: #805267 #1b2030; }
.catalog-scroll .item-card { margin-bottom: 8px; }
.inventory-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; justify-content: flex-start; overflow: hidden; }
.item-card { flex: 0 0 auto; display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px; gap: 8px; padding: 8px; min-height: 86px; align-items: center; }
.item-picture { width: 58px; height: 64px; border: 0; padding: 0; background: transparent; }
.item-picture .item-icon { width: 58px; height: 64px; }
.item-name { display: block; border: 0; padding: 0; background: transparent; color: #ffd5ad; font-size: 12px; font-weight: bold; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
.item-bonuses { font-size: 10px; line-height: 1.4; margin: 5px 0; }
.item-level { color: var(--muted); font-size: 10px; }
.item-action .button { font-size: 11px; min-height: 36px; padding: 7px 3px; }
.item-action .currency { font-size: 12px; }
.shop-sell-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sale-note { flex: 0 0 auto; margin: 0 0 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.item-action .item-lock { width: 100%; margin-top: 4px; font-size: 10px; }
.item-lock { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.item-lock svg { flex: 0 0 15px; width: 15px; height: 18px; }
.item-lock.is-locked { color: #a6e8ed; border-color: #59949c; background: #1a3645; }
.sale-card .item-action { display: flex; flex-direction: column; gap: 5px; }
.sale-card .item-action .item-lock { margin-top: 0; }
.sale-card .item-action .button { width: 100%; min-height: 40px; }
.equipped-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px; margin-bottom: 8px; font-size: 11px; line-height: 1.4; }
.equipped-summary .button { min-height: 34px; font-size: 11px; }
.inventory-pager { flex: 0 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; }
.inventory-pager .button { min-width: 50px; min-height: 38px; }
.empty-inventory { font-size: 13px; line-height: 1.6; margin: 14px; color: var(--muted); }
.item-detail-art { display: flex; justify-content: center; margin: 8px 0; }
.item-detail-art .item-icon { width: 96px; height: 96px; }
.arena-lobby { flex: 1; min-height: 0; max-height: 330px; padding: 12px; }
.lobby-note { font-size: 12px; margin-bottom: 12px; }
.arena-mode-buttons { gap: 10px; grid-template-rows: repeat(3, minmax(42px, 1fr)); }
.arena-mode-buttons .button { min-height: 42px; padding: 12px; font-size: 15px; }
.battle-rules { flex: 0 0 38px; min-height: 38px; margin-top: 6px; font-size: 12px; }
.arena-scene { flex: 0 1 auto; min-height: 0; }
.arena-scene .combatants { padding: 5px 8px 9px; }
.combatant .fighter-stage { width: min(100%, 24dvh); max-width: 170px; }
.battle-turn-controls { flex: 0 0 auto; margin-top: 7px; padding: 8px; }
.battle-turn-controls .battle-submit { margin-top: 8px; }
.phase-log { flex: 1; min-height: 44px; max-height: 100px; margin-top: 7px; }
.battle-result { flex: 0 0 auto; padding: 9px; margin-top: 7px; }
.battle-result h2 { margin: 0 0 4px; }
.battle-result p { margin: 3px 0; font-size: 10px; }
.records-panel { flex: 1; min-height: 0; max-height: 350px; gap: 14px; padding: 16px; }
.records-panel > h2 { font-size: 20px; margin: 0; }
.record { padding: 16px 3px; }
.record b { font-size: 30px; }
.records-panel > .subtle { font-size: 12px; }
.settings-panel { flex: 0 1 auto; min-height: 0; padding: 12px; margin-bottom: 8px; }
.app-shell[data-screen="settings"] .settings-panel:first-of-type { flex: 1; max-height: 330px; min-height: 0; gap: 4px; }
.app-shell[data-screen="settings"] .settings-panel:last-of-type { flex: 0 0 auto; margin-top: 8px; }
.settings-panel h2 { font-size: 16px; margin-bottom: 12px; }
.settings-panel .text-input { min-height: 42px; margin: 5px 0; font-size: 16px; }
.settings-panel .subtle { font-size: 12px; margin: 7px 0; }
.guide-menu { flex: 1; min-height: 0; max-height: 380px; display: grid; grid-auto-rows: minmax(44px, 1fr); gap: 10px; }
.guide-menu .button { text-align: left; display: flex; justify-content: space-between; align-items: center; padding: 14px; font-size: 14px; }
.guide-page { flex: 1; min-height: 0; padding: 14px; }
.guide-page p { margin: 0; font-size: 14px; line-height: 1.65; }
.auth-panel { flex: 1; min-height: 0; padding: 10px; display: flex; flex-direction: column; }
.auth-tabs { flex: 0 0 auto; margin-bottom: 10px; }
.auth-tabs .button { min-height: 38px; }
#account-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.auth-fields { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.auth-fields .text-input { height: 42px; min-height: 42px; }
form[data-mode="register"] .auth-fields { gap:7px; }
form[data-mode="register"] .auth-fields .text-input { height:36px; min-height:36px; }
form[data-mode="register"] .auth-fields .field-label { font-size:11px; gap:4px; }
.auth-fields .field-label > small { display:inline; color:#9db6c7; }
.auth-info { flex:0 0 auto; font-size:9px; line-height:1.5; margin:6px 0 0; color:#b6c9d7; }
.auth-info a,.email-consent a { color:#9bd8f3; }
.email-consent { display:flex; align-items:flex-start; gap:7px; font-size:10px; line-height:1.4; margin:5px 0; color:#bed3e1; }
.email-consent[hidden] { display:none; }
.email-consent input { flex:0 0 auto; margin:2px 0; }
#account-email-form .field-label { margin-top:9px; }
.auth-note { flex: 0 0 auto; font-size: 10px; line-height: 1.4; margin: 8px 0 0; }
.auth-wizard-controls { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; }
.auth-wizard-controls .auth-submit { margin: 0; }
.auth-wizard-controls [data-action="auth-next"], form[data-mode="login"] .auth-submit { grid-column: 1 / -1; }
.registration-fighters { flex: 1; min-height: 0; padding: 0; margin: 0; display: flex; flex-direction: column; }
.registration-fighters legend { font-size: 14px; margin-bottom: 6px; }
.registration-grid { flex: 1; min-height: 0; display: block; }
.registration-fighter { height: 100%; min-height: 0; padding: 8px; gap: 4px; }
.registration-fighter > input { opacity: 0; width: 1px; height: 1px; }
.registration-portrait { flex: 1; min-height: 60px; max-height: 190px; width: 100%; height: auto; margin: 0; }
.registration-fighter > b { font-size: 16px; }
.registration-role { margin: 0; font-size: 11px; }
.registration-starts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.registration-starts > span { padding: 4px; font-size: 9px; }
.registration-description { margin: 0; font-size: 11px; line-height: 1.3; }
.fighter-carousel { flex: 0 0 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12px; }
.fighter-carousel .button { min-height: 36px; min-width: 50px; padding: 5px; }
.auth-error { flex: 0 0 auto; font-size: 11px; line-height: 1.4; padding: 7px; margin: 6px 0 0; }
dialog { max-height: calc(100dvh - 24px); overflow: hidden; }
dialog h2 { font-size: 17px; overflow-wrap: anywhere; }
dialog p { font-size: 12px; line-height: 1.5; }
@media (max-width: 350px) {
  .app-shell main { padding: 6px; }
  .fighter-overview { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr); gap: 7px; }
  .compact-stats .stat-row { grid-template-columns: minmax(0, 1fr) 18px 28px; gap: 3px; }
  .stat-label { font-size: 10px; }
  .compact-stats .stat-plus { width: 28px; height: 28px; min-height: 28px; }
  .item-card { grid-template-columns: 48px minmax(0, 1fr) 68px; gap: 6px; padding: 7px; }
  .item-picture, .item-picture .item-icon { width: 48px; height: 54px; }
}
@media (max-height: 650px) {
  .topbar { flex-basis: 36px; height: 36px; }
  .brand > span { font-size: 17px; }
  .brand img { height: 26px; width: 24px; }
  .brand small { display: none; }
  .compact-fighter { padding: 8px; }
  .fighter-summary > small { font-size: 9px; }
  .recovery-note { font-size: 9px; }
  .registration-portrait { max-height: 120px; }
  .inventory-list .item-card { min-height: 80px; }
  .fighter-vitals { margin-top: 5px; }
}
.phase-log { overflow: hidden; max-height: 96px; min-height: 60px; }
.phase-log h2 { position: static; margin: 0 0 3px; padding: 0; }
.phase-log h2 .text-link { min-height: 20px; padding: 0; font-size: 11px; }
.phase-log .log-entry { padding: 3px 0; border: 0; }

/* Duel lobby: fixed phone viewport; capsule drawings keep their proportions. */
.room-form { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.room-arena-preview { flex: 1; min-height: 58px; max-height: 150px; position: relative; overflow: hidden; border: 1px solid #54788b; border-radius: 8px; }
.room-arena-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: .65; }
.room-arena-preview span { position: absolute; left: 10px; top: 8px; font-size: 11px; text-shadow: 0 1px 4px #000; }
.room-arena-preview b { display: block; font-size: 17px; margin-top: 2px; }
.room-arena-preview > small { position: absolute; right: 8px; bottom: 6px; font-size: 9px; color: #d6e9f5; }
.room-field { flex: 0 0 auto; margin: 0; padding: 0; border: 0; min-width: 0; }
.room-field legend { font-size: 12px; margin-bottom: 4px; }
.room-types { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.room-choice { border: 1px solid #42647b; border-radius: 6px; padding: 8px 4px; text-align: center; font-size: 14px; }
.room-choice.selected { color: #c9f5ff; background: #245067; border-color: #75dbff; }
.room-choice.unavailable { color: #778592; background: #18232f; font-size: 12px; }
.room-choice small { display: block; font-size: 8px; margin-top: 2px; }
.room-match { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.room-match label { cursor: pointer; display: block; position: relative; }
.room-match input { position: absolute; opacity: 0; }
.room-match span { display: block; padding: 9px 4px; border: 1px solid #496173; border-radius: 6px; font-size: 12px; text-align: center; }
.room-match input:checked + span { background: #294e60; border-color: #84d7f1; color: #e4faff; }
.room-match input:focus-visible + span { outline: 2px solid white; }
.room-match input:disabled + span { opacity: .4; cursor: default; }
.room-fixed { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; padding: 6px 0; border-bottom: 1px solid #344859; }
.room-fixed small { color: var(--muted); font-size: 9px; font-weight: normal; }
.room-password-label { font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.room-password-label small { color: var(--muted); font-size: 9px; }
.room-form .text-input { width: 100%; min-height: 38px; height: 38px; font-size: 16px; margin: 0; }
.room-rating-note { font-size: 10px; color: #aad9ee; margin: 0; line-height: 1.4; }
.room-form-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-local-note { flex: 0 0 auto; color: #aabfce; font-size: 10px; line-height: 1.4; margin: 6px 0; }
.room-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.room-list-entry { width: 100%; padding: 12px; min-height: 80px; text-align: left; display: flex; flex-direction: column; gap: 5px; color: #e4effa; }
.room-list-entry b { font-size: 13px; overflow-wrap: anywhere; }
.room-list-entry small { color: #a5c8de; font-size: 10px; }
.room-list-entry > span { color: #8dd1e1; font-size: 10px; }
.duel-room { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px; background: linear-gradient(#081b2bd9,#102333eb), url("/art/optimized/b9ef73f8e8c8dc7a0c985bf6.webp?v=b9ef73f8e8c8dc7a") center/cover; }
.room-summary { flex: 0 0 auto; text-align: center; display: flex; flex-direction: column; gap: 5px; }
.room-summary b { font-size: 15px; overflow-wrap: anywhere; }
.room-summary small { font-size: 10px; color: #afcfe3; }
.room-capsules { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; }
.capsule-seat { min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.capsule-label { font-size: 10px; color: #a9d4ef; margin: 0 0 7px; }
.teleport-capsule { position: relative; display: block; border: 0; background: transparent; padding: 0; width: 100%; max-width: min(220px, 25dvh); aspect-ratio: 2/3; isolation: isolate; cursor: pointer; overflow:hidden; }
.teleport-capsule:disabled { opacity: 1; cursor: default; }
.teleport-capsule:not(:disabled):hover, .teleport-capsule:focus-visible { filter: drop-shadow(0 0 8px #64d9ff80); outline: 1px solid #a3eaff; border-radius: 18px; }
.capsule-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.capsule-front-rim { position:absolute; inset:0; width:100%; height:100%; z-index:4; pointer-events:none; clip-path:inset(85% 0 0 0); }
.capsule-shadow { position:absolute; left:25%; width:50%; height:4%; bottom:14.5%; border-radius:50%; background:radial-gradient(ellipse,#020b15b0,#04162970 50%,transparent 72%); z-index:1; }
.capsule-fighter { position: absolute; left: 14%; width: 72%; aspect-ratio: 1; bottom: 13.5%; z-index: 2; }
.capsule-fighter canvas { width: 100%; height: 100%; }
.capsule-empty { position: absolute; left: 20%; right: 20%; top: 46%; color: #b9edff; font-size: 22px; line-height: 1.1; z-index: 1; }
.capsule-empty small { display: block; font-size: 9px; margin-top: 6px; }
.teleport-capsule:disabled .capsule-empty { font-size: 11px; }
.capsule-name { font-size: 12px; margin-top: 7px; max-width: 100%; overflow-wrap: anywhere; }
.capsule-level { color: #a7bed0; font-size: 9px; margin-top: 4px; }
.room-status { flex: 0 0 auto; text-align: center; color: #a4e6fa; font-size: 12px; padding: 8px; border-top: 1px solid #426b83; }
.duel-room > .room-local-note { text-align: center; }
.room-leave { flex: 0 0 auto; margin-top: 8px; }
.teleport-opening { position: absolute; left: 19%; top: 15%; width: 62%; height: 70%; border-radius: 22% 22% 15% 15% / 7%; overflow: hidden; z-index: 3; pointer-events: none; }
.teleport-energy { position:absolute; inset:0; opacity:0; overflow:hidden; background:linear-gradient(90deg,#68cfff,#b8f1ff 35%,#dcf8ff 65%,#8fdfff); box-shadow:inset 0 0 14px #f1fdff; }
.teleport-streak { position:absolute; left:var(--stream-x); top:-35%; width:5%; height:var(--stream-height); border-radius:100px; background:#f4fdff; opacity:.6; }
.teleport-streak:nth-child(3n) { width:7%; background:#50bdf0; opacity:.45; }
.teleport-streak:nth-child(3n + 1) { background:#b0e4ff; opacity:.8; }
.teleporting .teleport-energy { animation:teleport-energy 1800ms ease-in-out both; animation-delay:var(--teleport-delay); }
.teleporting .teleport-streak { animation:teleport-stream var(--stream-duration) linear 5 both; animation-delay:calc(var(--teleport-delay) - var(--stream-offset)); }
.teleporting .capsule-fighter { animation: teleport-fighter 1800ms linear both; animation-delay: var(--teleport-delay); }
@keyframes teleport-energy { 0% { opacity:0; } 12%,52% { opacity:1; } 88%,100% { opacity:0; } }
@keyframes teleport-stream { from { transform:translateY(0); } to { transform:translateY(1300%); } }
@keyframes teleport-fighter { 0%,28% { opacity:0; } 42%,100% { opacity:1; } }
@media (max-height:650px) {
  .room-form { gap:6px; padding:9px; }
  .room-arena-preview { max-height:76px; }
  .room-fixed { padding:5px 0; font-size:11px; }
  .room-summary { gap:4px; }
  .room-capsules { gap:8px; }
  .teleport-capsule { max-width: min(160px, 25dvh); }
}

/* Shared enclaves: compact pages with button pagination. */
.enclave-home { flex:1; min-height:0; display:flex; flex-direction:column; padding:0; overflow:hidden; }
.enclave-cover { flex:1; min-height:60px; max-height:150px; position:relative; overflow:hidden; }
.enclave-cover > img { position:absolute; width:100%; height:100%; object-fit:cover; }
.enclave-heading { flex:0 0 auto; display:flex; gap:10px; align-items:center; padding:10px; }
.enclave-heading > img { width:62px; height:62px; object-fit:contain; }
.enclave-heading > div { min-width:0; }
.enclave-heading h2 { margin:0 0 5px; font-size:17px; overflow-wrap:anywhere; }
.enclave-heading p { font-size:11px; color:#a6cce2; margin:0 0 5px; }
.enclave-heading small { font-size:10px; color:#f4d593; }
.enclave-description { margin:0; padding:0 12px 8px; font-size:11px; line-height:1.4; color:#abc5d9; overflow-wrap:anywhere; max-height:70px; overflow:hidden; }
.enclave-level { flex:0 0 auto; padding:0 12px 10px; display:flex; flex-direction:column; gap:6px; font-size:11px; }
.enclave-level progress { width:100%; height:7px; accent-color:#67c4f1; }
.enclave-home-menu { flex:0 0 auto; display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:0 10px 10px; }
.enclave-home-menu .button { min-height:45px; font-size:12px; padding:9px 4px; }
.enclave-error { flex:0 0 auto; color:#ffccaa; background:#472b29; padding:8px; font-size:11px; line-height:1.4; margin:0 0 7px; }
.enclave-form { flex:1; min-height:0; padding:12px; display:flex; flex-direction:column; gap:12px; }
.enclave-form h2 { font-size:18px; margin:0; }
.enclave-form p { font-size:12px; line-height:1.6; color:#b5cbdc; }
.enclave-form label { display:flex; flex-direction:column; font-size:12px; gap:7px; }
.enclave-form .text-input { width:100%; min-height:42px; font-size:16px; }
.enclave-directory-intro { flex:0 0 auto; margin-bottom:10px; }
.enclave-directory-intro p { font-size:12px; line-height:1.5; color:#adc4d8; margin:0 0 8px; }
.enclave-directory-intro .button { width:100%; }
.enclave-list { flex:1; min-height:0; display:flex; flex-direction:column; gap:8px; overflow:hidden; }
.enclave-directory-card { padding:9px; display:flex; align-items:center; gap:8px; min-height:82px; }
.enclave-directory-card > img { flex:0 0 44px; width:44px; height:44px; object-fit:contain; }
.enclave-directory-card > div { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.enclave-directory-card b { font-size:12px; overflow-wrap:anywhere; }
.enclave-directory-card small { font-size:10px; color:#a2bcd1; }
.enclave-directory-card .button { min-width:58px; font-size:10px; padding:7px 4px; }
.enclave-member { padding:12px 9px; display:flex; align-items:center; gap:8px; text-align:left; color:#d1e8fa; min-height:64px; }
.enclave-role { flex:0 0 20px; width:20px; font-size:19px; color:#b0d3ec; }
.enclave-role.head { color:#f6cd6b; }.enclave-role.officer { color:#83d4ff; }
.enclave-member > span:nth-child(2) { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.enclave-member b { font-size:12px; overflow-wrap:anywhere; }
.enclave-member small { font-size:9px; color:#9cb6ca; }
.enclave-member .presence-online { color:#70d3b1; }
.enclave-message { padding:10px; color:#d1e8fa; text-align:left; width:100%; }
.enclave-message b { color:#83c9ed; font-size:11px; }
.enclave-message p { font-size:12px; line-height:1.5; margin:7px 0 0; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; overflow:hidden; }
.enclave-chat-form { flex:0 0 auto; display:flex; gap:7px; margin-top:8px; }
.enclave-chat-form .text-input { flex:1; min-width:0; min-height:42px; font-size:16px; }
.enclave-chat-form button { min-width:44px; }
.enclave-treasury { flex:1; min-height:0; padding:12px; display:flex; flex-direction:column; gap:10px; }
.enclave-treasury h2 { margin:0; font-size:18px; }
.enclave-balance { color:#f2d18a; font-size:25px; }
.enclave-treasury p { font-size:12px; line-height:1.5; margin:0; color:#adc6d9; }
#enclave-donate-form label { display:flex; flex-direction:column; gap:6px; font-size:12px; }
#enclave-donate-form .text-input { width:100%; min-height:40px; margin-bottom:8px; font-size:16px; }
#enclave-donate-form .button { width:100%; }
.enclave-upgrade { margin-top:auto; padding-top:10px; border-top:1px solid #45657d; }
.enclave-upgrade h3 { margin:0 0 6px; font-size:15px; }
.enclave-upgrade .button { width:100%; margin:8px 0; }
.enclave-upgrade small { font-size:9px; color:#99b3c9; display:block; }
.enclave-task-panels { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; }
.enclave-task { flex:1; min-height:0; padding:12px; display:flex; flex-direction:column; gap:9px; }
.enclave-task h2 { font-size:16px; margin:0; }
.enclave-task p { font-size:12px; line-height:1.5; margin:0; }
.enclave-task small { font-size:10px; line-height:1.4; color:#9dbbd1; }
.enclave-task .button { margin-top:auto; width:100%; }
.enclave-cover-grid { flex:1; min-height:0; display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:8px; }
.enclave-cover-option { min-height:0; padding:6px; display:flex; flex-direction:column; gap:5px; }
.enclave-cover-option img { flex:1; min-height:0; width:100%; object-fit:cover; }
.enclave-cover-option small { flex:0 0 auto; font-size:10px; color:#c3dcec; }
.enclave-emblem-grid { flex:1; min-height:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:1fr 1fr; gap:6px; }
.enclave-emblem-grid button { min-height:0; padding:6px 3px; display:flex; flex-direction:column; align-items:center; gap:8px; justify-content:center; }
.enclave-emblem-grid img { width:100%; max-height:90px; min-height:0; object-fit:contain; }
.enclave-emblem-grid small { font-size:9px; color:#c3dcec; }
.enclave-management { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; }
.enclave-management .enclave-form { flex:1; max-height:260px; }
.enclave-management textarea { resize:none; min-height:90px; max-height:120px; }
.enclave-application { padding:12px; display:flex; flex-direction:column; gap:10px; }
.enclave-application b { font-size:13px; overflow-wrap:anywhere; }
.enclave-application > div { display:flex; gap:8px; }.enclave-application .button { flex:1; }
@media(max-height:650px){
 .enclave-heading { padding:8px; }.enclave-heading > img { width:49px; height:49px; }
 .enclave-home-menu .button { min-height:40px; font-size:11px; }
 .enclave-home-menu { gap:7px; }
 .enclave-task { padding:9px; gap:7px; }
 .enclave-treasury { gap:8px; padding:10px; }
 .enclave-balance { font-size:22px; }
 .enclave-treasury p { font-size:11px; }
}
@media (prefers-reduced-motion: reduce) {
  .teleporting .teleport-energy, .teleporting .teleport-streak { animation:none; opacity:0; }
  .teleporting .capsule-fighter { animation:none; opacity:1; }
}

/* Trainer social profile; content fits the phone, galleries use page buttons. */
.fighter-mini { display:block; flex:0 0 auto; width:36px; height:36px; object-fit:contain; border:1px solid #526d85; border-radius:7px; background:linear-gradient(#284257,#101d2a); }
.trainer-fighter-link > .fighter-mini { width:34px; height:34px; }
.trainer-fighter-link > span { flex:1; }
.capsule-name { display:flex; align-items:center; justify-content:center; gap:4px; }
.capsule-name .fighter-mini { width:18px; height:18px; border-radius:4px; }
.enclave-member .fighter-mini { width:30px; height:30px; }
.enclave-member .enclave-member-copy { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.enclave-message-author { display:flex; align-items:center; gap:7px; }
.enclave-message-author .fighter-mini { width:25px; height:25px; }
.ranking-period { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; font-size:11px; color:#a9c9df; }
.ranking-period .text-link { min-height:34px; padding:4px; font-size:10px; }
.ranking-metrics { flex:0 0 auto; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
.ranking-metrics .button { font-size:11px; min-height:38px; padding:7px 3px; }
.ranking-metrics [aria-pressed="true"] { border-color:#9ee3ff; background:linear-gradient(#355d79,#1c3b52); }
.ranking-filter-title { flex:0 0 auto; margin:9px 0 5px; display:flex; justify-content:space-between; align-items:center; gap:5px; font-size:11px; }
.ranking-filter-title .text-link { font-size:10px; padding:5px; }
.ranking-fighters { flex:0 0 auto; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; }
.ranking-fighters > button { min-width:0; padding:4px 1px; border:1px solid #3f5d73; border-radius:6px; background:#152638; color:#a7c0d3; display:flex; flex-direction:column; align-items:center; gap:4px; cursor:pointer; }
.ranking-fighters .fighter-mini { width:31px; height:31px; border:0; background:none; }
.ranking-fighters small { font-size:9px; }.ranking-fighters [aria-pressed="true"] { border-color:#8bd3f5; background:#294a62; color:#edfaff; }
.ranking-caption { flex:0 0 auto; font-size:9px; color:#9fb9cd; line-height:1.4; margin:8px 0; }
.ranking-error { flex:0 0 auto; font-size:10px; padding:6px; background:#462e2b; color:#ffd7bc; margin:0 0 6px; }
.ranking-list { flex:1; min-height:0; display:flex; flex-direction:column; gap:7px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; touch-action:pan-y; scrollbar-width:thin; scrollbar-color:#60829a #172633; padding-right:3px; }
.ranking-entry { flex:0 0 auto; width:100%; min-height:60px; padding:8px 7px; display:flex; align-items:center; gap:7px; text-align:left; color:#dbedfc; }
.ranking-more { flex:0 0 auto; min-height:32px; display:flex; align-items:center; justify-content:center; color:#96bcd2; font-size:11px; }
.ranking-more .button { width:100%; }
.ranking-entry .fighter-mini { width:32px; height:32px; }
.ranking-place { flex:0 0 20px; min-width:20px; font-size:16px; font-weight:bold; color:#a8bfd2; text-align:center; }
.place-1 { color:#ffda75; }.place-2 { color:#dae9f5; }.place-3 { color:#dba57e; }
.ranking-person { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.ranking-person > b { font-size:11px; overflow-wrap:anywhere; }
.ranking-person small { font-size:9px; font-weight:normal; color:#99bbd3; }
.ranking-score { flex:0 0 auto; font-size:12px; color:#b6e7ff; }
.ranking-self { border-color:#6aaecb; background:#1d3547; }
.ranking-own { flex:0 0 auto; display:flex; align-items:center; gap:8px; padding:7px 9px; margin-top:7px; background:#172c40; border:1px solid #3e607b; border-radius:6px; font-size:11px; }
.ranking-own .fighter-mini { width:24px; height:24px; }
.ranking-entry-detail { display:flex; align-items:center; gap:12px; font-size:13px; margin:12px 0; }
.ranking-entry-detail .fighter-mini { width:56px; height:56px; }
.ranking-detail-stats { display:flex; flex-direction:column; gap:10px; font-size:13px; margin:14px 0; }
.ranking-detail-stats > span { display:flex; justify-content:space-between; gap:12px; }
@media(max-width:350px){.ranking-entry { padding:6px 4px; gap:5px; }.ranking-fighters { gap:3px; }.ranking-person > b { font-size:10px; }.ranking-score { font-size:11px; }}
.trainer-profile { flex:1; min-height:0; padding:0; overflow:hidden; display:flex; flex-direction:column; background:#152332; }
.trainer-cover { flex:1 1 100px; min-height:64px; max-height:145px; position:relative; background:linear-gradient(0deg,#102030de,transparent 80%),url("/art/optimized/27ee9d1c8f5aca87225e8bb7.webp?v=27ee9d1c8f5aca87") center 44% / cover; border-bottom:1px solid #567d98; }
.trainer-cover > span { position:absolute; right:10px; top:10px; font-size:8px; letter-spacing:1px; color:#d8efff; text-shadow:0 1px 3px #000; }
.trainer-identity { flex:0 0 auto; display:grid; grid-template-columns:88px minmax(0,1fr); gap:12px; padding:0 12px; margin-top:-26px; position:relative; align-items:end; }
.trainer-avatar { border:2px solid #8ecbe9; border-radius:9px; background:#202934; width:88px; height:110px; padding:0; position:relative; overflow:hidden; cursor:pointer; box-shadow:0 4px 14px #0006; }
.trainer-avatar .trainer-art { width:100%; height:100%; }
.trainer-avatar > span { position:absolute; bottom:0; left:0; width:100%; padding:5px 1px; color:#e7f4ff; background:#0b192bd9; font-size:9px; text-align:center; }
.trainer-name { min-width:0; padding-bottom:7px; }
.trainer-name > span { font-size:8px; letter-spacing:1.7px; color:#9dbbd3; }
.trainer-name h2 { font-size:18px; line-height:1.2; overflow-wrap:anywhere; margin:4px 0 6px; color:#eef8ff; }
.trainer-name p { font-size:10px; color:#91b0c7; margin:0 0 6px; }
.trainer-presence { font-size:10px; color:#76d2b9; }
.trainer-counters { flex:0 0 auto; margin:12px 12px 0; padding:9px 0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid #39566b; border-bottom:1px solid #39566b; }
.trainer-counters > div { display:flex; flex-direction:column; gap:3px; align-items:center; border-right:1px solid #39566b; }
.trainer-counters > div:last-child { border:0; }
.trainer-counters b { font-size:21px; color:#e8f6ff; line-height:1.1; }
.trainer-counters small { font-size:10px; color:#9fb9cc; }
.trainer-section-title { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 12px 0; }
.trainer-section-title h2 { font-size:13px; margin:0; }
.trainer-section-title h2 small { color:#8eaabd; font-size:10px; margin-left:5px; font-weight:normal; }
.trainer-section-title .text-link { padding:5px; min-height:30px; font-size:11px; }
.trainer-featured-badges { flex:0 0 auto; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; padding:4px 12px 8px; }
.trainer-badge { display:flex; flex-direction:column; align-items:center; justify-content:flex-start; min-width:0; border:1px solid #40647b; border-radius:7px; background:#101b29; padding:6px 3px; color:#c8e2f4; cursor:pointer; gap:5px; }
.trainer-badge .trainer-art { display:block; width:50px; height:50px; max-width:100%; }
.trainer-badge b { font-size:9px; font-weight:normal; line-height:1.3; overflow-wrap:anywhere; }
.trainer-badge.unlocked { border-color:#8c7e4f; background:linear-gradient(#27333a,#152633); }
.trainer-badge.locked .trainer-art,.trainer-achievement-detail.locked .trainer-art { filter:grayscale(1) brightness(.65); opacity:.8; }
.trainer-badge.locked { color:#92a2b2; }
.trainer-fighter-link { flex:0 0 auto; margin:0 12px 10px; border-top:1px solid #39566b; padding:9px 0 0; color:#d1eaff; display:flex; align-items:center; justify-content:space-between; gap:8px; text-decoration:none; }
.trainer-fighter-link > span { display:flex; flex-direction:column; gap:4px; }
.trainer-fighter-link small { font-size:10px; color:#94b2c9; font-weight:normal; }
.trainer-fighter-link b { font-size:13px; }
.trainer-fighter-link .icon { width:20px; height:20px; }
.trainer-actions { flex:0 0 60px; margin-top:8px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.trainer-actions .button { display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 5px; font-size:12px; }
.trainer-actions .icon { width:21px; height:21px; color:#a6cfe7; }
.trainer-actions span { display:flex; flex-direction:column; gap:5px; }
.trainer-actions small { color:#9baabd; font-weight:normal; font-size:9px; }
.trainer-modal-note { font-size:11px; margin:8px 0 12px; color:#b2c6d7; }
.trainer-avatar-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; }
.avatar-option { min-width:0; padding:2px; border:1px solid #53657b; background:#252833; border-radius:5px; aspect-ratio:4/5; cursor:pointer; }
.avatar-option .trainer-art { display:block; width:100%; height:100%; }
.avatar-option[aria-pressed="true"] { border:2px solid #8bdefb; box-shadow:0 0 7px #75d3ff80; }
.trainer-art { display:block; }
.trainer-modal-back { width:100%; }
.trainer-achievement-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.trainer-achievement-grid .trainer-badge { padding:10px 6px; gap:7px; }
.trainer-achievement-grid .trainer-art { width:64px; height:64px; }
.trainer-achievement-grid b { font-size:11px; }
.trainer-achievement-grid small { font-size:10px; color:#9ab5c9; }
.trainer-achievement-detail { display:flex; justify-content:center; margin:12px 0; }
.trainer-achievement-detail .trainer-art { width:108px; height:108px; }
.trainer-achievement-progress { display:flex; flex-direction:column; gap:7px; color:#a8cde5; font-size:12px; margin:12px 0; }
.trainer-achievement-progress progress { width:100%; height:8px; accent-color:#70c6e9; }
.achievement-rewards { margin:12px 0; }
.achievement-rewards h3 { margin:0 0 8px; text-align:center; color:#d0dfef; font-size:12px; }
.achievement-reward-cards { display:flex; justify-content:center; gap:12px; }
.achievement-reward-cards figure { flex:0 1 110px; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px; margin:0; padding:8px; border:1px solid #716d50; border-radius:6px; background:linear-gradient(#27313d,#111e2b); }
.achievement-reward-cards .trainer-art { width:72px; height:80px; max-width:100%; }
.achievement-reward-cards figcaption { color:#dce9f2; font-size:10px; line-height:1.4; text-align:center; }
.achievement-rewards > .trainer-modal-note { margin:8px 0 0; text-align:center; font-size:10px; }
.achievement-notice-name { color:#ffe0a6; text-align:center; }
.trainer-achievement-grid .trainer-badge { gap:5px; padding:8px 5px; }
.trainer-achievement-grid .trainer-badge > .trainer-art { width:48px; height:48px; }
.achievement-reward-preview { display:flex; align-items:center; justify-content:center; gap:5px; margin-top:auto; min-height:28px; }
.trainer-achievement-grid .achievement-reward-preview .trainer-art { width:24px; height:28px; filter:none; opacity:1; }
.trainer-achievement-grid .achievement-reward-preview small { color:#a9c6d9; font-size:9px; }
@media (max-height:650px) {
  .trainer-identity { grid-template-columns:72px minmax(0,1fr); gap:10px; margin-top:-22px; }
  .trainer-avatar { width:72px; height:90px; }
  .trainer-name { padding-bottom:3px; }
  .trainer-name h2 { font-size:16px; margin:3px 0 4px; }
  .trainer-name p { font-size:9px; margin-bottom:4px; }
  .trainer-counters { margin-top:8px; padding:7px 0; }
  .trainer-counters b { font-size:18px; }
  .trainer-cover { max-height:110px; }
  .trainer-featured-badges { padding-top:3px; }
  .trainer-badge .trainer-art { width:43px; height:43px; }
  .trainer-fighter-link { padding-top:7px; margin-bottom:8px; }
  .trainer-actions { flex-basis:54px; }
}

/* Combat HUD: the arena replaces the visible journal, with six reserved sockets. */
.app-shell:has(.combat-arena) { max-width: 580px; }
.battle-tools { display:flex; align-items:center; gap:5px; }
.battle-tool { min-height:36px; padding:6px 8px; font-size:10px; border:1px solid #58748c; background:#14283c; border-radius:6px; color:#c9eaff; }
.sound-toggle { width:36px; padding:6px; }
.sound-toggle .icon { width:21px; height:21px; }
.sound-toggle[aria-pressed="false"] { color:#859aaf; }
.combat-arena { flex:1 1 0; min-height:190px; display:flex; flex-direction:column; border-radius:8px; }
.combat-arena .arena-turn-strip { flex:0 0 auto; justify-content:space-between; padding:7px 12px; }
.combat-arena .combatants { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:4px 7px 10px; align-items:stretch; position:relative; }
.combat-arena .combatant { min-height:0; display:flex; flex-direction:column; justify-content:flex-end; }
.combat-arena .combatant h2 { margin:4px 0; font-size:12px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.combat-arena .combatant .health-row { margin:2px 0 4px; }
.combat-arena .combatant .healthbar { height:8px; flex-shrink:0; }
.combat-arena .combatant .fighter-stage { flex:0 1 auto; width:min(100%,33dvh); max-width:225px; aspect-ratio:1 / 1.15; max-height:calc(100% - 52px); margin:12px auto 0; }
.combat-arena .versus { position:absolute; left:50%; top:51%; transform:translateX(-50%); font-size:14px; opacity:.45; z-index:0; }
.combat-arena .body-zones { z-index:2; }
.combat-arena .body-zone { border-radius:3px; }
.combat-arena ~ .battle-turn-controls { grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:9px 10px; }
.combat-arena ~ .battle-turn-controls .phase-title { font-size:12px; margin:0 0 4px; }
.combat-arena ~ .battle-turn-controls .selection-summary { font-size:10px; line-height:1.45; margin:0; min-height:28px; }
.combat-arena ~ .battle-turn-controls > .text-link { font-size:10px; min-height:38px; padding:5px; }
.combat-arena ~ .battle-result { display:flex; flex-direction:row; align-items:center; }
.combat-arena ~ .battle-result > div { flex:1; min-width:0; }
.combat-arena ~ .battle-result .button { min-width:95px; font-size:11px; }
.impulse-rack { flex:0 0 auto; margin-top:7px; padding:8px 10px; }
.impulse-rack-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.impulse-rack-heading b { font-size:10px; letter-spacing:1.5px; color:#9ccde9; }
.impulse-rack-heading small { font-size:9px; color:#8098af; }
.impulse-sockets { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:6px; }
.impulse-socket { position:relative; min-height:39px; aspect-ratio:1.12; max-height:57px; border:1px solid #46617a; border-radius:7px; background:radial-gradient(ellipse at center,#26425644,#0a1526); box-shadow:inset 0 0 9px #020a18; }
.impulse-socket > span { color:#56849b; font-size:22px; }
.impulse-socket > small { position:absolute; right:4px; bottom:2px; color:#7e9eae; font-size:8px; }
.impulse-socket:hover { border-color:#80bddb; }
.combat-announcement { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.combat-feedback { --fx-color:#ffcd87; --fx-delay:0ms; position:absolute; inset:0; z-index:5; pointer-events:none; }
.combat-float { position:absolute; top:12%; left:50%; width:max-content; max-width:130%; display:flex; flex-direction:column; align-items:center; text-align:center; transform:translateX(-50%); color:var(--fx-color); text-shadow:0 2px 1px #030916,1px 0 2px #030916,-1px 0 2px #030916,0 0 14px #000; animation:combat-number 1.35s both; animation-delay:var(--fx-delay); }
.combat-float > b { font-size:clamp(14px,3.6vw,21px); letter-spacing:1px; font-style:italic; line-height:1.1; }
.combat-float > strong { font-size:clamp(30px,7vw,46px); line-height:1.2; font-weight:900; }
.combat-float > small { font-size:9px; margin-top:5px; letter-spacing:1px; }
.fx-critical { --fx-color:#ffb056; }.fx-critical .combat-float > b { color:#fff0a5; }.fx-critical .combat-float > strong { font-size:clamp(36px,9vw,54px); }
.fx-pierced { --fx-color:#ff8376; }.fx-pierced .combat-float > b { color:#ffe0a5; font-size:clamp(12px,3.3vw,19px); }
.fx-block { --fx-color:#82deff; }
.fx-dodge { --fx-color:#b4ffe0; }
.combat-chance-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:10px 0; }
.combat-chance-grid > div { border:1px solid #48627a; padding:8px; border-radius:6px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.combat-chance-grid b { font-size:11px; overflow-wrap:anywhere; }.combat-chance-grid span { font-size:10px; color:#aecde2; line-height:1.4; }
.combat-formulas h3 { margin:10px 0; font-size:14px; color:#f4cf92; }.combat-formulas p { font-size:12px; line-height:1.6; margin:9px 0; }.combat-formulas small { font-size:10px; color:#93bbd2; }
@keyframes combat-number { 0% { opacity:0; transform:translate(-50%,10px) scale(.7); } 12% { opacity:1; transform:translate(-50%,-3px) scale(1.08); } 25%,65% { opacity:1; transform:translate(-50%,-5px) scale(1); } 100% { opacity:0; transform:translate(-50%,-45px) scale(.92); } }
@media(max-height:620px) { .impulse-rack { padding:6px 8px; }.impulse-socket { min-height:34px; max-height:40px; }.combat-arena ~ .battle-turn-controls { padding:7px 8px; }.combat-arena .combatant .fighter-stage { margin-top:6px; }.combat-formulas p { font-size:11px; margin:7px 0; line-height:1.45; } }
@media(prefers-reduced-motion:reduce) { .combat-float { animation-name:combat-number-quiet; }.combat-arena.critical-impact { animation:none; } }
@keyframes combat-number-quiet { 0%,80% { opacity:1; } 100% { opacity:0; } }

/* Combat health HUD stays against the upper arena edge; outcomes reveal no zone. */
.combat-vitals { flex:0 0 auto; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; padding:9px 8px; background:linear-gradient(#061321eb,#0c1b32ab,transparent); }
.combat-vital { position:relative; min-width:0; height:45px; overflow:hidden; border:1px solid #96c3c9; border-radius:7px 7px 12px 7px; background:linear-gradient(#091821,#182832); box-shadow:0 2px 8px #0008,inset 0 0 0 2px #081721; }
.combat-vital::after { content:''; position:absolute; inset:0; pointer-events:none; border-radius:inherit; background:linear-gradient(#e5ffff2b,transparent 45%,#020a191a); box-shadow:inset 0 0 0 2px #0c1b3477; }
.combat-vital progress { position:absolute; inset:0; width:100%; height:100%; border:0; appearance:none; -webkit-appearance:none; background:transparent; overflow:hidden; border-radius:inherit; }
.combat-vital progress::-webkit-progress-bar { background:transparent; }
.combat-vital progress::-webkit-progress-value { background:linear-gradient(90deg,#1b6a66,#2ba691 65%,#42b59f); border-right:1px solid #abffda; }
.combat-vital progress::-moz-progress-bar { background:linear-gradient(90deg,#1b6a66,#2ba691 65%,#42b59f); border-right:1px solid #abffda; }
.combat-vital-names { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:3px; padding:4px 8px; text-shadow:0 1px 3px #00191a,1px 0 2px #00191a; }
.combat-vital-names > * { display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.2; }
.combat-vital-names span { font-size:10px; color:#d5ffed; }.combat-vital-names b { font-size:12px; color:#fff; }
.combat-vital:last-child { border-color:#cc9e94; border-radius:7px 7px 7px 12px; }.combat-vital:last-child .combat-vital-names { align-items:flex-end; }
.combat-vital:last-child progress::-webkit-progress-value { background:linear-gradient(90deg,#b94f49,#a44048 70%,#7d343e); border-right-color:#ffbbb0; }
.combat-vital:last-child progress::-moz-progress-bar { background:linear-gradient(90deg,#b94f49,#a44048 70%,#7d343e); border-right-color:#ffbbb0; }
.combat-vital:last-child .combat-vital-names span { color:#ffe0d6; }
.combat-arena .combatant .fighter-stage { max-height:100%; margin:12px auto 0; }
.combat-arena .combatants { padding-top:0; }
.combat-retreat { min-height:28px; padding:2px 4px; font-size:10px; color:#b0cfdf; }
.combat-float { top:13%; padding:5px 7px; border-radius:7px; background:radial-gradient(ellipse,#071122a3,transparent 75%); }
@media(max-height:620px) { .combat-vitals { padding:7px 6px; gap:8px; }.combat-vital { height:41px; }.combat-vital-names { padding:4px 6px; }.combat-retreat { min-height:23px; } }

/* Duel readiness, a quiet waiting indicator, and the end-of-match ceremony. */
.room-ready { flex:0 0 auto; width:calc(100% - 16px); margin:0 8px 8px; min-height:40px; }
.duel-status { position:absolute; left:50%; top:82px; transform:translateX(-50%); max-width:90%; padding:8px 12px; background:#081a32d9; color:#bfddf0; border:1px solid #578197; border-radius:20px; font-size:10px; text-align:center; pointer-events:none; }
.duel-status::before { content:''; display:inline-block; width:6px; height:6px; border-radius:50%; background:#73d3e4; margin-right:7px; box-shadow:0 0 7px #73d3e4; animation:duel-wait 1.5s ease-in-out infinite; }
@keyframes duel-wait { 50% { opacity:.25; } }
.battle-result-reopen { flex:0 0 auto; min-height:37px; margin-top:7px; color:#ffe2a4; background:#172c43; border-color:#b6a26d; }
dialog.battle-outcome-modal { padding:20px 18px; border:2px solid #d6bc77; border-radius:18px; background:radial-gradient(ellipse at 50% 20%,#394052,#121b2c 60%,#09131f); max-width:360px; box-shadow:0 0 0 4px #111d30,0 0 75px #d3ae5038,0 30px 90px #000b; }
.battle-outcome { position:relative; text-align:center; color:#e5edf4; overflow:hidden; }
.outcome-kicker { display:block; font-size:10px; color:#a5bfd3; letter-spacing:1px; padding-top:4px; }
.outcome-emblem { width:134px; height:134px; margin:12px auto 3px; position:relative; display:grid; place-items:center; }
.outcome-emblem::before { content:''; position:absolute; inset:8px; border-radius:50%; background:radial-gradient(circle,#ffd37c55,#e4aa4022 45%,transparent 70%); box-shadow:0 0 22px #edbf5530; animation:outcome-glow 2s ease-in-out infinite; }
.outcome-emblem svg { position:absolute; inset:0; width:100%; height:100%; fill:#f5c96833; stroke:#e8c877; stroke-width:2; }
.outcome-emblem .fighter-mini { width:83px; height:83px; z-index:1; border:2px solid #ffe2a0; border-radius:50%; margin-top:18px; background:radial-gradient(#4b535b,#122135); box-shadow:0 0 0 4px #7a694b66,0 5px 12px #0008; }
.battle-outcome h2 { margin:5px 0 7px; font-size:30px; line-height:1.1; color:#ffe6a5; letter-spacing:2px; text-shadow:0 2px #523b26,0 0 20px #f1cd6344; }
.battle-outcome .outcome-trainer { font-size:14px; color:#fff0c7; margin:0 0 6px; overflow-wrap:anywhere; }
.battle-outcome .outcome-message { font-size:12px; color:#a8c1d5; line-height:1.5; margin:6px 0 14px; }
.outcome-rewards { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.outcome-rewards > div { border:1px solid #8e7a50; border-radius:8px; background:linear-gradient(#3e3d354d,#17293b); padding:10px 8px; display:flex; flex-direction:column; gap:5px; }
.outcome-rewards b { font-size:24px; color:#ffdc8c; }.outcome-rewards span { font-size:9px; color:#a7bdcc; letter-spacing:1px; }
.battle-outcome .outcome-level { padding:8px; border-radius:6px; background:#275a573b; color:#91f0ca; font-size:11px; margin:10px 0 0; }
.battle-outcome .outcome-footnote { font-size:10px; color:#a1b6c6; margin:8px 0 0; }
.outcome-continue { width:100%; margin-top:15px; min-height:43px; font-size:13px; }
.outcome-lost .outcome-emblem svg { stroke:#a4b6ca;fill:#9aafb222; }.outcome-lost h2 { color:#d9e7f2; font-size:25px; text-shadow:0 2px #24364d; }
.outcome-draw h2 { color:#b6ecf2; }.outcome-draw .outcome-emblem svg { stroke:#8dc8dc; }
@keyframes outcome-glow { 50% { opacity:.5; transform:scale(.96); } }
@media(max-height:620px) { dialog.battle-outcome-modal { padding:15px 16px; }.outcome-emblem { width:110px; height:110px; margin:9px auto 2px; }.outcome-emblem .fighter-mini { width:68px; height:68px; }.battle-outcome h2 { font-size:27px; }.battle-outcome .outcome-message { margin-bottom:10px; }.outcome-rewards > div { padding:8px; }.outcome-continue { margin-top:11px; } }

.outcome-won .outcome-continue { color:#192534; border-color:#ffe3a0; background:linear-gradient(#f7dda1,#d6ad62); text-shadow:none; box-shadow:inset 0 1px #fff5cf,0 3px 9px #0005; }

/* Team rooms: columns are teams, rows are the two seats of each team. */
.room-type-option { display:block; position:relative; cursor:pointer; }
.room-type-option input { position:absolute; opacity:0; width:1px; height:1px; }
.room-type-option .room-choice { display:flex; width:100%; height:100%; justify-content:center; align-items:center; }
.room-type-option input:checked + .room-choice { border-color:#d8bc76; background:#38566b; color:#ffe7b4; box-shadow:inset 0 0 0 1px #cfbe7766; }
.room-type-option input:focus-visible + .room-choice { outline:2px solid #9cdcff; outline-offset:2px; }
.team-room { padding:8px; }
.team-room .room-capsules { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr) minmax(0,1fr); gap:5px 12px; align-items:stretch; }
.team-room .capsule-seat { min-height:0; height:100%; display:grid; grid-template-rows:15px minmax(0,1fr) 18px 14px; justify-items:center; gap:1px; }
.team-room .capsule-label { font-size:9px; margin:0; line-height:15px; }
.team-room .teleport-capsule { min-height:0; height:100%; width:auto; max-width:100px; aspect-ratio:2/3; }
.team-room .capsule-name { font-size:9px; max-width:100%; white-space:nowrap; overflow:hidden; margin:0; line-height:16px; }
.team-room .capsule-name .fighter-mini { width:14px; height:14px; }
.team-room .capsule-level { font-size:8px; margin:0; line-height:12px; }
.team-room .room-summary { padding-bottom:6px; }.team-room .room-summary b { font-size:12px; }.team-room .room-summary small { font-size:9px; }
.team-room .room-status { padding:5px; font-size:10px; }.team-room .room-local-note { margin:4px 0; font-size:9px; }
.team-room .room-ready { min-height:34px; margin:4px 0 0; width:100%; font-size:11px; padding:6px; }
/* Four fighters: the near fighter overlaps a smaller, raised teammate. */
.team-arena .team-vitals { padding:7px 7px 10px; gap:10px; }
.team-vital-group { min-width:0; display:flex; flex-direction:column; gap:5px; }
.team-vital-row,.team-target-vital { min-width:0; width:100%; }
.team-target-vital { padding:0; display:block; border:0; background:none; color:inherit; text-align:left; }
.team-target-vital:disabled { opacity:1; cursor:default; }
.team-target-vital[aria-pressed="true"] .combat-vital { outline:2px solid #f3d389; outline-offset:1px; }
.team-arena .combat-vital { height:34px; border-radius:5px; }
.team-arena .combat-vital-names { padding:3px 6px; gap:2px; }
.team-arena .combat-vital-names span { font-size:8px; }.team-arena .combat-vital-names b { font-size:10px; }
.team-arena .team-vital-group.own .combat-vital { border-color:#87c7bb; }
.team-arena .team-vital-group.own .combat-vital progress::-webkit-progress-value { background:linear-gradient(90deg,#1b6a66,#2ba691 65%,#42b59f); border-right-color:#abffda; }
.team-arena .team-vital-group.own .combat-vital progress::-moz-progress-bar { background:linear-gradient(90deg,#1b6a66,#2ba691 65%,#42b59f); border-right-color:#abffda; }
.team-arena .team-vital-group.own .combat-vital-names { align-items:flex-start; }.team-arena .team-vital-group.own .combat-vital-names span { color:#d5ffed; }
.team-arena .team-vital-group.opposing .combat-vital { border-color:#c69d93; }
.team-arena .team-vital-group.opposing .combat-vital progress::-webkit-progress-value { background:linear-gradient(90deg,#b94f49,#a44048 70%,#7d343e); border-right-color:#ffbbb0; }
.team-arena .team-vital-group.opposing .combat-vital progress::-moz-progress-bar { background:linear-gradient(90deg,#b94f49,#a44048 70%,#7d343e); border-right-color:#ffbbb0; }
.team-arena .team-vital-group.opposing .combat-vital-names { align-items:flex-end; }.team-arena .team-vital-group.opposing .combat-vital-names span { color:#ffe0d6; }
.own-fighter-vital .combat-vital { box-shadow:0 0 0 1px #82dbc3,0 2px 8px #0008; }
.team-arena .team-combatants { gap:10px; padding:0 7px 10px; }
.team-arena .team-lineup { min-height:0; position:relative; display:block; }
.team-fighter { position:absolute; max-width:200px; }
.team-fighter.front { bottom:0; left:0; width:85%; z-index:2; }
.team-fighter.rear { bottom:70px; left:25%; width:75%; z-index:1; filter:brightness(.89) saturate(.9); }
.enemy-lineup .team-fighter.front { left:auto; right:0; }.enemy-lineup .team-fighter.rear { left:0; }
.team-arena .combatant .team-fighter .fighter-stage { width:100%; max-width:none; max-height:none; aspect-ratio:1 / 1.22; margin:0; }
.team-arena .combat-float { top:3%; }
.team-arena .combat-float > strong { font-size:30px; }.team-arena .combat-float > b { font-size:12px; }.team-arena .combat-float > small { font-size:8px; }
.team-arena .duel-status { top:94px; max-width:88%; font-size:9px; padding:6px 9px; }
.team-arena .body-zone-number { font-size:7px; }.team-arena .body-zone-mark { font-size:17px; }
@media(max-height:620px) { .team-room .room-summary small:last-child { display:none; }.team-arena .combat-vital { height:32px; }.team-fighter.rear { bottom:65px; }.team-room .capsule-empty { font-size:13px; }.team-room .capsule-empty small { font-size:8px; } }

.enemy-lineup .team-fighter.selected-target { z-index:4; }

/* 3v3 uses assigned pairs; only the opponent crosses the arena edge. */
.triple-room .room-capsules { grid-template-rows:repeat(3,minmax(0,1fr)); gap:3px 12px; }
.triple-room .capsule-seat { grid-template-rows:13px minmax(0,1fr) 16px 12px; }
.triple-room .capsule-label { font-size:8px; line-height:13px; }.triple-room .capsule-level { font-size:7px; }
.triple-room .capsule-name { font-size:8px; line-height:14px; }
.triple-room .teleport-capsule { max-width:85px; }
.triple-room .room-summary { padding-bottom:3px; }.triple-room .room-local-note { margin:3px 0; }
.round-robin-arena .combatant.enemy { position:relative; }
.round-robin-arena .combatant.enemy.opponent-out { animation:opponent-depart .32s ease-in both; pointer-events:none; }
.round-robin-arena .combatant.enemy.opponent-in { animation:opponent-arrive .36s ease-out both; pointer-events:none; }
.combat-empty-vital { height:45px; border:1px solid #587485; border-radius:7px; display:grid; place-items:center; font-size:10px; color:#9ab6ca; background:#0c1c2e; }
.pair-wait-placeholder { margin:auto 6px 28px; padding:14px 8px; border:1px dashed #55718b; border-radius:8px; font-size:11px; line-height:1.6; color:#a7c2d7; background:#0916286b; }
.round-robin-arena .duel-status { top:68px; }
@keyframes opponent-depart { 0% { transform:translateX(0);opacity:1; } 70% { opacity:1; } 100% { transform:translateX(165%);opacity:0; } }
@keyframes opponent-arrive { 0% { transform:translateX(165%);opacity:0; } 25% { opacity:1; } 100% { transform:translateX(0);opacity:1; } }
@media(max-height:620px) { .combat-empty-vital { height:41px; }.triple-room .room-status { padding:3px; }.triple-room .room-ready { min-height:30px; } }
.combat-arena .turn-clock { position:absolute; z-index:4; top:68px; left:50%; transform:translateX(-50%); width:96px; padding:5px 8px 6px; border:1px solid #4a8eae; border-radius:9px; background:#081b30ed; color:#d9f5ff; box-shadow:0 2px 12px #020c1b80; pointer-events:none; text-align:center; font-size:10px; font-variant-numeric:tabular-nums; }
.combat-arena .turn-clock[hidden] { display:none; }
.turn-clock-label { margin-right:6px; font-size:9px; color:#aacedd; }
.turn-clock-value { font-size:13px; }
.turn-clock-track { display:block; height:3px; margin-top:4px; overflow:hidden; border-radius:2px; background:#18354c; }
.turn-clock-track i { display:block; height:100%; width:100%; background:#72dded; transition:width .1s linear; }
.turn-clock.urgent { border-color:#d0a24d; color:#ffe1a6; }
.turn-clock.urgent i { background:#f1b75a; }
.turn-clock.automatic .turn-clock-label { color:#f1c785; }
.team-arena .turn-clock { top:106px; }


.outcome-rating { margin:9px 0 0; font-size:12px; color:#91e6cf; }
.outcome-rating b { font-size:17px; }.outcome-rating span { color:#b2c9d7; font-size:11px; }
.outcome-rating.negative { color:#f4ae9e; }

.impulse-loadout { flex:none; padding:8px; }.impulse-loadout > b { display:block; font-size:10px; margin-bottom:6px; color:#add8e8; }
.impulse-explanation { flex:none; font-size:10px; line-height:1.35; color:#b2cad8; margin:7px 1px; }
.impulse-card { display:grid; grid-template-columns:58px minmax(0,1fr) 66px; gap:8px; align-items:center; padding:9px; margin-bottom:7px; }
.impulse-art { padding:0; width:58px; height:58px; background:#0c1c2c; border:1px solid #42566b; border-radius:6px; }
.impulse-art .item-icon { width:100%; height:100%; }.impulse-copy { min-width:0; }
.impulse-copy > b { font-size:13px; color:#d8eff7; }.impulse-copy p { margin:5px 0; font-size:10px; line-height:1.35; color:#b8cddd; }
.impulse-copy > small { font-size:10px; color:#a2d9d5; }.impulse-inventory { flex:1; min-height:0; }
.impulse-slot-picker { display:grid; gap:7px; }
.impulse-socket .item-icon { position:absolute; inset:3px; width:calc(100% - 6px); height:calc(100% - 6px); }
.stocked-impulse > small { font-size:10px; color:#efffff; background:#081626e8; padding:1px 3px; border-radius:3px; }
.stocked-impulse:disabled { opacity:.38; }.impulse-rack-note { display:block; text-align:center; font-size:9px; line-height:1.1; color:#a7c5d4; margin-top:4px; }
.combat-vital { height:65px; }
.combat-vital progress { height:calc(100% - 20px); }
.combat-vital-names { bottom:20px; }
.combat-vital-effects { position:absolute; left:4px; right:4px; bottom:1px; height:18px; display:flex; gap:3px; z-index:2; }
.combat-status { position:relative; display:block; flex:none; width:19px; height:18px; }
.combat-status .status-icon { width:18px; height:18px; }
.combat-status > b { position:absolute; bottom:-1px; right:-1px; font-size:9px; color:#fff; line-height:10px; min-width:9px; padding:0 1px; background:#06111be8; border-radius:2px; text-shadow:0 1px #000; }
.combat-vital:last-child .combat-vital-effects { justify-content:flex-end; }
.team-arena .combat-vital { height:54px; }
.combat-arena .turn-clock { top:89px; }
.team-arena .turn-clock { top:146px; width:80px; }
.status-feedback { position:absolute; top:12px; left:4px; z-index:5; pointer-events:none; display:grid; gap:3px; animation:status-tick-rise 1.35s ease-out both; }
.status-tick { display:flex; align-items:center; gap:3px; padding:2px 4px; border-radius:4px; background:#05131bdd; text-shadow:0 1px #000; }
.status-tick .item-icon { width:19px; height:19px; }.status-tick b { font-size:16px; }.status-tick.positive { color:#a1ffb2; }.status-tick.negative { color:#ffaba7; }
@keyframes status-tick-rise { from { opacity:0; transform:translateY(6px); } 15%,75% { opacity:1; } to { opacity:0; transform:translateY(-15px); } }
@media(prefers-reduced-motion:reduce) { .status-feedback { animation:none; } }
@media(max-height:620px) { .combat-vital { height:61px; }.team-arena .combat-vital { height:52px; } }

/* A shared team outcome, with each trainer's own reward below the roster. */
.outcome-team h2 { font-size:24px; margin:14px 0; letter-spacing:1px; }
.outcome-squad { display:flex; justify-content:center; gap:8px; margin:10px 0; }
.outcome-ally { flex:1; min-width:0; max-width:105px; padding:9px 3px 6px; border:1px solid #728e9c; border-radius:10px; background:linear-gradient(#36526377,#152536); display:flex; flex-direction:column; align-items:center; gap:4px; }
.outcome-ally .fighter-mini { width:48px; height:48px; border:2px solid #e4c47d; border-radius:50%; }
.outcome-ally b { max-width:100%; font-size:11px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.outcome-ally small { font-size:9px; color:#bcd3df; }
.outcome-ally span { font-size:9px; color:#9be2c4; }
.outcome-ally-down .fighter-mini { filter:saturate(.4); }
.outcome-ally-down span { color:#c9b3a4; }
.battle-outcome .outcome-personal { font-size:9px; letter-spacing:1.5px; color:#bcd3df; margin:8px 0; }
.outcome-level-up { display:flex; align-items:center; gap:12px; text-align:left; padding:12px; margin-top:12px; border:1px solid #8ce5d0; border-radius:10px; background:linear-gradient(110deg,#184c56,#173344); box-shadow:inset 0 0 22px #78e7ce18; animation:level-up-appear .55s ease-out both; }
.level-up-number { flex:none; display:grid; place-items:center; width:48px; height:48px; color:#183e46; background:#acffe3; border-radius:50%; font-size:28px; box-shadow:0 0 16px #90efd250; }
.outcome-level-up > div { display:flex; flex-direction:column; gap:5px; min-width:0; }
.outcome-level-up strong { color:#b1ffe6; font-size:12px; }
.outcome-level-up span { font-size:12px; color:#effff8; }
.outcome-level-up small { font-size:10px; color:#b5d3d9; }
@keyframes level-up-appear { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@media(max-height:620px) {
  .outcome-promoted .outcome-emblem { width:78px; height:78px; margin:3px auto; }
  .outcome-promoted .outcome-emblem .fighter-mini { width:48px; height:48px; margin-top:8px; }
  .outcome-team h2 { font-size:22px; margin:10px 0; }
  .outcome-ally { padding:6px 2px; }.outcome-ally .fighter-mini { width:42px; height:42px; }
  .outcome-level-up { gap:9px; padding:9px; margin-top:9px; }
}
@media(prefers-reduced-motion:reduce) { .outcome-level-up { animation:none; } }

/* General chat scrolls inside the terminal; the page and composer stay fixed. */
.social-toolbar { flex:0 0 auto; display:flex; align-items:center; gap:5px; margin-bottom:7px; min-width:0; }
.social-toolbar .button { flex:0 1 auto; font-size:10px; min-height:34px; padding:6px 7px; text-decoration:none; text-align:center; }
.social-toolbar > span { flex:1; min-width:0; font-size:9px; color:#9fc5d8; overflow-wrap:anywhere; }
.social-toolbar > .text-input { flex:1; width:50%; min-width:0; }
.social-toolbar [aria-pressed="true"] { border-color:#9de3ff; background:#29485f; }
.social-error { flex:0 0 auto; color:#ffbc9b; font-size:10px; line-height:1.4; margin:0 0 6px; }
.social-error:empty { display:none; }
.chat-scroll { flex:1 1 0; min-height:40px; overflow-y:auto; overscroll-behavior:contain; border:1px solid #42637b; border-radius:5px; background:#081425b5; padding:7px; scrollbar-width:thin; }
.chat-message { border-bottom:1px solid #2b4658; padding:7px 0 8px; overflow-wrap:anywhere; }
.chat-message:first-child { padding-top:0; }.chat-message:last-child { border-bottom:0; }
.chat-message.own .chat-author > b { color:#8fe2db; }
.chat-author { display:flex; align-items:center; flex-wrap:wrap; gap:5px; min-width:0; }
.chat-author .fighter-mini { width:24px; height:24px; flex:0 0 24px; }
.chat-author > b { font-size:11px; color:#d2e5f3; max-width:60%; }
.chat-author time { font-size:9px; color:#7fa3b7; margin-left:auto; }
.chat-author > button { border:1px solid #395c75; background:#152b42; color:#cbe5f6; border-radius:4px; width:30px; min-height:28px; padding:0; font-size:20px; cursor:pointer; }
.chat-role { font-size:8px; color:#ffce86; border:1px solid #6d664b; padding:2px 4px; border-radius:4px; }
.chat-text { margin-top:5px; font-size:12px; line-height:1.55; white-space:normal; overflow-wrap:anywhere; }
.chat-emote { display:inline-block; width:26px; height:26px; object-fit:contain; vertical-align:middle; }
.chat-message blockquote,.mail-letter-body blockquote { margin:6px 0; padding:5px 7px; border-left:2px solid #72c1dd; background:#1b36516b; font-size:10px; line-height:1.45; overflow-wrap:anywhere; }
.chat-message blockquote > b,.chat-message blockquote > span { display:block; }
.chat-message blockquote .chat-emote { width:18px; height:18px; }
.chat-reply-link { border:0; background:transparent; color:#93b8cf; font-size:9px; min-height:27px; padding:4px 0 0; cursor:pointer; }
.chat-reply-preview { display:flex; gap:5px; align-items:center; border-left:2px solid #76c5dc; padding:5px 7px; margin-top:5px; color:#b6d1df; font-size:9px; line-height:1.4; }
.chat-reply-preview > span { flex:1; min-width:0; overflow-wrap:anywhere; }.chat-reply-preview > button { border:0; background:transparent; color:#d3e6ef; font-size:20px; padding:0 7px; }
.chat-mute { flex:0 0 auto; font-size:10px; color:#f8bb94; margin:6px 0; line-height:1.4; }
.chat-compose { flex:0 0 auto; padding-top:7px; }.chat-compose textarea { width:100%; min-height:52px; height:57px; max-height:25dvh; resize:none; font-size:12px; padding:7px; line-height:1.4; }
.chat-compose-tools { display:flex; gap:6px; align-items:center; margin-top:5px; }.chat-compose-tools > small { flex:1; color:#95b1c4; font-size:10px; }.chat-compose-tools .button { min-height:34px; font-size:11px; padding:6px 10px; }
.chat-editor { width:100%; min-height:57px; max-height:25dvh; overflow-y:auto; padding:7px; font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; cursor:text; }
.chat-editor:empty::before { content:attr(data-placeholder); color:#8599ac; pointer-events:none; }
.chat-editor .chat-emote { width:28px; height:28px; vertical-align:middle; user-select:all; }
.chat-emote-picker { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:14px 0; }.chat-emote-picker .button { padding:4px; }.chat-emote-picker img { width:100%; height:52px; object-fit:contain; }
.social-message-preview { max-height:23dvh; overflow-y:auto; font-size:12px; line-height:1.5; padding:9px; border:1px solid #456176; margin:10px 0; overflow-wrap:anywhere; }
.social-actions { display:grid; gap:7px; margin-top:12px; }.social-actions .button { min-height:36px; font-size:12px; padding:7px; }
[id^="social-"] .field-label { display:flex; flex-direction:column; gap:6px; margin:10px 0; font-size:11px; }
[id^="social-"] .text-input { min-width:0; width:100%; font-size:12px; padding:8px; }
#social-mail-form textarea { height:130px; max-height:26dvh; resize:vertical; }
#social-mail-form .text-input { margin:0; min-height:34px; }
.mail-list { flex:1 1 0; min-height:0; display:flex; flex-direction:column; gap:7px; }
.mail-entry { flex:1 1 0; min-height:0; max-height:95px; width:100%; padding:9px; display:flex; flex-direction:column; justify-content:center; gap:6px; text-align:left; color:#c3dbe9; cursor:pointer; overflow:hidden; }
.mail-entry > span { display:flex; align-items:center; justify-content:space-between; gap:7px; font-size:10px; }.mail-entry time { font-size:8px; color:#91aabe; white-space:nowrap; }
.mail-entry strong { display:block; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; width:100%; }.mail-entry small { font-size:9px; color:#88a8bc; }
.mail-entry.unread { border-color:#7ac0dc; background:#173750; }.mail-entry.unread > span > b::before { content:'● '; color:#91e9d8; }
.mail-letter-body { max-height:40dvh; overflow-y:auto; font-size:12px; line-height:1.55; padding:8px; border:1px solid #3e5c70; overflow-wrap:anywhere; }
.staff-entry { flex:1 1 0; min-height:0; max-height:86px; display:flex; align-items:center; gap:8px; padding:8px; }
.staff-entry .fighter-mini { width:32px; height:32px; flex:0 0 32px; }.staff-entry > span { flex:1; min-width:0; }.staff-entry b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }.staff-entry small { font-size:9px; color:#9fbace; display:block; margin-top:4px; }
.staff-entry .button { min-height:34px; padding:6px; font-size:10px; }.social-note { font-size:10px; line-height:1.5; margin:0 0 8px; color:#a8c6d9; }
[data-mail-unread] { border-radius:8px; background:#456a82; color:#f0f6fb; padding:1px 5px; font-size:10px; }[data-mail-unread][hidden] { display:none; }
@media(max-height:650px) {
  #social-mail-form textarea { height:78px; resize:none; }
  #social-mail-form .social-actions { grid-template-columns:1fr 1fr; }
  #social-mail-form .field-label { margin:7px 0; }
}

/* Physical impulse devices and individually charged items. */
.empty-impulse { color:#7096ac; font-size:22px; }
.impulse-instance-picker { display:grid; gap:7px; }
.impulse-slot-picker { grid-template-columns:1fr 1fr; }
.impulse-slot-picker .button { font-size:11px; padding:9px 5px; min-height:48px; }
.status-immunity { outline:1px dashed #9fd8e6; outline-offset:-1px; border-radius:3px; }
.status-immunity canvas { opacity:.5; }
.impulse-copy p { margin:4px 0; }

.impulse-loadout-heading { display:flex; align-items:center; justify-content:space-between; min-height:17px; margin-bottom:6px; gap:4px; }
.impulse-loadout-heading b { font-size:10px; color:#add8e8; }
.impulse-loadout-heading .text-link { min-height:17px; padding:0 3px; font-size:10px; }
.impulse-guide-link { flex: 0 0 auto; min-height: 36px; justify-content: center; margin-bottom: 6px; }
.impulse-socket.selected-impulse-slot { outline:2px solid #9be9f1; outline-offset:1px; background:#174258; box-shadow:0 0 9px #78dded66; }
.impulse-card .impulse-art:disabled { opacity:1; }
.impulse-empty { padding:12px; font-size:12px; color:#b8cddd; }

/* Health numbers share the filled bar with names; effects keep their own row. */
.combat-vital .combat-vital-names {
  display:grid; grid-template-columns:minmax(0,1fr) auto;
  align-content:center; align-items:center; column-gap:6px; row-gap:3px;
}
.combat-vital-names > span { grid-column:1 / -1; }
.combat-vital-names > .combat-vital-hp {
  font-size:11px; line-height:1.2; color:#fff; font-variant-numeric:tabular-nums;
  white-space:nowrap; text-shadow:0 1px 3px #000,0 0 3px #000;
}
.team-arena .combat-vital .combat-vital-names { row-gap:2px; }
.team-arena .combat-vital-hp { font-size:10px; }
.loader-card h1 { letter-spacing:2px; overflow-wrap:normal; }

/* Space Coliseum loading artwork; the progress and retry remain live HTML. */
.game-loader { display:block; padding:0; background:#040b13; overflow:hidden; }
.loader-art { position:absolute; inset:0; display:block; }
.loader-art img { display:block; width:100%; height:100%; object-fit:contain; }
.game-loader .loader-card {
  position:absolute; width:min(350px,calc(100% - 32px)); left:50%; transform:translateX(-50%); bottom:max(5%,calc(env(safe-area-inset-bottom) + 16px));
  padding:16px 18px 12px; border-color:#7d6a4b; background:linear-gradient(#071421e8,#07101bf5);
  box-shadow:0 0 0 3px #b7772824,0 10px 32px #0008;
}
.game-loader .loader-title { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.loader-card progress { border-color:#927444; }
.loader-card progress::-webkit-progress-value { background:linear-gradient(90deg,#b46a27,#ffbe67); }
.loader-card progress::-moz-progress-bar { background:linear-gradient(90deg,#b46a27,#ffbe67); }
.loader-card small { min-height:16px; }
.load-error .loader-card { border-color:#ffbe67; }
.brand img { object-fit:contain; }
#modal:has(#account-email-form) { padding:16px; }
#modal:has(#account-email-form) h2 { margin:6px 30px 12px 0; }
#modal:has(#account-email-form) p { margin:6px 0; line-height:1.4; }
#modal:has(#account-email-form) .equipment-entry { min-height:34px; margin-top:6px; }
#account-email-form .field-label { margin-top:6px; gap:5px; }
#account-email-form .auth-error:empty { display:none; }
@media(orientation:portrait) {
  .game-loader .loader-card { left:50%; transform:translateX(-50%); bottom:max(5%,calc(env(safe-area-inset-bottom) + 16px)); }
}
@media(orientation:landscape) and (max-height:500px) {
  .game-loader .loader-card { bottom:4%; padding:10px 12px; }
  .loader-card p { margin-bottom:6px; font-size:11px; }
  .loader-card small { font-size:9px; margin-top:6px; }
}
