/* Bandit Arcade shared theme — Burtson Labs front-end standards.
   Source: Burtson.io MUI theme (src/theme/DarkTheme.js), refined for the arcade.
   Dark casino-felt surfaces, indigo primary, pink secondary, gold + React-blue accents. */

:root {
  --bg: #1a1d23;
  --bg-2: #22262e;
  --surface: #2a2f3a;
  --surface-2: #343a47;
  --edge: #454d5e;
  --primary: #3f51b5;
  --primary-bright: #5c6bc0;
  --secondary: #f50057;
  --accent: #61dafb;
  --text: #f2f4f8;
  --muted: rgba(242, 244, 248, 0.6);
  --win: #4ade80;
  --gold: #f5c542;
  --gold-deep: #c9962e;
  --felt: #1e4636;
  --felt-2: #2a5c47;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 50% -10%, rgba(63, 81, 181, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 58px;
  background: rgba(18, 20, 25, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 1rem;
  color: var(--text);
}

.topbar .brand .brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(63, 81, 181, 0.5);
}

.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topbar nav a.active {
  color: var(--accent);
  background: rgba(97, 218, 251, 0.1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 24px;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary-bright) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(63, 81, 181, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background: linear-gradient(180deg, #ff2e74 0%, var(--secondary) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(245, 0, 87, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-gold {
  background: linear-gradient(180deg, #ffd970 0%, var(--gold) 55%, var(--gold-deep) 100%);
  color: #2a1f05;
  box-shadow: 0 3px 10px rgba(245, 197, 66, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ---------- Panels & layout ---------- */
.panel {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

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

/* ---------- Shared game typography ---------- */
.game-title {
  margin: 0;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Shared playing cards ---------- */
.card {
  width: 58px;
  height: 84px;
  border-radius: 8px;
  background: linear-gradient(160deg, #ffffff 0%, #eceff4 100%);
  color: #1c2333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  animation: deal-in 0.22s ease-out;
}

.card .rank { font-size: 1.35rem; line-height: 1.1; }
.card .suit { font-size: 1.2rem; line-height: 1.1; }
.card.red { color: #d32f2f; }

.card.back {
  background:
    repeating-linear-gradient(45deg, var(--primary) 0 6px, var(--primary-bright) 6px 12px);
  border: 2px solid #eceff4;
}

.card.placeholder {
  background: rgba(255, 255, 255, 0.04);
  border: 2px dashed var(--edge);
  box-shadow: none;
}

@keyframes deal-in {
  from { transform: translateY(-14px) rotate(-2deg); opacity: 0; }
  to   { transform: translateY(0)     rotate(0);    opacity: 1; }
}

/* ---------- Shared stat chips ---------- */
.stats {
  display: grid;
  gap: 12px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat span:last-child { font-size: 1.15rem; font-weight: 700; }

.label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ---------- Shared message line ---------- */
.message {
  min-height: 1.4em;
  color: var(--muted);
  transition: color 0.2s;
}
.message.win  { color: var(--win); font-weight: 600; }
.message.lose { color: var(--secondary); font-weight: 600; }
.message.push { color: var(--muted); font-weight: 600; }
.message.big  { color: var(--gold); font-weight: 700; }

/* ---------- Shared help/rules ---------- */
.help {
  margin-top: 18px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
}
.help summary {
  cursor: pointer;
  text-align: center;
  list-style-position: inside;
  transition: color 0.15s;
}
.help summary:hover { color: var(--accent); }
.help p { line-height: 1.6; }
