* {
  box-sizing: border-box;
}

:root {
  --bg: #0f1113;
  --surface: #1a1d21;
  --surface-strong: #0f1113;
  --surface-soft: #15181c;
  --text: #e6e9ed;
  --muted: #a0a7af;
  --line: #3a3f45;
  --line-strong: #3a3f45;
  --accent: #39ff14;
  --accent-dark: #1fa30b;
  --success: #39ff14;
  --accent-rgb: 57, 255, 20;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --section-gap: 18px;
  --subsection-gap: 14px;
  --animal-card-ratio: 3 / 5;
  --animal-card-width: 100%;
  --animal-card-height: auto;
  --animal-card-zoom-width: 350px;
  --animal-card-zoom-height: 584px;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #17191c 0%, #101214 42%, #0f1113 100%);
  color: var(--text);
}

h1,
h2,
h3 {
  line-height: 1.08;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.app {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: var(--section-gap);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
}

.page-header p {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ruby-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 48, 64, 0.34);
  border-radius: 999px;
  background: rgba(255, 48, 64, 0.1);
  color: var(--text);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 0 18px rgba(255, 48, 64, 0.18);
}

.ruby-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  transform: rotate(45deg);
  border: 1px solid rgba(255, 188, 194, 0.8);
  background: linear-gradient(135deg, #ff8a94 0%, #ff3040 45%, #8f0f1d 100%);
  box-shadow: 0 0 12px rgba(255, 48, 64, 0.7);
}

.highlight-color-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.color-swatch {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 2px solid rgba(230, 233, 237, 0.2);
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: 0 0 16px rgba(var(--swatch-rgb), 0.3);
}

.color-swatch:hover,
.color-swatch.is-active {
  border-color: var(--text);
  background: var(--swatch-color);
  box-shadow: 0 0 22px rgba(var(--swatch-rgb), 0.52);
}

.color-swatch--pink {
  --swatch-color: #ff4fd8;
  --swatch-rgb: 255, 79, 216;
}

.color-swatch--yellow {
  --swatch-color: #f5ff00;
  --swatch-rgb: 245, 255, 0;
}

.color-swatch--red {
  --swatch-color: #ff3040;
  --swatch-rgb: 255, 48, 64;
}

.color-swatch--green {
  --swatch-color: #39ff14;
  --swatch-rgb: 57, 255, 20;
}

.color-swatch--blue {
  --swatch-color: #2af5ff;
  --swatch-rgb: 42, 245, 255;
}

.dashboard {
  display: grid;
  gap: var(--section-gap);
}

.dashboard-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--section-gap);
  align-items: start;
}

.panel,
.profile-hero {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.profile-hero {
  padding: 24px;
  background: linear-gradient(135deg, #1c1f23, #111315);
  color: var(--text);
}

.profile-shell {
  display: grid;
  gap: var(--subsection-gap);
}

.auth-shell {
  display: grid;
  gap: 14px;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.auth-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.auth-panel-start {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 20, 23, 0.78);
}

.auth-copy,
.auth-form-copy {
  display: grid;
  gap: 8px;
}

.auth-lead,
.auth-form-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-actions {
  align-items: stretch;
}

.auth-restore-row {
  display: flex;
  justify-content: flex-end;
}

.auth-shell.is-authenticated .auth-grid,
.auth-shell.is-authenticated .auth-restore-row {
  display: none;
}

.login-form {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 20, 23, 0.78);
}

.profile-hero .panel-head {
  align-items: start;
}

.profile-hero .panel-head > div {
  min-width: 0;
}

.profile-hero #logout-button {
  justify-self: end;
  align-self: start;
}

.profile-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 6px;
}

.profile-top h2 {
  margin: 4px 0 6px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.profile-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.profile-identity {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-subline {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 100%;
}

.profile-subline span {
  position: static;
}

.secret-code-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.secret-code-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.secret-code-button:hover {
  background: transparent;
  color: var(--text);
}

.secret-code-value.is-blurred {
  filter: blur(5px);
  user-select: none;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-groups {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.profile-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-group-collapsible {
  margin: 0;
}

.profile-group-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-group-title {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  font-size: 0.86rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.profile-chip-action {
  cursor: pointer;
}

.profile-chip-action:hover {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
}

.profile-chip.is-positive {
  background: rgba(var(--accent-rgb), 0.16);
}

.profile-chip.is-warning {
  background: rgba(31, 163, 11, 0.2);
}

.profile-chip.is-danger {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.profile-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #fecaca;
  font-size: 0.9rem;
}

.hero-note {
  color: var(--muted);
}

#account-box {
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: var(--subsection-gap);
}

.panel-head.compact {
  margin-bottom: var(--subsection-gap);
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
}

.panel-heading-button {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-transform: none;
  text-align: left;
}

.profile-hero input,
.profile-hero select {
  background: #111417;
  color: var(--text);
}

.profile-hero .ghost-button {
  color: var(--text);
  border-color: var(--line);
}

.profile-hero .ghost-button:hover {
  background: rgba(var(--accent-rgb), 0.08);
}

.actions,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-form,
.search-form,
label {
  display: grid;
  gap: 8px;
}

.login-form,
.search-form {
  margin-bottom: 14px;
}

.search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.search-inline-field {
  min-width: 0;
}

input,
select,
button {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
}

button {
  border-color: transparent;
  background: var(--accent);
  color: #0f1113;
  font-weight: 700;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-dark);
  color: var(--text);
}

button.secondary-button {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

button.secondary-button:hover {
  background: #20242a;
}

button.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.success-button {
  background: var(--success);
  color: #0f1113;
}

button.is-active-toggle {
  cursor: default;
}

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

.info-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
  white-space: pre-wrap;
}

.section-copy {
  color: var(--muted);
  margin-bottom: var(--subsection-gap);
}

.stacked-sections {
  display: grid;
  gap: var(--subsection-gap);
}

.subsection {
  display: grid;
  gap: 10px;
}

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

.subsection + .subsection {
  padding-top: var(--subsection-gap);
  border-top: 1px solid var(--line);
}

.collection-section {
  padding-top: 0;
  border-top-color: transparent;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    grid-template-rows 320ms ease,
    opacity 220ms ease,
    transform 320ms ease,
    padding-top 320ms ease,
    border-top-color 320ms ease;
}

.collection-section.is-open {
  padding-top: var(--subsection-gap);
  border-top-color: var(--line);
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.collection-section-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
}

.collection-toggle-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.header-shop-button {
  min-height: 34px;
  padding: 7px 12px;
}

.shop-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  padding: 24px;
  place-items: center;
}

.shop-modal.is-active {
  display: grid;
}

.shop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 7, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.shop-window {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(82vh, 860px);
  overflow: auto;
  padding: var(--view-panel-padding, 14px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #1a1d21, #111315);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.shop-box {
  display: grid;
  gap: 14px;
}

.shop-feature {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 48, 64, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 48, 64, 0.14), rgba(17, 20, 23, 0.8)),
    #15181c;
}

.shop-feature h3 {
  margin: 0;
  font-size: 1rem;
}

.shop-feature p {
  margin: 6px 0 0;
  max-width: 62ch;
}

.shop-kicker {
  margin-bottom: 6px;
  color: #ff9aa3;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shop-buy {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.shop-price {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
  gap: 18px 14px;
}

.shop-item {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.shop-card-wrap {
  position: relative;
  min-width: 0;
}

.price-sticker {
  position: absolute;
  top: 10px;
  right: 8px;
  z-index: 3;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffb8f, #ffcb3d);
  color: #1c1504;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(4deg);
  pointer-events: none;
}

.team-pagination {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 10px;
}

.team-pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(230, 233, 237, 0.24);
  transition: transform 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.team-pagination-dot.is-active {
  background: rgba(230, 233, 237, 0.96);
  transform: scale(1.15);
}

.subsection-title {
  margin: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}

.team-grid,
.collection-grid {
  display: grid;
  gap: 14px;
}

.team-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  justify-content: stretch;
  overflow: visible;
  scroll-snap-type: none;
  padding-bottom: 6px;
}

.collection-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
}

.team-grid > .card,
.collection-grid > .card,
.card-shell > .card,
.shop-card-wrap > .card {
  width: 100%;
  height: auto;
  aspect-ratio: var(--animal-card-ratio);
}

.card-shell {
  display: grid;
  gap: 8px;
  align-content: start;
  width: 100%;
  min-width: 0;
}

.card-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 42px;
}

.card-context-bar button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-context-bar--shop {
  grid-template-columns: 1fr;
}

.card-context-status {
  min-height: 18px;
  text-align: center;
}

.team-grid > .card,
.team-grid > .card-shell {
  scroll-snap-align: start;
}

.card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #1d2025, #171a1e);
  height: 100%;
  container-type: inline-size;
}

.card.is-flippable {
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 1200px;
  cursor: pointer;
}

.card-inner {
  display: grid;
  min-height: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 420ms ease;
}

.card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  grid-area: 1 / 1;
  position: relative;
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto auto auto 1fr auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #1d2025, #171a1e);
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  height: 100%;
  isolation: isolate;
}

.card-front {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

.card-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  grid-template-rows: 1fr;
  align-content: stretch;
}

.card-back-copy {
  display: grid;
  gap: 10px;
  height: 100%;
  align-content: start;
}

.card-back-head {
  display: grid;
  gap: 3px;
}

.card-back-id {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-back-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.beast-card .card-back-copy {
  grid-template-rows: minmax(0, var(--card-head-size)) minmax(0, 1fr) auto;
  overflow: hidden;
}

.beast-card .card-back-copy p {
  overflow: hidden;
}

.card-back-meta {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(58, 63, 69, 0.78);
}

.card-back-meta span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-back-meta strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.3;
}

.card.is-attacker .card-face {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: 0 14px 30px rgba(var(--accent-rgb), 0.14);
  animation: attacker-pulse 3.6s ease-in-out infinite;
}

@keyframes attacker-pulse {
  0%,
  100% {
    border-color: rgba(var(--accent-rgb), 0.58);
    box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.1);
  }

  50% {
    border-color: rgba(var(--accent-rgb), 0.82);
    box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.is-attacker .card-face {
    animation: none;
  }

  .card-inner {
    transition: none;
  }
}

.card.is-empty {
  justify-items: start;
  align-content: start;
  min-height: 180px;
  background: repeating-linear-gradient(
    135deg,
    rgba(58, 63, 69, 0.45),
    rgba(58, 63, 69, 0.45) 16px,
    rgba(21, 24, 28, 0.95) 16px,
    rgba(21, 24, 28, 0.95) 32px
  );
}

.team-grid > .card.is-empty,
.collection-grid > .card.is-empty {
  min-height: 0;
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.beast-card {
  --card-pad: 10px;
  --card-gap: 8px;
  --card-head-size: 0.14fr;
  --card-art-size: 0.56fr;
  --card-stats-size: 0.16fr;
  --card-copy-size: 0.2fr;
  --rarity-rgb: 160, 167, 175;
  --rarity-soft: rgba(var(--rarity-rgb), 0.13);
  --rarity-line: rgba(var(--rarity-rgb), 0.5);
}

.beast-card .card-face {
  padding: var(--card-pad);
  gap: var(--card-gap);
  border-color: var(--rarity-line);
  background:
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.13), transparent 34%),
    linear-gradient(180deg, #20242a, #101316);
  box-shadow: inset 0 0 24px rgba(var(--rarity-rgb), 0.08);
}

.beast-card .card-face::before,
.beast-card .card-face::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.beast-card .card-face::before {
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  inset: 7px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) top left / 28px 1px no-repeat,
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) top left / 1px 28px no-repeat,
    linear-gradient(90deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) top right / 28px 1px no-repeat,
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) top right / 1px 28px no-repeat,
    linear-gradient(90deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) bottom left / 28px 1px no-repeat,
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) bottom left / 1px 28px no-repeat,
    linear-gradient(90deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) bottom right / 28px 1px no-repeat,
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.42), rgba(var(--rarity-rgb), 0.42)) bottom right / 1px 28px no-repeat;
  opacity: 0.74;
}

.beast-card .card-face::after {
  top: 9px;
  right: 9px;
  bottom: 9px;
  left: 9px;
  inset: 9px;
  border-radius: 4px;
  opacity: 0.72;
}

.beast-card .card-face > * {
  position: relative;
  z-index: 1;
}

.beast-card .card-front {
  grid-template-rows:
    minmax(0, var(--card-head-size))
    minmax(0, var(--card-art-size))
    minmax(0, var(--card-stats-size))
    minmax(0, var(--card-copy-size));
}

.beast-card .card-front::after {
  background:
    repeating-linear-gradient(135deg, rgba(var(--rarity-rgb), 0.08) 0, rgba(var(--rarity-rgb), 0.08) 1px, transparent 1px, transparent 13px),
    repeating-linear-gradient(90deg, transparent 0, transparent 28px, rgba(255, 255, 255, 0.03) 28px, rgba(255, 255, 255, 0.03) 29px),
    radial-gradient(circle at 18% 14%, rgba(var(--rarity-rgb), 0.18), transparent 18%),
    radial-gradient(circle at 86% 82%, rgba(var(--rarity-rgb), 0.12), transparent 20%);
}

.beast-card .card-back {
  grid-template-rows: 1fr;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--rarity-rgb), 0.22), transparent 28%),
    linear-gradient(180deg, #20242a, #0f1215);
}

.beast-card .card-back::after {
  opacity: 0.88;
  background:
    radial-gradient(circle at 50% 50%, transparent 0, transparent 24%, rgba(var(--rarity-rgb), 0.16) 25%, transparent 27%, transparent 100%),
    repeating-linear-gradient(45deg, rgba(var(--rarity-rgb), 0.08) 0, rgba(var(--rarity-rgb), 0.08) 2px, transparent 2px, transparent 15px),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 12px);
}

.beast-card .card-top {
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.beast-card .card-top h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rarity-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 0;
}

.rarity-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: #252930;
  color: #d8dde5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.rarity-text {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rarity-rare .rarity-icon {
  background: linear-gradient(180deg, #1d4f7a, #182f4c);
  color: #70d7ff;
}

.rarity-epic .rarity-icon {
  background: linear-gradient(180deg, #6736a2, #37205c);
  color: #e7bdff;
}

.rarity-legendary .rarity-icon {
  background: linear-gradient(180deg, #b86a18, #523114);
  color: #ffe08a;
}

.rarity-common {
  --rarity-rgb: 160, 167, 175;
}

.rarity-rare {
  --rarity-rgb: 83, 194, 255;
}

.rarity-epic {
  --rarity-rgb: 197, 118, 255;
}

.rarity-legendary {
  --rarity-rgb: 255, 198, 83;
}

.beast-card.rarity-rare .card-face {
  border-color: rgba(83, 194, 255, 0.56);
}

.beast-card.rarity-epic .card-face {
  border-color: rgba(197, 118, 255, 0.58);
}

.beast-card.rarity-legendary .card-face {
  border-color: rgba(255, 198, 83, 0.68);
}

.card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: #20242a;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
}

.badge.accent {
  background: #20242a;
  color: var(--text);
}

.badge.success {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--success);
}

.card-art-placeholder {
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1px solid rgba(58, 63, 69, 0.9);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(34, 38, 43, 0.9), rgba(24, 27, 31, 0.98));
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-art {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  max-height: 42cqw;
  border: 1px solid rgba(58, 63, 69, 0.9);
  border-radius: 14px;
  overflow: hidden;
  background: #111417;
}

.beast-card .card-art,
.beast-card .card-art-placeholder {
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  border-color: rgba(var(--rarity-rgb), 0.38);
  background:
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.14), rgba(17, 20, 23, 0.98)),
    #111417;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 14px rgba(var(--rarity-rgb), 0.08);
}

.card-art-media {
  position: relative;
}

.card-art-image,
.card-art-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-art-video {
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.card-art-media.is-playing .card-art-video {
  opacity: 1;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.beast-card .card-stats {
  height: 100%;
}

.card-stats div {
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--surface-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.card-stat {
  align-items: center;
}

.card-stats strong {
  font-size: 0.92rem;
  line-height: 1;
}

.card-stats-primary div {
  min-height: 0;
  height: 100%;
  padding: 8px 9px;
  align-items: center;
  border: 1px solid rgba(var(--rarity-rgb), 0.2);
  background:
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.1), transparent),
    var(--surface-soft);
}

.card-stats-primary strong {
  font-size: 1.08rem;
}

.stat-symbol {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(var(--rarity-rgb), 0.28);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(var(--rarity-rgb), 0.14), rgba(255, 255, 255, 0.025)),
    rgba(8, 10, 12, 0.52);
  box-shadow: inset 0 0 8px rgba(var(--rarity-rgb), 0.08);
}

.stat-symbol::before,
.stat-symbol::after {
  content: "";
  position: absolute;
  display: block;
  background: currentColor;
}

.stat-symbol-attack {
  color: #ff727d;
}

.stat-symbol-attack::before {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(-38deg);
  box-shadow:
    0 -5px 0 currentColor,
    0 5px 0 currentColor;
}

.stat-symbol-attack::after {
  width: 5px;
  height: 5px;
  right: 4px;
  bottom: 4px;
  border-radius: 1px;
  transform: rotate(45deg);
  opacity: 0.7;
}

.stat-symbol-health {
  color: #61f58c;
  border-radius: 999px;
}

.stat-symbol-health::before {
  width: 12px;
  height: 3px;
  border-radius: 999px;
}

.stat-symbol-health::after {
  width: 3px;
  height: 12px;
  border-radius: 999px;
}

.small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.card-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-blurb {
  display: -webkit-box;
  min-height: 0;
  max-height: 100%;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-actions {
  gap: 6px;
}

.card-actions button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.2;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-preview-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  overflow: auto;
}

.card-preview-modal.is-active {
  display: grid;
}

body.is-card-preview-open {
  overflow: hidden;
}

.card-preview-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  background: rgba(2, 4, 6, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card-preview-window {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 10px;
  width: var(--animal-card-zoom-width);
  perspective: 1100px;
  animation: card-preview-pop 180ms ease-out;
}

.card-preview-close {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 20, 23, 0.94);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.card-preview-card {
  --preview-tilt-x: 0deg;
  --preview-tilt-y: 0deg;
  --preview-glow-x: 50%;
  --preview-glow-y: 42%;
  position: relative;
  width: var(--animal-card-zoom-width);
  isolation: isolate;
  transform: rotateX(var(--preview-tilt-x)) rotateY(var(--preview-tilt-y)) translate3d(0, 0, 0);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 150ms ease, filter 150ms ease;
  will-change: transform;
  filter:
    drop-shadow(0 18px 34px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 18px rgba(var(--rarity-rgb), 0.18));
}

.card-preview-card::before,
.card-preview-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.card-preview-card::before {
  top: -18px;
  right: -18px;
  bottom: -18px;
  left: -18px;
  inset: -18px;
  z-index: -1;
  border-radius: 24px;
  background: radial-gradient(circle at var(--preview-glow-x) var(--preview-glow-y), rgba(var(--rarity-rgb), 0.32), transparent 48%);
  opacity: 0.7;
}

.card-preview-card::after {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 2;
  border-radius: 10px;
  background:
    radial-gradient(circle at var(--preview-glow-x) var(--preview-glow-y), rgba(255, 255, 255, 0.18), transparent 25%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 32%, rgba(var(--rarity-rgb), 0.1) 78%, transparent);
  opacity: 0.24;
}

.card-preview-card > .card {
  position: relative;
  z-index: 1;
  width: 100%;
  height: var(--animal-card-zoom-height);
  aspect-ratio: auto;
}

.card-preview-card .beast-card {
  --card-pad: 16px;
  --card-gap: 10px;
  --card-head-size: 48px;
  --card-art-size: 268px;
  --card-stats-size: 58px;
  --card-copy-size: 146px;
}

.card-preview-card .beast-card .card-face {
  box-shadow:
    inset 0 0 24px rgba(var(--rarity-rgb), 0.1),
    0 0 22px rgba(var(--rarity-rgb), 0.14);
}

.card-preview-card .card h3 {
  font-size: 1.24rem;
}

.card-preview-card .rarity-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 1.08rem;
}

.card-preview-card .rarity-text {
  font-size: 0.68rem;
}

.card-preview-card .card-stats-primary strong {
  font-size: 1.34rem;
}

.card-preview-card .stat-symbol {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.card-preview-card .stat-symbol-attack::before {
  width: 18px;
}

.card-preview-card .stat-symbol-health::before {
  width: 15px;
}

.card-preview-card .stat-symbol-health::after {
  height: 15px;
}

.card-preview-card .card-blurb {
  font-size: 1rem;
  line-height: 1.42;
  -webkit-line-clamp: 4;
}

.card-preview-card .card-back-copy p {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes card-preview-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.list-item .inline-actions button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  line-height: 1.2;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.incoming-battle-card {
  animation: incoming-battle-pulse 3.8s ease-in-out infinite;
}

@keyframes incoming-battle-pulse {
  0%,
  100% {
    border-color: rgba(var(--accent-rgb), 0.22);
    background: rgba(var(--accent-rgb), 0.04);
    box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  }

  50% {
    border-color: rgba(var(--accent-rgb), 0.5);
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.12), 0 10px 24px rgba(var(--accent-rgb), 0.08);
  }
}

.opponent-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.opponent-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item h3 {
  margin: 0;
  font-size: 1rem;
}

.opponent-actions {
  align-items: center;
}

.opponent-actions button:first-child:not(:only-child) {
  margin-right: auto;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.event-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.event-overlay.is-active {
  pointer-events: auto;
}

body.is-overlay-active {
  overflow: hidden;
}

.event-overlay-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.event-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 11, 0.64);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.event-panel {
  position: relative;
  width: min(100%, 620px);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(22, 25, 29, 0.96), rgba(13, 15, 18, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.event-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-panel {
  align-self: start;
  margin-top: min(10vh, 88px);
  width: min(100%, 560px);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.intro-panel h2,
.reward-panel h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.intro-panel p,
.reward-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.starter-reveal-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 20px 10px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(var(--accent-rgb), 0.14), transparent 55%),
    linear-gradient(180deg, rgba(24, 28, 32, 0.96), rgba(14, 16, 19, 0.98));
}

.starter-reveal-stage::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 45%);
  opacity: 0.9;
}

.starter-reveal-stage.is-revealing::after {
  content: "";
  position: absolute;
  inset: -20% 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateY(-120%);
  animation: reward-scan 1.2s ease 1;
}

.starter-reveal-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: end;
  padding: 0 8px;
}

.starter-reveal-card {
  width: clamp(112px, 16vw, 148px);
  aspect-ratio: var(--animal-card-ratio);
  margin-inline: -16px;
  transform: translateX(var(--starter-shift)) rotate(var(--starter-angle));
  transform-origin: center bottom;
  z-index: 1;
}

.starter-reveal-card:nth-child(3) {
  z-index: 3;
}

.starter-reveal-card:nth-child(2),
.starter-reveal-card:nth-child(4) {
  z-index: 2;
}

.starter-reveal-card .card-inner {
  transition: transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.starter-reveal-card.is-revealing .card-inner {
  animation: starter-reveal-flip 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--starter-delay, 0ms);
}

@keyframes starter-reveal-flip {
  0% {
    transform: rotateY(180deg);
  }

  100% {
    transform: rotateY(0deg);
  }
}

.starter-reveal-card.is-starter-lead .card-face {
  border-color: rgba(var(--accent-rgb), 0.72);
  box-shadow: 0 16px 38px rgba(var(--accent-rgb), 0.18);
  animation: attacker-pulse 2.4s ease-in-out infinite;
}

.intro-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
  font-size: 0.84rem;
}

.intro-status.is-ready {
  background: rgba(var(--accent-rgb), 0.14);
}

.reward-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.reward-panel--common {
  border-color: rgba(var(--accent-rgb), 0.18);
}

.reward-panel--rare {
  border-color: rgba(68, 211, 255, 0.28);
}

.reward-panel--epic {
  border-color: rgba(255, 176, 92, 0.32);
}

.reward-panel--legendary {
  border-color: rgba(255, 225, 107, 0.4);
}

.reward-copy {
  display: grid;
  gap: 10px;
}

.reward-reveal-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(var(--accent-rgb), 0.14), transparent 55%),
    linear-gradient(180deg, rgba(24, 28, 32, 0.96), rgba(14, 16, 19, 0.98));
}

.reward-reveal-stage::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 45%);
  opacity: 0.9;
}

.rarity-rare .reward-reveal-stage::before {
  background: radial-gradient(circle, rgba(68, 211, 255, 0.22), transparent 45%);
}

.rarity-epic .reward-reveal-stage::before {
  background: radial-gradient(circle, rgba(255, 176, 92, 0.24), transparent 45%);
}

.rarity-legendary .reward-reveal-stage::before {
  background: radial-gradient(circle, rgba(255, 225, 107, 0.32), transparent 42%);
}

.reward-reveal-stage::after {
  content: "";
  position: absolute;
  inset: -20% 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateY(-120%);
  animation: reward-scan 1.2s ease 1;
}

@keyframes reward-scan {
  0% {
    transform: translateY(-120%);
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  100% {
    transform: translateY(120%);
    opacity: 0;
  }
}

.reward-reveal-card {
  position: relative;
  width: min(100%, var(--animal-card-zoom-width));
  aspect-ratio: var(--animal-card-ratio);
  z-index: 1;
}

.reward-reveal-card .card-inner {
  transition: transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reward-reveal-card-back {
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at top, rgba(var(--accent-rgb), 0.15), transparent 55%),
    linear-gradient(180deg, #182025, #101419);
}

.reward-reveal-emblem {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reward-reveal-rarity {
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-reveal-grid {
  width: 72%;
  height: 72%;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  background:
    linear-gradient(rgba(var(--accent-rgb), 0.1), rgba(var(--accent-rgb), 0.02)),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(var(--accent-rgb), 0.08) 18px,
      rgba(var(--accent-rgb), 0.08) 19px
    ),
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 18px,
      rgba(var(--accent-rgb), 0.08) 18px,
      rgba(var(--accent-rgb), 0.08) 19px
    );
}

.reward-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reward-actions button {
  flex: 1 1 0;
}

.toast-viewport {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(58, 63, 69, 0.9);
  border-radius: 18px;
  background: rgba(17, 20, 23, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.toast--success {
  border-color: rgba(var(--accent-rgb), 0.28);
}

.toast--error {
  border-color: rgba(248, 113, 113, 0.34);
}

.toast--info {
  border-color: rgba(68, 211, 255, 0.2);
}

.toast-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.toast-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast-message {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.toast-close {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1;
}

.toast-close:hover {
  background: transparent;
  color: var(--text);
}

.toast-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.toast-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  animation: toast-progress var(--toast-duration, 4200ms) linear forwards;
}

.toast--success .toast-progress span {
  background: rgba(var(--accent-rgb), 0.72);
}

.toast--error .toast-progress span {
  background: rgba(248, 113, 113, 0.78);
}

.toast--info .toast-progress span {
  background: rgba(68, 211, 255, 0.72);
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (max-width: 760px) {
  :root {
    --section-gap: 14px;
    --subsection-gap: 12px;
  }

  h1,
  h2,
  h3,
  .subsection-title,
  .panel-heading-button,
  button,
  .profile-chip,
  .badge,
  .opponent-meta,
  .card-source {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body {
    font-size: 15px;
  }

  .app {
    padding: 12px;
  }

  .page-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .page-header h1 {
    margin-bottom: 0;
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .page-header p {
    max-width: none;
    font-size: 0.95rem;
  }

  .highlight-color-picker {
    justify-content: flex-start;
  }

  .shop-modal {
    padding: 10px;
    align-items: stretch;
  }

  .shop-window {
    max-height: calc(100vh - 20px);
    border-radius: 16px;
    padding: 14px;
  }

  .shop-feature {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .shop-feature {
    display: grid;
  }

  .shop-buy {
    justify-items: stretch;
  }

  .panel,
  .profile-hero {
    border-radius: 18px;
  }

  .panel {
    padding: 14px;
  }

  .profile-hero {
    padding: 16px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mobile-panel[data-panel="battles"] {
    order: 1;
  }

  .mobile-panel[data-panel="opponents"] {
    order: 2;
  }

  .mobile-panel[data-panel="history"] {
    order: 3;
  }

  .panel-head,
  .profile-top {
    grid-template-columns: 1fr;
    display: grid;
    gap: 10px;
  }

  .profile-hero .panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .profile-inline {
    display: grid;
    gap: 12px;
  }

  .profile-top h2,
  .panel-head h2,
  .panel-heading-button {
    font-size: 1.15rem;
  }

  .profile-groups,
  .profile-group {
    justify-items: start;
  }

  .profile-group {
    display: grid;
    gap: 6px;
    justify-items: start;
  }

  .profile-group-collapsible .profile-group-title,
  .profile-group-collapsible .profile-meta {
    display: none;
  }

  .profile-group-collapsible.is-open .profile-group-title,
  .profile-group-collapsible.is-open .profile-meta {
    display: flex;
  }

  .profile-group-collapsible.is-open .profile-group-title {
    display: block;
  }

  .profile-group-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .profile-group-summary::after {
    content: "+";
    color: var(--text);
  }

  .profile-group-collapsible.is-open .profile-group-summary::after {
    content: "−";
  }

  .profile-subline,
  .profile-meta.single-row {
    overflow: visible;
    white-space: normal;
  }

  .profile-subline span:not(:last-child)::after {
    content: "";
    margin: 0;
  }

  .profile-chip,
  .badge {
    line-height: 1.3;
  }

  .panel-head.compact {
    margin-bottom: 0;
  }

  .mobile-panel .mobile-panel-body,
  .mobile-panel.is-open .mobile-panel-body {
    display: grid;
    padding-top: 12px;
  }

  .mobile-panel {
    background: linear-gradient(180deg, #1a1d21, #14181b);
  }

  .actions,
  .inline-actions {
    flex-direction: column;
  }

  .toast-viewport {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .toast {
    border-radius: 16px;
  }

  .event-overlay-shell {
    padding: 14px;
  }

  .event-overlay--fullscreen .event-overlay-shell {
    place-items: stretch;
    padding: 0;
    overflow-y: auto;
  }

  .event-overlay--fullscreen .event-overlay-backdrop {
    background: rgba(8, 10, 11, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .event-overlay--fullscreen .event-panel {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .event-overlay--fullscreen .intro-panel,
  .event-overlay--fullscreen .reward-panel {
    align-self: stretch;
    margin-top: 0;
    padding: 18px 16px 24px;
  }

  .event-overlay--fullscreen .reward-panel {
    grid-template-rows: auto 1fr auto;
  }

  .event-overlay--fullscreen .starter-reveal-stage,
  .event-overlay--fullscreen .reward-reveal-stage {
    min-height: 320px;
    min-height: min(54dvh, 440px);
  }

  .event-overlay--fullscreen .starter-reveal-stage {
    padding-inline: 0;
  }

  .event-overlay--fullscreen .starter-reveal-card {
    width: clamp(96px, 22vw, 128px);
  }

  .event-overlay--fullscreen .reward-actions,
  .event-overlay--fullscreen .intro-panel .inline-actions {
    margin-top: auto;
  }

  .intro-panel {
    margin-top: 18px;
  }

  .reward-panel,
  .intro-panel {
    border-radius: 18px;
  }

  .starter-reveal-stage {
    min-height: 248px;
    padding: 14px 0;
  }

  .starter-reveal-card {
    width: clamp(84px, 18vw, 112px);
    margin-inline: -12px;
  }

  .reward-panel {
    padding: 16px;
  }

  .reward-reveal-stage {
    padding: 12px;
  }

  .reward-actions {
    flex-direction: column;
  }

  .auth-shell {
    gap: 12px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .auth-panel-start {
    padding: 14px;
    border-radius: 16px;
  }

  .auth-restore-row {
    justify-content: stretch;
  }

  .auth-restore-row button {
    width: 100%;
  }

  .login-form {
    padding: 14px;
    border-radius: 16px;
  }

  .actions button,
  .inline-actions button,
  .search-inline button,
  .collection-toggle-row button,
  .subsection-head .ghost-button,
  .reward-actions button {
    width: 100%;
  }

  .subsection-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-inline {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  input,
  select,
  button {
    min-height: 48px;
  }

  .team-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 12px;
    overflow: visible;
    scroll-snap-type: none;
    padding-right: 0;
    padding-bottom: 6px;
  }

  .collection-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
  }

  .team-pagination {
    display: flex;
    margin-top: 4px;
  }

  .team-grid > .card,
  .team-grid > .card-shell {
    width: 100%;
    scroll-snap-align: none;
  }

  .collection-grid > .card,
  .collection-grid > .card-shell {
    width: 100%;
  }

  .card,
  .card-face {
    gap: 12px;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions button,
  .card-context-bar button,
  .list-item .inline-actions button {
    width: 100%;
  }

  .card-stats {
    grid-template-columns: 1fr;
  }

  .list-item {
    gap: 10px;
  }

  .opponent-actions {
    align-items: stretch;
  }

  .opponent-actions button:first-child:not(:only-child) {
    margin-right: 0;
  }
}

@media (min-width: 761px) {
  .profile-group-collapsible {
    display: flex;
  }

  .mobile-panel .mobile-panel-body {
    display: grid;
  }

  .profile-group-summary {
    display: none;
  }

  .profile-group-collapsible .profile-group-title,
  .profile-group-collapsible .profile-meta {
    display: flex;
  }

  .profile-group-collapsible .profile-group-title {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .starter-reveal-card.is-revealing .card-inner,
  .reward-reveal-card .card-inner,
  .event-overlay-backdrop,
  .reward-reveal-stage::after,
  .starter-reveal-stage.is-revealing::after,
  .card-preview-card,
  .starter-reveal-card.is-starter-lead .card-face {
    transition: none;
    animation: none;
  }

  .card-preview-card {
    transform: none;
  }
}

/* Simplified game-first interface */
:root {
  --bg: #0b0d0f;
  --surface: #15181b;
  --surface-strong: #0d1012;
  --surface-soft: #101316;
  --text: #f1f4f6;
  --muted: #9ca6ae;
  --line: rgba(241, 244, 246, 0.12);
  --line-strong: rgba(241, 244, 246, 0.2);
  --shadow: none;
  --section-gap: 12px;
  --subsection-gap: 12px;
  --animal-card-width: 100%;
  --animal-card-height: auto;
  --animal-card-zoom-width: 350px;
  --animal-card-zoom-height: 584px;
  --view-panel-padding: 14px;
  --view-panel-padding: clamp(12px, 1.8vw, 16px);
  --view-head-height: 40px;
  --header-control-height: 42px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -8%, rgba(var(--accent-rgb), 0.14), transparent 34rem),
    linear-gradient(180deg, #111417 0%, var(--bg) 48%, #08090a 100%);
}

body.is-shop-open {
  overflow: hidden;
}

.app {
  max-width: 1180px;
  padding: 18px;
  padding: clamp(14px, 2.2vw, 24px);
  gap: 12px;
  align-content: start;
  grid-auto-rows: max-content;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 54px;
  height: auto;
  overflow: visible;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  letter-spacing: 0;
}

.brand-lockup {
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
}

.profile-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.ruby-balance,
.color-swatch,
input,
select,
button,
.profile-chip,
.badge {
  border-radius: 8px;
}

.ruby-balance {
  height: var(--header-control-height);
  min-height: var(--header-control-height);
  padding: 0 12px;
  background: rgba(255, 48, 64, 0.12);
  box-shadow: none;
  font-size: 0.9rem;
}

.header-shop-button {
  height: var(--header-control-height);
  min-height: var(--header-control-height);
  padding: 0 14px;
}

.highlight-color-picker {
  height: 38px;
  gap: 0;
  flex-wrap: nowrap;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 12, 0.5);
}

.color-swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  min-width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.color-swatch::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: 0 0 10px rgba(var(--swatch-rgb), 0.22);
}

.color-swatch:hover,
.color-swatch.is-active {
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.color-swatch.is-active::before {
  width: 16px;
  height: 16px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.16),
    0 0 14px rgba(var(--swatch-rgb), 0.36);
}

.panel,
.profile-hero {
  border-radius: 10px;
  background: rgba(21, 24, 27, 0.86);
  box-shadow: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.shop-window {
  border-radius: 10px;
}

.profile-hero {
  padding: 0;
  overflow: hidden;
  background: rgba(13, 16, 18, 0.82);
}

.profile-shell,
.auth-shell,
.stacked-sections {
  gap: 10px;
}

.profile-hero .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 64px;
  margin-bottom: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.profile-hero .panel-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: 0;
}

.profile-hero #logout-button {
  height: var(--header-control-height);
  min-height: var(--header-control-height);
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.auth-shell.is-authenticated {
  padding: 0;
}

.profile-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 12px 16px;
}

.profile-detail-strip,
.profile-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
}

.profile-detail-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.profile-detail-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.secret-code-button {
  min-height: 0;
  padding: 0;
  border: 0;
}

.profile-groups {
  gap: 8px;
  justify-items: end;
}

.profile-group {
  justify-content: flex-end;
  gap: 8px;
}

.profile-group-title {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.profile-meta {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.profile-chip {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 66px;
  min-height: 38px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  font-size: 0.72rem;
  line-height: 1.15;
}

.profile-chip span {
  color: var(--muted);
  font-weight: 700;
}

.profile-chip strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
}

.dashboard {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.dashboard-tabs {
  position: static;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  height: 52px;
  min-height: 52px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 10, 12, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.dashboard-tab {
  position: relative;
  display: flex;
  height: 40px;
  min-height: 40px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-tab:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.dashboard-tab.is-active {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--text);
}

.dashboard-tab-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 48, 64, 0.92);
  color: white;
  font-size: 0.68rem;
  line-height: 1;
}

.dashboard-view[hidden] {
  display: none !important;
}

.dashboard-view {
  min-width: 0;
}

.dashboard-view.is-active {
  display: grid;
}

.dashboard-stack.dashboard-view.is-active {
  display: grid;
}

.dashboard-view > .panel,
.today-panel {
  min-width: 0;
}

.today-panel {
  padding: var(--view-panel-padding);
  border-color: rgba(var(--accent-rgb), 0.2);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), rgba(21, 24, 27, 0.92) 42%),
    rgba(13, 16, 18, 0.9);
}

.today-head,
.collection-panel .panel-head,
.sidebar-panel .panel-head {
  display: flex;
  align-items: center;
  min-height: var(--view-head-height);
  margin-bottom: 10px;
}

.today-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  letter-spacing: 0;
}

.today-context {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.75fr);
  gap: 8px;
}

.today-quick-row {
  display: grid;
  gap: 8px;
}

.today-card {
  display: grid;
  min-height: 92px;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 10, 12, 0.58);
  color: var(--text);
  text-align: left;
}

button.today-card {
  font: inherit;
}

.today-card.is-action:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
}

.today-card-primary {
  min-height: 132px;
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
}

.today-card-compact {
  min-height: 62px;
  padding: 10px;
}

.today-card.is-urgent {
  border-color: rgba(255, 48, 64, 0.48);
  background: rgba(255, 48, 64, 0.1);
}

.today-card-kicker,
.today-card-note {
  color: var(--muted);
  font-size: 0.76rem;
}

.today-card-kicker {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-card-value {
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
  line-height: 1.1;
}

.today-card-compact .today-card-value {
  font-size: 0.98rem;
}

.collection-panel {
  padding: var(--view-panel-padding);
  border-color: rgba(var(--accent-rgb), 0.16);
  background:
    linear-gradient(180deg, rgba(24, 28, 32, 0.94), rgba(13, 16, 18, 0.92));
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0;
}

.section-copy {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.subsection-title {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  justify-content: stretch;
  gap: 10px;
  overflow: visible;
  scroll-snap-type: none;
  padding-bottom: 2px;
}

.collection-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  justify-content: stretch;
  gap: 10px;
}

.shop-grid {
  gap: 10px;
}

.team-grid > .card,
.collection-grid > .card,
.team-grid > .card-shell,
.collection-grid > .card-shell {
  width: 100%;
  scroll-snap-align: none;
}

.card-face,
.card {
  border-radius: 10px;
  border-color: var(--line);
  background: linear-gradient(180deg, #1b1f23, #111417);
}

.team-grid .card.is-attacker .card-face {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.16);
}

.card-face {
  padding: 10px;
  gap: 8px;
}

.card h3,
.list-item h3 {
  letter-spacing: 0;
}

.card-art,
.card-art-placeholder {
  border-radius: 8px;
  border-color: var(--line);
}

.card-stats {
  gap: 6px;
}

.card-stats div {
  padding: 7px 8px;
  border-radius: 8px;
}

.card-actions button,
.card-context-bar button,
.list-item .inline-actions button {
  border-radius: 8px;
}

.collection-toggle-row {
  justify-content: center;
}

.collection-toggle-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 210px;
}

.collection-toggle-row button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.collection-toggle-row button.is-open::after {
  transform: translateY(2px) rotate(225deg);
}

.dashboard-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  grid-template-areas:
    "battles history";
  gap: 12px;
}

.sidebar-panel {
  padding: var(--view-panel-padding);
  overflow: hidden;
  background: rgba(15, 18, 20, 0.82);
}

.sidebar-panel[data-panel="battles"] {
  grid-area: battles;
}

.sidebar-panel[data-panel="opponents"] {
  grid-area: opponents;
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(18, 21, 24, 0.9);
}

.sidebar-panel[data-panel="history"] {
  grid-area: history;
  opacity: 0.84;
}

.panel-heading-button {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.mobile-panel .mobile-panel-body,
.mobile-panel.is-open .mobile-panel-body {
  display: grid;
  padding: 0;
}

.list {
  gap: 8px;
}

.list-item {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.subsection + .subsection {
  padding-top: 10px;
}

input,
select,
button {
  padding: 10px 12px;
}

button {
  min-height: 40px;
}

.search-inline {
  grid-template-columns: minmax(0, 1fr);
}

.auth-grid {
  gap: 10px;
}

.auth-panel-start,
.login-form {
  border-radius: 10px;
}

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

  .today-card-primary {
    grid-column: auto;
    min-height: 112px;
  }

  .today-quick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
    grid-template-areas:
      "battles"
      "history";
  }

  .profile-inline,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .profile-inline {
    align-items: stretch;
  }

  .profile-groups {
    justify-items: start;
  }

  .profile-meta,
  .profile-group {
    justify-content: flex-start;
  }

  .profile-meta {
    flex-wrap: wrap;
  }

  .team-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    scroll-snap-type: none;
    padding-right: 0;
  }

  .team-grid > .card,
  .team-grid > .card-shell {
    width: 100%;
    scroll-snap-align: none;
  }

  .team-pagination {
    display: flex;
    margin-top: 4px;
  }

  .collection-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app {
    padding: 10px;
  }

  .dashboard {
    padding-bottom: 0;
  }

  .dashboard-tabs {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 52px;
    min-height: 52px;
    box-shadow: none;
  }

  .dashboard-tab {
    height: 40px;
    min-height: 40px;
    padding: 8px 4px;
    font-size: 0.76rem;
  }

  .dashboard-tab-badge {
    position: absolute;
    top: 4px;
    right: 8px;
  }

  .page-header {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    overflow: visible;
  }

  .highlight-color-picker {
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .highlight-color-picker::-webkit-scrollbar {
    display: none;
  }

  .today-head {
    align-items: flex-start;
  }

  .today-grid {
    grid-template-columns: 1fr;
  }

  .today-quick-row {
    grid-template-columns: 1fr;
  }

  .today-card-primary {
    grid-column: auto;
  }

  .today-card {
    min-height: 82px;
  }

  .profile-inline,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero .panel-head {
    grid-template-columns: 1fr;
    min-height: 58px;
    padding: 12px;
    gap: 10px;
  }

  .profile-head-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile-inline {
    min-height: 0;
    padding: 12px;
  }

  .profile-detail-item {
    flex: 1 1 138px;
  }

  .profile-meta,
  .profile-group {
    justify-content: flex-start;
  }

  .team-grid {
    grid-auto-columns: auto;
    padding-right: 36px;
  }

  .team-grid > .card,
  .team-grid > .card-shell {
    width: 100%;
  }

  .collection-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .actions,
  .inline-actions {
    flex-direction: column;
  }

  .actions button,
  .inline-actions button,
  .search-inline button,
  .collection-toggle-row button,
  .subsection-head .ghost-button,
  .reward-actions button {
    width: 100%;
  }
}

@supports not (aspect-ratio: 1 / 1) {
  .card-art,
  .card-art-placeholder {
    height: 140px;
  }

  .starter-reveal-card,
  .reward-reveal-card,
  .shop-card {
    min-height: 340px;
  }

  .card-shell > .card,
  .shop-card-wrap > .card {
    position: relative;
    min-height: 0;
    height: 0;
    padding-top: 166.6667%;
  }

  .card-shell > .card > .card-inner,
  .shop-card-wrap > .card > .card-inner {
    position: absolute;
    inset: 0;
  }

  .card-preview-card > .card {
    min-height: 0;
    height: var(--animal-card-zoom-height);
    padding-top: 0;
  }

  .team-grid > .card,
  .collection-grid > .card,
  .team-grid > .card-shell > .card,
  .collection-grid > .card-shell > .card {
    min-height: 0;
  }
}
