@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #061419;
  --panel: rgba(8, 28, 33, 0.92);
  --panel-soft: rgba(14, 39, 44, 0.78);
  --line: rgba(224, 189, 106, 0.2);
  --gold: #e2b45d;
  --gold-pale: #ffe8a7;
  --teal: #62d9cb;
  --red: #ef655c;
  --text: #f4f0e6;
  --muted: #b4c5c5;
  --rare: #4ca8ff;
  --epic: #b46cff;
  --legendary: #ffbd43;
  --mythic: #ff5e63;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 30% -10%, #143c41 0, transparent 34rem),
    linear-gradient(160deg, #071b21, #030a0d 75%);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100dvh;
}

.auth-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(28px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
  background:
    linear-gradient(90deg, rgba(2, 10, 14, .78), rgba(2, 10, 14, .18) 52%, rgba(2, 10, 14, .72)),
    linear-gradient(to bottom, rgba(4, 12, 15, .08), rgba(4, 12, 15, .92)),
    url("/assets/home-arena-v2.png") center / cover no-repeat;
}

.auth-screen::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 32%, rgba(102, 222, 203, .15), transparent 32rem);
  content: "";
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 480px);
  gap: clamp(42px, 8vw, 130px);
  align-items: center;
  width: min(1160px, 100%);
}

.auth-brand {
  max-width: 600px;
}

.auth-brand .hero-heading {
  margin: 26px 0 18px;
  font-size: clamp(48px, 7vw, 98px);
  line-height: .9;
}

.auth-brand > p {
  max-width: 570px;
  margin: 0;
  color: #d9e5e2;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 600;
  line-height: 1.6;
  text-shadow: 0 2px 14px #020809;
}

.auth-card {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(226, 180, 93, .42);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(13, 42, 47, .97), rgba(3, 15, 19, .98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(151, 203, 202, .2);
  border-radius: 13px;
  background: rgba(1, 10, 13, .64);
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8eaaa9;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.auth-tabs button.active {
  background: linear-gradient(135deg, #1b6671, #174553);
  color: white;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .26);
}

.auth-heading {
  margin: 27px 0 20px;
}

.auth-heading h2 {
  margin: 7px 0 0;
  font: 700 clamp(24px, 3vw, 34px) "Unbounded", sans-serif;
}

.auth-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.auth-field > span {
  color: #c6d7d5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(121, 191, 191, .32);
  border-radius: 11px;
  outline: none;
  background: rgba(1, 11, 14, .72);
  color: white;
  font-size: 16px;
}

.auth-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(98, 217, 203, .12);
}

.auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 24px;
}

.auth-note {
  margin: 15px 0 0;
  color: #9eb3b2;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.logout-button {
  align-self: stretch;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(239, 101, 92, .32);
  border-radius: 9px;
  background: rgba(87, 24, 25, .3);
  color: #ffc1bc;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
}

@media (max-width: 800px) {
  .auth-screen {
    align-items: end;
    padding-inline: 14px;
  }

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

  .auth-brand .hero-heading {
    margin: 18px 0 11px;
    font-size: clamp(43px, 15vw, 70px);
  }

  .auth-brand > p {
    display: none;
  }

  .auth-card {
    padding: 20px;
    border-radius: 19px;
  }

  .auth-heading {
    margin: 20px 0 14px;
  }
}

.home-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(36px + var(--safe-top)) 22px calc(32px + var(--safe-bottom));
}

.home-screen::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 10, 14, .38), rgba(2, 10, 14, .04) 48%, rgba(2, 10, 14, .38)),
    linear-gradient(to bottom, rgba(4, 15, 18, .04), rgba(4, 12, 15, .88)),
    url("/assets/home-arena-v2.png") center center / cover no-repeat;
  content: "";
  filter: saturate(.9) contrast(1.04);
  opacity: .98;
}

.home-screen::after {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 231, 166, 0.18) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, black 65%);
}

.home-content {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  margin-top: auto;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-pale);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-gem {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gold);
  rotate: 45deg;
  box-shadow: 0 0 18px rgba(226, 180, 93, 0.5);
}

.hero-heading {
  margin: 20px 0 12px;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(43px, 12vw, 68px);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.hero-heading span {
  display: block;
  color: var(--gold);
}

.hero-subtitle {
  max-width: 380px;
  margin: 0 0 28px;
  color: #c2cdca;
  font-size: 15px;
  line-height: 1.6;
}

.home-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(5, 19, 23, 0.86);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  outline: none;
  padding: 0 15px;
  background: #0b2429;
  color: white;
  transition: border 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 180, 93, 0.1);
}

.row {
  display: flex;
  gap: 10px;
}

.btn {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s, filter 0.15s, border-color 0.15s;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  cursor: default;
  filter: grayscale(0.6);
  opacity: 0.46;
}

.btn-primary {
  flex: 1.3;
  background: linear-gradient(135deg, #f0c66e, #b67c2e);
  color: #231704;
  box-shadow: 0 8px 30px rgba(196, 135, 46, 0.2);
}

.btn-secondary {
  flex: 1;
  border-color: rgba(255, 255, 255, 0.11);
  background: #123139;
}

.btn-ghost {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.join-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.join-inline input {
  min-width: 0;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 0 14px;
  background: #081e23;
  color: white;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.microcopy {
  margin-top: 15px;
  color: #758c8e;
  font-size: 11px;
  text-align: center;
}

.lobby-screen {
  padding: calc(18px + var(--safe-top)) 18px calc(22px + var(--safe-bottom));
  background:
    linear-gradient(rgba(3, 12, 15, 0.5), #061419 80%),
    url("/assets/arena.png") center top / 760px auto no-repeat;
}

.topbar,
.section-head,
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.room-code {
  margin: 3px 0 0;
  font-family: "Unbounded", sans-serif;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(0, 1.5fr);
  gap: 16px;
  width: min(1180px, 100%);
  margin: 28px auto 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.players-panel,
.heroes-panel {
  padding: 16px;
}

.section-title {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 15px;
}

.counter {
  color: var(--muted);
  font-size: 12px;
}

.player-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.player-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 53px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.025);
}

.player-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #17353a;
  font-size: 20px;
}

.player-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-label {
  color: var(--muted);
  font-size: 10px;
}

.ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #516164;
}

.ready-dot.on {
  background: var(--teal);
  box-shadow: 0 0 11px rgba(98, 217, 203, 0.8);
}

.lobby-actions {
  display: grid;
  gap: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hero-card {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--hero-color) 25%, transparent), transparent 48%),
    #0a2328;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

.hero-card:hover {
  transform: translateY(-2px);
}

.hero-card.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(226, 180, 93, 0.38), 0 10px 30px rgba(0, 0, 0, 0.22);
}

.hero-card.blocked {
  filter: grayscale(1);
  opacity: 0.38;
}

.hero-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--hero-color) 62%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--hero-color) 15%, #06161a);
  box-shadow: 0 0 28px color-mix(in srgb, var(--hero-color) 22%, transparent);
  font-size: 30px;
}

.hero-picture {
  overflow: hidden;
  padding: 0;
}

.hero-portrait {
  width: 100%;
  height: 100%;
  transform: scale(1.16);
}

.avatar-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.hero-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.hero-title {
  min-height: 28px;
  margin: 2px 0 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

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

.trait {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 100px;
  padding: 3px 6px;
  color: #c6d1ce;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.trait-filter {
  cursor: pointer;
}

.trait-filter.active {
  border-color: var(--red);
  color: #ff9a93;
  background: rgba(239, 101, 92, 0.09);
}

.trait-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.game-screen {
  min-height: 100dvh;
  padding: calc(9px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
  background: #040d10;
}

.game-topbar {
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(7, 23, 27, 0.94);
}

.round-label {
  font-family: "Unbounded", sans-serif;
  font-size: 13px;
}

.phase-message {
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-exit {
  min-height: 34px;
  padding: 0 11px;
  white-space: nowrap;
}

.timer-ring {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-pale);
  font-size: 13px;
  font-weight: 800;
}

.game-layout {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 290px;
  gap: 9px;
  height: calc(100dvh - 87px - var(--safe-top) - var(--safe-bottom));
  margin-top: 9px;
}

.scoreboard,
.build-panel {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(7, 24, 28, 0.94);
  scrollbar-width: none;
}

.score-row {
  display: grid;
  width: 100%;
  grid-template-columns: 30px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  margin-bottom: 5px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  padding: 6px;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  appearance: none;
}

.score-vitals {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.commander-damage {
  border: 1px solid rgba(255, 111, 79, 0.42);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(111, 24, 18, 0.45);
  color: #ffc1a9;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.commander-damage b {
  color: #fff1d8;
  font-size: 10px;
}

.score-row[aria-disabled="false"] {
  cursor: pointer;
}

.score-row[aria-disabled="false"]:hover {
  border-color: rgba(100, 218, 215, 0.48);
  background: rgba(72, 188, 188, 0.07);
}

.score-row[aria-disabled="true"] {
  cursor: help;
}

.score-row.me {
  border-color: rgba(226, 180, 93, 0.5);
  background: rgba(226, 180, 93, 0.06);
}

.score-row.watching {
  border-color: rgba(87, 226, 217, 0.72);
  background: linear-gradient(90deg, rgba(62, 204, 194, 0.13), rgba(226, 180, 93, 0.05));
  box-shadow: inset 3px 0 #55d9d1;
}

.score-row.dead {
  filter: grayscale(1);
  opacity: 0.42;
}

.scoreboard-list {
  margin-top: 8px;
}

.battle-row {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  min-height: 88px;
  margin-bottom: 7px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 11px;
  padding: 7px;
  color: inherit;
  font: inherit;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(36, 102, 105, 0.1), rgba(226, 180, 93, 0.04)),
    rgba(2, 13, 16, 0.54);
  appearance: none;
  overflow: visible;
}

.battle-row:not(:disabled) {
  cursor: pointer;
}

.battle-row:not(:disabled):hover {
  border-color: rgba(100, 218, 215, 0.5);
  background: linear-gradient(135deg, rgba(36, 153, 153, 0.17), rgba(226, 180, 93, 0.07));
}

.battle-row.me {
  border-color: rgba(226, 180, 93, 0.48);
}

.battle-row.watching {
  border-color: rgba(87, 226, 217, 0.78);
  background: linear-gradient(135deg, rgba(44, 189, 181, 0.2), rgba(226, 180, 93, 0.08));
  box-shadow: inset 3px 0 #55d9d1, 0 0 16px rgba(42, 203, 192, 0.08);
}

.battle-row-top,
.battle-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.battle-row-bottom > span:first-child,
.battle-row-bottom > span:last-child {
  display: grid;
  gap: 1px;
}

.battle-row-bottom > span:last-child {
  justify-items: end;
}

.battle-row-bottom small {
  color: #ffb293;
  font-size: 8px;
  font-weight: 800;
}

.battle-pair-avatars {
  display: flex;
  align-items: center;
}

.battle-avatar {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(241, 199, 105, 0.38);
  border-radius: 50%;
  background: #07191d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.battle-avatar + .battle-versus {
  margin-left: -2px;
}

.battle-versus {
  z-index: 1;
  margin-right: -2px;
  border: 1px solid rgba(226, 180, 93, 0.34);
  border-radius: 50%;
  padding: 3px;
  color: #f2c96b;
  font-size: 7px;
  font-weight: 900;
  background: #08181b;
}

.battle-number {
  color: #8ea9a8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.battle-pair-names {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
  align-items: center;
  color: #eefaf7;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.battle-pair-names span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-pair-names b {
  color: #e2b45d;
  font-size: 11px;
}

.copy-badge {
  display: inline-flex;
  margin-left: 4px;
  border: 1px solid rgba(139, 225, 255, .45);
  border-radius: 999px;
  padding: 1px 4px;
  background: rgba(51, 138, 176, .22);
  color: #9ceaff;
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .06em;
  vertical-align: middle;
}

.battle-row-bottom {
  color: #ff9389;
  font-size: 8px;
  font-weight: 800;
}

.battle-watch-state {
  color: #6ee4dc;
  font-size: 7px;
  letter-spacing: 0.07em;
}

.watch-indicator {
  margin-left: 3px;
  color: #73e7df;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.battle-inspect {
  position: absolute;
  z-index: 80;
  top: 6px;
  left: calc(100% + 8px);
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 360px;
  border: 1px solid rgba(226, 180, 93, 0.42);
  border-radius: 11px;
  padding: 9px;
  background: rgba(3, 18, 23, 0.985);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.62);
  color: white;
  text-align: left;
  pointer-events: none;
}

.battle-row:hover .battle-inspect,
.battle-row:focus .battle-inspect {
  display: grid;
}

.battle-inspect-player {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 4px 9px;
}

.battle-inspect-player + .battle-inspect-player {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.battle-inspect-player strong {
  overflow: hidden;
  color: #fff5d8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-inspect-player > small {
  color: #b9cdcd;
  font-size: 10px;
}

.battle-inspect-player > b {
  color: #ffb79e;
  font-size: 10px;
  line-height: 1.35;
}

.score-name {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-stats {
  color: var(--muted);
  font-size: 9px;
}

.hp {
  color: #ff857d;
  font-size: 11px;
  font-weight: 800;
}

.arena-wrap {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(111, 218, 208, 0.22);
  border-radius: 14px;
  background: #05161a;
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.42),
    inset 0 0 42px rgba(2, 8, 10, 0.58),
    inset 0 1px rgba(255, 226, 147, 0.12);
}

.arena-wrap::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.2)),
    linear-gradient(180deg, rgba(98, 216, 206, 0.04), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.28));
  box-shadow: inset 0 0 0 1px rgba(255, 230, 170, 0.035);
  content: "";
  pointer-events: none;
}

.spectator-notice {
  position: absolute;
  z-index: 3;
  bottom: 15px;
  left: 50%;
  display: flex;
  max-width: calc(100% - 24px);
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(85, 217, 209, 0.42);
  border-radius: 12px;
  padding: 8px 13px;
  color: #d7f7f3;
  font-size: 9px;
  text-align: center;
  background: rgba(3, 18, 22, 0.82);
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.spectator-notice b {
  color: #69ddd5;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.spectator-notice span {
  color: var(--muted);
}

.spectating-chip {
  display: inline-block;
  margin: 3px 0;
  border: 1px solid rgba(85, 217, 209, 0.35);
  border-radius: 100px;
  padding: 3px 7px;
  color: #70e2da;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#arena {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  filter: saturate(1.05) contrast(1.025);
  touch-action: none;
}

.arena-status {
  position: absolute;
  top: 12px;
  left: 50%;
  max-width: 88%;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 100px;
  padding: 7px 13px;
  background: rgba(4, 14, 17, 0.74);
  color: #d6dedb;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
}

.gameover-panel {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(390px, calc(100% - 28px));
  border: 1px solid rgba(226, 180, 93, 0.42);
  border-radius: 16px;
  padding: 20px;
  background: rgba(5, 20, 24, 0.94);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.65), inset 0 0 28px rgba(226, 180, 93, 0.06);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
}

.gameover-panel h2 {
  margin: 7px 0;
  color: var(--gold-pale);
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
}

.gameover-panel p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 10px;
}

.gameover-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.gameover-actions .btn {
  flex: 1;
}

.shop-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  border: 1px solid rgba(226, 180, 93, 0.26);
  border-radius: 15px;
  padding: 10px;
  background: rgba(3, 15, 18, 0.91);
  box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(15px);
}

.shop-overlay.shop-locked {
  border-color: rgba(91, 203, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(8, 49, 78, 0.98), rgba(3, 24, 43, 0.99)),
    radial-gradient(circle at 50% 0%, rgba(81, 196, 255, 0.3), transparent 58%);
  box-shadow:
    0 -18px 70px rgba(0, 0, 0, 0.62),
    inset 0 0 0 2px rgba(113, 217, 255, 0.16),
    inset 0 0 44px rgba(49, 151, 255, 0.12);
}

.shop-overlay.shop-locked .shop-card {
  border-color: rgba(95, 203, 255, 0.34);
  background:
    radial-gradient(circle at 50% 24%, rgba(83, 188, 255, 0.18), transparent 46%),
    linear-gradient(145deg, #164761, #0a2a42);
}

.shop-lock-state {
  min-width: 0;
  border: 1px solid rgba(115, 218, 255, 0.62);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(22, 125, 185, 0.24);
  color: #a9eaff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
}

.shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.shop-title {
  display: grid;
  gap: 3px;
}

.shop-odds {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.shop-odds i {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(2, 14, 20, 0.54);
  color: #aebfc4;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.shop-odds .odds-common b { color: #72cfff; }
.shop-odds .odds-rare b { color: #d592ff; }
.shop-odds .odds-legendary b { color: #ffd66b; }

.bank {
  color: var(--gold-pale);
  font-size: 12px;
  font-weight: 800;
}

.bank small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.income-breakdown {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 5px;
  margin: -2px 0 9px;
}

.income-breakdown span {
  min-width: 0;
  border: 1px solid rgba(226, 180, 93, 0.13);
  border-radius: 7px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.025);
  color: #9fb2b3;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.income-breakdown b {
  display: block;
  margin-top: 2px;
  color: var(--gold-pale);
  font-size: 11px;
}

.income-breakdown .income-total {
  border-color: rgba(226, 180, 93, 0.38);
  background: rgba(226, 180, 93, 0.1);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.art-sprite {
  display: inline-block;
  flex: 0 0 auto;
  background-image: var(--art-url);
  background-repeat: no-repeat;
  background-position: var(--art-x) var(--art-y);
  background-size: var(--art-size);
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.45));
}

.shop-card {
  min-width: 0;
  min-height: 148px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  padding: 8px;
  background:
    radial-gradient(circle at 50% 28%, rgba(226, 180, 93, 0.1), transparent 45%),
    linear-gradient(145deg, #14343a, #0b2227);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}

.rarity-badge {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  padding: 2px 5px;
  background: rgba(3, 12, 15, 0.72);
  color: var(--muted);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rarity-rare {
  border-color: color-mix(in srgb, var(--rare) 55%, transparent) !important;
}

.rarity-epic {
  border-color: color-mix(in srgb, var(--epic) 58%, transparent) !important;
  box-shadow: inset 0 0 22px rgba(180, 108, 255, 0.07);
}

.rarity-legendary {
  border-color: color-mix(in srgb, var(--legendary) 75%, transparent) !important;
  box-shadow: inset 0 0 28px rgba(255, 189, 67, 0.12), 0 0 15px rgba(255, 189, 67, 0.08);
}

.rarity-mythic {
  border-color: color-mix(in srgb, var(--mythic) 72%, var(--legendary)) !important;
  box-shadow: inset 0 0 28px rgba(255, 76, 96, 0.14), 0 0 17px rgba(255, 189, 67, 0.1);
}

.rarity-rare .rarity-badge {
  color: #9bd0ff;
}

.rarity-epic .rarity-badge {
  color: #d8aeff;
}

.rarity-legendary .rarity-badge {
  color: #ffe19b;
}

.rarity-mythic .rarity-badge {
  color: #ffb2a2;
}

.shop-card.rarity-legendary::after,
.reward-card.rarity-mythic::after {
  position: absolute;
  top: 16%;
  right: -42%;
  bottom: 42%;
  left: -42%;
  background: linear-gradient(110deg, transparent 42%, rgba(255, 238, 167, 0.26) 49%, transparent 56%);
  content: "";
  pointer-events: none;
  transform: translateX(-45%);
  animation: rarity-shine 2.8s ease-in-out infinite;
}

@keyframes rarity-shine {
  0%, 58% { transform: translateX(-48%); }
  100% { transform: translateX(48%); }
}

.shop-card:active {
  transform: scale(0.97);
}

.shop-card:hover {
  border-color: rgba(226, 180, 93, 0.38);
}

.shop-card .card-icon {
  display: block;
  width: 54px;
  height: 54px;
  margin: -2px auto 2px;
}

.shop-card .card-name {
  display: block;
  overflow: hidden;
  margin: 4px 0 2px;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-card-level {
  display: block;
  overflow: hidden;
  color: #ffe08b;
  font-size: 7px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card .card-desc {
  color: var(--muted);
  font-size: 8px;
}

.card-styles {
  display: flex;
  min-height: 15px;
  flex-wrap: wrap;
  gap: 3px;
  margin: 3px 0;
}

.card-style {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--style-color) 48%, transparent);
  border-radius: 100px;
  padding: 2px 4px;
  background: color-mix(in srgb, var(--style-color) 10%, rgba(3, 13, 16, 0.88));
  color: color-mix(in srgb, var(--style-color) 80%, white);
  font-size: 6px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.style-art {
  width: 11px;
  height: 11px;
  margin-right: 2px;
}

.card-style.compact {
  display: grid;
  width: 10px;
  height: 10px;
  padding: 0;
  place-items: center;
  font-size: 7px;
}

.card-style.compact .style-art {
  width: 9px;
  height: 9px;
  margin: 0;
}

.price {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
}

.shop-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.shop-controls .btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: 8px;
}

.pool-hint {
  margin-left: 5px;
  color: var(--muted);
  font-size: 7px;
}

.hero-level {
  margin-top: 5px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.commander-health {
  margin: 4px 0 5px;
  color: #ff938a;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.level-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.level-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fcac3, #f1c468);
  box-shadow: 0 0 8px rgba(226, 180, 93, 0.45);
  transition: width 0.35s ease;
}

.shop-level {
  margin: -3px 0 7px;
}

.build-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
  text-align: center;
}

.build-hero .hero-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.build-hero h3 {
  margin: 0;
  font-size: 15px;
}

.build-hero p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.hero-skills {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  text-align: left;
}

.hero-skill {
  border: 1px solid rgba(108, 205, 222, 0.16);
  border-radius: 8px;
  padding: 6px;
  background: rgba(70, 173, 196, 0.06);
}

.hero-skill.ultimate-skill {
  border-color: rgba(219, 140, 255, 0.23);
  background: rgba(151, 88, 214, 0.08);
}

.hero-skill b,
.hero-skill span {
  display: block;
}

.hero-skill b {
  margin-bottom: 2px;
  color: #8fdae7;
  font-size: 6px;
  letter-spacing: 0.08em;
}

.hero-skill.ultimate-skill b {
  color: #d9abff;
}

.hero-skill span {
  color: #c7d3d1;
  font-size: 7px;
  line-height: 1.25;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
}

.stat {
  border-radius: 9px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.stat strong {
  font-size: 13px;
}

.advanced-stats {
  margin: 7px 0 12px;
  border: 1px solid rgba(123, 202, 213, 0.15);
  border-radius: 10px;
  background: rgba(2, 15, 19, 0.36);
  overflow: hidden;
}

.advanced-stats summary {
  padding: 7px 9px;
  color: #d5e2df;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
  list-style-position: inside;
  text-transform: uppercase;
}

.advanced-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0 7px 7px;
}

.advanced-stats-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  border-radius: 7px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.035);
}

.advanced-stats-grid span {
  min-width: 0;
  color: #9fb2b3;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.15;
}

.advanced-stats-grid b {
  flex: 0 0 auto;
  color: #f0f6f3;
  font-size: 9px;
}

.mini-title {
  margin: 13px 0 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.style-progress-list {
  display: grid;
  gap: 5px;
}

.style-progress {
  border: 1px solid color-mix(in srgb, var(--style-color) 22%, transparent);
  border-radius: 8px;
  padding: 6px;
  background: color-mix(in srgb, var(--style-color) 5%, rgba(255, 255, 255, 0.02));
}

.style-progress.active {
  border-color: color-mix(in srgb, var(--style-color) 48%, transparent);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--style-color) 7%, transparent);
}

.style-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 8px;
}

.style-progress-head strong {
  display: flex;
  align-items: center;
  gap: 4px;
}

.style-progress-art {
  width: 17px;
  height: 17px;
}

.style-progress-head b {
  color: var(--style-color);
}

.style-track {
  height: 3px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.style-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--style-color);
  box-shadow: 0 0 8px var(--style-color);
}

.style-progress small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
}

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

.collection-chip {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(226, 180, 93, 0.1), transparent 68%),
    rgba(255, 255, 255, 0.04);
  font-size: 17px;
}

.chip-art {
  width: 35px;
  height: 35px;
}

.card-level-chip b {
  position: absolute;
  right: 2px;
  bottom: 1px;
  color: #ffe08b;
  font-size: 6px;
  letter-spacing: -1px;
  text-shadow: 0 1px 2px #000;
}

.card-level-chip em {
  position: absolute;
  top: 1px;
  right: 2px;
  border-radius: 5px;
  padding: 1px 2px;
  background: rgba(2, 10, 12, 0.8);
  color: white;
  font-size: 6px;
  font-style: normal;
}

.chip-styles {
  position: absolute;
  bottom: 1px;
  left: 1px;
  display: flex;
  gap: 1px;
}

.empty {
  color: #627678;
  font-size: 10px;
}

.damage-report {
  display: grid;
  gap: 6px;
}

.damage-line {
  display: grid;
  grid-template-columns: 45px 1fr 36px;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 8px;
}

.damage-track {
  height: 6px;
  overflow: hidden;
  border-radius: 5px;
  background: #10262a;
}

.damage-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.damage-bar.taken {
  background: var(--red);
}

.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 7, 9, 0.82);
  backdrop-filter: blur(9px);
}

.modal-card {
  width: min(620px, 100%);
  border: 1px solid rgba(226, 180, 93, 0.35);
  border-radius: 22px;
  padding: 22px;
  background: #091e23;
  box-shadow: 0 30px 100px #000;
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 7px;
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
}

.modal-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.reward-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  padding: 15px 10px;
  background: radial-gradient(circle at top, rgba(226, 180, 93, 0.12), transparent 65%), #0d2a30;
  cursor: pointer;
}

.reward-kind {
  position: absolute;
  top: 9px;
  right: 10px;
  color: #a9c5c8;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.item-reward-card {
  border-color: rgba(95, 190, 207, 0.24);
  background:
    radial-gradient(circle at 50% 18%, rgba(85, 194, 215, 0.16), transparent 55%),
    linear-gradient(155deg, #12343c, #091f25);
}

.artifact-reward-card {
  border-color: rgba(226, 180, 93, 0.34);
}

.reward-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 14px;
  border: 1px solid rgba(226, 180, 93, 0.26);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(3, 14, 18, 0.7);
  color: #b8c9c9;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.reward-timer b {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: #ddb155;
  color: #071317;
  font-size: 13px;
}

.reward-timer b.urgent {
  background: #ef705d;
  color: white;
  animation: reward-timer-pulse 0.7s ease-in-out infinite alternate;
}

.reward-reroll {
  width: 100%;
  margin-top: 12px;
}

@keyframes reward-timer-pulse {
  to { transform: scale(1.1); box-shadow: 0 0 18px rgba(239, 112, 93, 0.62); }
}

body[data-celebration]::after {
  position: fixed;
  z-index: 200;
  inset: 0;
  border: 4px solid var(--legendary);
  box-shadow: inset 0 0 80px rgba(255, 189, 67, 0.25);
  content: "";
  pointer-events: none;
  animation: celebration-flash 0.85s ease-out forwards;
}

body[data-celebration="violet"]::after {
  border-color: var(--epic);
  box-shadow: inset 0 0 80px rgba(180, 108, 255, 0.28);
}

@keyframes celebration-flash {
  0% { opacity: 0; transform: scale(1.03); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

.reward-icon {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 8px;
}

.reward-card strong {
  display: block;
  font-size: 12px;
}

.reward-card small {
  color: var(--muted);
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 11px 15px;
  background: #173238;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

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

  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .scoreboard {
    position: absolute;
    z-index: 5;
    top: 77px;
    left: 11px;
    width: 176px;
    max-height: 44dvh;
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.2s;
  }

  .scoreboard.open {
    transform: none;
  }

  .build-panel {
    display: grid;
    grid-template-columns: 115px 1fr;
    gap: 10px;
    max-height: 148px;
  }

  .build-hero {
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding-right: 9px;
    padding-bottom: 0;
  }

  .stats-grid {
    margin-top: 0;
  }

  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 921px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .home-screen {
    place-items: end center;
  }

  .home-content {
    margin-top: 44dvh;
  }

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

  .hero-card {
    min-height: 174px;
    padding: 11px;
  }

  .hero-icon {
    width: 52px;
    height: 52px;
  }

  .game-topbar {
    height: 52px;
  }

  .topbar-exit {
    min-height: 31px;
    padding: 0 8px;
    font-size: 8px;
  }

  .game-layout {
    height: calc(100dvh - 74px - var(--safe-top) - var(--safe-bottom));
    grid-template-rows: minmax(0, 1fr) 123px;
  }

  .arena-status {
    top: 7px;
  }

  .shop-overlay {
    right: 5px;
    bottom: 5px;
    left: 5px;
    padding: 7px;
  }

  .shop-card {
    min-height: 121px;
    padding: 6px;
  }

  .shop-card .card-icon {
    width: 45px;
    height: 45px;
  }

  .shop-card .card-name {
    font-size: 9px;
  }

  .shop-card .card-desc {
    display: none;
  }

  .card-style {
    padding: 1px 3px;
    font-size: 5px;
  }

  .build-panel {
    max-height: 123px;
    padding: 7px;
  }

  .build-hero .hero-icon {
    width: 45px;
    height: 45px;
    font-size: 23px;
  }

  .collection-chip {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .chip-art {
    width: 31px;
    height: 31px;
  }

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

  .reward-card {
    display: grid;
    min-height: 92px;
    grid-template-columns: 70px 1fr;
    align-items: center;
    text-align: left;
  }

  .reward-icon {
    width: 66px;
    height: 66px;
    grid-row: 1 / 3;
    margin: 0;
  }
}

.damage-type-guide {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.damage-type-guide span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(2,12,15,.5);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
}

.damage-type-guide small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0;
}

.damage-physical { color: #ffad68; }
.damage-magic { color: #aa9dff; }
.damage-pure { color: #fff0a5; }
.damage-health-loss { color: #ff7994; }

/* Shop and draft refresh */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atlas-button {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(106, 222, 226, 0.32);
  color: #bff9f4;
  font-size: 9px;
  letter-spacing: .12em;
}

.hero-offers {
  max-width: 900px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px auto 0;
}

.hero-offers .hero-card {
  min-height: 285px;
}

.favorite-style {
  display: block;
  margin: -2px 0 8px;
  color: var(--gold-pale);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.draft-bans {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid rgba(255, 102, 113, .2);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(55, 11, 19, .35);
}

.draft-bans > span {
  margin-right: 3px;
  color: #ffadb3;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
}

.draft-bans b {
  border: 1px solid rgba(255, 117, 127, .28);
  border-radius: 999px;
  padding: 4px 7px;
  color: #ffd1d4;
  font-size: 8px;
}

.draft-reroll-bans {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  text-decoration: underline;
  cursor: pointer;
}

.draft-actions {
  display: flex;
  max-width: 520px;
  gap: 8px;
  margin: 12px auto 0;
}

.draft-actions .btn { flex: 1; }

.hero-shop-button {
  border-color: rgba(255, 211, 104, .48);
  color: #fff0ae;
}

.hero-shop-button i,
.hero-shard-balance i,
.hero-buy i {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid #ffef9c;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fffbd2 0 13%, #ffd760 14% 43%, #b66b1d 44% 100%);
  box-shadow: 0 0 8px rgba(255, 203, 81, .5);
}

.hero-shop-modal { z-index: 80; }

.hero-shop-panel {
  width: min(1080px, calc(100% - 28px));
  max-height: min(780px, calc(100dvh - 30px));
  overflow: hidden;
  padding: 18px;
  text-align: left;
}

.hero-shop-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 1px 31px 12px 1px;
}

.hero-shop-heading h2 { margin: 3px 0 6px; }

.hero-shop-heading p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.hero-shard-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid rgba(255, 211, 104, .32);
  border-radius: 9px;
  padding: 8px 10px;
  background: rgba(74, 49, 14, .42);
  color: #ffde78;
  font-size: 10px;
}

.hero-shard-balance b { font-size: 15px; }

.hero-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 9px;
  max-height: calc(min(780px, 100dvh - 30px) - 118px);
  overflow: auto;
  padding: 3px 3px 8px;
}

.hero-shop-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 5px 9px;
  min-height: 84px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hero-color) 44%, rgba(255,255,255,.14));
  border-radius: 11px;
  padding: 9px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--hero-color) 14%, #0a232a), #07171b 76%);
  box-shadow: inset 0 0 20px color-mix(in srgb, var(--hero-color) 9%, transparent);
}

.hero-shop-card::after {
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  content: "";
  pointer-events: none;
}

.hero-shop-card.owned { border-color: rgba(117, 232, 173, .42); }

.hero-shop-portrait {
  display: grid;
  grid-row: 1 / 3;
  width: 52px;
  height: 62px;
  place-items: end center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hero-color) 58%, #fff);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--hero-color) 36%, transparent), rgba(3, 13, 17, .95) 72%);
}

.hero-shop-portrait .hero-portrait {
  width: 68px;
  height: 68px;
  transform: translateY(7px);
}

.hero-shop-copy {
  min-width: 0;
  align-self: end;
  padding-right: 3px;
}

.hero-shop-copy b,
.hero-shop-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-shop-copy b { color: #f7fbf3; font-size: 11px; }
.hero-shop-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.hero-owned,
.hero-buy {
  z-index: 1;
  display: inline-flex;
  grid-column: 2;
  align-items: center;
  justify-content: center;
  gap: 5px;
  justify-self: start;
  min-width: 76px;
  min-height: 24px;
  border: 1px solid rgba(255, 211, 104, .5);
  border-radius: 6px;
  padding: 0 8px;
  background: rgba(12, 41, 51, .82);
  color: #ffe887;
  font-size: 9px;
  font-weight: 900;
}

.hero-owned { border-color: rgba(115, 229, 159, .42); color: #aaf3c1; }
.hero-buy { cursor: pointer; }
.hero-buy:hover:not(:disabled) { filter: brightness(1.18); transform: translateY(-1px); }
.hero-buy:disabled { opacity: .38; cursor: not-allowed; }

.shop-toggle {
  position: absolute;
  z-index: 7;
  right: 18px;
  bottom: 14px;
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(226, 180, 93, .42);
  border-radius: 8px;
  padding: 0 10px;
  background: linear-gradient(180deg, rgba(27, 65, 72, .96), rgba(6, 25, 30, .98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  color: #e9f7f3;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}

.shop-toggle.open {
  right: 25px;
  bottom: 7px;
  transform: none;
}

.shop-toggle.locked {
  border-color: rgba(103, 215, 255, 0.78);
  background: linear-gradient(180deg, rgba(26, 105, 151, 0.98), rgba(7, 42, 72, 0.99));
  box-shadow: 0 0 22px rgba(55, 174, 238, 0.34), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.shop-toggle b { color: #ffd66b; }

.shop-toggle-icon {
  width: 17px;
  height: 14px;
  border: 2px solid #70cfd2;
  border-radius: 2px;
  box-shadow: inset 0 4px rgba(112, 207, 210, .18);
}

.shop-overlay {
  right: 18px;
  bottom: 44px;
  left: 18px;
  overflow: visible;
  border-color: rgba(126, 214, 213, .26);
  border-radius: 18px;
  padding: 11px 13px 9px;
  background:
    linear-gradient(180deg, rgba(8, 35, 42, .97), rgba(3, 16, 21, .98)),
    radial-gradient(circle at 50% 0%, rgba(97, 212, 212, .12), transparent 55%);
  box-shadow: 0 -18px 65px rgba(0, 0, 0, .58), inset 0 0 0 1px rgba(255, 220, 143, .04);
}

.shop-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  align-items: stretch;
  gap: 10px;
}

.shop-grid { gap: 9px; }

.shop-card {
  min-height: 218px;
  overflow: hidden;
  border-width: 2px;
  border-radius: 6px 6px 13px 13px;
  padding: 24px 9px 37px;
  background:
    linear-gradient(180deg, rgba(26, 101, 137, .97) 0 43%, rgba(13, 62, 82, .98) 43% 100%);
  box-shadow: inset 0 0 22px rgba(104, 218, 255, .1), 0 8px 18px rgba(0, 0, 0, .28);
  text-align: center;
}

.shop-card.rarity-rare {
  background: linear-gradient(180deg, rgba(99, 50, 147, .98) 0 43%, rgba(50, 25, 82, .98) 43% 100%);
  box-shadow: inset 0 0 28px rgba(215, 161, 255, .13), 0 8px 18px rgba(0, 0, 0, .3);
}

.shop-card.rarity-legendary {
  background: linear-gradient(180deg, rgba(147, 101, 31, .98) 0 43%, rgba(77, 48, 12, .98) 43% 100%);
}

.shop-card::before {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 239, 188, .22);
  border-radius: 4px 4px 10px 10px;
  content: "";
  pointer-events: none;
}

.shop-card .rarity-badge {
  top: 6px;
  right: 7px;
  left: auto;
  border: 0;
  background: transparent;
  font-size: 6px;
}

.card-style-crests {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 9px;
  display: flex;
  gap: 5px;
}

.card-style-crests .card-style.compact {
  width: 29px;
  height: 29px;
  border: 1px solid color-mix(in srgb, var(--style-color) 82%, #e7fbff);
  border-radius: 8px 8px 50% 50%;
  background: color-mix(in srgb, var(--style-color) 22%, rgba(2, 13, 19, .96));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .18);
  transform: none;
}

.card-style-crests .style-art {
  width: 23px;
  height: 23px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8));
}

.card-art-frame {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 2px auto 5px;
  border: 2px solid rgba(255, 232, 178, .58);
  border-radius: 4px;
  background: rgba(1, 12, 18, .78);
  box-shadow: 0 6px 15px rgba(0, 0, 0, .42);
  place-items: center;
}

.shop-card .card-icon {
  width: 70px;
  height: 70px;
  margin: 0;
}

.card-star-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 0 -9px 6px;
  border-top: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(0,0,0,.16);
  padding: 3px 0;
  background: rgba(255,255,255,.08);
}

.card-star-row i {
  color: rgba(5, 27, 37, .5);
  font-size: 10px;
  font-style: normal;
}

.card-star-row i.filled {
  color: #ffe36c;
  filter: drop-shadow(0 0 3px rgba(255, 212, 76, .65));
}

.shop-card .card-name {
  margin: 3px 0 5px;
  color: white;
  font-size: 10px;
  text-align: center;
  white-space: normal;
}

.shop-card .card-desc {
  display: block;
  min-height: 29px;
  color: #d2e7e8;
  font-size: 8px;
  line-height: 1.35;
  text-align: center;
}

.card-style-caption {
  display: block;
  margin-top: 4px;
  color: #8ee7c9;
  font-size: 7px;
  font-weight: 800;
}

.card-style-caption b {
  color: #d8fbff;
  font-size: .9em;
  letter-spacing: .06em;
}

.shop-card .price {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  display: flex;
  height: 24px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(228, 190, 98, .34);
  border-radius: 3px 3px 8px 8px;
  background: rgba(2, 16, 22, .67);
  color: #fff3bd;
  font-size: 11px;
  font-weight: 900;
}

.shop-card .price i,
.shop-action b::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff694 0 18%, #ffc72e 45%, #a96b00 100%);
  box-shadow: 0 0 4px rgba(255, 205, 47, .65);
  content: "";
}

.shop-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.shop-action {
  position: relative;
  display: grid;
  min-height: 47px;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  border: 1px solid rgba(102, 183, 219, .42);
  border-radius: 4px 9px 9px 4px;
  padding: 5px 6px;
  background: linear-gradient(90deg, rgba(20, 75, 112, .97), rgba(24, 55, 91, .96));
  color: #eaf8ff;
  text-align: left;
  cursor: pointer;
}

.shop-action:hover,
.shop-action.active {
  border-color: rgba(255, 219, 119, .65);
  background: linear-gradient(90deg, rgba(31, 106, 132, .98), rgba(42, 73, 105, .98));
}

#lock-shop.active {
  border-color: rgba(107, 224, 255, 0.9);
  background: linear-gradient(90deg, rgba(19, 126, 174, 0.99), rgba(25, 78, 134, 0.99));
  box-shadow: inset 0 0 18px rgba(103, 220, 255, 0.16), 0 0 16px rgba(48, 178, 235, 0.2);
}

.shop-action span {
  align-self: end;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.shop-action b {
  display: flex;
  align-self: start;
  align-items: center;
  gap: 4px;
  color: #ffe07c;
  font-size: 9px;
}

.action-icon {
  grid-row: 1 / 3;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(160, 223, 255, .48);
  border-radius: 5px;
  background-color: rgba(4, 30, 52, .8);
  transform: rotate(45deg);
}

.action-icon::before,
.action-icon::after {
  position: absolute;
  content: "";
}

.refresh-icon::before {
  inset: 7px;
  border: 2px solid #a5e7ff;
  border-left-color: transparent;
  border-radius: 50%;
}

.random-icon::before {
  inset: 7px;
  border: 2px dotted #fff0a7;
  border-radius: 4px;
}

.lock-icon::before {
  top: 6px;
  left: 9px;
  width: 9px;
  height: 12px;
  border: 2px solid #bfefff;
  border-radius: 6px 6px 2px 2px;
}

.ready-icon::before {
  top: 8px;
  left: 6px;
  width: 15px;
  height: 8px;
  border-bottom: 3px solid #a8ffc7;
  border-left: 3px solid #a8ffc7;
  transform: rotate(-45deg);
}

.ready-action.active { filter: saturate(1.35); }

.xp-purchase {
  display: block;
  margin: 7px 0 0 auto;
  border: 0;
  background: transparent;
  color: #8ea8ad;
  font-size: 7px;
  cursor: pointer;
}

.talent-offer {
  margin-top: 8px;
  border: 1px solid rgba(226, 180, 93, .3);
  border-radius: 8px;
  padding: 6px;
  background: rgba(69, 43, 12, .28);
}

.talent-tier {
  display: grid;
  grid-template-columns: 52px 1fr 1fr;
  gap: 4px;
  align-items: stretch;
}

.talent-tier > b {
  display: grid;
  place-items: center;
  color: #ffe2a2;
  font-size: 7px;
}

.talent-tier button {
  border: 1px solid rgba(226, 180, 93, .25);
  border-radius: 5px;
  padding: 5px;
  background: rgba(5, 24, 29, .84);
  color: white;
  text-align: left;
}

.talent-tier button strong,
.talent-tier button small { display: block; font-size: 7px; }
.talent-tier button small { color: var(--muted); }

.talent-modal {
  z-index: 35;
}

.talent-modal-card {
  width: min(720px, 100%);
  border-color: rgba(255, 210, 100, 0.62);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 198, 70, 0.16), transparent 48%),
    linear-gradient(160deg, #102f39, #071a20);
}

.talent-modal-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.talent-modal-choices button {
  min-height: 125px;
  border: 1px solid rgba(255, 211, 108, 0.4);
  border-radius: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 211, 108, 0.14), transparent 62%),
    rgba(7, 30, 37, 0.94);
  color: #f5fbfa;
  text-align: center;
  cursor: pointer;
}

.talent-modal-choices button:hover {
  border-color: #ffe094;
  transform: translateY(-2px);
}

.talent-modal-choices strong,
.talent-modal-choices small {
  display: block;
}

.talent-modal-choices strong {
  margin-bottom: 9px;
  color: #ffe7a8;
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
}

.talent-modal-choices small {
  color: #c8d9d9;
  font-size: 12px;
  line-height: 1.45;
}

.atlas-card {
  position: relative;
  width: min(1050px, calc(100vw - 28px));
  max-height: min(780px, calc(100dvh - 28px));
  overflow: auto;
  text-align: left;
}

.atlas-close {
  position: absolute;
  top: 8px;
  right: 9px;
  border: 0;
  background: transparent;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.atlas-columns {
  display: grid;
  grid-template-columns: .8fr 1.5fr .8fr;
  gap: 12px;
}

.atlas-columns section {
  border: 1px solid rgba(117, 209, 210, .16);
  border-radius: 10px;
  padding: 12px;
  background: rgba(6, 27, 32, .72);
}

.atlas-columns h3 { margin: 0 0 8px; color: var(--gold-pale); font-size: 12px; }
.atlas-columns p { color: #b8cccf; font-size: 9px; line-height: 1.5; }

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

.atlas-style-grid article {
  display: grid;
  grid-template-columns: 30px 1fr;
  border: 1px solid color-mix(in srgb, var(--style-color) 35%, transparent);
  border-radius: 7px;
  padding: 6px;
  background: color-mix(in srgb, var(--style-color) 7%, rgba(2, 18, 22, .92));
}

.atlas-style-art { width: 26px; height: 26px; grid-row: 1 / 3; }
.atlas-style-grid b { color: white; font-size: 9px; }
.atlas-style-grid small { color: var(--muted); font-size: 7px; line-height: 1.35; }

/* Desktop keeps the card-art look, but uses the available space for readable text. */
@media (min-width: 1100px) {
  .shop-overlay { padding: 14px 16px 12px; }
  .shop-head { margin-bottom: 11px; }
  .shop-head .eyebrow { font-size: 14px; }
  .shop-head .pool-hint { margin-left: 8px; font-size: 10px; }
  .bank { font-size: 16px; }
  .bank small { font-size: 11px; }

  .shop-stage { grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; }
  .shop-grid { gap: 12px; }
  .shop-card { min-height: 278px; padding: 36px 16px 48px; }
  .shop-card .rarity-badge { top: 9px; right: 10px; font-size: 8px; }
  .card-style-crests { top: 9px; left: 11px; gap: 6px; }
  .card-style-crests .card-style.compact { width: 34px; height: 34px; }
  .card-style-crests .style-art { width: 27px; height: 27px; }
  .card-art-frame { width: 88px; height: 88px; margin-bottom: 7px; }
  .shop-card .card-icon { width: 84px; height: 84px; }
  .card-star-row { gap: 4px; margin: 0 -16px 8px; padding: 4px 0; }
  .card-star-row i { font-size: 14px; }
  .shop-card .card-name { margin: 5px 0 7px; font-size: 15px; line-height: 1.2; }
  .shop-card .card-desc { min-height: 42px; font-size: 11px; line-height: 1.42; }
  .card-style-caption { margin-top: 6px; font-size: 10px; }
  .shop-card .price { right: 17px; bottom: 11px; left: 17px; height: 29px; font-size: 14px; }
  .shop-card .price i, .shop-action b::before { width: 10px; height: 10px; }

  .shop-controls { gap: 8px; }
  .shop-action { min-height: 64px; grid-template-columns: 44px 1fr; padding: 7px 8px; }
  .shop-action span { font-size: 10px; }
  .shop-action b { gap: 5px; font-size: 13px; }
  .action-icon { width: 37px; height: 37px; }
  .refresh-icon::before, .random-icon::before { inset: 9px; }
}

@media (max-width: 800px) {
  .hero-offers { grid-template-columns: repeat(3, minmax(110px, 1fr)); overflow-x: auto; }
  .hero-offers .hero-card { min-height: 205px; }
  .hero-shop-panel { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: 13px; }
  .hero-shop-heading { align-items: stretch; flex-direction: column; gap: 9px; padding-bottom: 9px; }
  .hero-shop-heading h2 { font-size: 16px; }
  .hero-shop-heading p { font-size: 9px; }
  .hero-shard-balance { align-self: flex-start; padding: 6px 8px; }
  .hero-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: calc(100dvh - 176px); gap: 7px; }
  .hero-shop-card { grid-template-columns: 44px minmax(0, 1fr); min-height: 71px; padding: 7px; gap: 3px 6px; }
  .hero-shop-portrait { width: 42px; height: 53px; }
  .hero-shop-portrait .hero-portrait { width: 57px; height: 57px; }
  .hero-shop-copy b { font-size: 9px; }
  .hero-shop-copy small { font-size: 7px; }
  .hero-owned, .hero-buy { min-width: 60px; min-height: 20px; padding: 0 5px; font-size: 7px; }
  .draft-actions { position: sticky; bottom: 0; }
  .game-topbar .atlas-button { min-width: 34px; min-height: 29px; padding: 0 4px; font-size: 6px; }
  .shop-overlay { right: 4px; bottom: 47px; left: 4px; padding: 7px; }
  .shop-head { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .shop-odds { width: 100%; order: 3; gap: 3px; }
  .shop-odds i { flex: 1; padding: 4px 3px; font-size: 5px; text-align: center; }
  .shop-lock-state { padding: 4px 6px; font-size: 6px; letter-spacing: .04em; }
  .talent-modal-choices { grid-template-columns: 1fr; gap: 8px; }
  .talent-modal-choices button { min-height: 92px; padding: 12px; }
  .shop-stage { grid-template-columns: minmax(0, 1fr) 59px; gap: 5px; }
  .shop-grid {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 1px 2px 5px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .shop-grid::-webkit-scrollbar { display: none; }
  .shop-card {
    min-width: 122px;
    min-height: 196px;
    flex: 0 0 122px;
    padding: 22px 6px 32px;
    scroll-snap-align: start;
  }
  .card-art-frame { width: 58px; height: 58px; }
  .shop-card .card-icon { width: 54px; height: 54px; }
  .shop-card .card-name { font-size: 8px; }
  .shop-card .card-desc { display: block; min-height: 29px; font-size: 6px; }
  .card-style-crests { top: 6px; left: 7px; gap: 4px; }
  .card-style-crests .card-style.compact { width: 25px; height: 25px; }
  .card-style-crests .style-art { width: 20px; height: 20px; }
  .card-style-caption { overflow: visible; font-size: 6px; line-height: 1.25; white-space: normal; }
  .shop-card .price { right: 5px; bottom: 5px; left: 5px; height: 21px; }
  .shop-controls { gap: 4px; }
  .shop-action { min-height: 43px; grid-template-columns: 23px 1fr; padding: 3px; }
  .action-icon { width: 22px; height: 22px; }
  .shop-action span { font-size: 5px; }
  .shop-action b { font-size: 7px; }
  .shop-toggle { right: 6px; bottom: 7px; }
  .shop-toggle.open { right: 8px; bottom: 7px; transform: none; }
  .atlas-columns { grid-template-columns: 1fr; }
  .atlas-style-grid { grid-template-columns: 1fr; }
}

.score-row {
  position: relative;
  overflow: visible;
}

.player-inspect {
  position: absolute;
  z-index: 40;
  top: 6px;
  left: calc(100% + 8px);
  display: none;
  width: 235px;
  border: 1px solid rgba(226, 180, 93, .35);
  border-radius: 9px;
  padding: 9px;
  background: rgba(3, 18, 23, .98);
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  color: white;
  text-align: left;
  pointer-events: none;
}

.score-row:hover .player-inspect,
.score-row:focus .player-inspect { display: block; }
.player-inspect strong,
.player-inspect small { display: block; }
.player-inspect small { margin: 3px 0 7px; color: var(--muted); font-size: 7px; }
.inspect-styles { display: flex; flex-wrap: wrap; gap: 3px; }
.inspect-styles i {
  border: 1px solid color-mix(in srgb, var(--style-color) 45%, transparent);
  border-radius: 99px;
  padding: 2px 4px;
  color: color-mix(in srgb, var(--style-color) 75%, white);
  font-size: 6px;
  font-style: normal;
}
.inspect-items { display: flex; min-height: 24px; align-items: center; gap: 3px; margin-top: 6px; color: var(--muted); font-size: 7px; }
.inspect-item { width: 23px; height: 23px; }

@media (max-width: 800px) {
  .scoreboard:has(.score-row:focus),
  .scoreboard:has(.battle-row:focus) {
    max-height: none;
    overflow: visible;
  }

  .player-inspect,
  .battle-inspect {
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    width: min(235px, 75vw);
  }

  .battle-inspect {
    grid-template-columns: 1fr;
  }

  .battle-inspect-player + .battle-inspect-player {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
  }
}

/* Readability pass: gameplay information must remain legible at every viewport. */
.eyebrow { font-size: 12px; letter-spacing: .12em; }
.section-title { font-size: 17px; }
.counter { font-size: 13px; }
.player-name { font-size: 14px; }
.player-label { font-size: 11px; }
.hero-name { font-size: 16px; }
.hero-title { min-height: 34px; font-size: 12px; line-height: 1.4; }
.trait { padding: 4px 7px; font-size: 10px; }
.favorite-style { font-size: 10px; }
.draft-bans > span,
.draft-bans b,
.draft-reroll-bans { font-size: 10px; }
.draft-actions { max-width: 680px; }
.draft-actions .btn { min-height: 46px; font-size: 12px; }

.round-label { font-size: 15px; }
.phase-message { color: #c1d0d0; font-size: 13px; }
.topbar-exit,
.atlas-button { font-size: 11px; }
.timer-ring { width: 46px; height: 46px; font-size: 15px; }
.score-name { font-size: 13px; }
.score-stats { color: #b8c8c8; font-size: 11px; }
.hp { font-size: 13px; }
.battle-versus { font-size: 9px; }
.battle-number { font-size: 10px; }
.battle-pair-names { font-size: 12px; }
.battle-pair-names b { font-size: 13px; }
.battle-row-bottom { font-size: 10px; }
.battle-watch-state,
.watch-indicator { font-size: 9px; }
.arena-status { font-size: 12px; }
.spectator-notice,
.spectator-notice b { font-size: 11px; }
.spectating-chip { font-size: 9px; }
.damage-type-guide span { min-height: 30px; padding: 6px 8px; font-size: 10px; }
.damage-type-guide small { font-size: 9px; }

.build-hero h3 { font-size: 17px; }
.build-hero p { color: #bdcdcd; font-size: 11px; }
.hero-level,
.commander-health { font-size: 10px; }
.hero-skill b { font-size: 9px; }
.hero-skill span { font-size: 10px; line-height: 1.38; }
.stat span { font-size: 10px; }
.stat strong { font-size: 15px; }
.mini-title { font-size: 11px; }
.style-progress-head { font-size: 11px; }
.style-progress-art { width: 22px; height: 22px; }
.style-progress small { color: #b8c8c8; font-size: 9px; line-height: 1.35; }
.empty { font-size: 11px; }
.damage-line { font-size: 10px; }
.card-level-chip b,
.card-level-chip em { font-size: 8px; }

.shop-head .eyebrow { font-size: 13px; }
.pool-hint { color: #b7c7c7; font-size: 10px; }
.bank { font-size: 15px; }
.bank small { font-size: 11px; }
.shop-card .rarity-badge { font-size: 9px; }
.shop-card .card-name { font-size: 14px; line-height: 1.25; }
.shop-card .card-desc { color: #e0eeee; font-size: 11px; line-height: 1.42; }
.card-style-caption { color: #9ff1d5; font-size: 10px; line-height: 1.35; }
.shop-card .price { font-size: 13px; }
.shop-action span { font-size: 9px; }
.shop-action b { font-size: 12px; }
.shop-toggle { min-height: 42px; font-size: 10px; }
.xp-purchase { font-size: 10px; }
.talent-tier > b,
.talent-tier button strong,
.talent-tier button small { font-size: 10px; line-height: 1.35; }

.hero-shop-heading p { color: #c3d1d1; font-size: 13px; }
.hero-shard-balance { font-size: 12px; }
.hero-shop-copy b { font-size: 13px; }
.hero-shop-copy small { color: #bdcccc; font-size: 10px; }
.hero-owned,
.hero-buy { min-height: 28px; font-size: 11px; }

.modal-card > p { color: #bdcccc; font-size: 14px; line-height: 1.5; }
.gameover-panel p { color: #bdcccc; font-size: 12px; line-height: 1.45; }
.reward-card strong { font-size: 14px; }
.reward-card small { color: #bdcccc; font-size: 11px; line-height: 1.4; }
.toast { font-size: 14px; }
.player-inspect { width: 280px; }
.player-inspect strong { font-size: 13px; }
.player-inspect small,
.inspect-items { color: #bdcccc; font-size: 10px; }
.inspect-styles i { font-size: 9px; }
.atlas-columns h3 { font-size: 15px; }
.atlas-columns p { color: #c9d7d7; font-size: 12px; }
.atlas-style-grid b { font-size: 12px; }
.atlas-style-grid small { color: #bdcccc; font-size: 10px; }

.card-current-value {
  display: block;
  margin-top: 4px;
  border: 1px solid rgba(116, 227, 198, 0.24);
  border-radius: 7px;
  padding: 4px 6px;
  background: rgba(13, 54, 57, 0.72);
  color: #a9d8cf;
  font-size: 9px;
  line-height: 1.3;
}

.card-current-value b {
  color: #fff2ae;
  font-size: 11px;
}

@media (min-width: 921px) {
  .scoreboard {
    position: relative;
    z-index: 60;
    overflow: visible;
  }

  .player-inspect {
    z-index: 80;
  }
}

@media (min-width: 1400px) {
  .game-layout { grid-template-columns: 270px minmax(0, 1fr) 340px; gap: 12px; }
  .scoreboard, .build-panel { padding: 13px; }
  .score-row { grid-template-columns: 36px 1fr auto; min-height: 58px; padding: 8px; }
  .battle-row { min-height: 104px; padding: 9px; }
  .battle-avatar { width: 35px; height: 35px; }
  .build-hero .hero-icon { width: 76px; height: 76px; }
  .hero-skill { padding: 9px; }
  .style-progress { padding: 8px; }
  .shop-card { min-height: 300px; padding-right: 18px; padding-left: 18px; }
  .shop-card .card-name { font-size: 16px; }
  .shop-card .card-desc { min-height: 52px; font-size: 13px; }
  .card-style-caption { font-size: 11px; }
  .shop-stage { grid-template-columns: minmax(0, 1fr) 150px; }
  .shop-action { min-height: 68px; }
  .shop-action span { font-size: 11px; }
  .shop-action b { font-size: 14px; }
}

@media (min-width: 921px) and (max-width: 1399px) {
  .game-layout { grid-template-columns: 235px minmax(0, 1fr) 305px; }
  .scoreboard, .build-panel { padding: 11px; }
  .battle-row { min-height: 98px; }
  .shop-card { min-height: 268px; }
}

@media (max-width: 920px) {
  body { font-size: 14px; }
  .game-layout { grid-template-rows: minmax(0, 1fr) 174px; }
  .scoreboard { width: 225px; }
  .build-panel { max-height: 174px; grid-template-columns: 132px 1fr; }
  .score-name { font-size: 12px; }
  .score-stats { font-size: 10px; }
  .battle-pair-names { font-size: 11px; }
  .hero-skill b { font-size: 9px; }
  .hero-skill span { font-size: 10px; }
  .style-progress-head { font-size: 10px; }
  .style-progress small { font-size: 9px; }
  .hero-shop-heading p { font-size: 11px; }
  .hero-shop-copy b { font-size: 11px; }
  .hero-shop-copy small { font-size: 9px; }
  .hero-owned, .hero-buy { min-height: 25px; font-size: 10px; }
}

@media (max-width: 800px) {
  .game-topbar .atlas-button { min-width: 44px; min-height: 32px; padding: 0 7px; font-size: 9px; }
  .round-label { font-size: 12px; }
  .phase-message { font-size: 10px; }
  .topbar-exit { font-size: 9px; }
  .hero-offers { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .hero-offers .hero-card { min-height: 235px; }
  .favorite-style { font-size: 9px; }
  .hero-name { font-size: 14px; }
  .hero-title { font-size: 10px; }
  .trait { font-size: 9px; }
  .draft-actions { overflow-x: auto; }
  .draft-actions .btn { min-width: 126px; padding: 0 10px; font-size: 10px; }

  .shop-stage { grid-template-columns: minmax(0, 1fr) 78px; gap: 7px; }
  .shop-card { min-width: 154px; min-height: 232px; flex-basis: 154px; padding: 24px 9px 36px; }
  .card-art-frame { width: 68px; height: 68px; }
  .shop-card .card-icon { width: 64px; height: 64px; }
  .shop-card .card-name { font-size: 12px; }
  .shop-card .card-desc { min-height: 44px; font-size: 10px; }
  .card-style-caption { font-size: 9px; }
  .shop-card .price { height: 26px; font-size: 12px; }
  .shop-action { min-height: 52px; grid-template-columns: 28px 1fr; padding: 4px; }
  .action-icon { width: 26px; height: 26px; }
  .shop-action span { font-size: 7px; letter-spacing: 0; }
  .shop-action b { font-size: 10px; }
  .xp-purchase { font-size: 9px; }
  .hero-shop-grid { grid-template-columns: repeat(2, minmax(148px, 1fr)); }
  .hero-shop-card { grid-template-columns: 48px minmax(0, 1fr); min-height: 80px; }
  .hero-shop-portrait { width: 46px; height: 58px; }
}

@media (max-width: 560px) {
  .lobby-screen { padding-right: 10px; padding-left: 10px; }
  .game-topbar { height: 58px; gap: 6px; padding: 0 8px; }
  .round-label { max-width: 72px; font-size: 11px; }
  .phase-message { font-size: 9px; }
  .timer-ring { width: 39px; height: 39px; font-size: 13px; }
  .topbar-exit { min-height: 32px; padding: 0 7px; font-size: 8px; }
  .game-layout { height: calc(100dvh - 87px - var(--safe-top) - var(--safe-bottom)); grid-template-rows: minmax(0, 1fr) 162px; }
  .build-panel { max-height: 162px; grid-template-columns: 115px 1fr; }
  .arena-status { font-size: 10px; }
  .shop-head .eyebrow { font-size: 10px; }
  .pool-hint { font-size: 8px; }
  .bank { font-size: 12px; }
  .bank small { display: none; }
  .income-breakdown { grid-template-columns: repeat(4, minmax(58px, 1fr)); }
  .income-breakdown span { padding: 4px 3px; font-size: 6px; }
  .income-breakdown b { font-size: 9px; }
  .advanced-stats-grid { grid-template-columns: 1fr; }
  .shop-overlay { max-height: calc(100dvh - 120px); overflow-y: auto; }
  .hero-shop-grid { grid-template-columns: 1fr; max-height: calc(100dvh - 190px); }
  .hero-shop-card { grid-template-columns: 54px minmax(0, 1fr) auto; }
  .hero-shop-portrait { grid-row: 1 / 3; width: 52px; }
  .hero-owned, .hero-buy { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .modal { padding: 8px; }
  .modal-card { padding: 16px; }
}

/* Style crests: artwork fills the frame instead of disappearing in its padding. */
.style-art {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  filter: saturate(1.22) brightness(1.16) drop-shadow(0 1px 3px rgba(0, 0, 0, .9));
}

.card-style-crests { gap: 7px; }

.card-style-crests .card-style.compact {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-width: 2px;
  border-radius: 11px 11px 50% 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--style-color) 38%, #112a31) 0 45%, rgba(2, 13, 19, .98) 78%);
  box-shadow:
    0 3px 9px rgba(0, 0, 0, .68),
    0 0 10px color-mix(in srgb, var(--style-color) 28%, transparent),
    inset 0 1px 3px rgba(255, 255, 255, .25);
}

.card-style-crests .style-art,
.card-style-crests .card-style.compact .style-art {
  width: 41px;
  height: 41px;
  margin: 0;
  transform: scale(1.13);
  filter: saturate(1.3) brightness(1.22) drop-shadow(0 1px 3px rgba(0, 0, 0, .9));
}

.style-progress-head { min-height: 34px; }
.style-progress-art { width: 32px; height: 32px; margin-right: 3px; transform: scale(1.08); }
.atlas-style-grid article { grid-template-columns: 43px 1fr; align-items: center; }
.atlas-style-art { width: 39px; height: 39px; transform: scale(1.08); }

@media (min-width: 1400px) {
  .card-style-crests .card-style.compact { width: 50px; height: 50px; }
  .card-style-crests .style-art,
  .card-style-crests .card-style.compact .style-art { width: 47px; height: 47px; }
  .style-progress-art { width: 36px; height: 36px; }
}

@media (max-width: 800px) {
  .card-style-crests { top: 7px; left: 8px; gap: 5px; }
  .card-style-crests .card-style.compact { width: 38px; height: 38px; }
  .card-style-crests .style-art,
  .card-style-crests .card-style.compact .style-art { width: 36px; height: 36px; transform: scale(1.12); }
  .style-progress-art { width: 29px; height: 29px; }
  .atlas-style-art { width: 36px; height: 36px; }
}

/* Profile hub, matchmaking and clearer combat HUD */
.card-style-crests .card-style.compact {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.card-style-crests .style-art,
.card-style-crests .card-style.compact .style-art {
  flex: 0 0 auto;
  transform: translate(var(--style-art-x, 0), var(--style-art-y, 0)) scale(1.13);
  transform-origin: 50% 50%;
}

.hero-offers .hero-icon {
  width: 108px;
  height: 108px;
  margin-bottom: 14px;
  border-width: 2px;
  border-radius: 25px;
}

.hero-offers .hero-portrait {
  transform: scale(1.08);
}

.home-screen {
  overflow-x: hidden;
  overflow-y: auto;
  place-items: center;
}

.home-content-wide {
  width: min(1120px, 100%);
  margin: auto;
}

.home-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.home-profile-stats {
  display: flex;
  gap: 8px;
}

.home-profile-stats > span {
  display: grid;
  min-width: 128px;
  gap: 2px;
  border: 1px solid rgba(226, 180, 93, .3);
  border-radius: 12px;
  padding: 9px 13px;
  background: rgba(4, 20, 24, .88);
  text-align: right;
  backdrop-filter: blur(16px);
}

.home-profile-stats small,
.profile-item-rarity {
  color: #93a9aa;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.home-profile-stats b {
  color: #ffe199;
  font-size: 14px;
}

.player-rating {
  margin-top: 2px;
  color: #e6bf69;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(390px, .9fr) minmax(430px, 1.1fr);
  gap: 20px;
  align-items: end;
}

.home-main .hero-heading {
  font-size: clamp(48px, 7vw, 78px);
}

.home-main .hero-subtitle {
  max-width: 520px;
  margin-bottom: 20px;
  color: #d6e1df;
  font-size: 14px;
}

.btn-matchmaking {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-color: rgba(255, 224, 142, .55);
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 224, 142, .25), transparent 36%),
    linear-gradient(135deg, #d9a944, #77501c);
  color: #170f04;
  box-shadow: 0 12px 34px rgba(197, 137, 44, .25);
}

.btn-matchmaking span,
.hub-action span {
  display: grid;
  gap: 3px;
  text-align: left;
}

.btn-matchmaking b {
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  letter-spacing: .04em;
}

.btn-matchmaking small,
.hub-action small {
  font-size: 9px;
  font-weight: 800;
  opacity: .72;
}

.btn-matchmaking.searching .search-rune {
  animation: hub-spin 1s linear infinite;
}

.search-rune {
  position: relative;
  width: 28px;
  height: 28px;
  border: 3px solid #211503;
  border-radius: 50%;
}

.search-rune::after {
  position: absolute;
  width: 12px;
  height: 3px;
  right: -9px;
  bottom: -4px;
  rotate: 45deg;
  border-radius: 3px;
  background: #211503;
  content: "";
}

.private-actions {
  margin-top: 10px;
}

.private-actions .btn {
  min-height: 44px;
  font-size: 10px;
}

.home-hub {
  border: 1px solid rgba(128, 215, 214, .2);
  border-radius: 22px;
  padding: 17px;
  background:
    linear-gradient(145deg, rgba(10, 41, 48, .96), rgba(3, 18, 22, .96));
  box-shadow: 0 24px 90px rgba(0, 0, 0, .46);
  backdrop-filter: blur(20px);
}

.home-hub-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-hub-heading h2,
.home-panel-heading h2,
.home-overlay-card > h2 {
  margin: 3px 0 0;
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
}

.home-item-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.profile-item-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  padding: 10px;
  background: linear-gradient(145deg, #123640, #071d23);
}

.profile-item-card.compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px 6px;
  text-align: center;
}

.profile-item-card.equipped {
  border-color: #ebc66f;
  box-shadow: inset 0 0 0 1px rgba(235, 198, 111, .25);
}

.profile-item-picture {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(226, 180, 93, .45);
  border-radius: 12px;
  background: #06171c;
}

.compact .profile-item-picture {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.profile-item-art {
  width: 100%;
  height: 100%;
  transform: scale(1.08);
}

.profile-item-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-item-copy strong {
  overflow: hidden;
  color: #f4f8f7;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact .profile-item-copy strong {
  font-size: 9px;
}

.profile-item-copy small {
  color: #b7c9ca;
  font-size: 10px;
}

.compact .profile-item-copy small,
.compact .profile-item-rarity {
  display: none;
}

.profile-item-action {
  min-width: 92px;
  min-height: 38px;
  border: 1px solid rgba(226, 180, 93, .45);
  border-radius: 9px;
  background: #173d47;
  color: #ffe199;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.profile-item-action:disabled {
  cursor: default;
  opacity: .58;
}

.hub-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.hub-action {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(104, 217, 215, .25);
  border-radius: 13px;
  padding: 9px 12px;
  background: linear-gradient(135deg, #153c46, #0b2830);
  color: #edf8f7;
  cursor: pointer;
}

.hub-shop {
  margin-top: 9px;
  border-color: rgba(226, 180, 93, .36);
}

.hub-action > i {
  position: relative;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border: 2px solid #e2b45d;
  border-radius: 8px;
  rotate: 45deg;
}

.hub-action > i::after {
  position: absolute;
  inset: 7px;
  border: 2px solid currentColor;
  content: "";
}

.hub-wheel-icon {
  border-radius: 50% !important;
}

.hub-wheel-icon::after {
  inset: 5px !important;
  border-radius: 50%;
}

.hub-quest-icon::after {
  inset: 6px 8px !important;
  border-width: 0 0 3px 3px !important;
}

.home-overlay {
  position: fixed;
  z-index: 80;
  display: grid;
  inset: 0;
  place-items: center;
  overflow: auto;
  padding: 22px;
  background: rgba(1, 8, 11, .86);
  backdrop-filter: blur(12px);
}

.home-overlay-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(820px, calc(100dvh - 44px));
  overflow: auto;
  border: 1px solid rgba(226, 180, 93, .3);
  border-radius: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(68, 194, 191, .12), transparent 34%),
    #071c22;
  box-shadow: 0 30px 120px rgba(0, 0, 0, .68);
}

.home-overlay-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: #123039;
  color: white;
  cursor: pointer;
  font-size: 24px;
}

.home-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-right: 42px;
}

.profile-gold {
  color: #ffe199;
  font-size: 18px;
}

.home-panel-note {
  margin: 10px 0 17px;
  color: #b8c8c8;
  font-size: 12px;
}

.profile-items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.wheel-panel {
  width: min(520px, 100%);
  text-align: center;
}

.fortune-stage {
  position: relative;
  width: min(310px, 70vw);
  margin: 18px auto;
  aspect-ratio: 1;
}

.fortune-wheel {
  position: absolute;
  display: grid;
  inset: 8px;
  place-items: center;
  overflow: hidden;
  border: 8px solid #d4a34a;
  border-radius: 50%;
  background: conic-gradient(#113b4a 0 25%, #72334e 25% 50%, #17604f 50% 75%, #76501d 75% 100%);
  box-shadow: 0 0 0 4px #3d2810, 0 18px 50px rgba(0, 0, 0, .55), inset 0 0 30px rgba(0, 0, 0, .45);
}

.fortune-wheel::before,
.fortune-wheel::after {
  position: absolute;
  width: 100%;
  height: 2px;
  background: rgba(255, 232, 170, .72);
  content: "";
}

.fortune-wheel::after {
  rotate: 90deg;
}

.fortune-wheel span {
  position: absolute;
  color: white;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 2px 4px black;
}

.fortune-wheel span:nth-child(1) { top: 16%; left: 27%; }
.fortune-wheel span:nth-child(2) { top: 28%; right: 13%; }
.fortune-wheel span:nth-child(3) { right: 26%; bottom: 16%; }
.fortune-wheel span:nth-child(4) { left: 10%; bottom: 30%; }

.fortune-wheel.spinning {
  animation: fortune-spin 1s cubic-bezier(.15, .68, .24, 1) forwards;
}

.fortune-pointer {
  position: absolute;
  z-index: 3;
  top: -7px;
  left: 50%;
  width: 0;
  height: 0;
  translate: -50% 0;
  border-top: 0;
  border-right: 16px solid transparent;
  border-bottom: 30px solid #fff0a8;
  border-left: 16px solid transparent;
  filter: drop-shadow(0 3px 3px #000);
}

.wheel-spin {
  width: min(360px, 100%);
  margin: 0 auto;
}

.wheel-result {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 13px;
  border: 1px solid rgba(226, 180, 93, .3);
  border-radius: 13px;
  padding: 8px;
  background: rgba(226, 180, 93, .08);
}

.wheel-reward-hero {
  width: 52px;
  height: 52px;
}

.reward-coin {
  width: 35px;
  height: 35px;
  border: 4px solid #fff0a0;
  border-radius: 50%;
  background: #d9a62d;
  box-shadow: 0 0 16px rgba(255, 205, 73, .5);
}

.quest-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.quest-group {
  display: grid;
  align-content: start;
  gap: 8px;
}

.quest-group h3 {
  margin: 0 0 3px;
  color: #ffe199;
  font-size: 13px;
}

.quest-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  padding: 11px;
  background: #0d2b33;
}

.quest-card.complete {
  border-color: rgba(226, 180, 93, .5);
}

.quest-card.claimed {
  opacity: .58;
}

.quest-copy {
  display: grid;
  gap: 3px;
}

.quest-copy strong {
  font-size: 12px;
}

.quest-copy small {
  color: #b9cacc;
  font-size: 9px;
}

.quest-progress {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 7px;
  background: #041418;
}

.quest-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #2fa67c, #74e8aa);
}

.quest-progress span {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: white;
  font-size: 8px;
  font-weight: 900;
}

.quest-card button {
  min-height: 34px;
  border: 1px solid rgba(226, 180, 93, .4);
  border-radius: 8px;
  background: #153c45;
  color: #ffe199;
  cursor: pointer;
  font-size: 8px;
  font-weight: 900;
}

.quest-card button:disabled {
  cursor: default;
  opacity: .45;
}

@keyframes hub-spin {
  to { rotate: 360deg; }
}

@keyframes fortune-spin {
  to { rotate: 1420deg; }
}

@media (max-width: 800px) {
  .card-style-crests .style-art,
  .card-style-crests .card-style.compact .style-art {
    transform: translate(var(--style-art-x, 0), var(--style-art-y, 0)) scale(1.12);
  }

  .hero-offers .hero-icon {
    width: 82px;
    height: 82px;
    border-radius: 19px;
  }

  .home-screen {
    display: block;
    padding: calc(18px + var(--safe-top)) 10px calc(18px + var(--safe-bottom));
  }

  .home-profile-bar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .home-profile-bar .brand-mark {
    max-width: 140px;
    font-size: 8px;
  }

  .home-profile-stats {
    gap: 4px;
  }

  .home-profile-stats > span {
    min-width: 0;
    padding: 7px 8px;
  }

  .home-profile-stats small {
    font-size: 6px;
  }

  .home-profile-stats b {
    font-size: 10px;
  }

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

  .home-main .hero-heading {
    margin: 12px 0 7px;
    font-size: clamp(42px, 16vw, 64px);
  }

  .home-main .hero-subtitle {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.45;
  }

  .home-card,
  .home-hub {
    border-radius: 16px;
    padding: 12px;
  }

  .btn-matchmaking {
    min-height: 64px;
  }

  .btn-matchmaking b {
    font-size: 11px;
  }

  .home-item-preview {
    gap: 5px;
  }

  .compact .profile-item-copy strong {
    font-size: 7px;
  }

  .hub-action-row {
    grid-template-columns: 1fr;
  }

  .home-overlay {
    padding: 7px;
  }

  .home-overlay-card {
    max-height: calc(100dvh - 14px);
    border-radius: 15px;
    padding: 17px 12px;
  }

  .profile-items-grid,
  .quest-columns {
    grid-template-columns: 1fr;
  }

  .profile-item-card {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .profile-item-picture {
    width: 56px;
    height: 56px;
  }

  .profile-item-action {
    min-width: 74px;
    padding: 0 5px;
  }
}

/* Dual-currency account store and rating talismans */
.premium-wallet b,
.profile-crystals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #85f2ff !important;
}

.premium-wallet i,
.profile-crystals i {
  display: inline-block;
  width: 12px;
  height: 12px;
  rotate: 45deg;
  border: 2px solid #b8fbff;
  border-radius: 3px;
  background: linear-gradient(135deg, #9ef7ff, #3477cb);
  box-shadow: 0 0 12px rgba(83, 216, 255, .7);
}

.profile-crystals {
  padding-right: 43px;
  font-size: 18px;
}

.profile-heroes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.profile-hero-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 10px;
  background:
    radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--hero-color) 18%, transparent), transparent 42%),
    linear-gradient(145deg, #12323c, #071b21);
}

.profile-hero-card.owned {
  border-color: color-mix(in srgb, var(--hero-color) 50%, #d9b45c);
}

.profile-hero-picture {
  display: block;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hero-color) 55%, transparent);
  border-radius: 16px;
  background: #06161b;
}

.profile-hero-picture .hero-portrait {
  width: 100%;
  height: 100%;
  transform: scale(1.08);
}

.profile-hero-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-hero-copy > span {
  color: var(--hero-color);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.profile-hero-copy strong {
  font-size: 14px;
}

.profile-hero-copy small {
  overflow: hidden;
  color: #aebfc1;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hero-card > button,
.rating-booster-card > button {
  min-width: 90px;
  min-height: 38px;
  border: 1px solid rgba(226, 180, 93, .5);
  border-radius: 9px;
  background: linear-gradient(135deg, #244851, #15323a);
  color: #ffe29c;
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}

.profile-hero-card > button:disabled,
.rating-booster-card > button:disabled {
  cursor: default;
  filter: grayscale(.7);
  opacity: .42;
}

.profile-hero-owned {
  color: #7fe7bd;
  font-size: 9px;
}

.rating-shop-panel {
  width: min(760px, 100%);
}

.rating-booster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.rating-booster-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  border: 1px solid rgba(226, 180, 93, .27);
  border-radius: 16px;
  padding: 15px;
  background:
    radial-gradient(circle at 10% 35%, rgba(226, 180, 93, .16), transparent 34%),
    linear-gradient(145deg, #14333b, #071a20);
}

.rating-booster-card > i {
  display: grid;
  width: 66px;
  height: 66px;
  grid-row: 1 / 3;
  place-items: center;
  border: 3px solid #e7c269;
  border-radius: 18px;
  rotate: 45deg;
  background: #0d2c35;
  box-shadow: inset 0 0 18px rgba(226, 180, 93, .25), 0 0 22px rgba(0, 0, 0, .55);
}

.rating-booster-card > i::after {
  display: block;
  width: 24px;
  height: 24px;
  rotate: -45deg;
  border: 4px solid #8ce8dc;
  border-radius: 50%;
  content: "";
}

.booster-double > i::after {
  border-radius: 3px;
  box-shadow: 9px 0 0 -3px #8ce8dc;
}

.rating-booster-card strong {
  color: #ffe5a3;
  font-size: 13px;
}

.rating-booster-card p {
  min-height: 34px;
  margin: 5px 0;
  color: #c7d4d4;
  font-size: 10px;
  line-height: 1.45;
}

.rating-booster-card small {
  color: #79d9cf;
  font-size: 9px;
  font-weight: 900;
}

.rating-booster-card > button {
  grid-column: 2;
  width: 100%;
}

.hub-hero-icon {
  border-radius: 50% !important;
}

.hub-hero-icon::after {
  inset: 6px 9px !important;
  border-radius: 50% 50% 40% 40%;
}

.hub-rating-icon::after {
  inset: 5px !important;
  rotate: -45deg;
  border-width: 3px !important;
  border-radius: 50%;
}

.home-rules-action {
  margin-top: 8px;
}

.hub-rules-icon::after {
  inset: 6px 8px !important;
  border-width: 0 3px !important;
  rotate: -45deg;
}

.atlas-rule-list {
  display: grid;
  gap: 6px;
}

.atlas-rule-list p {
  margin: 0;
  border-left: 2px solid rgba(226, 180, 93, .4);
  padding-left: 8px;
}

.atlas-rule-list b {
  color: #ffe199;
}

@media (max-width: 800px) {
  .home-profile-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-profile-bar .brand-mark {
    max-width: none;
  }

  .home-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .home-profile-stats > span {
    text-align: center;
  }

  .premium-wallet b {
    justify-content: center;
  }

  .profile-heroes-grid,
  .rating-booster-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero-card {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    padding: 8px;
  }

  .profile-hero-picture {
    width: 60px;
    height: 60px;
  }

  .profile-hero-card > button {
    min-width: 73px;
    padding: 0 5px;
    font-size: 8px;
  }

  .profile-crystals {
    justify-content: flex-start;
    padding-right: 42px;
  }
}
