.game-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.28), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.2), transparent 34%),
    rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(10px);
}

.game-modal-backdrop.hidden {
  display: none;
}

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

.game-modal {
  width: min(1060px, 100%);
  max-height: min(900px, calc(100vh - 36px));
  overflow: auto;
  color: #e5e7eb;
  background:
    linear-gradient(155deg, rgba(30, 41, 59, 0.98), rgba(10, 15, 28, 0.99)),
    #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 26px;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.5);
}

.game-modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(14px);
}

.game-modal-header h2,
.game-modal-header p {
  margin: 0;
}

.game-modal-header h2 {
  margin-top: 2px;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: -0.035em;
}

.game-eyebrow {
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.game-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  font-size: 1.55rem;
  line-height: 1;
}

.game-icon-btn:hover,
.game-icon-btn:focus-visible {
  background: rgba(148, 163, 184, 0.24);
}

.game-socket-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
}

.game-socket-status::before {
  width: 7px;
  height: 7px;
  content: '';
  background: #f59e0b;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13);
}

.game-socket-status.connected::before {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.13);
}

.game-content {
  min-height: 480px;
  padding: clamp(18px, 3vw, 30px);
}

.game-loading,
.game-empty-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  margin: 0;
  color: #94a3b8;
  text-align: center;
}

.game-alert {
  margin: 16px 24px 0;
  padding: 10px 13px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.42);
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.game-home {
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.game-hero,
.game-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
}

.game-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 400px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 48px);
  background:
    linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.92)),
    radial-gradient(circle at 70% 20%, rgba(129, 140, 248, 0.5), transparent 28%),
    radial-gradient(circle at 30% 30%, rgba(14, 165, 233, 0.3), transparent 32%),
    #111827;
}

.game-hero::before,
.game-hero::after {
  position: absolute;
  content: '';
  border: 1px solid rgba(165, 180, 252, 0.23);
  transform: rotate(45deg);
}

.game-hero::before {
  top: 28px;
  right: 54px;
  width: 180px;
  height: 180px;
  border-radius: 42px;
}

.game-hero::after {
  top: 105px;
  right: 132px;
  width: 70px;
  height: 70px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 18px;
}

.game-hero > * {
  position: relative;
  z-index: 1;
}

.game-kicker {
  margin: 0 0 10px;
  color: #a5b4fc;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-hero h3 {
  max-width: 580px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.game-hero-copy {
  max-width: 570px;
  margin: 20px 0 0;
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.6;
}

.game-panel {
  padding: 22px;
  background: rgba(15, 23, 42, 0.62);
}

.game-panel h3,
.game-panel p {
  margin-top: 0;
}

.game-panel h3 {
  color: #fff;
}

.game-actions-stack {
  display: grid;
  gap: 12px;
}

.game-primary-btn,
.game-secondary-btn {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 900;
}

.game-primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid #818cf8;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.game-primary-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.game-secondary-btn {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.game-primary-btn:disabled,
.game-secondary-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.game-join-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 18px;
}

.game-code-input {
  min-width: 0;
  padding: 10px 12px;
  color: #fff;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.game-rules {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.84rem;
  line-height: 1.45;
}

.game-rules span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.game-rules strong {
  color: #e2e8f0;
}

.game-phase-layout {
  display: grid;
  gap: 18px;
}

.game-phase-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: linear-gradient(125deg, rgba(79, 70, 229, 0.24), rgba(14, 165, 233, 0.1));
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 18px;
}

.game-phase-banner h3,
.game-phase-banner p {
  margin: 0;
}

.game-phase-banner h3 {
  color: #fff;
  font-size: 1.2rem;
}

.game-phase-banner p {
  margin-top: 4px;
  color: #a5b4fc;
  font-size: 0.84rem;
  font-weight: 700;
}

.game-countdown {
  min-width: 78px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(165, 180, 252, 0.25);
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.game-room-code {
  color: #c7d2fe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
}

.game-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.game-player-card {
  min-width: 0;
  padding: 13px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
}

.game-player-card.self {
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.18);
}

.game-player-card.eliminated {
  opacity: 0.48;
  filter: grayscale(0.8);
}

.game-player-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-player-name {
  overflow: hidden;
  color: #f8fafc;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-player-state {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
}

.game-player-state.ready {
  color: #6ee7b7;
}

.game-health-track {
  height: 7px;
  margin: 10px 0 6px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.7);
  border-radius: 999px;
}

.game-health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #fb7185);
  border-radius: inherit;
}

.game-player-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.75rem;
}

.game-shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 16px;
}

.game-section-card {
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 18px;
}

.game-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.game-section-heading h3,
.game-section-heading p {
  margin: 0;
}

.game-section-heading h3 {
  color: #fff;
}

.game-resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.32);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.game-unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.game-unit-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 14px;
}

.game-unit-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 12px;
  font-size: 1.25rem;
}

.game-unit-card h4,
.game-unit-card p {
  margin: 0;
}

.game-unit-card h4 {
  color: #f8fafc;
}

.game-unit-stats {
  margin-top: 4px !important;
  color: #94a3b8;
  font-size: 0.76rem;
}

.game-roster-unit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
}

.game-roster-unit strong {
  color: #f8fafc;
}

.game-owned-unit-stats {
  color: #94a3b8;
  font-size: 0.64rem;
  line-height: 1.05;
}

.game-ready-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.game-ready-note {
  margin: 0 auto 0 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.game-battle-list {
  display: grid;
  gap: 12px;
}

.game-battle-card {
  padding: 16px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.17);
  border-radius: 16px;
}

.game-battle-card h4,
.game-battle-card p {
  margin: 0;
}

.game-battle-card h4 {
  color: #fff;
  font-size: 1rem;
}

.game-battle-summary {
  margin-top: 6px !important;
  color: #cbd5e1;
}

.game-battle-card details {
  margin-top: 10px;
  color: #94a3b8;
  font-size: 0.8rem;
}

.game-battle-card summary {
  cursor: pointer;
  font-weight: 800;
}

.game-battle-log {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.game-lobby {
  max-width: 760px;
  margin: 0 auto;
}

.game-lobby-code-card {
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 20px;
}

.game-lobby-code-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.game-lobby-code-card strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(2rem, 7vw, 3.6rem);
  letter-spacing: 0.16em;
}

.game-lobby-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.game-finish-card {
  max-width: 680px;
  margin: 24px auto;
  padding: clamp(28px, 6vw, 58px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.22), transparent 44%),
    rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 24px;
}

.game-finish-icon {
  display: block;
  margin-bottom: 12px;
  font-size: 3.5rem;
}

.game-finish-card h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.game-finish-card p {
  color: #cbd5e1;
}

@media (max-width: 780px) {
  .game-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .game-modal {
    width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .game-modal-header {
    padding: 16px;
  }

  .game-content {
    min-height: 520px;
    padding: 16px;
  }

  .game-home,
  .game-shop-layout {
    grid-template-columns: 1fr;
  }

  .game-hero {
    min-height: 290px;
  }

  .game-unit-grid {
    grid-template-columns: 1fr;
  }

  .game-ready-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .game-ready-note {
    margin: 0;
  }

  .game-ready-bar .game-primary-btn {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .game-socket-status {
    width: 9px;
    overflow: hidden;
    color: transparent;
  }

  .game-join-form {
    grid-template-columns: 1fr;
  }

  .game-phase-banner {
    align-items: flex-start;
  }
}

.game-shop-market {
  background:
    linear-gradient(135deg, rgba(49, 46, 129, 0.16), transparent 50%),
    rgba(15, 23, 42, 0.58);
}

.game-preparation-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
}

.game-hand-zone,
.game-board-zone {
  min-height: 128px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  background: rgba(2, 6, 23, 0.42);
  border: 2px dashed rgba(148, 163, 184, 0.23);
  border-radius: 15px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.game-hand-zone {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(99, 102, 241, 0.045) 0,
      rgba(99, 102, 241, 0.045) 10px,
      transparent 10px,
      transparent 20px
    ),
    rgba(2, 6, 23, 0.42);
}

.game-board-zone {
  position: relative;
  min-height: 156px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.08)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(14.2857% - 1px),
      rgba(148, 163, 184, 0.08) calc(14.2857% - 1px),
      rgba(148, 163, 184, 0.08) 14.2857%
    ),
    rgba(2, 6, 23, 0.48);
}

.game-hand-zone.drag-over,
.game-board-zone.drag-over {
  background-color: rgba(79, 70, 229, 0.18);
  border-color: #818cf8;
  box-shadow: inset 0 0 0 2px rgba(129, 140, 248, 0.18);
}

body.game-unit-dragging [data-game-drop].game-drop-eligible {
  outline: 2px dashed rgba(129, 140, 248, 0.72);
  outline-offset: -4px;
  box-shadow:
    inset 0 0 0 2px rgba(129, 140, 248, 0.1),
    0 0 18px rgba(99, 102, 241, 0.16);
}

body.game-unit-dragging [data-game-drop].game-drop-eligible.drag-over {
  outline-style: solid;
  outline-color: #c7d2fe;
  box-shadow:
    inset 0 0 0 3px rgba(165, 180, 252, 0.28),
    0 0 24px rgba(99, 102, 241, 0.32);
}

.game-draggable-unit {
  position: relative;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.game-draggable-unit:active {
  cursor: grabbing;
}

.game-draggable-unit.dragging {
  opacity: 0.35;
}

.game-draggable-unit.disabled,
.game-draggable-unit.locked,
.game-hand-zone.locked .game-draggable-unit,
.game-board-zone.locked .game-draggable-unit {
  cursor: not-allowed;
  opacity: 0.52;
}

.game-unit-tags {
  display: block;
  max-width: 100%;
  margin: 2px 0 0;
  overflow: hidden;
  color: #a5b4fc;
  font-size: 0.58rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tribe-dinosaur {
  border-color: rgba(74, 222, 128, 0.42) !important;
}

.tribe-machine {
  border-color: rgba(125, 211, 252, 0.42) !important;
}

.tribe-demon {
  border-color: rgba(248, 113, 113, 0.42) !important;
}

.tribe-feline {
  border-color: rgba(251, 191, 36, 0.42) !important;
}

.game-unit-card,
.game-roster-unit,
.game-choice-option,
.game-combat-unit {
  position: relative;
}

:is(.game-unit-card, .game-roster-unit, .game-choice-option, .game-combat-unit).has-guard::before {
  position: absolute;
  z-index: 4;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 24px;
  content: '';
  background:
    linear-gradient(145deg, #fff7b2 0 20%, #fbbf24 21% 58%, #92400e 59% 100%);
  border: 1px solid rgba(254, 243, 199, 0.9);
  clip-path: polygon(50% 0, 92% 18%, 84% 72%, 50% 100%, 16% 72%, 8% 18%);
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.9));
  pointer-events: none;
}

:is(.game-unit-card, .game-roster-unit, .game-choice-option, .game-combat-unit).has-shield::after {
  position: absolute;
  z-index: 3;
  inset: 1px;
  content: '';
  border: 2px solid rgba(125, 211, 252, 0.88);
  border-radius: inherit;
  box-shadow:
    inset 0 0 10px rgba(56, 189, 248, 0.22),
    0 0 9px rgba(56, 189, 248, 0.6);
  opacity: 0.9;
  pointer-events: none;
  animation: game-shield-pulse 1.8s ease-in-out infinite;
}

.game-hand-zone .game-roster-unit,
.game-board-zone .game-roster-unit {
  width: 112px;
  min-width: 112px;
  align-content: center;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.game-hand-zone .game-owned-unit-stats,
.game-board-zone .game-owned-unit-stats {
  text-align: center;
}

.game-unit-tooltip-source:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.game-unit-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: min(300px, calc(100vw - 16px));
  padding: 9px 11px;
  visibility: hidden;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(165, 180, 252, 0.6);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.52);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 100ms ease, transform 100ms ease, visibility 100ms ease;
}

.game-unit-tooltip.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.game-sell-zone {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 12px 14px;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.16);
  border: 2px dashed rgba(248, 113, 113, 0.28);
  border-radius: 13px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.game-sell-zone small {
  justify-self: end;
  color: #94a3b8;
}

.game-sell-zone.drag-over {
  transform: scale(1.01);
  color: #fff;
  background: rgba(185, 28, 28, 0.36);
  border-color: #f87171;
}

.game-sell-zone.locked {
  opacity: 0.45;
}

.game-drag-ghost {
  position: fixed !important;
  z-index: 4000;
  width: 118px !important;
  min-width: 118px !important;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  transform: translate(-50%, -55%) rotate(var(--game-drag-rotation, 0deg)) scale(1.04);
  transform-origin: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
}

body.game-unit-dragging {
  cursor: grabbing;
}

.game-arena-section {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 25%, rgba(99, 102, 241, 0.13), transparent 38%),
    rgba(15, 23, 42, 0.65);
}

.game-battle-arena {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(2, 6, 23, 0.86));
}

.game-battle-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(2, 6, 23, 0.52);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.game-battle-versus > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-battle-versus > div:last-child {
  flex-direction: row-reverse;
}

.game-battle-versus strong {
  overflow: hidden;
  color: #f8fafc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-battle-versus span {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 800;
}

.game-versus-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff !important;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: 1px solid #a78bfa;
  border-radius: 999px;
  font-size: 0.72rem !important;
}

.game-first-attacker {
  margin: 0;
  padding: 9px 14px;
  color: #c7d2fe;
  background: rgba(49, 46, 129, 0.22);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.game-combat-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  min-height: 230px;
  padding: 16px;
}

.game-combat-terrain {
  min-width: 0;
  padding: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(14.2857% - 1px),
      rgba(148, 163, 184, 0.06) calc(14.2857% - 1px),
      rgba(148, 163, 184, 0.06) 14.2857%
    ),
    rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(96, 165, 250, 0.17);
  border-radius: 14px;
}

.game-combat-terrain.right {
  border-color: rgba(244, 114, 182, 0.17);
}

.game-terrain-label {
  display: block;
  margin-bottom: 9px;
  overflow: hidden;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-combat-terrain.right .game-terrain-label {
  color: #f9a8d4;
  text-align: right;
}

.game-combat-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 154px;
  overflow-x: auto;
  padding: 6px;
}

.game-combat-field.compact {
  min-height: 100px;
}

.game-combat-center {
  align-self: center;
  color: #a5b4fc;
  font-size: 1.35rem;
  filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.8));
}

.game-combat-unit {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 5px 3px;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
  text-align: center;
  transition: opacity 180ms ease, filter 180ms ease, transform 220ms ease, border-color 180ms ease;
}

.game-combat-unit strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-combat-unit .game-owned-unit-stats,
.game-combat-unit small {
  max-width: 100%;
  overflow: hidden;
  color: #94a3b8;
  font-size: 0.49rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-combat-unit .game-unit-tags {
  font-size: 0.45rem;
}

.game-combat-unit.defeated {
  z-index: 0;
  opacity: 0;
  filter: grayscale(1);
  transform: scale(0.72);
}

.game-combat-unit.destroying {
  pointer-events: none;
  animation: game-unit-destroy 190ms ease-in forwards;
}

.game-combat-unit.attacking-right {
  z-index: 3;
  border-color: #a5b4fc;
  animation: game-attack-right 620ms ease;
}

.game-combat-unit.attacking-left {
  z-index: 3;
  border-color: #f9a8d4;
  animation: game-attack-left 620ms ease;
}

.game-combat-unit.taking-hit,
.game-combat-unit.taking-counter {
  animation: game-unit-hit 300ms ease 150ms;
}

.game-floating-damage {
  position: absolute;
  z-index: 6;
  top: -9px;
  right: 4px;
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 1000;
  text-shadow: 0 2px 6px #000;
  pointer-events: none;
  animation: game-damage-float 760ms ease forwards;
}

.game-floating-damage.counter {
  right: auto;
  left: 4px;
  color: #fde68a;
}

.game-shield-break {
  position: absolute;
  z-index: 7;
  inset: 5px;
  border: 3px solid rgba(186, 230, 253, 0.95);
  border-radius: inherit;
  box-shadow:
    inset 0 0 13px rgba(14, 165, 233, 0.6),
    0 0 14px rgba(56, 189, 248, 0.95);
  pointer-events: none;
  animation: game-shield-break 760ms ease-out forwards;
}

.game-shield-break::before,
.game-shield-break::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28%;
  height: 3px;
  content: '';
  background: #e0f2fe;
  box-shadow:
    -18px -14px 0 -1px #7dd3fc,
    20px 10px 0 -1px #38bdf8;
}

.game-shield-break::before {
  transform: translate(-50%, -50%) rotate(38deg);
}

.game-shield-break::after {
  transform: translate(-50%, -50%) rotate(-42deg);
}

.game-battle-result {
  padding: 13px 16px 16px;
  background: rgba(2, 6, 23, 0.52);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  text-align: center;
  animation: game-result-reveal 320ms ease;
}

.game-battle-result h4,
.game-battle-result p {
  margin: 0;
}

.game-battle-result p {
  margin-top: 5px;
}

.game-empty-field {
  width: 100%;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.game-battle-bye {
  display: grid;
  gap: 8px;
  text-align: center;
}

@keyframes game-attack-right {
  0%,
  100% { transform: translateX(0) scale(1); }
  48% { transform: translateX(34px) scale(1.07); }
}

@keyframes game-attack-left {
  0%,
  100% { transform: translateX(0) scale(1); }
  48% { transform: translateX(-34px) scale(1.07); }
}

@keyframes game-unit-hit {
  0%,
  100% { filter: brightness(1); }
  35% { filter: brightness(2.2) saturate(0.4); transform: translateX(-4px); }
  65% { transform: translateX(4px); }
}

@keyframes game-damage-float {
  from { opacity: 0; transform: translateY(5px) scale(0.8); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translateY(-25px) scale(1.08); }
}

@keyframes game-shield-pulse {
  0%,
  100% { opacity: 0.68; filter: brightness(0.9); }
  50% { opacity: 1; filter: brightness(1.35); }
}

@keyframes game-shield-break {
  from { opacity: 1; transform: scale(1); }
  55% { opacity: 0.9; transform: scale(1.14); }
  to { opacity: 0; transform: scale(1.42) rotate(6deg); }
}

@keyframes game-unit-destroy {
  from { opacity: 0.5; filter: grayscale(0.2); transform: scale(0.9); }
  to { opacity: 0; filter: grayscale(1); transform: scale(0.55) rotate(5deg); }
}

@keyframes game-result-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

  .game-combat-board {
    grid-template-columns: 1fr;
  }

  .game-combat-center {
    justify-self: center;
    transform: rotate(90deg);
  }

  .game-combat-terrain.right .game-terrain-label {
    text-align: left;
  }

  .game-sell-zone {
    grid-template-columns: auto 1fr;
  }

  .game-sell-zone small {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .game-hand-zone .game-roster-unit,
  .game-board-zone .game-roster-unit {
    width: 96px;
    min-width: 96px;
  }

  .game-battle-versus {
    gap: 8px;
    padding: 12px 10px;
  }

  .game-combat-board {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-combat-unit,
  .game-floating-damage,
  .game-battle-result {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* Single-screen game layout */
.game-modal {
  height: min(900px, calc(100dvh - 36px));
  max-height: none;
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

.game-modal-header {
  position: relative;
  flex: 0 0 auto;
}

.game-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.game-content > .game-phase-layout {
  height: 100%;
  min-height: 0;
}

.game-shop-screen {
  grid-template-rows: auto auto minmax(92px, 0.85fr) minmax(105px, 1fr) minmax(94px, 0.88fr) auto;
  gap: 9px;
}

.game-shop-screen .game-player-grid {
  display: flex;
  gap: 6px;
}

.game-shop-screen .game-player-card {
  min-width: 0;
  flex: 1 1 0;
  padding: 7px 8px;
}

.game-shop-screen .game-health-track {
  height: 5px;
  margin: 5px 0 3px;
}

.game-shop-screen .game-section-card {
  min-height: 0;
  padding: 9px 11px;
  overflow: hidden;
  border-radius: 14px;
}

.game-shop-screen .game-section-heading {
  min-height: 24px;
  margin-bottom: 6px;
}

.game-shop-screen .game-section-heading h3 {
  font-size: 0.92rem;
}

.game-shop-market {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.game-shop-market.drag-over {
  background-color: rgba(185, 28, 28, 0.2);
  border-color: #f87171;
  box-shadow: inset 0 0 0 2px rgba(248, 113, 113, 0.15);
}

body.game-unit-dragging .game-shop-market.game-drop-eligible {
  outline-color: rgba(248, 113, 113, 0.78);
  box-shadow:
    inset 0 0 0 2px rgba(248, 113, 113, 0.1),
    0 0 18px rgba(239, 68, 68, 0.16);
}

body.game-unit-dragging .game-shop-market.game-drop-eligible.drag-over {
  outline-color: #fecaca;
  box-shadow:
    inset 0 0 0 3px rgba(252, 165, 165, 0.25),
    0 0 24px rgba(239, 68, 68, 0.3);
}

.game-shop-market.locked {
  opacity: 0.62;
}

.game-shop-screen .game-unit-grid {
  grid-template-columns: repeat(var(--game-shop-slot-count, 3), minmax(0, 1fr));
  gap: 6px;
}

.game-shop-empty {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.game-shop-screen .game-unit-card {
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
}

.game-shop-screen .game-unit-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1rem;
}

.game-shop-screen .game-unit-card h4 {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shop-screen .game-unit-stats {
  font-size: 0.64rem;
}

.game-shop-screen .game-board-card,
.game-shop-screen .game-hand-card {
  display: flex;
  flex-direction: column;
}

.game-shop-screen .game-board-zone,
.game-shop-screen .game-hand-zone {
  min-height: 0;
  display: grid;
  align-items: stretch;
  gap: 6px;
  flex: 1 1 auto;
  padding: 6px;
  overflow: hidden;
}

.game-shop-screen .game-board-zone {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.game-shop-screen .game-hand-zone {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.game-shop-screen .game-hand-zone .game-roster-unit,
.game-shop-screen .game-board-zone .game-roster-unit {
  width: auto;
  min-width: 0;
  min-height: 0;
  align-content: center;
  gap: 3px;
  padding: 5px 3px;
  overflow: hidden;
}

.game-shop-screen .game-roster-unit strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shop-screen .game-owned-unit-stats {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.49rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shop-screen .game-roster-unit .game-unit-tags {
  font-size: 0.45rem;
}

.game-shop-screen .game-ready-bar {
  min-height: 32px;
}

.game-shop-screen .game-ready-bar .game-primary-btn {
  padding: 7px 12px;
}

.game-combat-screen {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
}

.game-combat-screen .game-arena-section {
  min-height: 0;
  display: flex;
  padding: 10px;
  flex-direction: column;
}

.game-combat-screen .game-section-heading {
  margin-bottom: 7px;
}

.game-combat-screen .game-battle-list {
  min-height: 0;
  flex: 1 1 auto;
}

.game-combat-screen .game-battle-arena {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.game-combat-screen .game-combat-board {
  min-height: 0;
  flex: 1 1 auto;
}

.game-combat-screen .game-combat-field {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
}

.game-combat-screen .game-combat-unit {
  width: auto;
  min-width: 0;
  padding: 5px 3px;
}

.game-combat-screen .game-combat-unit .game-unit-icon {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.game-combat-screen .game-battle-result {
  position: absolute;
  z-index: 8;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(129, 140, 248, 0.3);
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.42);
}

.game-combat-continue {
  margin-top: 7px;
  padding: 7px 14px;
}

.game-other-battles {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  overflow: hidden;
}

.game-other-battles span {
  min-width: 0;
  padding: 4px 7px;
  overflow: hidden;
  color: #94a3b8;
  background: rgba(2, 6, 23, 0.42);
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-home,
.game-lobby,
.game-finish-card {
  min-height: 0;
}

@media (max-height: 620px), (max-width: 780px) and (orientation: portrait) {
  .game-modal-header {
    min-height: 42px;
    padding: 6px 12px;
  }

  .game-modal-header h2 {
    font-size: 1.05rem;
  }

  .game-modal-header .game-eyebrow {
    display: none;
  }

  .game-icon-btn {
    width: 32px;
    height: 32px;
  }

  .game-content {
    padding: 5px;
  }

  .game-alert {
    position: absolute;
    z-index: 12;
    top: 44px;
    right: 8px;
    left: 8px;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .game-home {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
    gap: 6px;
  }

  .game-hero {
    min-height: 0;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
  }

  .game-hero::before {
    top: 18px;
    right: 22px;
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .game-hero::after {
    top: 58px;
    right: 62px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .game-kicker {
    margin-bottom: 5px;
    font-size: 0.58rem;
  }

  .game-hero h3 {
    font-size: clamp(1.55rem, 5.5vw, 2.5rem);
    line-height: 0.94;
  }

  .game-hero-copy {
    margin-top: 8px;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .game-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    align-items: start;
    gap: 6px 8px;
    padding: 9px;
    overflow: hidden;
    border-radius: 12px;
  }

  .game-panel h3,
  .game-panel > .game-player-state {
    margin: 0;
  }

  .game-panel h3 {
    grid-column: 1;
    font-size: 0.85rem;
  }

  .game-panel > .game-player-state {
    grid-column: 2;
    font-size: 0.6rem;
    line-height: 1.25;
  }

  .game-actions-stack {
    grid-column: 1;
    grid-row: 2;
    gap: 5px;
  }

  .game-join-form {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    margin: 0;
  }

  .game-panel .game-primary-btn,
  .game-panel .game-secondary-btn,
  .game-panel .game-code-input {
    min-height: 34px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
  }

  .game-rules {
    min-height: 0;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 3px 8px;
    margin: 0;
    padding: 5px 0 0;
    overflow: hidden;
    font-size: 0.56rem;
    line-height: 1.2;
  }

  .game-rules span {
    gap: 4px;
  }

  .game-empty-state {
    height: 100%;
    min-height: 0;
    padding: 8px;
  }

  .game-empty-state > div {
    max-width: 560px;
  }

  .game-empty-state .game-finish-icon {
    margin-bottom: 2px;
    font-size: 1.8rem;
  }

  .game-empty-state h3,
  .game-empty-state p {
    margin: 5px 0;
  }

  .game-empty-state h3 {
    font-size: 1rem;
  }

  .game-empty-state p {
    font-size: 0.68rem;
  }

  .game-empty-state .game-primary-btn {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .game-lobby {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(170px, 0.5fr) minmax(0, 1.5fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
  }

  .game-lobby-code-card {
    min-height: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 8px;
    border-radius: 12px;
  }

  .game-lobby-code-card strong {
    margin: 0;
    font-size: clamp(1.25rem, 5vw, 2.2rem);
  }

  .game-lobby-code-card .game-secondary-btn {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 0.66rem;
  }

  .game-lobby > .game-section-card {
    min-height: 0;
    display: flex;
    padding: 7px;
    overflow: hidden;
    flex-direction: column;
    border-radius: 12px;
  }

  .game-lobby .game-section-heading {
    margin-bottom: 4px;
  }

  .game-lobby .game-section-heading h3 {
    font-size: 0.8rem;
  }

  .game-lobby .game-player-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    flex: 1 1 auto;
  }

  .game-lobby .game-player-card {
    min-height: 0;
    padding: 4px 5px;
    overflow: hidden;
    border-radius: 8px;
  }

  .game-lobby .game-player-name,
  .game-lobby .game-player-state {
    font-size: 0.6rem;
  }

  .game-lobby .game-health-track {
    height: 3px;
    margin: 2px 0;
  }

  .game-lobby .game-player-meta {
    font-size: 0.54rem;
  }

  .game-lobby-actions {
    min-height: 32px;
    margin-top: 4px;
    flex-wrap: nowrap;
  }

  .game-lobby-actions .game-primary-btn,
  .game-lobby-actions .game-secondary-btn {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 0.66rem;
  }

  .game-phase-banner {
    min-height: 38px;
    padding: 5px 9px;
    border-radius: 10px;
  }

  .game-phase-banner h3 {
    font-size: 0.88rem;
  }

  .game-phase-banner p,
  .game-ready-note,
  .game-shop-screen .game-section-heading p,
  .game-combat-screen > .game-phase-banner p,
  .game-combat-screen .game-section-heading p {
    display: none;
  }

  .game-countdown {
    min-width: 54px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 0.94rem;
  }

  .game-shop-screen {
    grid-template-rows: 38px 30px minmax(0, 0.95fr) minmax(0, 1fr) minmax(0, 0.85fr) 28px;
    gap: 4px;
  }

  .game-shop-screen .game-player-card {
    padding: 3px 5px;
  }

  .game-shop-screen .game-player-name {
    font-size: 0.7rem;
  }

  .game-shop-screen .game-health-track {
    height: 3px;
    margin: 2px 0;
  }

  .game-shop-screen .game-player-meta {
    font-size: 0.58rem;
  }

  .game-shop-screen .game-section-card {
    padding: 4px 6px;
    border-radius: 9px;
  }

  .game-shop-screen .game-section-heading {
    min-height: 16px;
    margin-bottom: 2px;
  }

  .game-shop-screen .game-section-heading h3 {
    font-size: 0.7rem;
  }

  .game-resource-pill {
    padding: 2px 6px;
    font-size: 0.65rem;
  }

  .game-shop-screen .game-unit-card {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 3px;
  }

  .game-shop-screen .game-unit-icon {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }

  .game-shop-screen .game-board-zone,
  .game-shop-screen .game-hand-zone {
    gap: 3px;
    padding: 3px;
  }

  .game-shop-screen .game-hand-zone .game-roster-unit,
  .game-shop-screen .game-board-zone .game-roster-unit {
    grid-template-rows: auto auto;
    padding: 2px;
  }

  .game-shop-screen .game-roster-unit .game-unit-icon {
    width: 20px;
    height: 20px;
  }

  .game-shop-screen .game-owned-unit-stats {
    font-size: 0.42rem;
  }

  .game-shop-screen .game-ready-bar .game-primary-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .game-shop-screen .game-ready-bar {
    min-height: 0;
  }

  .game-combat-screen {
    grid-template-rows: 38px minmax(0, 1fr);
    gap: 4px;
  }

  .game-combat-screen .game-arena-section {
    padding: 5px;
  }

  .game-combat-screen .game-section-heading {
    min-height: 20px;
    margin-bottom: 2px;
  }

  .game-combat-screen .game-section-heading h3 {
    margin: 0;
    font-size: 0.75rem;
  }

  .game-battle-versus {
    padding: 4px 9px;
  }

  .game-versus-mark {
    width: 25px;
    height: 25px;
  }

  .game-first-attacker {
    padding: 3px 8px;
    font-size: 0.6rem;
  }

  .game-combat-screen .game-combat-board {
    gap: 5px;
    padding: 5px;
  }

  .game-combat-screen .game-combat-terrain {
    padding: 4px;
  }

  .game-combat-screen .game-terrain-label {
    margin-bottom: 2px;
    font-size: 0.56rem;
  }

  .game-combat-screen .game-combat-field {
    gap: 3px;
    padding: 2px;
  }

  .game-combat-screen .game-combat-unit {
    gap: 2px;
    padding: 3px 2px;
  }

  .game-combat-screen .game-combat-unit .game-unit-icon {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }

  .game-combat-screen .game-combat-unit strong {
    font-size: 0.59rem;
  }

  .game-combat-screen .game-combat-unit .game-owned-unit-stats {
    font-size: 0.42rem;
  }

  .game-combat-screen .game-combat-unit .game-unit-tags {
    font-size: 0.45rem;
  }

  .game-combat-screen .game-battle-result {
    right: 5px;
    bottom: 5px;
    left: 5px;
    padding: 5px 8px;
  }

  .game-combat-screen .game-battle-result p {
    display: none;
  }

  .game-combat-continue {
    margin-top: 4px;
    padding: 4px 10px;
    font-size: 0.68rem;
  }
}

@media (max-width: 780px) and (orientation: portrait) {
  .game-modal-backdrop {
    display: block;
    padding: 0;
    overflow: hidden;
  }

  .game-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100dvh;
    height: 100dvw;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center;
  }
}

@media (max-height: 620px) and (max-width: 1024px) and (orientation: landscape) {
  .game-modal-backdrop {
    display: block;
    padding: 0;
    overflow: hidden;
  }

  .game-modal {
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
}

/* Player sidebar and vertical battlefields */
.game-shop-screen,
.game-combat-screen {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 9px;
}

.game-shop-screen {
  position: relative;
  grid-template-rows: auto minmax(110px, 1fr) minmax(100px, 0.85fr) minmax(210px, 1.45fr);
}

.game-shop-screen > .game-phase-banner,
.game-combat-screen > .game-phase-banner {
  grid-column: 2;
  grid-row: 1;
}

.game-shop-screen > .game-player-grid,
.game-combat-screen > .game-player-grid {
  min-height: 0;
  display: flex;
  grid-column: 1;
  grid-row: 1 / -1;
  gap: 5px;
  overflow: hidden;
  flex-direction: column;
}

.game-shop-screen > .game-player-grid .game-player-card,
.game-combat-screen > .game-player-grid .game-player-card {
  min-height: 0;
  flex: 1 1 0;
  padding: 6px 7px;
  overflow: hidden;
}

.game-shop-screen > .game-player-grid .game-health-track,
.game-combat-screen > .game-player-grid .game-health-track {
  height: 5px;
  margin: 4px 0 3px;
}

.game-shop-screen > .game-player-grid .game-player-meta,
.game-combat-screen > .game-player-grid .game-player-meta {
  font-size: 0.65rem;
}

.game-shop-screen > .game-shop-market {
  grid-column: 2;
  grid-row: 2;
}

.game-shop-screen > .game-board-card {
  grid-column: 2;
  grid-row: 3;
}

.game-shop-screen > .game-hand-card {
  grid-column: 2;
  grid-row: 4;
}

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

.game-combat-screen > .game-arena-section {
  grid-column: 2;
  grid-row: 2;
}

.game-combat-board {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 5px;
  min-height: 0;
  padding: 8px;
}

.game-combat-terrain.opponent {
  border-color: rgba(244, 114, 182, 0.36);
  background:
    linear-gradient(rgba(157, 23, 77, 0.08), rgba(157, 23, 77, 0.08)),
    rgba(15, 23, 42, 0.5);
}

.game-combat-terrain.ally {
  border-color: rgba(96, 165, 250, 0.36);
  background:
    linear-gradient(rgba(29, 78, 216, 0.08), rgba(29, 78, 216, 0.08)),
    rgba(15, 23, 42, 0.5);
}

.game-combat-terrain.opponent .game-terrain-label {
  color: #f9a8d4;
}

.game-combat-terrain.ally .game-terrain-label {
  color: #93c5fd;
}

.game-combat-center {
  justify-self: center;
  padding: 1px 8px;
  transform: none;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-combat-screen .game-combat-field {
  min-height: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.game-shop-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.game-shop-upgrade-btn,
.game-shop-action-btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.68rem;
  white-space: nowrap;
}

.game-shop-action-btn.active {
  color: #e0f2fe;
  background: rgba(14, 116, 144, 0.34);
  border-color: rgba(125, 211, 252, 0.58);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.16);
}

.game-choice-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
}

.game-choice-panel {
  width: min(720px, 96%);
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22), transparent 48%),
    #111827;
  border: 1px solid rgba(165, 180, 252, 0.4);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.game-choice-panel h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
}

.game-choice-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.game-choice-option {
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  text-align: center;
}

.game-choice-option:hover,
.game-choice-option:focus-visible {
  background: rgba(67, 56, 202, 0.34);
  border-color: #a5b4fc !important;
}

.game-choice-option span,
.game-choice-option small,
.game-choice-option p {
  margin: 0;
  font-size: 0.65rem;
}

.game-choice-option p {
  color: #cbd5e1;
  line-height: 1.25;
}

.game-combat-unit.attacking-up {
  z-index: 5;
  border-color: #fbbf24;
  animation: game-attack-up 620ms ease;
}

.game-combat-unit.attacking-down {
  z-index: 5;
  border-color: #fbbf24;
  animation: game-attack-down 620ms ease;
}

.game-attack-link {
  position: absolute;
  z-index: 4;
  height: 3px;
  display: block;
  color: #fff;
  background: linear-gradient(90deg, #fbbf24, #fb7185);
  border-radius: 999px;
  pointer-events: none;
  transform-origin: left center;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.95));
  animation: game-attack-link 720ms ease forwards;
}

.game-attack-link::after {
  position: absolute;
  top: 50%;
  right: -2px;
  width: 0;
  height: 0;
  content: '';
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #fb7185;
  transform: translateY(-50%);
}

.game-attack-link > span {
  position: absolute;
  top: -18px;
  left: 50%;
  padding: 2px 5px;
  color: #fff;
  background: rgba(120, 53, 15, 0.9);
  border-radius: 5px;
  font-size: 0.52rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  transform: translateX(-50%);
}

.game-drag-preview-source {
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
  opacity: 0 !important;
}

.game-drop-preview {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  color: #c7d2fe;
  background: rgba(79, 70, 229, 0.22);
  border: 2px dashed #818cf8;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 900;
  text-align: center;
  animation: game-drop-preview 180ms ease;
}

@keyframes game-attack-up {
  0%,
  100% { transform: translateY(0) scale(1); }
  48% { transform: translateY(-24px) scale(1.07); }
}

@keyframes game-attack-down {
  0%,
  100% { transform: translateY(0) scale(1); }
  48% { transform: translateY(24px) scale(1.07); }
}

@keyframes game-attack-link {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  25%,
  70% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 100%); }
}

@keyframes game-drop-preview {
  from { opacity: 0; transform: scaleX(0.35); }
  to { opacity: 1; transform: scaleX(1); }
}

@media (max-height: 620px), (max-width: 780px) and (orientation: portrait) {
  .game-shop-screen,
  .game-combat-screen {
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 4px;
  }

  .game-shop-screen {
    grid-template-rows: 38px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.85fr);
  }

  .game-shop-screen > .game-player-grid,
  .game-combat-screen > .game-player-grid {
    gap: 2px;
  }

  .game-shop-screen > .game-player-grid .game-player-card,
  .game-combat-screen > .game-player-grid .game-player-card {
    padding: 2px 4px;
    border-radius: 7px;
  }

  .game-shop-screen > .game-player-grid .game-player-name,
  .game-shop-screen > .game-player-grid .game-player-state,
  .game-combat-screen > .game-player-grid .game-player-name,
  .game-combat-screen > .game-player-grid .game-player-state {
    font-size: 0.56rem;
  }

  .game-shop-screen > .game-player-grid .game-health-track,
  .game-combat-screen > .game-player-grid .game-health-track {
    height: 3px;
    margin: 1px 0;
  }

  .game-shop-screen > .game-player-grid .game-player-meta,
  .game-combat-screen > .game-player-grid .game-player-meta {
    font-size: 0.5rem;
  }

  .game-shop-screen > .game-player-grid .game-player-meta span:last-child,
  .game-combat-screen > .game-player-grid .game-player-meta span:last-child {
    display: none;
  }

  .game-combat-screen {
    grid-template-rows: 38px minmax(0, 1fr);
  }

  .game-combat-screen .game-combat-board {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 14px minmax(0, 1fr);
    gap: 2px;
    padding: 3px;
  }

  .game-combat-center {
    padding: 0 5px;
    font-size: 0.48rem;
  }

  .game-drop-preview {
    border-radius: 6px;
    font-size: 0.48rem;
  }

  .game-unit-tags {
    font-size: 0.46rem;
  }

  .game-choice-backdrop {
    padding: 6px;
  }

  .game-choice-panel {
    padding: 9px;
    border-radius: 11px;
  }

  .game-choice-panel h3 {
    margin-bottom: 7px;
    font-size: 0.72rem;
  }

  .game-choice-options {
    gap: 5px;
  }

  .game-choice-option {
    min-height: 74px;
    gap: 2px;
    padding: 5px;
  }

  .game-choice-option .game-unit-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .game-choice-option span,
  .game-choice-option small,
  .game-choice-option p {
    font-size: 0.5rem;
  }

  .game-shop-controls {
    gap: 3px;
  }

  .game-shop-upgrade-btn,
  .game-shop-action-btn {
    min-height: 22px;
    padding: 2px 5px;
    font-size: 0.54rem;
  }
}

@media (max-width: 780px) and (orientation: portrait) {
  .game-unit-tooltip,
  .game-unit-tooltip.visible {
    top: 50% !important;
    left: 50% !important;
    width: min(320px, calc(100vh - 24px));
    max-width: calc(100vh - 24px);
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center;
  }
}

/* Solo mode, reconnection feedback, and clearer hand cards. */
.game-solo-btn {
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.2);
}

.game-paused-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 250px;
  padding: 7px 11px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.32);
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.game-zone-count {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 6px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.24);
  border-radius: 999px;
  font-size: 0.62rem;
  vertical-align: middle;
}

.game-zone-help {
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 0.63rem;
}

.game-owned-unit-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.game-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 5px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.game-shop-screen .game-hand-zone {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
}

.game-shop-screen .game-hand-zone .game-hand-unit {
  min-height: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(14px, auto);
  align-content: center;
  align-items: center;
  justify-items: stretch;
  gap: 4px 6px;
  padding: 6px;
  overflow: hidden;
  text-align: left;
}

.game-shop-screen .game-hand-zone .game-hand-unit .game-unit-icon {
  width: 36px;
  height: 36px;
  grid-column: 1;
  grid-row: 1 / 4;
  font-size: 1.05rem;
}

.game-shop-screen .game-hand-zone .game-hand-unit strong {
  grid-column: 2;
  grid-row: 1;
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #f8fafc;
  font-size: 0.68rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-shop-screen .game-hand-zone .game-hand-unit .game-owned-unit-stats {
  grid-column: 2;
  grid-row: 2;
  justify-content: flex-start;
  overflow: visible;
}

.game-shop-screen .game-hand-zone .game-hand-unit .game-unit-tags {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  font-size: 0.51rem;
}

.game-shop-screen .game-board-zone .game-owned-unit-stats {
  gap: 2px;
}

.game-shop-screen .game-board-zone .game-stat-chip {
  min-width: 0;
  padding: 2px 3px;
  font-size: 0.43rem;
}

@media (max-width: 980px) {
  .game-shop-screen .game-hand-zone {
    gap: 5px;
  }

  .game-shop-screen .game-hand-zone .game-hand-unit {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 3px 4px;
    padding: 5px;
  }

  .game-shop-screen .game-hand-zone .game-hand-unit .game-unit-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
}

@media (max-width: 620px) {
  .game-shop-screen .game-hand-zone .game-hand-unit strong {
    font-size: 0.56rem;
  }

  .game-shop-screen .game-hand-zone .game-stat-chip {
    min-width: 0;
    padding: 2px 3px;
    font-size: 0.48rem;
  }

  .game-paused-pill {
    max-width: 180px;
    padding: 5px 8px;
    font-size: 0.58rem;
  }
}

/* Eliminated-player exit panel */
.game-eliminated-exit {
  min-width: 0;
  min-height: 72px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px !important;
  overflow: visible !important;
}

.game-eliminated-exit > div {
  min-width: 0;
}

.game-eliminated-exit h3,
.game-eliminated-exit p {
  margin: 0;
}

.game-eliminated-exit h3 {
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.game-eliminated-exit .game-primary-btn {
  min-width: max-content;
  min-height: 40px;
  flex: 0 0 auto;
  padding: 8px 14px;
  white-space: nowrap;
}

.game-shop-screen.game-player-eliminated {
  grid-template-rows: auto minmax(0, 1fr);
}

.game-shop-screen.game-player-eliminated > .game-eliminated-exit {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

.game-combat-screen.game-player-eliminated {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.game-combat-screen.game-player-eliminated > .game-eliminated-exit {
  grid-column: 2;
  grid-row: 2;
}

.game-combat-screen.game-player-eliminated > .game-arena-section {
  grid-row: 3;
}

@media (max-height: 620px), (max-width: 780px) and (orientation: portrait) {
  .game-shop-screen.game-player-eliminated {
    grid-template-rows: 38px minmax(0, 1fr);
  }

  .game-combat-screen.game-player-eliminated {
    grid-template-rows: 38px auto minmax(0, 1fr);
  }

  .game-eliminated-exit {
    min-height: 46px !important;
    gap: 6px;
    padding: 5px 7px !important;
  }

  .game-eliminated-exit h3 {
    margin: 0;
    font-size: 0.7rem;
  }

  .game-eliminated-exit .game-player-state {
    display: none;
  }

  .game-eliminated-exit .game-primary-btn {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.64rem;
  }
}

/* Readable battlefield cards */
.game-shop-screen .game-board-zone {
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.game-shop-screen .game-board-zone .game-board-unit {
  min-width: 104px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: minmax(34px, auto) auto minmax(13px, auto);
  align-content: start;
  align-items: center;
  justify-items: stretch;
  gap: 4px 6px;
  padding: 7px;
  overflow: hidden;
  text-align: left;
}

.game-shop-screen .game-board-zone .game-board-unit .game-unit-icon {
  width: 34px;
  height: 34px;
  grid-column: 1;
  grid-row: 1;
  font-size: 1rem;
}

.game-shop-screen .game-board-zone .game-board-unit strong {
  grid-column: 2;
  grid-row: 1;
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-shop-screen .game-board-zone .game-board-unit .game-owned-unit-stats {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 4px;
  overflow: visible;
}

.game-shop-screen .game-board-zone .game-board-unit .game-stat-chip {
  width: 100%;
  min-width: 0;
  padding: 3px 4px;
  font-size: 0.55rem;
  white-space: nowrap;
}

.game-shop-screen .game-board-zone .game-board-unit .game-unit-tags {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  font-size: 0.5rem;
  text-align: center;
}

@media (max-width: 980px) {
  .game-shop-screen .game-board-zone {
    grid-template-columns: repeat(7, minmax(94px, 1fr));
    gap: 6px;
  }

  .game-shop-screen .game-board-zone .game-board-unit {
    min-width: 94px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 3px 5px;
    padding: 6px;
  }

  .game-shop-screen .game-board-zone .game-board-unit .game-unit-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .game-shop-screen .game-board-zone .game-board-unit strong {
    font-size: 0.65rem;
  }

  .game-shop-screen .game-board-zone .game-board-unit .game-stat-chip {
    min-width: 29px;
    padding: 2px 3px;
    font-size: 0.5rem;
  }
}

@media (max-height: 620px), (max-width: 780px) and (orientation: portrait) {
  .game-shop-screen .game-board-zone {
    grid-template-columns: repeat(7, minmax(88px, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .game-shop-screen .game-board-zone .game-board-unit {
    min-width: 88px;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 2px 4px;
    padding: 4px;
  }

  .game-shop-screen .game-board-zone .game-board-unit .game-unit-icon {
    width: 27px;
    height: 27px;
    font-size: 0.82rem;
  }

  .game-shop-screen .game-board-zone .game-board-unit strong {
    font-size: 0.61rem;
  }

  .game-shop-screen .game-board-zone .game-board-unit .game-stat-chip {
    min-width: 27px;
    padding: 2px;
    font-size: 0.47rem;
  }

  .game-shop-screen .game-board-zone .game-board-unit .game-unit-tags {
    font-size: 0.44rem;
  }
}


/* Unified compact unit cards: icon and combat stats stay visible; identity lives in the tooltip. */
.game-unit-tooltip {
  white-space: pre-line;
}

.game-shop-screen .game-unit-card,
.game-shop-screen .game-hand-zone .game-hand-unit,
.game-shop-screen .game-board-zone .game-board-unit {
  grid-template-rows: auto;
  align-content: center;
  align-items: center;
  text-align: left;
}

.game-shop-screen .game-unit-card .game-unit-icon,
.game-shop-screen .game-hand-zone .game-hand-unit .game-unit-icon,
.game-shop-screen .game-board-zone .game-board-unit .game-unit-icon {
  grid-column: 1;
  grid-row: 1;
}

.game-shop-screen .game-unit-card .game-owned-unit-stats,
.game-shop-screen .game-hand-zone .game-hand-unit .game-owned-unit-stats,
.game-shop-screen .game-board-zone .game-board-unit .game-owned-unit-stats {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 4px;
  overflow: visible;
}

.game-shop-screen .game-unit-card .game-stat-chip,
.game-shop-screen .game-hand-zone .game-hand-unit .game-stat-chip,
.game-shop-screen .game-board-zone .game-board-unit .game-stat-chip {
  width: 100%;
  min-width: 0;
  padding: 3px 4px;
  white-space: nowrap;
}

.game-combat-screen .game-combat-unit {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px;
}

.game-combat-screen .game-combat-unit .game-unit-icon {
  grid-row: 1;
}

.game-combat-screen .game-combat-unit .game-owned-unit-stats {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-row: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  overflow: visible;
}

.game-combat-screen .game-combat-unit .game-stat-chip {
  width: 100%;
  min-width: 0;
  padding: 2px 1px;
  font-size: clamp(0.42rem, 0.8vw, 0.55rem);
  white-space: nowrap;
}

@media (max-width: 620px), (max-height: 620px) {
  .game-shop-screen .game-unit-card .game-owned-unit-stats,
  .game-shop-screen .game-hand-zone .game-hand-unit .game-owned-unit-stats,
  .game-shop-screen .game-board-zone .game-board-unit .game-owned-unit-stats {
    gap: 2px;
  }

  .game-shop-screen .game-unit-card .game-stat-chip,
  .game-shop-screen .game-hand-zone .game-hand-unit .game-stat-chip,
  .game-shop-screen .game-board-zone .game-board-unit .game-stat-chip {
    padding: 2px;
    font-size: 0.47rem;
  }
}

/* Unit choices use the same compact presentation as shop, hand, board and combat cards. */
.game-choice-option.game-unit-tooltip-source {
  min-width: 0;
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(44px, 0.8fr) minmax(72px, 1.2fr);
  grid-template-rows: auto;
  align-content: center;
  align-items: center;
  justify-items: stretch;
  gap: 8px;
  padding: 10px;
  text-align: left;
}

.game-choice-option.game-unit-tooltip-source .game-unit-icon {
  width: clamp(38px, 5vw, 54px);
  height: clamp(38px, 5vw, 54px);
  justify-self: center;
  font-size: clamp(1.15rem, 2.6vw, 1.8rem);
}

.game-choice-option.game-unit-tooltip-source .game-owned-unit-stats {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow: visible;
}

.game-choice-option.game-unit-tooltip-source .game-stat-chip {
  width: 100%;
  min-width: 0;
  padding: 4px 5px;
  font-size: 0.62rem;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 620px), (max-height: 620px) {
  .game-choice-option.game-unit-tooltip-source {
    min-height: 74px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 4px;
    padding: 5px;
  }

  .game-choice-option.game-unit-tooltip-source .game-unit-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .game-choice-option.game-unit-tooltip-source .game-owned-unit-stats {
    gap: 2px;
  }

  .game-choice-option.game-unit-tooltip-source .game-stat-chip {
    padding: 2px 1px;
    font-size: 0.47rem;
  }
}
