/* ================================================================
   Oẳn Tù Tì Arena — dark neon arcade theme
   ================================================================ */

:root {
  --bg: #0b0f1a;
  --felt: #125239;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.13);
  --stroke-strong: rgba(255, 255, 255, 0.22);
  --text: #eef4ff;
  --text-dim: #93a1bd;
  --cyan: #4df3ff;
  --magenta: #ff4dd2;
  --gold: #ffc94d;
  --green: #5cf2a0;
  --red: #ff5c6c;
  --purple: #a78bfa;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --font-display: "Bungee", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.mount, .shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

[hidden] { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

button:disabled { cursor: not-allowed; }

/* ---------------- shell + bg ---------------- */

.bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(0, 0, 0, 0) 40%, rgba(4, 8, 14, 0.78) 100%),
    linear-gradient(rgba(4, 8, 14, 0.35), rgba(4, 8, 14, 0.55));
}

/* ---------------- ambient particles ---------------- */

.particle-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.particle-field i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: floatUp var(--dur, 9s) ease-in var(--del, 0s) infinite;
  opacity: 0;
}

.particle-field i:nth-child(1)  { left: 8%;  top: 90%; background: var(--cyan);   --dur: 10s; --del: 0s; }
.particle-field i:nth-child(2)  { left: 22%; top: 95%; background: var(--gold);   --dur: 8s;  --del: 1.5s; }
.particle-field i:nth-child(3)  { left: 35%; top: 88%; background: var(--magenta); --dur: 11s; --del: 3s; }
.particle-field i:nth-child(4)  { left: 50%; top: 92%; background: var(--cyan);   --dur: 7s;  --del: 0.7s; }
.particle-field i:nth-child(5)  { left: 62%; top: 94%; background: var(--purple); --dur: 9s;  --del: 4s; }
.particle-field i:nth-child(6)  { left: 76%; top: 87%; background: var(--gold);   --dur: 8.5s;--del: 2.3s; }
.particle-field i:nth-child(7)  { left: 88%; top: 91%; background: var(--cyan);   --dur: 10s; --del: 5.5s; }
.particle-field i:nth-child(8)  { left: 15%; top: 96%; background: var(--green);  --dur: 9s;  --del: 6.2s; }
.particle-field i:nth-child(9)  { left: 68%; top: 89%; background: var(--magenta);--dur: 8s;  --del: 3.8s; }
.particle-field i:nth-child(10) { left: 42%; top: 93%; background: var(--cyan);   --dur: 11s; --del: 1.8s; }

@keyframes floatUp {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  15%  { opacity: var(--peak, 0.7); transform: translateY(-18vh) scale(1); }
  70%  { opacity: 0.45; transform: translateY(-70vh) scale(0.7); }
  100% { opacity: 0; transform: translateY(-100vh) scale(0.2); }
}


/* ---------------- HUD ---------------- */

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px clamp(14px, 4vw, 34px);
  background: linear-gradient(180deg, rgba(5, 9, 16, 0.85), rgba(5, 9, 16, 0));
}

.hud-left, .hud-right { display: flex; align-items: center; gap: 10px; }

.hud-right { margin-left: auto; }

.brand-mini {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--stroke);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover { transform: translateY(-2px); border-color: var(--cyan); background: var(--panel-strong); }
.icon-btn:disabled { opacity: 0.4; transform: none; }

.hub-open-glyph {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 4px;
}
.hub-open-glyph i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(77, 243, 255, 0.9);
}

.pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.balance.pill { font-size: 17px; color: var(--gold); text-shadow: 0 0 18px rgba(255, 201, 77, 0.4); }

.streak-label-hud {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.streak.pill {
  color: var(--text-dim);
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  min-width: 58px;
  text-align: center;
}

.streak.pill.hot {
  color: var(--magenta);
  border-color: rgba(255, 77, 210, 0.55);
  box-shadow: 0 0 18px rgba(255, 77, 210, 0.35);
  animation: hotPulse 0.9s ease-in-out infinite;
}

@keyframes hotPulse {
  50% { box-shadow: 0 0 30px rgba(255, 77, 210, 0.6); }
}

/* ---------------- screen ---------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 92px clamp(14px, 4vw, 34px) 40px;
}

.screen > * {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.97); }

.btn-primary {
  color: #04121b;
  background: linear-gradient(135deg, var(--cyan), #7de8ff);
  box-shadow: 0 8px 30px rgba(77, 243, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 12px 40px rgba(77, 243, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-primary:disabled { opacity: 0.55; filter: saturate(0.4); }

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
}
.btn-ghost:not(:disabled):hover { border-color: var(--cyan); background: var(--panel-strong); }

.btn-buy {
  color: #1a0d00;
  background: linear-gradient(135deg, var(--gold), #ffb32d);
  box-shadow: 0 6px 20px rgba(255, 201, 77, 0.3);
}

.btn-small { padding: 9px 16px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.link-btn {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.link-btn:hover { background: rgba(77, 243, 255, 0.1); }

/* ---------------- auth pages ---------------- */

.auth-mount {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.auth-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(90% 80% at 50% 45%, rgba(11, 22, 33, 0.88), rgba(5, 8, 14, 0.98));
  backdrop-filter: blur(8px);
  padding: 20px;
}

.auth-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 36px 30px;
  border-radius: 22px;
  background: linear-gradient(200deg, #12203a, #0a101d);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  animation: riseIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.auth-emblem {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 18px;
}

.auth-emblem i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid;
  animation: emblemBob 2.4s ease-in-out infinite;
}
.auth-emblem i:nth-child(1) { border-color: var(--cyan); box-shadow: 0 0 16px rgba(77, 243, 255, 0.5); animation-delay: 0s; }
.auth-emblem i:nth-child(2) { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 201, 77, 0.5); animation-delay: 0.25s; }
.auth-emblem i:nth-child(3) { border-color: var(--magenta); box-shadow: 0 0 16px rgba(255, 77, 210, 0.5); animation-delay: 0.5s; }

.auth-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 42px);
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, var(--cyan), #7de8ff 40%, var(--magenta) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--text-dim);
  letter-spacing: 0.3em;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-field span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(77, 243, 255, 0.2), inset 0 0 14px rgba(77, 243, 255, 0.04);
}

.auth-seg {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.auth-seg-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.18s ease;
}

.auth-seg-btn:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.auth-seg-btn.on {
  color: #04121b;
  background: linear-gradient(135deg, var(--cyan), #7de8ff);
  box-shadow: 0 3px 12px rgba(77, 243, 255, 0.35);
}

.auth-error {
  font-size: 13px;
  color: var(--red);
  font-weight: 700;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 92, 108, 0.1);
}

.auth-switch {
  margin-top: 18px;
  width: 100%;
  text-align: center;
}

.auth-form .btn { margin-top: 4px; }
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: radial-gradient(90% 80% at 50% 45%, rgba(11, 22, 33, 0.82), rgba(5, 8, 14, 0.96));
  backdrop-filter: blur(10px);
}

.start-inner {
  text-align: center;
  padding: 20px;
  animation: riseIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.start-emblem {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 22px;
}

.start-emblem i {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid;
  animation: emblemBob 2.4s ease-in-out infinite;
}
.start-emblem i:nth-child(1) { border-color: var(--cyan); box-shadow: 0 0 22px rgba(77, 243, 255, 0.5); animation-delay: 0s; }
.start-emblem i:nth-child(2) { border-color: var(--gold); box-shadow: 0 0 22px rgba(255, 201, 77, 0.5); animation-delay: 0.25s; }
.start-emblem i:nth-child(3) { border-color: var(--magenta); box-shadow: 0 0 22px rgba(255, 77, 210, 0.5); animation-delay: 0.5s; }

@keyframes emblemBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(8deg); }
}

.start-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 60px);
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, var(--cyan), #7de8ff 40%, var(--magenta) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px rgba(77, 243, 255, 0.35));
  margin-bottom: 8px;
}

.start-sub {
  color: var(--text-dim);
  letter-spacing: 0.34em;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 26px;
}

.start-loading {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 24px;
  min-height: 24px;
}

.btn-start {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  padding: 18px 44px;
  animation: startGlow 2s ease-in-out infinite;
}

@keyframes startGlow {
  0%, 100% { box-shadow: 0 8px 30px rgba(77, 243, 255, 0.35); }
  50% { box-shadow: 0 8px 44px rgba(77, 243, 255, 0.7); }
}

/* ---------------- cards + shared ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

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

.card-head h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  color: var(--text-dim);
}

/* segmented control */

.seg {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
}

.seg-btn {
  flex: 1;
  padding: 12px 6px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dim);
  transition: all 0.18s ease;
}

.seg-btn:not(:disabled):hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.seg-btn.on {
  color: #04121b;
  background: linear-gradient(135deg, var(--cyan), #7de8ff);
  box-shadow: 0 4px 16px rgba(77, 243, 255, 0.4);
}

/* streak bar + pips */

.streak-bar { margin-top: 16px; }

.streak-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.streak-label strong { color: var(--text); }

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

.pip {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  transition: all 0.25s ease;
}

.pip.on {
  background: linear-gradient(135deg, var(--gold), #ff9d2d);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 201, 77, 0.55);
  transform: scale(1.05);
}

/* stats */

.stats-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

.stat span, .stat-card span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.stats-row .link-btn { margin-left: auto; }

/* ---------------- lobby ---------------- */

.lobby { display: flex; flex-direction: column; gap: 18px; animation: fadeUp 0.4s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.lobby-hero { text-align: center; margin-bottom: 4px; }

.lobby-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 38px);
  letter-spacing: 0.05em;
  background: linear-gradient(120deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.lobby-tag { color: var(--text-dim); font-size: 15px; line-height: 1.55; }
.lobby-tag strong { color: var(--gold); }

.lobby-note { font-size: 13.5px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.lobby-note strong { color: var(--green); }
.lobby-note .jackpot { color: var(--gold); }

.btn-create { width: 100%; padding: 18px; font-size: 17px; }
.btn-create.searching { pointer-events: none; }

.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 3px solid rgba(4, 18, 27, 0.25);
  border-top-color: #04121b;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.matches { transition: opacity 0.3s ease; }
.matches.dimmed { opacity: 0.45; pointer-events: none; }

.match-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.match-row + .match-row { border-top: 1px solid var(--stroke); }
.match-row:hover { background: rgba(255, 255, 255, 0.05); transform: translateX(3px); }

.match-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #04121b;
  background: linear-gradient(135deg, var(--magenta), #ff8fd9);
  box-shadow: 0 4px 14px rgba(255, 77, 210, 0.35);
}

.match-info { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.match-info strong { font-size: 15px; }
.match-info small { color: var(--text-dim); font-size: 12px; }

.match-stake {
  margin-left: auto;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.match-arrow { color: var(--text-dim); font-size: 20px; }

/* ---------------- battle (table layout) ---------------- */

.battle { display: flex; flex-direction: column; gap: 18px; animation: fadeUp 0.35s ease both; }

.table-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--stroke-strong);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow);
}

.table-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
}

.opponent-row { justify-content: flex-start; border-bottom: 1px solid var(--stroke); }
.player-row { justify-content: flex-end; border-top: 1px solid var(--stroke); }

.fighter-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-battle {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--stroke-strong);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.fighter-card.opp .avatar-battle { border-color: var(--magenta); box-shadow: 0 0 0 2px rgba(255, 77, 210, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4); }
.fighter-card.you .avatar-battle { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(77, 243, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4); }

.fighter-tag { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fighter-tag strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fighter-tag small { color: var(--text-dim); font-size: 11px; }

.player-row .fighter-tag { align-items: flex-end; text-align: right; }

/* Table surface */

.table-surface {
  position: relative;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(18, 82, 57, 0.55), rgba(6, 21, 15, 0.8));
}

.table-felt {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255,255,255,0.015) 30px, rgba(255,255,255,0.015) 31px),
    radial-gradient(ellipse 80% 70% at 50% 55%, rgba(77, 243, 255, 0.06), transparent);
  pointer-events: none;
}

.table-center {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.table-cards {
  display: flex;
  gap: 28px;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.table-card-slot {
  flex: 1;
  max-width: 200px;
  min-height: 150px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px dashed var(--stroke);
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.table-card-slot.played {
  border-style: solid;
  border-color: var(--cyan);
  box-shadow: inset 0 0 30px rgba(77, 243, 255, 0.06), 0 0 20px rgba(77, 243, 255, 0.1);
  animation: cardDeal 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.table-card-slot:first-child.played { border-color: var(--magenta); box-shadow: inset 0 0 30px rgba(255, 77, 210, 0.06), 0 0 20px rgba(255, 77, 210, 0.1); }

/* locked card-back */

.table-card-slot.locked {
  border-style: solid;
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(255, 201, 77, 0.2);
  animation: cardLock 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.table-card-slot:first-child.locked { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 201, 77, 0.2); }

@keyframes cardLock {
  from { transform: scale(0.94); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}

.card-back {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 201, 77, 0.15), rgba(255, 201, 77, 0.04));
  border: 2px solid rgba(255, 201, 77, 0.3);
  animation: cardBackPulse 1.5s ease-in-out infinite;
}

.card-back.you {
  background: linear-gradient(135deg, rgba(77, 243, 255, 0.15), rgba(77, 243, 255, 0.04));
  border-color: rgba(77, 243, 255, 0.3);
}

.card-back-icon {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 201, 77, 0.5);
}

.card-back.you .card-back-icon { color: var(--cyan); text-shadow: 0 0 14px rgba(77, 243, 255, 0.5); }

@keyframes cardBackPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 201, 77, 0); }
  50% { box-shadow: 0 0 16px rgba(255, 201, 77, 0.2); }
}

.card-back.you { animation-name: cardBackYouPulse; }

@keyframes cardBackYouPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(77, 243, 255, 0); }
  50% { box-shadow: 0 0 16px rgba(77, 243, 255, 0.2); }
}

@keyframes cardDeal {
  from { transform: translateY(-14px) scale(0.92); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.card-owner {
  position: absolute;
  bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

/* match row avatars become background images */

.match-avatar {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-indent: -9999px;
}

.thinking-dots { display: flex; gap: 7px; position: absolute; }
.thinking-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  animation: dotBlink 1s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: 0.18s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes dotBlink {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

.think-label, .pick-label {
  position: absolute;
  bottom: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

.pick-label { color: var(--cyan); }

.versus-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.timer-ring {
  position: relative;
  width: 92px;
  height: 92px;
}

.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 6;
}

.ring-fg {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(77, 243, 255, 0.8)) drop-shadow(0 0 14px rgba(77, 243, 255, 0.4));
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.timer-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: ringShimmer 1.8s ease-in-out infinite;
  opacity: 0.3;
}

@keyframes ringShimmer {
  0%, 100% { border-color: transparent; }
  50% { border-color: rgba(77, 243, 255, 0.2); }
}

.timer-ring.urgent .ring-fg { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(255, 92, 108, 0.9)); }
.timer-ring.urgent { animation: urgentPulse 0.5s ease-in-out infinite; }

@keyframes urgentPulse {
  50% { transform: scale(1.06); }
}

.clock-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vs-word {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.battle-streak { margin: 0; }

/* choices */

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

.move-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1.5px solid var(--stroke);
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.move-btn:not(:disabled) { animation: choiceGlow 2.2s ease-in-out infinite; }
.move-btn:not(:disabled):nth-child(2) { animation-delay: 0.5s; }
.move-btn:not(:disabled):nth-child(3) { animation-delay: 1s; }

@keyframes choiceGlow {
  0%, 100% { border-color: var(--stroke); box-shadow: none; }
  50% { border-color: rgba(77, 243, 255, 0.45); box-shadow: 0 0 18px rgba(77, 243, 255, 0.15); }
}

.move-btn:not(:disabled):hover {
  transform: translateY(-5px);
  border-color: var(--cyan);
  box-shadow: 0 14px 34px rgba(77, 243, 255, 0.22);
  background: var(--panel-strong);
}

.move-btn:not(:disabled):active { transform: translateY(-1px) scale(0.96); }

.move-btn:disabled { opacity: 0.5; filter: saturate(0.5); }

.move-name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* move art (painted by the sprite painter) */

.move-art {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.move-art-lg { width: 96px; height: 96px; }
.move-art-btn { width: 58px; height: 58px; transition: transform 0.2s ease; }
.move-btn:not(:disabled):hover .move-art-btn { transform: scale(1.12) rotate(-4deg); }

/* ---------------- result ---------------- */

.result { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; animation: fadeUp 0.45s ease both; }

.result-verdict {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 44px);
  letter-spacing: 0.05em;
  padding: 10px 26px;
  border-radius: 16px;
  animation: verdictBounce 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.05s both;
}

.result-verdict.win { color: var(--green); text-shadow: 0 0 28px rgba(92, 242, 160, 0.55); animation-name: verdictWin; animation-duration: 0.6s; }
.result-verdict.loss { color: var(--red); text-shadow: 0 0 28px rgba(255, 92, 108, 0.55); }
.result-verdict.tie { color: var(--text-dim); }

@keyframes verdictBounce {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes verdictWin {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.result-sub { color: var(--text-dim); font-size: 15px; max-width: 420px; line-height: 1.5; }

.result-moves {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  justify-content: center;
  margin-top: 6px;
}

.move-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--stroke);
  min-width: 140px;
  animation: slideInCard 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.move-card:first-child { animation-name: slideInLeft; animation-delay: 0.25s; }
.move-card:last-child { animation-name: slideInRight; animation-delay: 0.4s; }

.move-card span { font-size: 12.5px; color: var(--text-dim); font-weight: 700; }
.move-card.opp .move-art { filter: hue-rotate(200deg) saturate(1.2); }

@keyframes slideInLeft {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInCard {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.move-art-none {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--text-dim);
}

.result-pay { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.result-pay strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.result-pay span { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; }

.pay-win { color: var(--green); }
.pay-tie { color: var(--text-dim); }
.pay-loss { color: var(--red); }

.result-streak { width: 100%; max-width: 420px; }

.result-balance { color: var(--text-dim); font-size: 14px; }
.result-balance strong { color: var(--gold); font-size: 18px; }

.result-actions { display: flex; gap: 12px; margin-top: 8px; }
.result-actions .btn { min-width: 150px; }

/* ---------------- toast ---------------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(20, 28, 44, 0.92);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 201, 77, 0.25);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
  white-space: nowrap;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------------- confetti ---------------- */

.confetti {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: calc(var(--scale, 1) * 8px);
  height: calc(var(--scale, 1) * 14px);
  background: var(--hue, var(--cyan));
  border-radius: 2px;
  animation: confettiFall var(--dur, 1.8s) ease-in var(--delay) both;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 0 8px var(--hue, var(--cyan));
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) scale(var(--scale, 1)); opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--rot, 720deg)) scale(0.3); opacity: 0; }
}

/* ---------------- match intro splash ---------------- */

.match-intro {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  gap: 4px;
  background: radial-gradient(circle at 50% 42%, rgba(4, 12, 22, 0.7), rgba(4, 8, 14, 0.92));
  animation: introIn 0.3s ease both;
  pointer-events: none;
}

.match-intro strong {
  font-family: var(--font-display);
  font-size: 70px;
  letter-spacing: 0.08em;
  background: linear-gradient(120deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: vsPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

.match-intro span {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.match-intro.out { animation: introOut 0.25s ease forwards; }

@keyframes introIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes introOut {
  to { opacity: 0; }
}

@keyframes vsPop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------------- arena pulse ---------------- */

.arena-pulse {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 45;
}

.arena-pulse.lock { border: 3px solid var(--cyan); animation: pulseRing 0.6s ease-out forwards; }
.arena-pulse.opponent { border: 3px solid var(--magenta); animation: pulseRing 0.6s ease-out forwards; }

@keyframes pulseRing {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}

/* ---------------- impact shards ---------------- */

.impact-shard {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(var(--angle)) translateY(var(--travel));
  pointer-events: none;
  z-index: 45;
  animation: shardFade 0.75s ease-out forwards;
}

.impact-shard.win { background: var(--green); box-shadow: 0 0 8px var(--green); }
.impact-shard.loss { background: var(--red); box-shadow: 0 0 8px var(--red); }
.impact-shard.tie { background: var(--text-dim); }

@keyframes shardFade {
  0% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateY(calc(var(--travel) + 30px)); }
}

/* impact screen flash */

.shell.impact-win::after, .shell.impact-loss::after, .shell.impact-tie::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 38;
  pointer-events: none;
  animation: impactFlash 0.7s ease-out forwards;
}

.shell.impact-win::after { background: radial-gradient(circle at 50% 42%, rgba(92, 242, 160, 0.35), transparent 65%); }
.shell.impact-loss::after { background: radial-gradient(circle at 50% 42%, rgba(255, 92, 108, 0.35), transparent 65%); }
.shell.impact-tie::after { background: radial-gradient(circle at 50% 42%, rgba(147, 161, 189, 0.3), transparent 65%); }

@keyframes impactFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- history ---------------- */

.history-list { display: flex; flex-direction: column; }

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.history-row + .history-row { border-top: 1px solid var(--stroke); }
.history-row:hover { background: rgba(255, 255, 255, 0.03); }

.h-outcome {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #04121b;
}

.history-row.win .h-outcome { background: linear-gradient(135deg, var(--green), #3ce08a); }
.history-row.loss .h-outcome { background: linear-gradient(135deg, var(--red), #ff3040); color: #fff; }
.history-row.tie .h-outcome { background: var(--panel-strong); color: var(--text-dim); }

.h-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.h-detail strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-detail small { color: var(--text-dim); font-size: 11.5px; }

.h-time {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hub-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}

.hub-overlay.open { visibility: visible; transition-delay: 0s; }

.hub-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.66);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hub-overlay.open .hub-backdrop { opacity: 1; }

.hub-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: linear-gradient(200deg, #101a2b, #0a101d);
  border-left: 1px solid var(--stroke);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.6);
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.25, 0.9, 0.3, 1);
}

.hub-overlay.open .hub-panel { transform: translateX(0); }

.hub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--stroke);
}

.hub-tabs { display: flex; gap: 6px; flex: 1; }

.hub-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.18s ease;
}

.hub-tab.on {
  color: #04121b;
  background: linear-gradient(135deg, var(--cyan), #7de8ff);
  box-shadow: 0 4px 14px rgba(77, 243, 255, 0.35);
}

.hub-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 15px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  transition: all 0.15s ease;
}

.hub-close:hover { color: var(--text); border-color: var(--red); }

.hub-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 18px; scrollbar-width: thin; }

.hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.hub-foot span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-dim); }
.hub-balance { color: var(--gold); font-size: 19px; font-variant-numeric: tabular-nums; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.avatar-lg {
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 50%;
  background-size: 60% !important;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(77, 243, 255, 0.1);
  border: 2px solid var(--stroke-strong);
}

.avatar-lg.frame-equipped {
  border: 0;
  background-size: 100% !important;
  background-color: transparent;
  border-radius: 0;
}

.profile-id { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.name-input {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--stroke-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 800;
  padding: 2px 0;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease;
}

.name-input:focus { border-bottom-color: var(--cyan); }

.title-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255, 201, 77, 0.1);
  border: 1px solid rgba(255, 201, 77, 0.35);
  border-radius: 999px;
  padding: 4px 12px 4px 8px;
}

.title-chip[data-hub-art] {
  background-size: 16px 16px;
  background-position: 8px center;
  background-repeat: no-repeat;
  padding-left: 30px;
}

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

.stat-card {
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  text-align: center;
}

.stat-card strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat-card:first-child strong { color: var(--gold); }

.hub-section h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.hub-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5; }
.hub-empty { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }

/* transactions */

.tx-list { list-style: none; display: flex; flex-direction: column; }

.tx {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 8px;
  border-radius: 12px;
}

.tx + .tx { border-top: 1px solid var(--stroke); }

.tx-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background-size: 70%;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
}

.tx-label { flex: 1; font-size: 13.5px; }
.tx-amount { font-variant-numeric: tabular-nums; font-weight: 800; }
.tx-amount.pos { color: var(--green); }
.tx-amount.neg { color: var(--red); }

/* shop */

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

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.shop-card:hover { transform: translateY(-3px); border-color: var(--cyan); }
.shop-card.owned { border-color: rgba(92, 242, 160, 0.4); }

.shop-art {
  width: 54px;
  height: 54px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.shop-name { font-weight: 800; font-size: 14px; }
.shop-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; min-height: 32px; }

.shop-state {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(92, 242, 160, 0.1);
  border: 1px solid rgba(92, 242, 160, 0.35);
  margin-top: 6px;
}

.shop-card .btn { margin-top: 6px; width: 100%; }

/* inventory */

.inv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.inv-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  text-align: center;
}

.inv-card.equipped { border-color: var(--cyan); box-shadow: 0 0 18px rgba(77, 243, 255, 0.15); }

.inv-card .btn { margin-top: 6px; width: 100%; }

/* ---------------- auth note ---------------- */

.auth-note {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.55;
  padding: 10px;
  border-radius: 10px;
  background: rgba(77, 243, 255, 0.06);
  border: 1px solid rgba(77, 243, 255, 0.12);
}

/* ---------------- bank ---------------- */

.bank-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.bank-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(77, 243, 255, 0.1), rgba(77, 243, 255, 0.03));
  border: 1px solid rgba(77, 243, 255, 0.25);
  transition: all 0.18s ease;
}

.bank-chip:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  box-shadow: 0 8px 24px rgba(77, 243, 255, 0.2);
  background: linear-gradient(135deg, rgba(77, 243, 255, 0.18), rgba(77, 243, 255, 0.06));
}

.bank-chip:active { transform: translateY(-1px) scale(0.97); }

.bank-chip strong {
  font-size: 17px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.bank-chip small {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.bank-custom {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bank-amount { flex: 1; }

.bank-custom .btn { white-space: nowrap; flex: none; }

.bank-quick-redeem {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.bank-quick-redeem .link-btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* ---------------- guide overlay ---------------- */

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.guide-overlay.open { opacity: 1; }

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.75);
  backdrop-filter: blur(4px);
}

.guide-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 34px 30px;
  border-radius: 22px;
  background: linear-gradient(200deg, #12203a, #0a101d);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  animation: riseIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.guide-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 15px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  transition: all 0.15s ease;
  z-index: 2;
}

.guide-close:hover { color: var(--text); border-color: var(--red); }

.guide-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  background: linear-gradient(120deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.guide-section {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--stroke);
}

.guide-section:last-of-type { border-bottom: 0; margin-bottom: 22px; }

.guide-section h2 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.guide-text {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.guide-text strong { color: var(--gold); }

/* triangle layout */

.guide-triangle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.guide-triangle .guide-move {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.guide-triangle .guide-move:nth-child(3) { grid-column: 1 / -1; justify-self: center; min-width: 160px; }

.guide-move-name {
  font-weight: 800;
  font-size: 14px;
}

.guide-beats {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.move-art-guide { width: 64px; height: 64px; }

/* payout table */

.guide-table {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.guide-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 14px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.guide-row.head {
  background: var(--panel-strong);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.guide-row + .guide-row { border-top: 1px solid var(--stroke); }

.g-pay { color: var(--green); font-weight: 800; }
.g-jackpot { color: var(--gold); font-weight: 800; }

.guide-note {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 10px;
  line-height: 1.5;
}

/* target chips */

.guide-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.guide-target-chip {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 201, 77, 0.1);
  border: 1px solid rgba(255, 201, 77, 0.3);
}

/* help glyph */

.guide-glyph {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  color: var(--cyan);
}

.guide-panel .btn-block { margin-top: 6px; }

@media (max-width: 560px) {
  .guide-panel { padding: 24px 18px; }
  .guide-table { font-size: 11px; }
  .guide-row { padding: 8px 10px; gap: 2px; }
  .guide-triangle { grid-template-columns: 1fr; }
  .guide-triangle .guide-move:nth-child(3) { grid-column: unset; min-width: 0; }
}

/* ---------------- onboarding ---------------- */

.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(3, 6, 12, 0.8);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.onboard-card {
  width: min(440px, 100%);
  text-align: center;
  padding: 34px 30px;
  border-radius: 22px;
  background: linear-gradient(200deg, #12203a, #0a101d);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  animation: riseIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.onboard-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 22px; }
.onboard-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
}
.onboard-dots i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); transform: scale(1.25); }

.onboard-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 12px;
  background: linear-gradient(120deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.onboard-body { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin-bottom: 26px; }

.onboard-next { width: 100%; }

/* ---------------- responsive ---------------- */

@media (max-width: 560px) {
  .table-stage { border-radius: 14px; }
  .table-cards { flex-direction: column; align-items: center; gap: 12px; }
  .table-card-slot { max-width: none; width: 100%; min-height: 120px; }
  .move-art-lg { width: 74px; height: 74px; }
  .result-moves { flex-direction: column; }
  .move-card { min-width: 0; width: 100%; flex-direction: row; justify-content: center; gap: 14px; }
  .shop-grid, .inv-grid { grid-template-columns: 1fr; }
  .brand-mini, .streak-label-hud { display: none; }
  .screen { padding-top: 84px; }
}

/* ---------------- motion preferences ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
