:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --surface-3: #f8fbfd;
  --text: #16202a;
  --muted: #627286;
  --line: #d6e0ea;
  --accent: #cf3030;
  --accent-2: #207f73;
  --warning: #8a6500;
  --ok: #1d6b3b;
  --bank-red: #d65f4a;
  --bank-red-dark: #a93d31;
  --bank-blue: #4e76b8;
  --bank-blue-dark: #244b86;
  --bank-paper: #fffaf5;
  --bank-line: #dfc7ae;
  --bank-shadow: 0 10px 24px rgba(71, 45, 34, 0.11);
  --shadow: 0 16px 40px rgba(25, 41, 58, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-inner,
main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
}

.brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid #111820;
  border-radius: 50%;
  background:
    linear-gradient(#d72e2e 0 46%, #111820 46% 54%, #ffffff 54% 100%);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}

.mark::after {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid #111820;
  border-radius: 50%;
  background: #ffffff;
}

nav,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link,
button,
input,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 8px 12px;
}

.nav-link,
button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  text-decoration: none;
}

.nav-link.primary,
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.nav-link:hover,
button:hover {
  border-color: #9fb0c0;
  background: #f9fbfd;
}

.nav-link.primary:hover,
button.primary:hover {
  border-color: #ad2828;
  background: #ad2828;
}

.nav-link.icon-only {
  width: 42px;
  padding: 8px;
}

.nav-link.icon-only svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.mobile-discord-link {
  display: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.topbar.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.topbar.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
select {
  width: min(360px, 100%);
}

main {
  display: grid;
  gap: 18px;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: 0;
  line-height: 1;
}

.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 17px;
  margin-top: 14px;
}

.lead strong {
  color: var(--text);
  font-weight: 900;
}

section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mask-control {
  display: block;
  justify-self: end;
  min-width: min(220px, 100%);
}

.mini-label {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mask-control select {
  width: 100%;
  min-height: 40px;
  border-color: #cbd9d2;
  padding: 7px 10px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.08);
  font-size: 13px;
  font-weight: 750;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 13px 16px;
}

.section-body {
  padding: 16px;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  justify-content: stretch;
}

.exchange-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.actions input {
  width: 100%;
}

.actions button {
  width: auto;
  white-space: nowrap;
}

.checkbox-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 11px;
  white-space: nowrap;
}

.checkbox-filter input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--ok);
}

.pokedex-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.pokedex-generation-toggle {
  display: inline-flex;
  gap: 4px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.generation-button {
  min-height: 30px;
  border-color: transparent;
  padding: 5px 11px;
  background: transparent;
  font-size: 13px;
}

.generation-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.generation-button.is-active:hover {
  border-color: #ad2828;
  background: #ad2828;
}

.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 12px;
}

.pokemon-card {
  display: grid;
  position: relative;
  overflow: hidden;
  gap: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pokemon-card.is-available {
  border-color: #2b9458;
}

.pokemon-card.is-locked {
  border-color: #d0a01a;
}

.pokemon-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.08);
}

.pokemon-card.turn-card {
  align-content: start;
}

.card-face {
  display: grid;
  gap: 0;
  min-width: 0;
}

.card-face.back {
  display: none;
}

.pokemon-card.is-turned .card-face.front {
  display: none;
}

.pokemon-card.is-turned .card-face.back {
  display: grid;
}

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  padding: 7px 10px;
}

.card-toolbar-title {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-toolbar-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

.card-turn-button {
  width: auto;
  min-height: 24px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.legit-mark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  gap: 5px;
  border: 1px solid #c6d4ce;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 3px 7px;
  text-transform: uppercase;
}

.legit-mark::before {
  content: "";
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #eef3f1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 13px 13px;
  color: currentColor;
}

.legit-mark.legit {
  border-color: rgba(29, 107, 59, 0.28);
  background: #eff8f2;
  color: var(--ok);
}

.legit-mark.legit::before {
  background-color: #d8efdf;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%231d6b3b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5 7.3 13 14 5'/%3E%3C/svg%3E");
}

.legit-mark.fake {
  border-color: rgba(138, 101, 0, 0.28);
  background: #fff8e5;
  color: var(--warning);
}

.legit-mark.fake::before {
  background-color: #f8e7b5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%238a6500' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 5 13 13M13 5 5 13'/%3E%3C/svg%3E");
}

.info-chip.legit {
  background: #e7f4ec;
  color: var(--ok);
}

.info-chip.fake {
  background: #fff3cd;
  color: var(--warning);
}

.legality-panel {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  padding: 9px 10px;
}

.legality-rules {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legality-reasons {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legality-reasons li {
  border: 1px solid #e6d7b5;
  border-radius: 6px;
  background: #fffaf0;
  color: #6f5200;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  padding: 6px 7px;
}

.pokedex-card {
  border-color: #2b9458;
}

.pokedex-detail {
  display: grid;
  gap: 7px;
}

.pokedex-detail-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  align-items: baseline;
  font-size: 12px;
}

.pokedex-detail-row span {
  color: var(--muted);
  font-weight: 750;
}

.pokedex-detail-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokemon-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  min-width: 0;
  align-items: center;
  padding: 10px 11px;
}

.sprite-wrap {
  display: grid;
  position: relative;
  width: 76px;
  height: 76px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #d9deea;
  border-radius: 8px;
  background: #ffffff;
}

.sprite-wrap img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(30, 42, 36, 0.18));
}

.shiny-star {
  position: absolute;
  top: 4px;
  right: 5px;
  color: #d09200;
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255, 211, 92, 0.85);
}

.header-summary {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.header-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.header-line strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-line > span:not(.gender-icon) {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offered-name-line {
  align-items: flex-end;
}

.offered-name-line strong {
  font-size: 15px;
}

.offered-species-line {
  gap: 5px;
}

.header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 800;
  background: #edf1ee;
  color: #45544e;
}

.info-chip.nature {
  background: #edf3fb;
  color: #285fa8;
}

.info-chip.shiny {
  background: #fff3cd;
  color: var(--warning);
}

.gender-icon {
  display: inline-grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.gender-icon img {
  display: block;
  width: 17px;
  height: 17px;
}

.gender-icon.gender-inline {
  width: 17px;
  height: 17px;
  border: 0;
  background: transparent;
}

.gender-icon.gender-inline img {
  width: 17px;
  height: 17px;
}

.gender-icon.male {
  border-color: #b6d1ef;
  background: #eef6ff;
  color: #1d67ad;
}

.gender-icon.female {
  border-color: #efbfd1;
  background: #fff1f6;
  color: #b9326d;
}

.gender-icon.genderless,
.gender-icon.either {
  border-color: #d7d5e6;
  background: #f5f4fb;
  color: #665a9c;
}

.gender-icon.gender-inline {
  border: 0;
  background: transparent;
}

.pokemon-details {
  width: 100%;
  border-top: 1px solid var(--line);
  border-collapse: collapse;
  background: var(--surface-3);
  table-layout: fixed;
}

.pokemon-details th,
.pokemon-details td {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 6px 9px;
  text-align: left;
}

.pokemon-details th:last-child,
.pokemon-details td:last-child {
  border-right: 0;
}

.pokemon-details th {
  color: var(--muted);
  background: #eef1f7;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pokemon-details td {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pokemon-details .item-display {
  max-width: 100%;
}

.item-display {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.item-sprite {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #d8e2dc;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.item-sprite img {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
  object-fit: contain;
}

.item-sprite.is-empty {
  background: #f3f6f8;
}

.item-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-section {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
}

.section-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.stat-list {
  display: grid;
  gap: 3px;
}

.stat-row {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) 34px 42px;
  align-items: center;
  gap: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: right;
}

.stat-value {
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.stat-bar {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.stat-ev {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.stat-ev.invested {
  color: #9a6b00;
}

.stat-iv {
  color: #285fa8;
  font-size: 10px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.stat-iv.perfect {
  color: var(--ok);
}

.iv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.iv-cell {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 7px 8px;
}

.iv-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.iv-cell strong {
  color: #285fa8;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.iv-cell.perfect strong {
  color: var(--ok);
}

.origin-summary {
  display: grid;
  gap: 2px;
  padding: 2px 0 1px;
}

.origin-summary p {
  margin: 0;
  color: #314056;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.38;
}

.origin-summary span {
  color: #cf5972;
  font-weight: 950;
}

.origin-summary .ball-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: -3px;
}

.origin-summary .ball-sprite {
  --ball-top: #d94848;
  --ball-bottom: #ffffff;
  --ball-band: #222a36;
  --ball-button: #ffffff;
  position: relative;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border: 1.5px solid #222a36;
  border-radius: 50%;
  background:
    linear-gradient(
      to bottom,
      var(--ball-top) 0 45%,
      var(--ball-band) 45% 56%,
      var(--ball-bottom) 56% 100%
    );
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.origin-summary .ball-sprite::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1.5px solid #222a36;
  border-radius: 50%;
  background: var(--ball-button);
  transform: translate(-50%, -50%);
}

.ball-sprite-master { --ball-top: #8b63c7; --ball-bottom: #f1edff; --ball-button: #e68ac1; }
.ball-sprite-ultra { --ball-top: #f2c642; --ball-bottom: #2c3442; --ball-button: #f6f1d4; }
.ball-sprite-great { --ball-top: #477fc9; --ball-bottom: #f9fbff; --ball-button: #ffffff; }
.ball-sprite-poke { --ball-top: #d94848; --ball-bottom: #ffffff; --ball-button: #ffffff; }
.ball-sprite-safari { --ball-top: #8cae5f; --ball-bottom: #f4edc6; --ball-button: #fff8d8; }
.ball-sprite-net { --ball-top: #44a8c9; --ball-bottom: #e8f4df; --ball-button: #f8ffe8; }
.ball-sprite-dive { --ball-top: #4b9fe8; --ball-bottom: #dcefff; --ball-button: #ffffff; }
.ball-sprite-nest { --ball-top: #87c657; --ball-bottom: #f6f1ca; --ball-button: #fff9d0; }
.ball-sprite-repeat { --ball-top: #e88943; --ball-bottom: #fff0d6; --ball-button: #fff7e7; }
.ball-sprite-timer { --ball-top: #d9dce5; --ball-bottom: #fff8e0; --ball-button: #ffffff; }
.ball-sprite-luxury { --ball-top: #202636; --ball-bottom: #3b2c1f; --ball-button: #f0d96d; }
.ball-sprite-premier { --ball-top: #ffffff; --ball-bottom: #ffffff; --ball-band: #d95050; --ball-button: #ffffff; }
.ball-sprite-dusk { --ball-top: #475069; --ball-bottom: #5f8d5d; --ball-button: #dff0d0; }
.ball-sprite-heal { --ball-top: #ef86bc; --ball-bottom: #fff0f8; --ball-button: #ffffff; }
.ball-sprite-quick { --ball-top: #4bbce6; --ball-bottom: #f6d844; --ball-button: #ffffff; }
.ball-sprite-cherish { --ball-top: #c73f4e; --ball-bottom: #f7dfe3; --ball-button: #ffffff; }
.ball-sprite-fast { --ball-top: #efc343; --ball-bottom: #fff3d2; --ball-button: #ffffff; }
.ball-sprite-level { --ball-top: #e99a3e; --ball-bottom: #f8e9bd; --ball-button: #ffffff; }
.ball-sprite-lure { --ball-top: #4aa1d7; --ball-bottom: #e3eefb; --ball-button: #ffffff; }
.ball-sprite-heavy { --ball-top: #667080; --ball-bottom: #d8dde4; --ball-button: #ffffff; }
.ball-sprite-love { --ball-top: #ef78a8; --ball-bottom: #ffe6ef; --ball-button: #ffffff; }
.ball-sprite-friend { --ball-top: #75bd62; --ball-bottom: #eef7dc; --ball-button: #ffffff; }
.ball-sprite-moon { --ball-top: #4f5c8c; --ball-bottom: #f3e7b8; --ball-button: #ffffff; }
.ball-sprite-sport { --ball-top: #d77c4f; --ball-bottom: #fff0d5; --ball-button: #ffffff; }
.ball-sprite-unknown { --ball-top: #9ca3af; --ball-bottom: #f3f4f6; --ball-button: #ffffff; }

.ev-line {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.move-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  min-width: 0;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.trade-summary {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f6fb 100%);
  padding: 8px 10px;
}

.footer-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-sprite {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid #d9deea;
  border-radius: 8px;
  background: #ffffff;
}

.footer-sprite img {
  width: 46px;
  height: 46px;
  image-rendering: pixelated;
  object-fit: contain;
}

.footer-sprite.fallback {
  color: var(--muted);
  font-weight: 900;
}

.footer-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.footer-label {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-line strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-line > span:not(.footer-label):not(.gender-icon) {
  flex: 0 0 auto;
}

.footer-line .gender-icon {
  width: 19px;
  height: 19px;
  font-size: 12px;
}

.pokemon-grid.mask-mobile {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.pokemon-card.mask-mobile {
  border-width: 1px;
}

.mobile-trade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.mobile-side {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.mobile-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-side strong,
.mobile-side span:not(.mobile-sprite):not(.mobile-label):not(.gender-icon) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-side strong {
  font-size: 13px;
  line-height: 1.2;
}

.mobile-name-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-side span:not(.mobile-sprite):not(.mobile-label):not(.gender-icon) {
  color: var(--muted);
  font-size: 11px;
}

.mobile-species-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-sprite {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid #d9deea;
  border-radius: 8px;
  background: #ffffff;
}

.mobile-sprite img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  object-fit: contain;
}

.mobile-sprite.fallback {
  color: var(--muted);
  font-weight: 900;
}

.mobile-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.empty {
  border: 1px dashed #c8d2cc;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

body.summary-modal-open {
  overflow: hidden;
}

.summary-modal[hidden] {
  display: none;
}

.summary-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.summary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 27, 24, 0.54);
}

.summary-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(840px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 28, 0.28);
}

.summary-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.summary-modal-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.summary-modal-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
}

.summary-modal-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-modal-close {
  min-height: 34px;
  padding: 7px 11px;
  flex: 0 0 auto;
}

.summary-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
}

.summary-modal-body .summary-card,
.summary-modal-body .tower-team-detail-card {
  box-shadow: none;
}

.status-line {
  color: var(--muted);
  font-size: 13px;
}

.tower-page {
  display: grid;
  gap: 14px;
}

.tower-page .page-shell {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.tower-page .hidden {
  display: none;
}

.tower-page .generation-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
}

.tower-page .generation-tabs button {
  width: 100%;
}

.tower-page .generation-tabs button.active {
  border-color: var(--bank-red);
  background: var(--bank-red);
  color: #ffffff;
}

.tower-page .museum-toolbar {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}

.tower-page .toolbar-actions,
.tower-page .toolbar-meta,
.tower-page .trainer-pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tower-page .toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 110px auto;
  width: min(100%, 760px);
  min-width: 0;
}

.tower-page .toolbar-meta {
  justify-content: flex-end;
  justify-self: end;
}

.tower-page .museum-toolbar input,
.tower-page .museum-toolbar select {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.tower-page .toolbar-actions button {
  width: auto;
  min-width: 92px;
  white-space: nowrap;
}

.tower-page .trainer-pagination {
  justify-content: center;
}

.tower-page .trainer-pagination button {
  min-width: 92px;
}

.tower-page .page-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-width: 92px;
  text-align: center;
}

.tower-page .trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.tower-page .trainer-card {
  display: grid;
  min-height: 236px;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--bank-red);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.55)),
    repeating-linear-gradient(0deg, #ffd9cc 0 19px, #ffe8df 19px 38px);
  box-shadow: var(--bank-shadow);
  color: #273040;
  padding: 0;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tower-page .trainer-card:hover,
.tower-page .trainer-card.selected {
  border-color: var(--bank-blue);
  box-shadow: 0 12px 26px rgba(71, 45, 34, 0.14);
  transform: translateY(-1px);
}

.tower-page .trainer-card-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  background: var(--bank-red);
  color: #ffffff;
  padding: 7px 10px;
}

.tower-page .trainer-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tower-page .trainer-card-gen {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  padding: 2px 7px;
  white-space: nowrap;
}

.tower-page .trainer-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px;
  gap: 12px;
  align-items: end;
  padding: 12px;
}

.tower-page .trainer-lines {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tower-page .trainer-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  border-bottom: 1px solid rgba(168, 77, 59, 0.24);
  padding-bottom: 5px;
}

.tower-page .trainer-line span {
  color: #7d5147;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tower-page .trainer-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.15;
}

.tower-page .trainer-line.name strong {
  color: var(--bank-blue-dark);
  font-size: 19px;
}

.tower-page .trainer-portrait {
  display: grid;
  align-self: stretch;
  justify-items: center;
  align-content: end;
  min-height: 132px;
  border-left: 1px solid rgba(168, 77, 59, 0.24);
  padding-left: 10px;
}

.tower-page .trainer-portrait img {
  width: 82px;
  max-height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 4px rgba(70, 44, 38, 0.22));
}

.tower-page .trainer-fallback {
  display: none;
  width: 74px;
  height: 94px;
  place-items: center;
  border: 2px solid rgba(168, 77, 59, 0.28);
  border-radius: 8px;
  color: var(--bank-red-dark);
  font-size: 34px;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.48);
}

.tower-page .trainer-portrait img.is-hidden {
  display: none;
}

.tower-page .trainer-portrait img.is-hidden + .trainer-fallback {
  display: grid;
}

.tower-page .trainer-most-used {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  min-width: 0;
  border-top: 1px solid rgba(168, 77, 59, 0.24);
  padding-top: 8px;
}

.tower-page .trainer-most-used > span {
  color: #7d5147;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tower-page .most-used-list,
.tower-mini-team {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tower-page .pokemon-usage-badge,
.tower-mini-badge {
  align-items: center;
  display: inline-flex;
  min-width: 0;
  gap: 4px;
  border: 1px solid rgba(168, 77, 59, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #273040;
  font-size: 11px;
  font-weight: 850;
  padding: 2px 7px 2px 3px;
}

.tower-page .pokemon-usage-badge img,
.tower-mini-badge img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.tower-view {
  display: grid;
  gap: 12px;
}

.tower-view-head,
.tower-room-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.tower-view-title,
.tower-room-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tower-view-title strong,
.tower-room-title strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-view-title span,
.tower-room-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tower-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.tower-room-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tower-room-card:hover,
.tower-room-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.1);
  transform: translateY(-1px);
}

.tower-room-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tower-room-stat-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tower-room-stat-grid small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-room-stat-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-record-list,
.tower-leader-list {
  display: grid;
  gap: 8px;
}

.tower-record-row,
.tower-leader-row {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.tower-record-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tower-record-main strong,
.tower-leader-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-record-main span,
.tower-leader-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tower-record-score {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 84px;
}

.tower-record-score strong {
  font-size: 18px;
  font-weight: 950;
}

.tower-record-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tower-page .bank-view {
  display: grid;
  gap: 12px;
}

.tower-page .bank-layout {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 0.44fr) minmax(430px, 0.56fr);
  gap: 14px;
}

.tower-page .pc-box {
  overflow: hidden;
  border: 2px solid #b9bed1;
  border-radius: 8px;
  background: #eef1f7;
}

.tower-page .pc-box-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #c9cede;
  background: #dce2ef;
  color: #25344f;
  padding: 9px 12px;
}

.tower-page .box-title {
  display: grid;
  min-width: 0;
  gap: 2px;
  font-weight: 900;
}

.tower-page .box-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-page .box-kicker {
  color: #536278;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-page .summary-panel {
  position: sticky;
  top: 82px;
}

.tower-page .trainer-card {
  min-height: 226px;
}

.tower-page .trainer-line.rating strong {
  color: var(--bank-red-dark);
  font-size: 22px;
  font-weight: 950;
}

.tower-page .pokemon-usage-badge {
  width: 42px;
  height: 42px;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.tower-page .pokemon-usage-badge img {
  width: 36px;
  height: 36px;
}

.tower-page .pokemon-usage-badge.is-empty {
  width: auto;
  height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
}

.tower-page .most-used-list {
  gap: 8px;
}

.tower-page .division-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(36, 75, 134, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: var(--bank-blue-dark);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
  padding: 3px 8px;
  white-space: nowrap;
}

.tower-page .division-pill.bronze {
  border-color: rgba(141, 86, 54, 0.32);
  color: #8d5636;
}

.tower-page .division-pill.silver {
  border-color: rgba(95, 113, 130, 0.32);
  color: #5f7182;
}

.tower-page .division-pill.gold {
  border-color: rgba(157, 108, 19, 0.32);
  background: #fff8e7;
  color: #9d6c13;
}

.tower-page .division-pill.platinum {
  border-color: rgba(32, 127, 115, 0.28);
  background: #eef9f6;
  color: #207f73;
}

.tower-page .division-pill.diamond {
  border-color: rgba(36, 75, 134, 0.28);
  background: #eef5ff;
  color: var(--bank-blue-dark);
}

.tower-page .division-pill.master {
  border-color: rgba(169, 61, 49, 0.3);
  background: #fff2ed;
  color: var(--bank-red-dark);
}

.tower-team-roster-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.team-roster-slot {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid #cfd5e3;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    #f6f0ea;
  color: #25344f;
  padding: 10px;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.team-roster-slot:hover,
.team-roster-slot.selected {
  border-color: var(--bank-blue);
  box-shadow: inset 0 0 0 2px rgba(78, 118, 184, 0.18), 0 10px 20px rgba(71, 45, 34, 0.08);
  transform: translateY(-1px);
}

.team-roster-top,
.team-roster-score {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.team-roster-top strong,
.team-roster-score strong {
  color: var(--text);
  font-weight: 950;
}

.team-roster-top span,
.team-roster-score span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-roster-slot .tower-mini-team {
  gap: 5px;
}

.team-roster-slot .tower-mini-badge {
  padding: 2px;
}

.team-roster-slot .tower-mini-badge span {
  display: none;
}

.tower-team-detail-card {
  border-width: 2px;
  border-color: var(--bank-blue);
  box-shadow: var(--bank-shadow);
}

.tower-team-detail-card.is-hot-streak,
.team-roster-slot.is-hot-streak,
.tower-room-plaque.is-hot-streak {
  border-color: #d6a235;
  box-shadow: 0 0 0 2px rgba(214, 162, 53, 0.22), 0 14px 30px rgba(120, 77, 14, 0.16);
}

.tower-team-detail-card.is-steady-run,
.team-roster-slot.is-steady-run,
.tower-room-plaque.is-steady-run {
  border-color: #4e76b8;
}

.tower-team-detail-card.is-building-run,
.team-roster-slot.is-building-run,
.tower-room-plaque.is-building-run {
  border-color: #9fb0c0;
}

.tower-team-detail-hero {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--bank-line);
  background: var(--bank-paper);
  padding: 14px;
}

.tower-team-detail-title {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.tower-team-detail-title strong {
  overflow: hidden;
  color: var(--bank-blue-dark);
  font-size: 22px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-team-detail-title span:not(.team-state-pill) {
  color: #7d5147;
  font-size: 12px;
  font-weight: 800;
}

.team-state-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(214, 162, 53, 0.36);
  border-radius: 999px;
  background: #fff6dc;
  color: #8a6500;
  font-size: 11px;
  font-weight: 950;
  padding: 2px 8px;
  text-transform: uppercase;
}

.tower-team-rating-seal {
  display: grid;
  min-width: 118px;
  min-height: 82px;
  place-items: center;
  border: 2px solid rgba(168, 77, 59, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: var(--bank-red-dark);
  padding: 10px;
}

.tower-team-rating-seal span {
  align-self: end;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-team-rating-seal strong {
  align-self: start;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
}

.tower-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--bank-line);
  background: #ffffff;
}

.tower-detail-metrics span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-right: 1px solid var(--bank-line);
  padding: 10px 12px;
}

.tower-detail-metrics span:last-child {
  border-right: 0;
}

.tower-detail-metrics small {
  color: #7d5147;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-detail-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-team-detail-party {
  display: grid;
  gap: 0;
  background: #ffffff;
}

.ev-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ev-chip {
  display: inline-flex;
  gap: 3px;
  border: 1px solid #e3eaf0;
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
}

.ev-chip strong {
  color: var(--text);
}

.tower-pokemon-table td.tower-ev-cell {
  overflow: visible;
  white-space: normal;
}

.tower-hall-header {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.tower-hall-title {
  display: grid;
  gap: 2px;
}

.tower-hall-title strong {
  color: var(--text);
  font-size: 28px;
  font-weight: 950;
  line-height: 1.1;
}

.tower-rank-hall {
  display: grid;
  gap: 16px;
}

.tower-rank-wing {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68)),
    #eef4f8;
  padding: 12px;
}

.tower-rank-wing-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tower-rank-wing-head span {
  color: var(--bank-red-dark);
  font-size: 18px;
  font-weight: 950;
}

.tower-rank-wing-head strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tower-rank-room-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 10px;
}

.tower-room-plaque {
  min-height: 190px;
  align-content: start;
  border-width: 2px;
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.94), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(0deg, #ffe8df 0 18px, #fff6ed 18px 36px);
  box-shadow: var(--bank-shadow);
}

.tower-room-plaque.is-hot-streak {
  border-color: #d6a235;
}

.tower-room-plaque.is-steady-run {
  border-color: var(--bank-blue);
}

.tower-room-plaque.is-building-run {
  border-color: #cfd5e3;
}

.tower-room-number {
  color: var(--bank-red-dark);
  font-size: 18px;
  font-weight: 950;
}

.tower-room-champion {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tower-room-champion strong,
.tower-room-champion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-room-champion strong {
  color: var(--bank-blue-dark);
  font-size: 15px;
  font-weight: 950;
}

.tower-room-champion span {
  color: #7d5147;
  font-size: 12px;
  font-weight: 850;
}

.tower-room-card .tower-mini-team {
  min-height: 34px;
}

.tower-room-card .tower-mini-badge {
  padding: 2px;
}

.tower-room-card .tower-mini-badge span {
  display: none;
}

.tower-room-dais .tower-team-card {
  border-width: 2px;
  border-color: var(--bank-blue);
  box-shadow: var(--bank-shadow);
}

.tower-room-page .tower-hall-header {
  align-items: end;
  border-bottom: 1px solid rgba(86, 98, 120, 0.18);
  padding-bottom: 14px;
}

.tower-room-page .tower-hall-header .status-line {
  justify-self: end;
}

.tower-room-page .tower-rank-selector,
.tower-room-page .tower-room-selector,
.tower-room-page .tower-room-stage {
  display: grid;
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tower-rank-carousel {
  display: grid;
  grid-auto-columns: minmax(116px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 8px;
  scroll-snap-type: x proximity;
}

.tower-rank-tab {
  display: grid;
  min-height: 92px;
  align-content: center;
  justify-items: start;
  gap: 2px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  scroll-snap-align: start;
  text-align: left;
}

.tower-rank-tab:hover,
.tower-rank-tab.selected {
  border-color: var(--bank-red);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.54)),
    #ffe8df;
  box-shadow: 0 10px 22px rgba(71, 45, 34, 0.12);
}

.tower-rank-tab span {
  color: #7d5147;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-rank-tab strong {
  color: var(--bank-blue-dark);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.tower-rank-tab small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.tower-rank-tab.is-empty {
  opacity: 0.58;
}

.tower-room-page .tower-room-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 10px;
}

.tower-room-page .tower-room-card {
  min-height: 148px;
  border: 1px solid #d8c5b3;
  box-shadow: none;
  padding: 11px;
}

.tower-room-page .tower-room-card:hover,
.tower-room-page .tower-room-card.selected {
  border-color: var(--bank-red);
  box-shadow: 0 10px 22px rgba(71, 45, 34, 0.12);
}

.tower-room-page .tower-room-plaque {
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.92), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(0deg, #fff0e7 0 18px, #fff8ef 18px 36px);
}

.tower-room-page .tower-room-number {
  font-size: 16px;
}

.tower-room-page .tower-room-stat-grid {
  gap: 6px;
}

.tower-room-data {
  display: grid;
  gap: 16px;
}

.tower-room-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--bank-line);
  border-bottom: 1px solid var(--bank-line);
}

.tower-room-summary-row span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-right: 1px solid var(--bank-line);
  padding: 10px 12px;
}

.tower-room-summary-row span:last-child {
  border-right: 0;
}

.tower-room-summary-row small {
  color: #7d5147;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-room-summary-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-room-data-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 0.65fr);
  gap: 22px;
}

.tower-room-data-list {
  display: grid;
  align-content: start;
}

.tower-room-overview {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 0.8fr);
  align-items: stretch;
  gap: 14px;
}

.room-champion-card {
  min-height: 100%;
}

.room-champion-card .trainer-card-body {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.room-champion-card .trainer-most-used {
  align-self: end;
}

.room-champion-card .tower-mini-badge {
  border-color: rgba(36, 75, 134, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

.tower-room-side-panel,
.tower-room-record-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.tower-room-stat-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--bank-line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.tower-room-stat {
  display: grid;
  min-width: 0;
  gap: 3px;
  border-right: 1px solid var(--bank-line);
  border-bottom: 1px solid var(--bank-line);
  padding: 10px 12px;
}

.tower-room-stat:nth-child(2n) {
  border-right: 0;
}

.tower-room-stat:nth-child(n + 3) {
  border-bottom: 0;
}

.tower-room-stat small {
  color: #7d5147;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-room-stat strong {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-room-stat em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-room-leader-panel {
  display: grid;
  align-content: start;
  gap: 2px;
}

.tower-room-record-panel {
  border-top: 1px solid rgba(86, 98, 120, 0.18);
  padding-top: 14px;
}

.tower-room-team-stack {
  display: grid;
  gap: 0;
}

.tower-room-team-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e1e8ee;
  padding: 11px 0;
}

.tower-room-team-row:last-child {
  border-bottom: 0;
}

.tower-room-team-row.is-champion .tower-room-team-rank {
  border-color: rgba(214, 162, 53, 0.5);
  background: #fff6dc;
  color: #8a6500;
}

.tower-room-team-rank {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.tower-room-list-head {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tower-room-list-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.tower-room-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tower-room-page .tower-record-row,
.tower-room-page .tower-leader-row {
  border: 0;
  border-bottom: 1px solid #e1e8ee;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
}

.tower-room-page .tower-record-row:last-child,
.tower-room-page .tower-leader-row:last-child {
  border-bottom: 0;
}

.tower-room-page .empty {
  border: 0;
  background: transparent;
  padding: 18px 0;
  text-align: left;
}

.tower-rating-page section {
  display: grid;
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tower-rating-hero {
  border-bottom: 1px solid rgba(86, 98, 120, 0.18);
  padding-bottom: 18px;
}

.tower-rating-hero h1 {
  max-width: 860px;
  font-size: clamp(34px, 5vw, 52px);
}

.tower-rating-hero .lead {
  max-width: 780px;
}

.tower-rating-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
  min-width: min(410px, 100%);
}

.tower-rating-summary span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  padding: 12px;
  text-transform: uppercase;
}

.tower-rating-summary strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.tower-term-grid,
.tower-division-grid,
.tower-signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.tower-term-grid article,
.tower-division-grid article,
.tower-signal-grid article {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px 14px;
}

.tower-term-grid.compact article {
  min-height: 116px;
}

.tower-term-grid strong,
.tower-division-grid strong,
.tower-signal-grid strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.tower-term-grid p,
.tower-signal-grid p,
.tower-rating-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.tower-signal-grid span {
  color: var(--bank-red);
  font-size: 11px;
  font-weight: 950;
}

.tower-division-grid article {
  border-left-width: 4px;
}

.tower-division-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.tower-division-grid .bronze {
  border-left-color: #8d5636;
}

.tower-division-grid .silver {
  border-left-color: #7e8d9d;
}

.tower-division-grid .gold {
  border-left-color: #d6a235;
}

.tower-division-grid .platinum {
  border-left-color: #207f73;
}

.tower-division-grid .diamond {
  border-left-color: #4e76b8;
}

.tower-division-grid .master {
  border-left-color: var(--bank-red);
}

.tower-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 8px;
  min-width: min(390px, 100%);
}

.tower-room-page .tower-metrics {
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  min-width: min(520px, 100%);
}

.tower-metrics > div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.08);
  padding: 10px 12px;
}

.tower-metrics span,
.tower-team-head span,
.tower-section-title h2 {
  color: var(--muted);
}

.tower-metrics span {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-metrics strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.tower-filter-head {
  align-items: center;
}

.tower-actions {
  grid-template-columns: minmax(180px, 1fr) 150px 110px auto;
}

.tower-actions input,
.tower-actions select {
  width: 100%;
}

.tower-section-title h2 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.tower-table-wrap {
  overflow-x: auto;
}

.tower-trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 12px;
}

.tower-trainer-card {
  display: grid;
  gap: 0;
  width: 100%;
  min-height: 170px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(0deg, #eaf1f7 0 18px, #f7fbfd 18px 36px);
  color: var(--text);
  padding: 0;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tower-trainer-card:hover,
.tower-trainer-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.1);
  transform: translateY(-1px);
}

.tower-trainer-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
}

.tower-trainer-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.tower-trainer-title strong,
.tower-trainer-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-trainer-title strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.tower-trainer-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tower-trainer-portrait {
  display: grid;
  width: 68px;
  height: 92px;
  place-items: end center;
  justify-self: end;
}

.tower-trainer-portrait img {
  width: 58px;
  max-height: 86px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 4px rgba(30, 42, 36, 0.18));
}

.tower-trainer-fallback {
  display: none;
  width: 54px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-2);
  font-size: 28px;
  font-weight: 950;
}

.tower-trainer-portrait img.is-hidden {
  display: none;
}

.tower-trainer-portrait img.is-hidden + .tower-trainer-fallback {
  display: grid;
}

.tower-trainer-stats,
.tower-team-record {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--surface-3);
}

.tower-trainer-stats span,
.tower-team-record span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-right: 1px solid var(--line);
  padding: 8px;
}

.tower-trainer-stats span:last-child,
.tower-team-record span:last-child {
  border-right: 0;
}

.tower-trainer-stats small,
.tower-team-record small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tower-trainer-stats strong,
.tower-team-record strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-ranking-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.tower-ranking-table th,
.tower-ranking-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.tower-ranking-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tower-ranking-table td {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-ranking-table td:nth-child(1) {
  width: 52px;
}

.tower-ranking-table td:nth-child(2) {
  width: 210px;
}

.tower-ranking-table td strong,
.tower-ranking-table td span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tower-ranking-table td span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tower-rank-number {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #cfd8df;
  border-radius: 50%;
  background: #f8fbfd;
  color: var(--text);
  font-weight: 900;
}

.tower-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr));
  gap: 12px;
}

.tower-team-card {
  align-content: start;
  border-width: 1px;
  border-color: var(--line);
}

.tower-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 11px 12px;
}

.tower-team-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tower-team-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-team-head span {
  font-size: 11px;
  font-weight: 800;
}

.tower-team-score {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 2px;
}

.tower-team-score strong {
  font-size: 18px;
}

.tower-team-members {
  display: grid;
  gap: 0;
}

.tower-member {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.tower-member:last-child {
  border-bottom: 0;
}

.tower-sprite {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid #d9deea;
  border-radius: 8px;
  background: #ffffff;
}

.tower-sprite img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(30, 42, 36, 0.14));
}

.tower-sprite.fallback {
  color: var(--muted);
  font-weight: 900;
}

.tower-member-body {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.tower-member-name {
  display: grid;
  gap: 2px;
}

.tower-member-name span {
  color: var(--muted);
}

.tower-pokemon-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.tower-pokemon-table th,
.tower-pokemon-table td {
  border-top: 1px solid #e3eaf0;
  padding: 5px 0;
  text-align: left;
  vertical-align: middle;
}

.tower-pokemon-table th {
  width: 42px;
  color: var(--muted);
  font-weight: 850;
}

.tower-pokemon-table td {
  overflow: hidden;
  color: var(--text);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-pokemon-table .item-display {
  max-width: 100%;
}

.tower-move-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.tower-empty-line {
  padding: 8px;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .tower-rating-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .mask-control {
    justify-self: start;
  }

}

@media (max-width: 620px) {
  .topbar-inner {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .mobile-discord-link {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: 0;
    width: 42px;
  }

  .menu-toggle {
    display: inline-grid;
    flex: 0 0 auto;
    gap: 4px;
    place-items: center;
    width: 42px;
  }

  nav {
    display: none;
    align-items: stretch;
    flex-direction: column;
    grid-column: 1 / -1;
    width: 100%;
  }

  nav .desktop-discord-link {
    display: none;
  }

  .topbar.nav-open nav {
    display: flex;
  }

  .nav-link,
  input,
  select,
  main button {
    width: 100%;
  }

  .mobile-discord-link {
    width: 42px;
  }

  .actions {
    width: 100%;
  }

  .exchange-actions {
    grid-template-columns: 1fr;
  }

  .actions button {
    width: auto;
  }

  .exchange-actions button,
  .exchange-actions .checkbox-filter {
    width: 100%;
  }

  .pokedex-actions {
    grid-template-columns: 1fr;
  }

  .pokedex-generation-toggle {
    width: 100%;
  }

  .generation-button {
    flex: 1 1 0;
  }

  .mask-control {
    justify-self: stretch;
    min-width: 0;
  }

  .mask-control select {
    min-width: 0;
  }

  .section-head {
    align-items: center;
  }

  .tower-actions {
    grid-template-columns: 1fr;
  }

  .tower-page .museum-toolbar {
    grid-template-columns: 1fr;
  }

  .tower-page .toolbar-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .tower-page .toolbar-actions button,
  .tower-page .toolbar-meta {
    width: 100%;
  }

  .tower-page .trainer-card-body {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .tower-page .trainer-line {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .tower-page .trainer-portrait img {
    width: 68px;
  }

  .tower-page .bank-layout,
  .tower-hall-header {
    grid-template-columns: 1fr;
  }

  .tower-page .summary-panel {
    position: static;
  }

  .tower-page .tower-team-summary {
    display: none;
  }

  .summary-modal {
    padding: 10px;
  }

  .summary-modal-panel {
    max-height: calc(100vh - 20px);
  }

  .tower-team-detail-hero,
  .tower-record-row,
  .tower-leader-row {
    grid-template-columns: 1fr;
  }

  .tower-team-rating-seal {
    width: 100%;
    height: auto;
    grid-template-columns: auto auto;
    justify-content: space-between;
    border-radius: 8px;
    padding: 10px 12px;
  }

  .tower-team-rating-seal span,
  .tower-team-rating-seal strong {
    align-self: center;
  }

  .tower-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tower-detail-metrics span:nth-child(2n) {
    border-right: 0;
  }

  .tower-detail-metrics span:nth-child(n + 3) {
    border-top: 1px solid var(--bank-line);
  }

  .ev-chip.ev-zero {
    display: none;
  }

  .tower-record-row,
  .tower-leader-row {
    grid-template-columns: 1fr;
  }

  .tower-record-score {
    justify-items: start;
  }

  .tower-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tower-room-page .tower-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tower-room-page .tower-hall-header .status-line {
    justify-self: start;
  }

  .tower-rank-carousel {
    grid-auto-columns: minmax(96px, 38vw);
  }

  .tower-rank-tab {
    min-height: 78px;
  }

  .tower-room-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tower-room-summary-row span:nth-child(2n) {
    border-right: 0;
  }

  .tower-room-summary-row span:nth-child(n + 3) {
    border-top: 1px solid var(--bank-line);
  }

  .tower-room-data-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tower-room-overview {
    grid-template-columns: 1fr;
  }

  .room-champion-card .trainer-card-body {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .tower-room-team-row {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
  }

  .tower-room-team-row .tower-record-score {
    grid-column: 2;
    justify-items: start;
  }

  .tower-trainer-top {
    grid-template-columns: auto minmax(0, 1fr) 58px;
  }

  .tower-trainer-portrait {
    width: 54px;
    height: 72px;
  }

  .tower-trainer-portrait img {
    width: 48px;
    max-height: 68px;
  }

  .tower-trainer-stats,
  .tower-team-record {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tower-trainer-stats span:nth-child(2n),
  .tower-team-record span:nth-child(2n) {
    border-right: 0;
  }

  .tower-trainer-stats span:nth-child(n + 3),
  .tower-team-record span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .tower-member {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .tower-sprite {
    width: 68px;
    height: 68px;
  }

  .tower-sprite img {
    width: 64px;
    height: 64px;
  }
}
