:root {
  --bg: #030712;
  --card: #0f1626;
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f4f7ff;
  --muted: #aab7d6;
  --accent: #f5a524;
  --accent-2: #32d9b4;
  --danger: #ff6b6b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --mono: 'Roboto Mono', monospace;
  --display: 'Space Grotesk', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--display);
  background: radial-gradient(circle at 10% 20%, rgba(245, 165, 36, 0.12), transparent 30%),
              radial-gradient(circle at 85% 0%, rgba(50, 217, 180, 0.12), transparent 28%),
              var(--bg);
  color: var(--text);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.hero {
  background: rgba(18, 25, 41, 0.75);
  border: 1px solid var(--card-border);
  padding: 18px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-tight {
  padding: 16px 20px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 0.5px;
}

.balance-banner {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.balance-pill {
  background: rgba(50, 217, 180, 0.18);
  border: 1px solid rgba(50, 217, 180, 0.45);
  color: #e5fff9;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ghost-link {
  color: var(--accent);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid rgba(245, 165, 36, 0.35);
  border-radius: 10px;
  font-weight: 600;
  align-self: flex-start;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ghost-link:hover {
  border-color: var(--accent);
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(245, 165, 36, 0.15);
  color: #ffe0b1;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  font-size: 12px;
}
.pill-small {
  padding: 4px 10px;
  font-size: 11px;
}

.card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.login-card .login-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.login-card .login-row > div {
  flex: 1 1 240px;
}
.login-card .login-row > button {
  align-self: flex-end;
}

.current-user {
  margin: 10px 0 0;
  color: var(--muted);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, button, textarea {
  font-family: var(--display);
}

input, select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  width: 100%;
}

select {
  cursor: pointer;
}

button {
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: #0c1224;
  background: #ffe7c2;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050a17;
  box-shadow: 0 10px 30px rgba(245, 165, 36, 0.3);
}

button.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

button.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

button:active {
  transform: translateY(1px);
  opacity: 0.9;
}

a.button-link {
  text-decoration: none;
  display: inline-block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
a.button-link.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050a17;
  box-shadow: 0 10px 30px rgba(245, 165, 36, 0.3);
}
a.button-link.btn-rps {
  background: linear-gradient(120deg, #7c3aed, #ec4899);
  color: #fff;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
}
a.button-link.btn-war {
  background: linear-gradient(120deg, #0ea5e9, #22d3ee);
  color: #04121f;
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.35);
}
a.button-link.btn-blackjack {
  background: linear-gradient(120deg, #10b981, #65a30d);
  color: #041a10;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
}
a.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
a.button-link:active {
  transform: translateY(1px);
  opacity: 0.9;
}

.field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.field-row:last-child { margin-bottom: 0; }

.wide { width: 100%; }

.ad-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.grid .ad-card {
  grid-column: 1 / -1;
}

.ad-slot {
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.ad-slot ins {
  display: block;
  margin: 0 auto;
}

.spin-reel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-size: 26px;
  font-family: var(--mono);
  letter-spacing: 2px;
  margin-bottom: 10px;
  min-height: 50px;
}

.info-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 10px;
  font-family: var(--mono);
  color: #cfe3ff;
  min-height: 160px;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.open-games {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

.pit-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pit-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pit-controls label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.pit-controls-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pit-controls-row select {
  flex: 1;
}

.pit-actions {
  display: flex;
  justify-content: flex-end;
}

.pit-feed {
  gap: 20px;
}

.pit-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.game-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.game-row-meta {
  margin-top: 4px;
}

.game-row.own {
  border-color: rgba(50, 217, 180, 0.6);
  box-shadow: 0 6px 18px rgba(50, 217, 180, 0.2);
}

.game-row .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

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

.small {
  font-size: 12px;
}

.chat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-window {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  min-height: 180px;
  max-height: 240px;
  overflow-y: auto;
  padding: 10px;
  font-family: var(--mono);
}

.chat-line {
  margin: 4px 0;
  color: #d5e6ff;
}

.chat-input {
  display: flex;
  gap: 8px;
}

.log-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-output {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  min-height: 180px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--mono);
  color: #bcd4ff;
  white-space: pre-wrap;
}
.log-output.small {
  font-size: 12px;
}

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

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

.hero-logo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 165, 36, 0.25);
  background: rgba(245, 165, 36, 0.08);
}

.logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), rgba(245, 165, 36, 0.4));
  color: #050a17;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
}

.logo-text-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-subtitle {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero-callout {
  flex: 1 1 300px;
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid rgba(50, 217, 180, 0.2);
  background: rgba(50, 217, 180, 0.08);
  box-shadow: inset 0 0 40px rgba(50, 217, 180, 0.08);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
  }
  button, input, select {
    width: 100%;
  }
}

.game-menu-card .game-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-menu-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(50, 217, 180, 0.08));
  border: 1px solid rgba(50, 217, 180, 0.2);
}
.game-menu-card p {
  color: var(--muted);
}

.bj-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.bj-game-card {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .bj-game-card {
    grid-column: span 1;
  }
}

.bj-table {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bj-tablefelt {
  margin-top: 16px;
  border-radius: 18px;
  padding: 18px;
  background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.2), transparent 40%), rgba(3, 50, 20, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bj-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.bj-stat-block {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bj-stat-block .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.bj-stat-block .value {
  font-weight: 700;
  font-size: 18px;
}

.bj-stat-block .value.small {
  font-size: 14px;
  color: #d7e7ff;
}

.bj-solo-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bj-scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.bj-column {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.bj-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bj-card-row-large .bj-card-img {
  width: 98px;
  height: 146px;
}

.bj-result-banner {
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.bj-result-banner.win {
  border-color: rgba(50, 217, 180, 0.5);
  background: rgba(50, 217, 180, 0.15);
  color: #e6fff7;
}

.bj-result-banner.loss {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.2);
  color: #ffe5e5;
}

.bj-result-banner.push {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.bj-result-banner.dealing {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #f8f8f8;
}

.bj-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bj-deal-row {
  gap: 10px;
  flex-wrap: wrap;
}

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

.bj-hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.bj-hand-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bj-hand-card.active {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(245, 165, 36, 0.2);
}

.bj-hand-card.hand-win {
  border-color: var(--accent-2);
}

.bj-hand-card.hand-loss {
  border-color: rgba(255, 107, 107, 0.8);
}

.bj-hand-card.hand-push {
  border-color: rgba(255, 255, 255, 0.4);
}

.bj-hand-card-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.bj-hand-card-meta {
  font-size: 13px;
  color: #e5edff;
}

.bj-summary-row {
  font-size: 13px;
  text-align: center;
}

.bj-bet-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.chip-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  flex: 1 1 80px;
  min-width: 70px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.chip-btn.active {
  border-color: var(--accent);
  background: rgba(245, 165, 36, 0.8);
  color: #050a17;
}

.bj-action-console {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bj-active-hand .label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.bj-active-hand .value {
  font-size: 16px;
  font-weight: 600;
}

.bj-toast {
  margin-top: 14px;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.text-center {
  text-align: center;
}

.bj-table-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 10px 0 0;
}

.meta-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.meta-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.meta-value {
  font-weight: 600;
  font-size: 15px;
}

.bj-ready-meter {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.bj-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bj-meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bj-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.bj-card-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bj-card-img {
  width: 86px;
  height: 128px;
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(5, 8, 20, 0.65);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.98), rgba(226, 234, 255, 0.92));
  object-fit: contain;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: bj-card-pop 0.45s ease;
}

.bj-card-img[data-card-side='back'] {
  border-color: rgba(41, 52, 88, 0.8);
  background: radial-gradient(circle at 30% 30%, rgba(59, 74, 120, 0.95), rgba(15, 22, 38, 0.95));
}

@keyframes bj-card-pop {
  0% {
    transform: translateY(12px) rotate(-6deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
}

.bj-hands {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bj-hand {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.bj-hand.active {
  border-color: var(--accent);
  box-shadow: 0 8px 16px rgba(245, 165, 36, 0.2);
}

.bj-hand.hand-win {
  border-color: var(--accent-2);
  box-shadow: 0 8px 18px rgba(50, 217, 180, 0.25);
}

.bj-hand.hand-loss {
  border-color: rgba(255, 107, 107, 0.8);
}

.bj-hand.hand-push {
  border-color: rgba(255, 255, 255, 0.45);
}

.bj-hand.bust {
  border-color: var(--danger);
  opacity: 0.85;
}

.bj-hand-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.bj-hand-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

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

.bj-actions button {
  width: 100%;
}

.bj-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bj-action-footer {
  margin-top: 12px;
}

.bj-action-footer button {
  width: 100%;
}

.bj-seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.bj-seat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.bj-seat.active {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(245, 165, 36, 0.25);
}

.bj-seat.self {
  border-color: rgba(50, 217, 180, 0.6);
}

.bj-seat.ready::after {
  content: 'READY';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(50, 217, 180, 0.25);
  border: 1px solid rgba(50, 217, 180, 0.4);
  color: #d2fff1;
}

.bj-seat-title {
  font-weight: 600;
}

.bj-seat-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.bj-seat-hands {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bj-seat-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bj-seat-tags span {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  letter-spacing: 0.5px;
}

.bj-join-row button {
  flex: 1;
}

.bj-ready-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.bj-ready-row button,
.bj-ready-actions button {
  flex: 1;
}

.bj-ready-actions {
  display: flex;
  gap: 10px;
  flex: 2;
}

.bj-ready-row .secondary {
  flex: 1;
}

#bjDealerStatus {
  font-size: 12px;
  color: var(--muted);
}

.war-card {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .war-card {
    grid-column: span 1;
  }
}

.war-table {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.war-row h3 {
  margin: 0 0 6px;
}

.war-bet-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.war-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.war-battlefield {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: center;
}

.war-side {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.war-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.war-card-slot {
  min-height: 150px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.war-card-slot.revealing img {
  animation: war-flip 0.6s ease;
}

@keyframes war-flip {
  0% { transform: rotateY(90deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.war-card-slot.winner {
  border-color: var(--accent-2);
  box-shadow: 0 0 20px rgba(50, 217, 180, 0.3);
}

.war-card-slot.loser {
  border-color: var(--danger);
  opacity: 0.9;
}

.war-card-slot.tie {
  border-color: var(--accent);
}

.war-card-placeholder {
  text-align: center;
  width: 100%;
}

.war-result {
  text-align: center;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  justify-self: center;
}

.war-result.win {
  border-color: rgba(50, 217, 180, 0.5);
  background: rgba(50, 217, 180, 0.15);
  color: #e7fff8;
}

.war-result.loss {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.18);
  color: #ffe5e5;
}

.war-result.tie {
  border-color: rgba(245, 165, 36, 0.5);
  background: rgba(245, 165, 36, 0.18);
}

.war-toast {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.war-history {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  min-height: 90px;
  background: rgba(255, 255, 255, 0.02);
}

.war-history-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.war-history-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  min-width: 140px;
  background: rgba(0, 0, 0, 0.2);
}

.war-history-title {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.war-history-cards {
  display: flex;
  gap: 6px;
}

.war-history-card {
  width: 46px;
  height: 68px;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 18px rgba(6, 9, 22, 0.6);
  object-fit: contain;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), rgba(226, 234, 255, 0.85));
}

.war-history-card[data-card-side='back'] {
  border-color: rgba(41, 52, 88, 0.7);
  background: radial-gradient(circle at 30% 30%, rgba(59, 74, 120, 0.95), rgba(10, 15, 29, 0.9));
}

.war-burn-row {
  margin-top: 4px;
}

.war-history-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.war-history-summary.win {
  border-color: rgba(50, 217, 180, 0.55);
  color: #d9fff3;
}

.war-history-summary.loss {
  border-color: rgba(255, 107, 107, 0.6);
  color: #ffe0e0;
}

.war-history-summary.tie {
  border-color: rgba(245, 165, 36, 0.6);
  color: #ffe6c2;
}

.pit-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 90px;
}

.pit-history-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.pit-history-item.win {
  border-color: rgba(50, 217, 180, 0.55);
}

.pit-history-item.loss {
  border-color: rgba(255, 107, 107, 0.6);
}

.pit-history-item.draw {
  border-color: rgba(245, 165, 36, 0.5);
}

.pit-history-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pit-history-players,
.pit-history-moves,
.pit-history-outcome {
  font-size: 13px;
  margin: 2px 0;
}

.pit-history-outcome {
  font-weight: 600;
}

.war-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.war-actions button {
  width: 100%;
}

.war-actions .muted.small {
  text-align: center;
}
