/* Atlas command table: original cartographic geometry, Ava navy and rose. */
.atlas-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.tool-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #111b2d;
  color: #b9c8df;
  flex-shrink: 0;
}
.tool-button:hover {
  color: #fda4af;
  border-color: #fb7185;
  background: #29182b;
}
.topbar {
  min-height: 80px;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 20px;
}
.account-tools {
  gap: 8px;
}
.account-tools .profile .avatar {
  display: none;
}
.brand small {
  font-size: 8px;
}
.prototype {
  font-size: 10px;
  padding: 10px 0;
}
.prototype button {
  font-size: 10px;
}
.atlas-lobby {
  padding: 36px 0 20px;
}
.lobby-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.lobby-heading h1 {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.055em;
  margin: 8px 0 12px;
}
.lobby-heading p {
  margin: 0;
}
.lobby-heading .eyebrow {
  font-size: 10px;
  letter-spacing: 0.25em;
}
.lobby-heading .secondary {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 20px;
}
.mode-feature,
.mode-tile {
  position: relative;
  isolation: isolate;
  border: 1px solid #334155;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(130deg, #19233b, #0b1124 65%);
}
.mode-feature {
  min-height: 470px;
  display: flex;
  align-items: flex-end;
}
.lobby-globe {
  position: absolute;
  width: 85%;
  right: -12%;
  top: -15%;
  opacity: 0.8;
  z-index: -1;
}
.lobby-globe .globe {
  width: 100%;
  height: auto;
  position: static;
  animation: atlas-orbit 90s linear infinite;
}
.mode-art {
  position: absolute;
  inset: 24px 25px auto 25px;
  display: flex;
  justify-content: center;
  height: 275px;
  align-items: center;
  pointer-events: none;
}
.mode-art > div {
  width: 150px;
  transform: rotate(-15deg) translateY(15px);
}
.mode-art > div:nth-child(2) {
  transform: translateY(-6px);
  z-index: 2;
}
.mode-art > div:nth-child(3) {
  transform: rotate(15deg) translateY(15px);
}
.mode-copy {
  padding: 30px;
  width: 100%;
  background: linear-gradient(transparent, #080d20 25%);
}
.mode-copy h2 {
  font-size: 38px;
  margin: 10px 0;
}
.mode-copy p {
  max-width: 340px;
}
.mode-copy .primary {
  min-width: 230px;
}
.lobby-side {
  display: grid;
  gap: 20px;
  grid-template-rows: 1fr 1fr;
}
.mode-tile {
  padding: 26px;
  background:
    radial-gradient(ellipse at 100% 0, #50223955, transparent 70%), #0f172a;
}
.mode-tile h2 {
  font-size: 25px;
  margin: 12px 0;
}
.mode-tile p {
  font-size: 13px;
  max-width: 260px;
}
.mode-tile .eyebrow {
  font-size: 9px;
}
.mode-emblem {
  position: absolute;
  right: 20px;
  top: 22px;
  color: #fb718577;
}
.mode-emblem .atlas-icon {
  width: 50px;
  height: 50px;
}
.friend-tile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  align-content: center;
}
.friend-tile .eyebrow,
.friend-tile h2 {
  grid-column: 1/-1;
}
.friend-tile h2 {
  margin-bottom: 22px;
}
.friend-tile button {
  padding: 12px;
  font-size: 12px;
}
.friend-tile form {
  display: flex;
  min-width: 0;
  gap: 4px;
}
.friend-tile input {
  width: 100%;
  font-size: 12px;
  padding: 10px;
}
.friend-tile .icon-button {
  width: 36px;
}
.lobby-bottom {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px 0;
}
.lobby-deck {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-align: left;
  background: #111b2c;
  border: 1px solid #334155;
  border-radius: 12px;
}
.lobby-deck > span:last-child {
  padding-left: 22px;
  color: #fb7185;
}
.lobby-deck small {
  color: #94a3b8;
  font-size: 10px;
  margin-top: 4px;
}
.lobby-stat {
  font-size: 11px;
  color: #94a3b8;
}
.lobby-stat b {
  display: block;
  font-size: 24px;
  color: #e2e8f0;
  font-weight: 400;
}
.lobby-safe {
  margin-left: auto;
  max-width: 220px;
  font-size: 11px;
  color: #94a3b8;
}
/* Regional insignia and tier frames remain cosmetic; rules are unchanged. */
.card {
  border-radius: 13px 13px 7px 7px;
  border-color: #7890ab;
  background:
    linear-gradient(135deg, #4b5c7555, transparent 40%),
    linear-gradient(#202e45, #0c1628);
  box-shadow:
    inset 0 0 0 2px #0b1426,
    inset 0 0 0 3px #94a3b828,
    0 8px 18px #0007;
}
.card .city-art {
  border-radius: 28px 28px 4px 4px;
  border: 1px solid #b8c7d955;
}
.card .card-name {
  font-family: Georgia, serif;
  letter-spacing: -0.02em;
}
.card.capital {
  border-color: #d2aeff;
  border-radius: 20px 20px 7px 7px;
  background: linear-gradient(150deg, #48334f, #10192e 65%);
  box-shadow:
    inset 0 0 0 2px #20152c,
    inset 0 0 0 3px #c4b5fd66,
    0 0 16px #a78bfa25,
    0 8px 18px #0008;
}
.card.capital .city-art {
  border-radius: 45% 45% 4px 4px;
  border-color: #c4b5fd88;
}
.card .cost {
  border-radius: 8px 3px 8px 3px;
}
.card.africa .card-stats i {
  color: #f6c884;
}
.card.europe .card-stats i {
  color: #8ecafa;
}
.card.asia .card-stats i {
  color: #d5afff;
}
.card.america .card-stats i {
  color: #91ccb5;
}
.card.oceania .card-stats i {
  color: #81d0d8;
}
.card .card-stats i {
  font-size: 15px;
}
/* Compact chrome while in a match. */
.in-battle .topbar {
  min-height: 58px;
  height: 58px;
  max-width: none;
  margin: 0 18px;
  padding: 6px 0;
}
.in-battle .brand {
  font-size: 18px;
}
.in-battle .brand-symbol {
  font-size: 30px;
}
.in-battle .brand small,
.in-battle .profile small,
.in-battle .prototype {
  display: none;
}
.in-battle .nav-link {
  padding: 14px 8px;
  font-size: 12px;
}
.in-battle .profile {
  font-size: 11px;
}
.in-battle #language {
  font-size: 11px;
  padding: 8px;
}
.in-battle main {
  max-width: 1500px;
  padding: 0 20px;
  margin: auto;
}
.in-battle footer {
  padding: 5px 20px;
  margin: 0;
  font-size: 9px;
  min-height: 0;
}
.in-battle .arena {
  max-width: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.arena .arena-header {
  height: 49px;
  padding: 5px 2px;
  margin: 0;
  display: flex;
  align-items: center;
}
.arena .arena-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 15px;
}
.arena .arena-header .eyebrow {
  font-size: 8px;
  margin: 0;
  color: #fb7185;
  letter-spacing: 0.2em;
}
.arena .arena-header h2 {
  font-size: 13px;
  margin: 0;
  letter-spacing: 0;
}
.arena .arena-header h2 span {
  font-size: 11px;
}
.arena .arena-tools {
  flex-direction: row;
  gap: 6px;
}
.arena-tools .tool-button {
  width: 32px;
  height: 32px;
  padding: 7px;
}
.arena-tools .atlas-icon {
  width: 17px;
  height: 17px;
}
.arena .battlefield {
  display: grid;
  grid-template-rows: 78px 143px 18px 143px 78px;
  padding: 0 105px;
  border: 1px solid #50607c;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 48%, #27354b66, transparent 60%),
    repeating-linear-gradient(30deg, transparent 0 69px, #94a3b805 70px 71px),
    linear-gradient(115deg, #0b1323, #18243b 50%, #0b1323);
  box-shadow:
    inset 0 0 0 5px #0a1020,
    inset 0 0 0 6px #8192af28,
    inset 0 0 70px #0008,
    0 10px 36px #0005;
  overflow: visible;
}
.arena .battlefield::before {
  width: 300px;
  height: 300px;
  border: 1px solid #71839f29;
  box-shadow:
    0 0 0 30px #71839f08,
    0 0 0 65px #71839f06;
  background: conic-gradient(
    from 45deg,
    transparent 0 40deg,
    #a3b7d210 41deg 45deg,
    transparent 46deg 85deg,
    #a3b7d210 86deg 90deg,
    transparent 91deg
  );
  border-radius: 50%;
}
.arena .battlefield .opponent-bar,
.arena .battlefield .player-bar {
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  min-height: 0;
  padding: 0;
  gap: 10px;
  align-items: center;
  margin: 0;
  border: 0;
  background: none;
}
.arena .opponent-bar {
  grid-row: 1;
}
.arena .player-bar {
  grid-row: 5;
}
.arena .hero-token,
.arena .player-identity {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  width: 150px;
  padding: 0;
  background: none;
  border: 0;
  min-height: 70px;
}
.arena .hero-token > button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  width: 100%;
  padding: 0;
  position: relative;
}
.arena .battlefield .commander-crest {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  background: radial-gradient(circle at 35% 25%, #415473, #111d32 75%);
  border: 2px solid #8798b9;
  border-radius: 14px 14px 20px 20px;
  box-shadow:
    0 0 0 3px #0b1424,
    0 0 0 4px #64748b55,
    0 4px 12px #0009;
  animation: crest-breathe 5s ease-in-out infinite;
}
.arena .battlefield .enemy-avatar {
  border-radius: 20px 20px 14px 14px;
  background: radial-gradient(circle at 35% 25%, #6a3651, #271426 75%);
  border-color: #e892a7;
}
.commander-crest .atlas-icon {
  width: 28px;
  height: 28px;
  color: #e8efff;
}
.arena .commander-name {
  font-size: 9px;
  color: #acbdd5;
  line-height: 1.3;
  margin-top: 5px;
  max-width: 146px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arena .hero-token strong,
.arena .player-identity strong {
  white-space: nowrap;
  position: absolute;
  left: calc(50% + 12px);
  top: 31px;
  margin: 0;
  padding: 0 6px;
  background: #251020;
  border: 1px solid #c46581;
  border-radius: 7px;
  font-size: 14px;
  color: #ffd4de;
  z-index: 2;
}
.arena .hero-token.target {
  filter: drop-shadow(0 0 8px #fb7185);
  outline: 2px solid #fb7185;
  border-radius: 15px;
}
.arena .resource-dial {
  flex-direction: row;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a9c4ee;
}
.arena .resource-dial > .atlas-icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 9px #7499d977);
}
.arena .resource-dial b {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.arena .resource-dial b small {
  font-size: 12px;
  color: #899bb5;
}
.arena .energy span.sr-only {
  position: absolute;
}
.arena .opponent-hand {
  flex-direction: row;
  position: relative;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 65px;
  margin: 0;
  padding: 0;
}
.arena .opponent-card-fan {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 55px;
  padding: 0 8px;
}
.arena .opponent-card-back {
  width: 25px;
  height: 38px;
  margin: 0 -6px;
  flex: 0 0 25px;
  border: 1px solid #a27799;
  background: linear-gradient(130deg, #2e223f, #111e34);
  border-radius: 4px;
  font-size: 14px;
  box-shadow: 0 3px 5px #0008;
  transform: rotate(var(--tilt));
  transform-origin: center center;
  animation: none;
}
.arena .hand-count {
  font-size: 11px;
  background: #121c31;
  border: 1px solid #475569;
  border-radius: 50%;
  padding: 2px 6px;
  color: #ced8e9;
}
.arena .board-row {
  min-height: 0;
  padding: 3px 8px;
  gap: 12px;
  overflow: visible;
  align-items: center;
}
.arena .enemy-board {
  grid-row: 2;
}
.arena .own-board {
  grid-row: 4;
}
.arena .board-unit {
  flex: 0 0 104px;
  width: 104px;
  margin: 0;
  position: relative;
}
:is(.arena, .flying-card) .on-board {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  height: 132px;
  aspect-ratio: auto;
  padding: 4px;
  overflow: hidden;
}
:is(.arena, .flying-card) .on-board .card-top {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 2;
  min-height: 0;
}
:is(.arena, .flying-card) .on-board .card-top > span,
:is(.arena, .flying-card) .on-board .card-country,
:is(.arena, .flying-card) .on-board .rarity-label,
:is(.arena, .flying-card) .on-board .unit-status {
  display: none;
}
:is(.arena, .flying-card) .on-board .cost {
  width: 19px;
  height: 20px;
  font-size: 11px;
  box-shadow: 0 2px 4px #0009;
}
:is(.arena, .flying-card) .on-board .city-art {
  height: 59px;
  width: 100%;
  flex-shrink: 0;
  border-radius: 14px 14px 3px 3px;
  object-fit: cover;
}
:is(.arena, .flying-card) .on-board .card-name {
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.2;
}
:is(.arena, .flying-card) .on-board .card-text {
  font-size: 6px;
  min-height: 12px;
  padding: 1px 0;
  line-height: 1.2;
}
:is(.arena, .flying-card) .on-board .card-stats {
  font-size: 12px;
  padding-top: 1px;
  margin-top: auto;
  min-height: 18px;
}
:is(.arena, .flying-card) .on-board .card-stats i {
  font-size: 10px;
}
.arena .inspect-unit {
  position: absolute;
  top: 0;
  right: -5px;
  padding: 0;
  min-height: 24px;
  width: 24px;
  height: 24px;
  font-size: 13px;
  border-radius: 50%;
  background: #0b1427e8;
  border: 1px solid #6b7e9c;
  color: #d4dff3;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s;
}
.board-unit:hover .inspect-unit,
.board-unit:focus-within .inspect-unit {
  opacity: 1;
}
.arena .empty-board {
  display: grid;
  place-items: center;
  width: 80px;
  height: 65px;
  border: 1px dashed #8fa1bd22;
  border-radius: 12px;
  font-size: 25px;
  color: #8fa1bd33;
}
.arena .battle-divider {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0;
  margin: 0;
  min-height: 0;
  opacity: 0.55;
}
.arena .battle-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, #9a759066, transparent);
  flex: 1;
}
.arena .battle-divider b {
  display: block;
  color: #c694b0;
}
.arena .battle-divider .atlas-icon {
  width: 28px;
  height: 28px;
}
.arena .turn-actions {
  flex-direction: row;
  flex-wrap: nowrap;
  width: auto;
  max-width: none;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  gap: 8px;
}
.arena .turn-actions button {
  white-space: nowrap;
  min-height: 0;
  width: 47px;
  height: 47px;
  padding: 3px;
  background: linear-gradient(145deg, #29364c, #0b1426);
  border: 1px solid #6a7c9b;
  border-radius: 50%;
  font-size: 16px;
}
.arena .turn-actions button small {
  font-size: 9px;
  margin-top: 0;
}
.arena .turn-actions .selected {
  border-color: #fb7185;
  box-shadow: 0 0 12px #fb718566;
}
.arena .battle-piles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
}
.arena .pile-pair {
  width: auto;
  align-items: flex-start;
  position: absolute;
  left: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: none;
  padding: 0;
  border: 0;
  pointer-events: auto;
}
.arena .pile-pair.enemy-piles {
  top: 22px;
}
.arena .pile-pair.own-piles {
  bottom: 22px;
}
.arena .draw-pile,
.arena .discard-pile {
  width: 54px;
  height: 51px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4px;
  border: 1px solid #526281;
  border-radius: 7px;
  background: linear-gradient(135deg, #25354b, #0b1425);
  font-size: 9px;
  box-shadow:
    3px 3px 0 #111d31,
    4px 4px 0 #53678366;
  color: #bccce3;
}
.arena .discard-pile {
  background: radial-gradient(ellipse, #302742, #0a1326 80%);
  border-color: #76576f;
}
.arena .pile-glyph {
  font-size: 15px;
  line-height: 16px;
}
.arena .pile-count {
  position: absolute;
  transform: translate(24px, -21px);
  border: 1px solid #63718b;
  border-radius: 6px;
  min-width: 21px;
  background: #111b2e;
  color: #e2e8f0;
  font-size: 11px;
  padding: 0 3px;
}
.arena .turn-mechanism {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 3;
}
.arena .end-turn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 76px;
  border: 2px solid #eea0b5;
  border-radius: 18px;
  background: linear-gradient(145deg, #6e2444, #2d142a);
  box-shadow:
    inset 0 0 0 4px #10182a,
    inset 0 0 0 5px #9b647966,
    0 0 20px #f43f5e22;
  padding: 0;
  color: #ffd2df;
}
.arena .end-turn:disabled {
  opacity: 1;
  color: #8c9bb6;
  border-color: #52637f;
  background: linear-gradient(145deg, #263047, #12192b);
  cursor: default;
}
.turn-arrow {
  display: block;
  transform: rotate(0deg);
}
.turn-arrow .atlas-icon {
  width: 36px;
  height: 36px;
  fill: currentColor;
  stroke-width: 0.5;
}
.is-opponent .turn-arrow {
  transform: rotate(180deg);
}
.arena .turn-mechanism small {
  font-size: 12px;
  color: #d5bfd0;
  min-height: 18px;
}
.turn-owner {
  font-size: 9px;
  color: #a3aec3;
}
.arena .reserve-toggle {
  position: absolute;
  right: 14px;
  bottom: 23px;
  width: 72px;
  padding: 7px 0;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid #6a6387;
  background: linear-gradient(#2a2941, #10182b);
  border-radius: 12px;
  font-size: 9px;
  color: #d3c5e8;
}
.reserve-toggle .atlas-icon {
  width: 21px;
  height: 21px;
}
.reserve-toggle b {
  font-size: 12px;
  font-weight: 500;
}
.arena .hand-dock {
  position: relative;
  padding-top: 3px;
}
.arena .hand-label {
  font-size: 8px;
  letter-spacing: 0.12em;
  padding: 0;
  margin: 3px 0 0;
  min-height: 14px;
  justify-content: center;
  gap: 12px;
}
.arena .hand {
  min-height: 0;
  height: 145px;
  gap: 7px;
  padding: 7px 3px 3px;
  align-items: start;
  overflow-x: auto;
  scrollbar-width: thin;
}
.arena .hand .card {
  flex: 0 0 100px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  height: 132px;
  aspect-ratio: auto;
  padding: 5px;
  border-radius: 10px;
}
.arena .hand .city-art {
  height: 43px;
  min-height: 43px;
}
.arena .hand .card-top {
  min-height: 20px;
  font-size: 5px;
}
.arena .hand .card-name {
  font-size: 12px;
  margin-top: 2px;
}
.arena .hand .card-country {
  font-size: 7px;
}
.arena .hand .card-text {
  min-height: 12px;
  font-size: 7px;
  padding: 2px 0;
  line-height: 1.1;
}
.arena .hand .card-stats {
  font-size: 12px;
  margin-top: auto;
  padding-top: 1px;
}
.arena .hand .rarity-label {
  display: none;
}
.arena .hand .card.chosen {
  transform: translateY(-4px);
  border-color: #fb7185;
  box-shadow:
    0 0 0 2px #fb718544,
    0 0 16px #fb718533;
}
.arena .card.ready {
  border-color: #88bcb5;
  box-shadow:
    0 0 0 1px #88bcb540,
    0 0 12px #88bcb525;
}
.arena .card.target {
  border-color: #fb7185;
  box-shadow:
    0 0 0 2px #fb718559,
    0 0 16px #fb718555;
}
.arena .selection-bar {
  min-height: 42px;
  margin: 0;
  padding: 3px 0;
  gap: 10px;
  background: none;
  border: 0;
  font-size: 11px;
}
.arena .selection-bar .tool-button {
  width: 30px;
  height: 30px;
  padding: 5px;
}
.arena .selection-bar .atlas-icon {
  width: 19px;
  height: 19px;
}
.arena .selection-bar .primary {
  padding: 8px 15px;
  font-size: 11px;
}
.arena .action-hint {
  color: #b3c2d8;
}
.arena .selection-bar p {
  font-size: 11px;
}
.arena .battle-drawer {
  position: absolute;
  right: 0;
  top: 49px;
  bottom: 0;
  width: min(460px, 100%);
  z-index: 25;
  border: 1px solid #64748b;
  border-radius: 18px;
  padding: 20px;
  background: #0b1428fa;
  box-shadow: -20px 0 60px #0008;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  animation: drawer-in 0.22s ease-out;
}
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.drawer-heading h2 {
  font-size: 22px;
  margin: 0;
}
.drawer-heading .atlas-icon {
  transform: rotate(-90deg);
}
.battle-drawer .next-move {
  display: block;
  padding: 16px;
  font-size: 12px;
}
.battle-drawer .next-move .next-icon {
  display: none;
}
.battle-drawer .next-move p {
  margin-top: 12px;
}
.battle-drawer .next-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
}
.battle-drawer .shared-reserve {
  margin: 0;
  padding: 0;
  border: 0;
}
.battle-drawer .reserve-offers article {
  flex-direction: column;
  align-items: stretch;
}
.battle-drawer .reserve-offers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.battle-drawer .reserve-offers .card {
  width: 100%;
  min-width: 0;
}
.battle-drawer .reserve-offers button.secondary {
  padding: 9px 4px;
  font-size: 10px;
}
.battle-drawer .journal p {
  padding: 10px 0;
  border-bottom: 1px solid #33415566;
}
/* A dedicated preparation surface replaces inactive combat controls. */
.phase-mulligan .battlefield {
  opacity: 0.2;
  pointer-events: none;
  filter: blur(2px);
}
.phase-mulligan .hand-dock {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(660px, 90%);
  padding: 30px 24px;
  background: radial-gradient(ellipse at 50% 20%, #332038, #0b1429 75%);
  border: 1px solid #786276;
  border-radius: 24px;
  box-shadow: 0 20px 80px #000b;
  z-index: 5;
}
.phase-mulligan .hand-label {
  flex-direction: column;
  font-size: 11px;
  margin-bottom: 20px;
  gap: 7px;
  letter-spacing: 0.05em;
}
.phase-mulligan .hand-label > span:last-child {
  font-size: 12px;
  color: #cbd5e1;
}
.phase-mulligan .hand {
  height: 225px;
  gap: 20px;
}
.phase-mulligan .hand .card {
  flex: 0 0 135px;
  width: 135px;
  max-width: 135px;
  height: 200px;
  padding: 8px;
}
.phase-mulligan .hand .city-art {
  height: 67px;
  min-height: 67px;
}
.phase-mulligan .hand .card-name {
  font-size: 17px;
  margin-top: 9px;
}
.phase-mulligan .hand .card-text {
  font-size: 10px;
  margin-top: 7px;
}
.phase-mulligan .hand .card-stats {
  font-size: 17px;
}
.phase-mulligan .hand .card.chosen::after {
  content: "↻";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: #401729bb;
  color: #fff;
}
.phase-mulligan .selection-bar {
  margin-top: 16px;
  flex-wrap: wrap;
}
.phase-mulligan {
  min-height: 630px;
}
.collection-view .section-heading {
  padding: 25px 0 16px;
}
.collection-view .section-heading h1 {
  font-size: 32px;
  margin-bottom: 8px;
}
.collection-view .section-heading p {
  font-size: 12px;
  max-width: 550px;
}
.collection-view .collection-help {
  padding: 10px 14px;
  font-size: 11px;
  margin-bottom: 18px;
}
.collection-view .card-grid {
  gap: 22px;
}
.collection-view .deck-list {
  background: linear-gradient(#19263c, #0c1528);
  border-color: #455572;
}
.collection-view .deck-row {
  border-radius: 4px;
  background: linear-gradient(100deg, #33445d66, #0c1528);
  margin: 3px 0;
}
.collection-view .filters {
  padding: 0 0 18px;
}
@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes crest-breathe {
  50% {
    filter: drop-shadow(0 0 5px #c0b1dc44);
  }
}
@keyframes atlas-orbit {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1000px) and (max-height: 850px) {
  .arena .battlefield {
    grid-template-rows: 68px 137px 14px 137px 68px;
  }
  .arena .board-unit {
    transform: none;
  }
  .arena .hand {
    height: 139px;
  }
  .arena .arena-header {
    height: 42px;
  }
  .arena .battle-drawer {
    top: 42px;
  }
  .in-battle .topbar {
    height: auto;
    min-height: 52px;
  }
}
@media (max-width: 1000px) {
  .account-tools .profile {
    display: flex;
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
  }
  .account-tools .profile > span:last-child {
    display: none;
  }
  .account-tools .profile .avatar {
    display: grid;
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  .lobby-grid {
    grid-template-columns: 1.2fr 1fr;
  }
  .mode-art > div {
    width: 110px;
  }
  .mode-art {
    height: 220px;
  }
  .mode-feature {
    min-height: 440px;
  }
  .lobby-bottom {
    gap: 18px;
  }
  .lobby-safe {
    display: none;
  }
  .arena .battlefield {
    padding: 0 83px;
  }
  .arena .board-row {
    gap: 7px;
  }
  .arena .board-unit {
    flex-basis: 77px;
    width: 77px;
  }
  :is(.arena, .flying-card) .on-board {
    width: 77px;
    min-width: 77px;
  }
  .arena .turn-mechanism {
    right: 10px;
  }
  .arena .end-turn {
    width: 57px;
  }
  .arena .reserve-toggle {
    width: 61px;
    right: 8px;
  }
  .arena .pile-pair {
    width: auto;
    align-items: flex-start;
    left: 11px;
  }
  .arena .draw-pile,
  .arena .discard-pile {
    width: 47px;
  }
  .arena .board-row {
    overflow-x: auto;
    justify-content: safe center;
  }
  .arena .inspect-unit {
    opacity: 1;
    right: 0;
    width: 22px;
    height: 22px;
    min-height: 22px;
  }
}
@media (max-width: 650px) {
  .topbar {
    gap: 8px;
    padding: 12px 0;
  }
  .account-tools {
    gap: 5px;
  }
  .account-tools .tool-button {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  .account-tools .atlas-icon {
    width: 18px;
    height: 18px;
  }
  .brand {
    font-size: 17px;
  }
  .brand-symbol {
    font-size: 30px;
  }
  .brand small {
    display: none;
  }
  .prototype {
    font-size: 8px;
  }
  .prototype > span:not(.dot) {
    font-size: 8px;
  }
  .atlas-lobby {
    padding-top: 23px;
  }
  .lobby-heading {
    align-items: start;
    margin-bottom: 20px;
  }
  .lobby-heading h1 {
    font-size: 32px;
  }
  .lobby-heading > div p:last-child {
    font-size: 12px;
  }
  .lobby-heading > .secondary {
    padding: 9px;
    font-size: 0;
  }
  .lobby-heading > .secondary .atlas-icon {
    width: 24px;
    height: 24px;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .mode-feature {
    min-height: 400px;
  }
  .mode-art {
    height: 205px;
    top: 20px;
  }
  .mode-art > div {
    width: 105px;
  }
  .mode-copy {
    padding: 24px;
  }
  .mode-copy h2 {
    font-size: 30px;
  }
  .mode-copy p {
    font-size: 12px;
  }
  .lobby-side {
    grid-template-rows: auto auto;
    gap: 14px;
  }
  .mode-tile {
    padding: 22px;
  }
  .lobby-bottom {
    gap: 16px;
    flex-wrap: wrap;
  }
  .lobby-deck {
    width: 100%;
  }
  .lobby-deck > span:last-child {
    margin-left: auto;
  }
  .lobby-stat {
    flex: 1;
    text-align: center;
  }
  .in-battle main {
    padding: 0 6px;
  }
  .in-battle .topbar {
    height: auto;
    margin: 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    min-height: 0;
    padding: 6px 0;
  }
  .in-battle .brand {
    font-size: 13px;
    gap: 6px;
  }
  .in-battle .brand-symbol {
    font-size: 23px;
  }
  .in-battle .account-tools .profile {
    display: none;
  }
  .in-battle .account-tools {
    margin-left: auto;
    gap: 4px;
  }
  .in-battle .account-tools .tool-button {
    width: 28px;
    height: 28px;
    padding: 5px;
  }
  .in-battle #language {
    padding: 5px;
    width: 80px;
    font-size: 10px;
  }
  .in-battle .topbar nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 2px;
    gap: 14px;
  }
  .in-battle .nav-link {
    padding: 6px 2px;
    font-size: 10px;
  }
  .in-battle footer {
    font-size: 8px;
    padding: 6px;
  }
  .in-battle footer > span:first-child {
    display: none;
  }
  .arena .arena-header {
    height: 41px;
  }
  .arena .arena-header > div:first-child {
    display: block;
  }
  .arena .arena-header .eyebrow {
    font-size: 6px;
    letter-spacing: 0.13em;
  }
  .arena .arena-header h2 {
    font-size: 10px;
    margin-top: 3px;
  }
  .arena .arena-header h2 span {
    font-size: 9px;
    display: inline;
  }
  .arena .arena-tools {
    flex-direction: row;
    gap: 4px;
  }
  .arena-tools .tool-button {
    width: 28px;
    height: 28px;
    padding: 6px;
  }
  .arena .battlefield {
    grid-template-rows: 67px 108px 12px 108px 67px;
    padding: 0 43px;
    border-radius: 19px;
  }
  .arena .battlefield::before {
    width: 175px;
    height: 175px;
    box-shadow: 0 0 0 25px #71839f06;
  }
  .arena .battlefield .opponent-bar,
  .arena .battlefield .player-bar {
    grid-template-columns: 1fr 83px 1fr;
    gap: 2px;
  }
  .arena .hero-token,
  .arena .player-identity {
    width: 83px;
    min-height: 60px;
  }
  .arena .battlefield .commander-crest {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }
  .commander-crest .atlas-icon {
    width: 23px;
    height: 23px;
  }
  .arena .hero-token strong,
  .arena .player-identity strong {
    top: 22px;
    left: calc(50% + 7px);
    font-size: 12px;
    padding: 0 4px;
  }
  .arena .commander-name {
    font-size: 7px;
    max-width: 82px;
  }
  .arena .resource-dial {
    flex-direction: row;
    gap: 3px;
  }
  .arena .resource-dial > .atlas-icon {
    width: 17px;
    height: 20px;
  }
  .arena .resource-dial b {
    font-size: 21px;
    gap: 2px;
  }
  .arena .resource-dial b small {
    font-size: 9px;
  }
  .arena .opponent-hand {
    flex-direction: row;
    height: 45px;
    gap: 0;
  }
  .arena .opponent-card-fan {
    height: 42px;
    padding: 0 2px;
  }
  .arena .opponent-card-back {
    width: 16px;
    height: 28px;
    margin: 0 -5px;
    flex: 0 0 16px;
    font-size: 9px;
  }
  .arena .hand-count {
    position: absolute;
    right: 0;
    bottom: -2px;
    z-index: 2;
    font-size: 8px;
    padding: 1px 3px;
    margin-left: 1px;
  }
  .arena .board-row {
    padding: 2px;
    gap: 6px;
    scrollbar-width: thin;
    overflow-x: auto;
    justify-content: safe center;
  }
  .arena .board-unit {
    flex: 0 0 70px;
    width: 70px;
  }
  :is(.arena, .flying-card) .on-board {
    width: 70px;
    min-width: 70px;
    height: 100px;
    padding: 3px;
    border-radius: 8px;
  }
  :is(.arena, .flying-card) .on-board .city-art {
    height: 39px;
  }
  :is(.arena, .flying-card) .on-board .card-name {
    font-size: 10px;
  }
  :is(.arena, .flying-card) .on-board .card-text {
    font-size: 6px;
    min-height: 12px;
  }
  :is(.arena, .flying-card) .on-board .card-stats {
    font-size: 11px;
  }
  :is(.arena, .flying-card) .on-board .cost {
    width: 17px;
    height: 17px;
    font-size: 10px;
  }
  .arena .inspect-unit {
    width: 21px;
    height: 21px;
    min-height: 21px;
    font-size: 13px;
    top: 0;
    right: 0;
  }
  .arena .pile-pair {
    width: auto;
    align-items: flex-start;
    left: 6px;
    gap: 13px;
  }
  .arena .pile-pair.enemy-piles {
    top: 76px;
  }
  .arena .pile-pair.own-piles {
    bottom: 72px;
  }
  .arena .draw-pile,
  .arena .discard-pile {
    width: 27px;
    height: 35px;
    font-size: 0;
    padding: 2px;
    border-radius: 4px;
  }
  .arena .pile-glyph {
    font-size: 15px;
  }
  .arena .pile-count {
    font-size: 9px;
    min-width: 17px;
    transform: translate(10px, -15px);
  }
  .arena .turn-mechanism {
    right: 3px;
    gap: 1px;
  }
  .arena .end-turn {
    width: 40px;
    height: 58px;
    border-radius: 11px;
    box-shadow:
      inset 0 0 0 3px #10182a,
      0 0 10px #f43f5e22;
  }
  .turn-arrow .atlas-icon {
    width: 23px;
    height: 23px;
  }
  .arena .turn-mechanism small {
    font-size: 9px;
    min-height: 14px;
  }
  .turn-owner {
    font-size: 6px;
    max-width: 40px;
    text-align: center;
  }
  .arena .reserve-toggle {
    width: 34px;
    right: 3px;
    bottom: 77px;
    padding: 5px 0;
    font-size: 6px;
    border-radius: 7px;
    gap: 1px;
  }
  .reserve-toggle .atlas-icon {
    width: 16px;
    height: 16px;
  }
  .reserve-toggle b {
    font-size: 9px;
  }
  .arena .turn-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    gap: 3px;
  }
  .arena .turn-actions button {
    white-space: nowrap;
    min-height: 0;
    width: 31px;
    height: 34px;
    font-size: 12px;
  }
  .arena .turn-actions button small {
    font-size: 7px;
  }
  .arena .hand {
    justify-content: safe center;
    height: 134px;
    gap: 5px;
    padding: 6px 2px 2px;
  }
  .arena .hand .card {
    flex: 0 0 88px;
    min-width: 88px;
    width: 88px;
    height: 123px;
    padding: 4px;
  }
  .arena .hand .city-art {
    height: 39px;
    min-height: 39px;
  }
  .arena .hand .card-name {
    font-size: 11px;
  }
  .arena .hand .card-text {
    font-size: 7px;
  }
  .arena .hand .card-stats {
    font-size: 11px;
  }
  .arena .hand .card-top {
    min-height: 18px;
  }
  .arena .hand .cost {
    width: 17px;
    height: 17px;
    font-size: 11px;
  }
  .arena .hand .card-country {
    font-size: 6px;
  }
  .arena .selection-bar {
    min-height: 45px;
    gap: 6px;
    flex-wrap: wrap;
    padding: 3px;
  }
  .arena .action-hint {
    font-size: 10px;
    max-width: 180px;
  }
  .arena .selection-bar .primary {
    padding: 9px;
    font-size: 10px;
  }
  .arena .hand-label {
    font-size: 7px;
    margin-top: 5px;
  }
  .arena .battle-drawer {
    top: 41px;
    padding: 16px;
    border-radius: 16px;
  }
  .battle-drawer .reserve-offers article {
    flex-direction: column;
    align-items: stretch;
  }
  .battle-drawer .reserve-offers {
    gap: 5px;
  }
  .phase-mulligan .hand-dock {
    top: 105px;
    width: 96%;
    padding: 23px 8px;
  }
  .phase-mulligan .hand {
    height: 171px;
    gap: 9px;
  }
  .phase-mulligan .hand .card {
    min-width: 90px;
    width: 90px;
    max-width: 96px;
    flex: 0 0 90px;
    height: 158px;
    padding: 5px;
  }
  .phase-mulligan .hand .city-art {
    height: 47px;
    min-height: 47px;
  }
  .phase-mulligan .hand .card-name {
    font-size: 13px;
    margin-top: 4px;
  }
  .phase-mulligan .hand .card-text {
    font-size: 8px;
    margin-top: 3px;
  }
  .phase-mulligan .hand .card-stats {
    font-size: 13px;
  }
  .phase-mulligan .hand-label {
    font-size: 10px;
  }
  .phase-mulligan .hand-label > span:last-child {
    font-size: 10px;
  }
  .phase-mulligan {
    min-height: 550px;
  }
  .collection-view .section-heading h1 {
    font-size: 26px;
  }
  .collection-view .card-grid {
    gap: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lobby-globe .globe,
  .arena .commander-crest,
  .battle-drawer {
    animation: none !important;
  }
}
.reduce-motion .lobby-globe .globe,
.reduce-motion .arena .commander-crest,
.reduce-motion .battle-drawer {
  animation: none !important;
}

.battle-legend {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px 12px;
  padding: 10px;
  font-size: 12px;
  color: #b8c7dc;
}
.battle-legend dt {
  color: #fda4af;
  font-weight: 600;
}
.battle-legend dd {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 650px) {
  .mode-art .card {
    height: 170px;
    aspect-ratio: auto;
    padding: 6px;
    min-height: 0;
  }
  .mode-art .card-top {
    font-size: 5px;
    min-height: 23px;
    gap: 3px;
  }
  .mode-art .cost {
    width: 21px;
    height: 21px;
    font-size: 12px;
  }
  .mode-art .city-art {
    height: 50px;
    min-height: 50px;
    flex-shrink: 0;
  }
  .mode-art .card-name {
    font-size: 13px;
    margin-top: 6px;
  }
  .mode-art .card-country {
    font-size: 8px;
  }
  .mode-art .card-text {
    font-size: 8px;
    min-height: 20px;
    padding: 5px 0;
  }
  .mode-art .card-stats {
    font-size: 13px;
    padding-top: 2px;
  }
  .mode-art .rarity-label {
    font-size: 5px;
  }
  .arena .opponent-card-fan {
    min-width: 0;
    min-height: 32px;
  }
  .arena .opponent-hand {
    min-height: 0;
    gap: 3px;
  }
}
@media (max-width: 650px) {
  .arena .opponent-hand {
    position: absolute;
    right: -30px;
    top: 10px;
    width: 80px;
    justify-content: flex-end;
  }
}

/* Origins abilities: shape, color and text all carry the status. */
.card {
  isolation: isolate;
}
.card.rarity-epic {
  --aura: #bba0ff;
  border: 2px solid #b794f6;
  background: linear-gradient(145deg, #31254b, #101b30 65%);
  box-shadow:
    inset 0 0 0 2px #614976,
    0 0 19px #a78bfa33;
}
.card.rarity-legendary {
  --aura: #ffc78f;
  border: 2px solid #ffd294;
  background: linear-gradient(145deg, #493245, #111b30 60%);
  box-shadow:
    inset 0 0 0 2px #9d6d52,
    0 0 25px #fb718544;
}
.card.rarity-epic .rarity-label {
  color: #dac5ff;
}
.card.rarity-legendary .rarity-label {
  color: #ffe0aa;
}
.card.rarity-epic::before,
.card.rarity-legendary::before,
.card.ready::before,
.card.has-shield::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 0 30%, var(--aura, #fb7185) 0, transparent 38%),
    radial-gradient(
      ellipse at 100% 75%,
      var(--aura, #fb7185) 0,
      transparent 34%
    );
  opacity: 0.28;
  filter: blur(7px);
  animation: atlas-mist 4s ease-in-out infinite alternate;
}
@keyframes atlas-mist {
  from {
    transform: scale(0.98) rotate(-3deg);
    opacity: 0.18;
  }
  to {
    transform: scale(1.07) rotate(3deg);
    opacity: 0.48;
  }
}
:is(.arena, .flying-card) .on-board.has-guard {
  border-radius: 10px 10px 24px 24px;
  border: 2px solid #a0c7ef;
  box-shadow:
    0 0 0 3px #548ab43d,
    inset 0 0 16px #92beff29;
}
:is(.arena, .flying-card) .on-board.has-shield {
  --aura: #81e4ff;
  outline: 2px solid #81e4ff;
  outline-offset: 3px;
}
:is(.arena, .flying-card) .on-board.is-infected {
  box-shadow:
    0 0 0 2px #c4e28688,
    0 0 16px #9cc16655;
}
:is(.arena, .flying-card) .on-board.target {
  border-color: #fb7185;
  outline: 2px solid #fb7185;
  outline-offset: 3px;
}
.status-sigils {
  position: absolute;
  left: 4px;
  top: 32px;
  display: flex;
  gap: 2px;
  z-index: 3;
  pointer-events: none;
}
.status-sigils span {
  font-size: 13px;
  line-height: 18px;
  min-width: 18px;
  background: #07101feb;
  border: 1px solid #9dc1ed;
  color: #d7edff;
  border-radius: 5px;
  text-align: center;
}
.is-infected .status-sigils {
  color: #d5ef96;
}
.starting-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 135px;
  gap: 10px;
}
.phase-mulligan .hand {
  height: auto;
  min-height: 252px;
  align-items: flex-start;
}
.phase-mulligan .starting-slot .card {
  flex: 0 0 200px;
  margin: 0;
  transform: none;
}
.replace-card {
  width: 100%;
  min-height: 40px;
  padding: 8px;
  font-size: 12px;
}
.rarity-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}
.rarity-chip.rarity-epic {
  color: #d8b8ff;
}
.rarity-chip.rarity-legendary {
  color: #ffd99e;
}
.tier-caption {
  font-size: 12px;
  color: #aab7cd;
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 24px;
}
.collection-card .unlock-label {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  min-height: 36px;
  padding: 8px 3px;
  color: #b2bfd4;
}
.lobby-bottom {
  flex-wrap: wrap;
  gap: 20px;
}
.result-backdrop {
  isolation: isolate;
}
.result {
  position: relative;
  border: 1px solid #986073;
  background: linear-gradient(145deg, #1b2038, #090e20);
  box-shadow: 0 25px 100px #000a;
}
.result-icon {
  display: block;
  width: 90px;
  height: 90px;
  line-height: 90px;
  margin: 0 auto 14px;
  border: 1px solid #fb718599;
  border-radius: 50%;
  background: radial-gradient(circle, #fb718540, transparent 70%);
  font-size: 65px;
}
.result-rays {
  position: fixed;
  width: 100vmax;
  height: 100vmax;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 17deg,
    #fb718554 18deg 20deg,
    transparent 21deg 30deg
  );
  border-radius: 50%;
  mask-image: radial-gradient(circle, #000, transparent 65%);
}
.result-loss .result-rays {
  background: radial-gradient(ellipse, #94a3b866, transparent 60%);
}
.result-loss .result-icon {
  color: #b6c5df;
  border-color: #7386aa;
}
.result-loss h1 {
  color: #c5d2e8;
}
.unlock-rewards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
}
.unlock-rewards > b {
  width: 100%;
  font-size: 12px;
  color: #ffc48c;
}
@media (max-width: 600px) {
  .starting-slot {
    flex-basis: 90px;
    gap: 8px;
    min-width: 0;
  }
  .phase-mulligan .starting-slot .card {
    flex: 0 0 158px;
  }
  .phase-mulligan .hand {
    min-height: 210px;
  }
  .replace-card {
    padding: 6px 2px;
    min-height: 38px;
    font-size: 10px;
  }
  .status-sigils {
    top: 25px;
    left: 2px;
    gap: 1px;
  }
  .status-sigils span {
    min-width: 13px;
    line-height: 14px;
    font-size: 10px;
  }
  .result-icon {
    width: 66px;
    height: 66px;
    line-height: 66px;
    font-size: 45px;
  }
}
html.reduce-motion .card::before {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .card::before {
    animation: none !important;
  }
}
@media (max-width: 380px) {
  .topbar {
    min-width: 0;
  }
  .topbar .brand {
    font-size: 14px;
    gap: 6px;
  }
  .topbar .brand-symbol {
    font-size: 24px;
  }
  .topbar .account-tools {
    gap: 4px;
  }
  .topbar nav {
    min-width: 0;
    width: 100%;
    gap: 2px;
    justify-content: space-between;
  }
  .topbar .nav-link {
    padding: 12px 8px;
    font-size: 11px;
  }
}
/* Distinct rarity families; status outlines remain independent of rarity. */
.card.rarity-rare {
  --rarity: #8fcbff;
  border-color: #6ea9df;
  box-shadow:
    inset 0 0 0 2px #6ea9df33,
    0 0 16px #60a5fa22;
}
.card.rarity-rare .card-top {
  background: linear-gradient(110deg, #164878aa, transparent);
}
.card.rarity-rare .cost {
  border-color: #8fcbff;
}
.card.rarity-epic .cost {
  background: #542d7c;
  border-color: #d0aeff;
}
.card.rarity-legendary .cost {
  background: #634129;
  border-color: #ffe1a6;
}

/* Catalogue ordering and inspection: browsing never removes a card. */
.cost-order {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 18px;
}
.cost-order span {
  color: var(--accent);
}
.deck-preview-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.deck-card-preview {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #ffffff20;
  border-bottom: 1px solid #ffffff20;
  margin-bottom: 12px;
}
.deck-card-preview > .card {
  width: 102px;
  align-self: start;
}
.deck-card-preview h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.deck-card-preview p {
  font-size: 11px;
  line-height: 1.5;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.deck-card-preview .preview-stats {
  color: #fda4af;
}
.deck-card-preview .text-button {
  text-align: left;
}
.deck-rows {
  max-height: 340px;
  overflow: auto;
  scrollbar-width: thin;
}
.collection-view .deck-row {
  gap: 0;
  padding: 0;
  border: 1px solid transparent;
}
.collection-view .deck-row.inspected {
  border-color: #fb718599;
  background: #fb71851a;
}
.deck-inspect {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 8px 5px;
  text-align: left;
  font-size: 11px;
  min-height: 44px;
}
.deck-inspect b {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--accent);
  background: #fb718518;
}
.deck-inspect span {
  flex: 1;
}
.deck-inspect strong {
  white-space: nowrap;
}
.deck-remove {
  align-self: stretch;
  width: 38px;
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid #ffffff12;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
}
.deck-remove:hover {
  background: #fb718524;
  color: #fda4af;
}
.forge-city-thumbnail {
  display: block;
  width: 48px;
  height: 69px;
  overflow: hidden;
  flex-shrink: 0;
  pointer-events: none;
  border-radius: 4px;
}
.forge-city-thumbnail > .card {
  width: 160px;
  transform: scale(0.3);
  transform-origin: top left;
}
.forge-card-preview {
  display: grid;
  grid-template-columns: minmax(0, 160px) 30px minmax(0, 160px);
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #05091880;
  border: 1px solid #ffffff12;
}
.forge-card-preview > div {
  min-width: 0;
  text-align: center;
}
.forge-card-preview > div > span {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}
.forge-card-preview > b {
  font-size: 26px;
  color: var(--accent);
  text-align: center;
}
.forge-card-preview .card {
  width: 100%;
}
.forge-card-preview > p {
  grid-column: 1/-1;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}
.impact-number .impact-card-name {
  display: block;
  font: 600 12px/1.4 system-ui;
  white-space: nowrap;
  color: #fff;
  background: #080d20e8;
  border: 1px solid #fb718566;
  border-radius: 5px;
  padding: 3px 9px;
  margin-bottom: 5px;
  text-shadow: none;
}
body.combat-resolving .arena [data-action="end"],
body.combat-resolving .arena [data-action="playcard"] {
  pointer-events: none;
  opacity: 0.65;
}
@media (max-width: 800px) {
  .collection-view .deck-list {
    max-height: none;
    overflow: visible;
  }
  .deck-rows {
    max-height: 230px;
  }
  .deck-card-preview {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .deck-card-preview > .card {
    width: 110px;
  }
  .forge-card-preview {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }
  .forge-card-preview > div > span {
    font-size: 8px;
    letter-spacing: 0;
  }
}

/* Fixed preview geometry prevents the hovered row moving under the pointer. */
#deck-inspector {
  height: 190px;
}
.deck-card-preview {
  height: 184px;
  margin: 0;
  padding: 12px 0;
}
.deck-card-preview > div:last-child {
  max-height: 158px;
  overflow: auto;
  scrollbar-width: thin;
}
.deck-preview-art {
  width: 102px;
  height: 150px;
}
.deck-preview-art > .card {
  width: 170px;
  transform: scale(0.6);
  transform-origin: top left;
}
.deck-preview-art > .card:hover {
  transform: scale(0.6);
}
.collection-view .deck-list {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.forge-choice {
  column-gap: 12px;
}
@media (max-width: 800px) {
  .deck-card-preview {
    grid-template-columns: 102px minmax(0, 1fr);
  }
  .collection-view .deck-list {
    max-height: none;
    overflow: visible;
  }
}

/* Role is encoded in the silhouette as well as colour. */
.card.role-guard {
  border-radius: 8px 8px 36% 36% / 8px 8px 13% 13%;
  border: 3px double #a9bed3;
  box-shadow:
    inset 8px 0 0 #64748b44,
    inset -8px 0 0 #64748b44,
    0 4px 16px #02061799;
}
.card.role-guard .city-art {
  border-radius: 5px 5px 35% 35%;
  outline: 2px solid #b1c6dd77;
}
.card.role-guard .card-name::before {
  content: "⬟ ";
  color: #c8d9ed;
}
.card.role-support {
  border-radius: 42% 42% 8px 8px / 12% 12% 8px 8px;
  border-top: 4px double #a5cfbd;
}
.card.role-support .city-art {
  border-radius: 50% 50% 8px 8px;
}
.card.role-striker {
  border-radius: 26px 3px 26px 3px;
  border-right: 4px double #ca9cad;
}
.card.role-event {
  border-radius: 4px 24px 4px 24px;
  border-top: 4px double #b5a6d0;
  border-bottom: 4px double #b5a6d0;
}
.card.role-event .city-art {
  border-radius: 50%;
}
.hand .card {
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}
.card-dragging,
.card-dragging * {
  cursor: grabbing !important;
}
.drag-origin {
  opacity: 0.22 !important;
}
.drag-card {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  transform: translate(-50%, -65%) rotate(-5deg);
  filter: drop-shadow(0 16px 20px #000a);
}
.drag-card .card {
  width: 100%;
  height: 100%;
  margin: 0;
  transform: none !important;
}
.drop-allowed {
  outline: 2px dashed #9bd9ce !important;
  outline-offset: 3px;
}
.drop-hover {
  outline: 3px solid #b6fff0 !important;
  box-shadow:
    inset 0 0 35px #75dccc33,
    0 0 28px #75dccc55 !important;
}
.match-finale {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse, #351326dd, #020617e8 70%);
  color: #fb7185;
  pointer-events: all;
}
.match-finale strong {
  z-index: 2;
  font:
    700 clamp(32px, 7vw, 90px) Georgia,
    serif;
  letter-spacing: 0.16em;
  text-shadow: 0 0 32px currentColor;
  animation: finale-title 2.3s both;
}
.finale-win {
  background: radial-gradient(ellipse, #43302bdd, #020617ed 70%);
  color: #f3d293;
}
.finale-draw {
  color: #bac9e7;
}
.finale-crest {
  position: relative;
  width: 180px;
  height: 190px;
  font-size: 170px;
  line-height: 1;
  filter: drop-shadow(0 0 25px currentColor);
}
.finale-crest span {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 54% 0, 44% 47%, 56% 60%, 45% 100%, 0 100%);
  animation: crest-left 2.3s both;
}
.finale-crest span + span {
  clip-path: polygon(54% 0, 100% 0, 100% 100%, 45% 100%, 56% 60%, 44% 47%);
  animation: crest-right 2.3s both;
}
.finale-win .finale-crest span,
.finale-draw .finale-crest span {
  animation: crest-rise 2.3s both;
}
.finale-halo {
  position: absolute;
  width: min(70vw, 650px);
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 0 90px currentColor,
    inset 0 0 80px #f43f5e22;
  animation: finale-wave 2.3s both;
}
.finale-fragments {
  position: absolute;
  left: 50%;
  top: 45%;
}
.finale-fragments i {
  position: absolute;
  width: 5px;
  height: 20px;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
  transform: rotate(var(--a));
  animation: finale-shard 1.8s 0.25s both;
}
@keyframes crest-left {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  20% {
    transform: scale(1.12);
    opacity: 1;
  }
  36% {
    transform: translate(-3px, 0);
  }
  80%,
  100% {
    transform: translate(-45px, 60px) rotate(-22deg);
    opacity: 0;
  }
}
@keyframes crest-right {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  20% {
    transform: scale(1.12);
    opacity: 1;
  }
  36% {
    transform: translate(3px, 0);
  }
  80%,
  100% {
    transform: translate(45px, 80px) rotate(28deg);
    opacity: 0;
  }
}
@keyframes crest-rise {
  0% {
    transform: translateY(80px) scale(0.3);
    opacity: 0;
  }
  35% {
    transform: translateY(0) scale(1.15);
    opacity: 1;
  }
  80%,
  100% {
    transform: translateY(-15px) scale(1);
    opacity: 1;
  }
}
@keyframes finale-wave {
  0% {
    transform: scale(0.15);
    opacity: 0;
  }
  30% {
    opacity: 0.65;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
@keyframes finale-shard {
  0% {
    transform: rotate(var(--a)) translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: rotate(var(--a)) translateY(var(--d));
    opacity: 0;
  }
}
@keyframes finale-title {
  0%,
  25% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(8px);
  }
  50%,
  90% {
    opacity: 1;
    transform: none;
    filter: none;
  }
  100% {
    opacity: 0;
  }
}
.reduce-motion .match-finale * {
  animation: none !important;
  filter: none !important;
}
.reduce-motion .finale-halo,
.reduce-motion .finale-fragments {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .match-finale * {
    animation: none !important;
    filter: none !important;
  }
  .finale-halo,
  .finale-fragments {
    display: none;
  }
}
.card.has-ward {
  outline: 2px dotted #a5b4fc;
  outline-offset: 3px;
}
.card.is-hidden .city-art {
  opacity: 0.6;
  filter: saturate(0.45);
}
.card.is-hidden::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 30% 25%, #d4c5ff33, transparent 55%),
    radial-gradient(ellipse at 70% 75%, #809cf644, transparent 50%);
  animation: card-mist 3s ease-in-out infinite alternate;
}
.card.is-sleeping {
  filter: saturate(0.45);
}
@keyframes card-mist {
  to {
    transform: scale(0.93) translateY(-5px);
    opacity: 0.35;
  }
}
.reduce-motion .card.is-hidden::after {
  animation: none;
}

/* Equipment has a chamfered metal frame, separate from unit and event roles. */
.card.role-relic {
  border-radius: 24px 8px 24px 8px;
  border-width: 3px;
  border-color: #b9a87d;
  background: linear-gradient(145deg, #383544, #101927 65%);
}
.card.role-relic .city-art {
  border-radius: 32% 8%;
  color: #edc884;
}
.card.role-relic .card-name::before {
  content: "⚒ ";
  color: #edc884;
}
.equipment-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
}
.equipped {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #b9a87d66;
  border-radius: 16px 4px;
  background: #111b2e;
  flex: 1 1 280px;
  min-width: 0;
}
.equipped > button:first-child {
  background: transparent;
  border: 0;
  color: #ecd6a5;
  text-align: left;
}
.equipped small {
  color: #a6b4cc;
}
.equipped .secondary {
  margin-left: auto;
}
.enemy-equipment {
  opacity: 0.8;
}
.pending-choice {
  padding: 20px;
  margin: 14px 0;
  background: #111b2e;
  border: 1px solid #d8ba76;
  border-radius: 16px;
}
.pending-choice h3 {
  margin: 0 0 8px;
  color: #ecd6a5;
}
.pending-choice p {
  color: #a6b4cc;
  font-size: 13px;
}
.decision-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 2px;
}
.decision-cards .card {
  flex: 0 0 165px;
  width: 165px;
}
.effect-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}
.effect-choices button {
  flex: 1 1 160px;
  white-space: normal;
}
@media (max-width: 600px) {
  .pending-choice {
    padding: 12px;
  }
  .decision-cards .card {
    flex-basis: 145px;
    width: 145px;
  }
  .equipped {
    padding: 10px;
    font-size: 12px;
  }
}

/* Attack gestures do not steal scrolling outside a ready unit. */
.own-board .card.ready { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.attack-origin { outline: 3px solid #fde3a7 !important; filter: brightness(1.18); }
.attack-tether { position: fixed; inset: 0; pointer-events: none; z-index: 9001; color: #fb7185; }
.attack-tether.valid { color: #92f0cf; }
.attack-tether svg { overflow: visible; }
.chain-shadow { fill: none; stroke: #020617bb; stroke-width: 14; }
.chain-links { fill: #142238; stroke: currentColor; stroke-width: 2; }
.chain-flow { fill: none; stroke: #fff3cf; stroke-width: 2; stroke-dasharray: 3 28; }
.animated .chain-flow { animation: chain-flow .75s linear infinite; }
.chain-arrow { fill: currentColor; stroke: #fff6df; stroke-width: 1.5; }
.chain-target { fill: #02061766; stroke: currentColor; stroke-width: 2; stroke-dasharray: 5 5; }
.chain-caption { position: absolute; transform: translateX(-50%); padding: 7px 12px; border: 1px solid currentColor; border-radius: 20px; background: #071020ee; font-size: 12px; white-space: nowrap; }
@keyframes chain-flow { to { stroke-dashoffset: -31; } }
.impact-burst.fatal { color: #dab4ff; }
.impact-burst.destroyed { color: #ffbb72; }
.impact-burst .hit-motif { position: absolute; inset: -64px; width: 128px; height: 128px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 5; filter: drop-shadow(0 0 7px currentColor); }
.impact-burst .hit-motif path { stroke-linecap: round; }
.hit-projectile { position: fixed; z-index: 9000; pointer-events: none; width: 42px; height: 12px; color: #ffefbd; background: linear-gradient(90deg, transparent, currentColor); border-radius: 50%; box-shadow: 0 0 12px #fbbf2488; }
.hit-projectile::after { content: ''; position: absolute; right: -4px; top: -5px; border-left: 13px solid currentColor; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
@media (prefers-reduced-motion: reduce) { .animated .chain-flow { animation: none; } }
.arena:not(.phase-mulligan) .hand .role-event .city-art { height: 24px; min-height: 24px; flex-shrink: 0; }
.arena:not(.phase-mulligan) .hand .role-event .card-country,
.arena:not(.phase-mulligan) .hand .role-event .spell-bottom { display: none; }
.arena:not(.phase-mulligan) .hand .role-event .card-name { flex-shrink: 0; line-height: 1.05; font-size: 11px; max-height: 24px; overflow: hidden; }
.arena:not(.phase-mulligan) .hand .role-event .card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; max-height: 34px; min-height: 0; margin-top: 4px; flex-shrink: 0; }

/* Tapered spectral claw trails stay readable over the victim, even without WebGL. */
.impact-burst.fatal { color:#aeffb9; }
.impact-burst.fatal .hit-motif { stroke-width:7; filter:drop-shadow(2px 3px 0 #092f22) drop-shadow(0 0 6px #49ed90); }
.skin-energy-gate { color:#efd697; font-weight:600; }

/* Readable card details on tap, without opening a modal or playing the card. */
.arena .hand-info {
  max-width: 620px;
  margin: 6px auto 4px;
  padding: 10px 14px;
  border: 1px solid #52627c;
  border-left: 3px solid #fb7185;
  border-radius: 8px;
  background: #101b2d;
  color: #e2e8f0;
  text-align: left;
}
.hand-info-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hand-info-heading strong { font-size: 15px; color: #fff; }
.hand-info-role { font-size: 12px; color: #fda4af; }
.hand-info-stats { margin-top: 4px; font-size: 12px; color: #d4dded; }
.hand-info-effect, .card-peek .hand-info-effect { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.arena .hand .card-country { color: #d7e0ee; }
@media (max-width: 600px) {
  .arena .hand-info { margin-inline: 8px; padding: 9px 11px; }
}
