/* ═══════════════════════════════════════════════════════════
   AZI — Typography-First Design System
   Anti-generic. Restrained. Confident.
   Inspired by Linear, Stripe, Vercel — not Stake.
   
   POLISHED: Visual refinements for premium feel
   ═══════════════════════════════════════════════════════════ */

/* ─── Fonts ─── */
@import url('https://fonts.bunny.net/css?family=inter:400,500,600,700&family=jetbrains-mono:400,500,700');

/* ─── Design Tokens — Dark Mode (default) ─── */
:root {
  /* Colors — Restrained palette */
  --bg-0: #09090b;
  --bg-1: #0f0f11;
  --bg-2: #18181b;
  --bg-3: #27272a;
  --bg: var(--bg-0);
  --surface: var(--bg-2);
  --border: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.06);
  
  --text-0: #fafafa;
  --text-1: #e4e4e7;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --text: var(--text-0);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  
  --accent: #10b981;
  --accent-subtle: rgba(16, 185, 129, 0.1);
  --accent-hover: rgba(16, 185, 129, 0.15);
  --danger: #f43f5e;
  --danger-subtle: rgba(244, 63, 94, 0.1);
  
  /* Card suits */
  --suit-red: #dc2626;
  --suit-black: #fafafa;
  
  /* Card styling */
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.15);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  
  /* Table */
  --felt-tint: rgba(21, 128, 61, 0.08);
  --felt-tint-light: rgba(21, 128, 61, 0.04);
  
  /* Code */
  --code-bg: var(--surface);
  
  /* Typography scale */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-30: 120px;
  
  /* Motion — purposeful only */
  --duration-fast: 100ms;
  --duration: 150ms;
  --duration-slow: 200ms;
  --duration-slower: 300ms;
  --ease: ease;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ─── Light Mode ─── */
[data-theme="light"] {
  --bg-0: #ffffff;
  --bg-1: #fafafa;
  --bg-2: #f4f4f5;
  --bg-3: #e4e4e7;
  --bg: var(--bg-0);
  --surface: #ffffff;
  --border: #e4e4e7;
  --border-subtle: rgba(0, 0, 0, 0.06);
  
  --text-0: #09090b;
  --text-1: #18181b;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --text: var(--text-0);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  
  --accent: #059669;
  --accent-subtle: rgba(5, 150, 105, 0.08);
  --accent-hover: rgba(5, 150, 105, 0.12);
  --danger: #e11d48;
  --danger-subtle: rgba(225, 29, 72, 0.08);
  
  --suit-black: #1a1a1a;
  
  --card-bg: #ffffff;
  --card-border: #d4d4d8;
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  
  --felt-tint: rgba(21, 128, 61, 0.08);
  --felt-tint-light: rgba(21, 128, 61, 0.04);
  
  --code-bg: #f4f4f5;
  
  /* Light mode shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ─── Transitions for theme switch ─── */
html {
  transition: background-color var(--duration-slow), color var(--duration-slow);
}

body,
.app-header,
.card,
.card-subtle,
.input,
.btn,
.modal-content,
.toast,
.felt,
.seat-avatar,
.playing-card {
  transition: background-color var(--duration-slow), border-color var(--duration-slow), color var(--duration-slow), box-shadow var(--duration-slow);
}

/* ─── Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Scrollbar — minimal */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus — accessible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ─── Typography ─── */
.hero-title {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  text-shadow: 0 0 80px rgba(16, 185, 129, 0.15);
}

h1, .h1 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

h2, .h2 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h3, .h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.body-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Links ─── */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.view {
  padding: var(--space-12) 0 var(--space-24);
  animation: fadeIn var(--duration) var(--ease);
}

.section {
  margin-bottom: var(--space-20);
}

/* Fade in animation for page transitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   HEADER — Clean & Functional
   ═══════════════════════════════════════════════════════════ */

.app-header {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  transition: filter var(--duration-fast);
}

.header-logo:hover {
  filter: brightness(1.15);
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: var(--space-1);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: 4px;
  transition: color var(--duration-fast), background-color var(--duration-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: var(--accent-subtle);
}

.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-balance {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.header-balance.not-connected {
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.status-indicator.connected {
  background: var(--accent);
}

.header-user {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}

.theme-toggle:hover {
  opacity: 1;
}

/* Mobile menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
  align-items: center;
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
}

.mobile-nav-overlay.open {
  display: block;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 999;
  transition: right var(--duration-slow);
  display: flex;
  flex-direction: column;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: var(--space-1);
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-links {
  flex: 1;
  padding: var(--space-4) 0;
}

.mobile-nav-link {
  display: block;
  padding: var(--space-4) var(--space-5);
  font-size: 16px;
  color: var(--text-secondary);
  transition: background var(--duration-fast);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: var(--bg);
  color: var(--text);
}

.mobile-nav-footer {
  padding: var(--space-5);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS — Clean, Purposeful, Tactile
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  text-decoration: none;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-primary:active {
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--border-subtle);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-subtle);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
  min-height: 48px;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.input::placeholder {
  color: var(--text-muted);
}

.input.mono {
  font-family: var(--font-mono);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   CARDS & SURFACES
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-6);
  transition: all var(--duration-slow) var(--ease-out);
}

.card-subtle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-5);
  transition: all var(--duration-slow) var(--ease-out);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */

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

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.table td {
  font-size: 14px;
  color: var(--text-secondary);
}

.table tbody tr:hover {
  background: var(--border-subtle);
}

.table tbody tr:nth-child(even) {
  background: var(--bg-1);
}

.table tbody tr:nth-child(even):hover {
  background: var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════
   STATUS INDICATORS
   ═══════════════════════════════════════════════════════════ */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.open {
  background: var(--accent);
}

.status-dot.playing {
  background: #f59e0b;
}

.status-dot.closed {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   LOADING & EMPTY STATES
   ═══════════════════════════════════════════════════════════ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) 0;
  color: var(--text-muted);
  gap: var(--space-4);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty {
  text-align: center;
  padding: var(--space-16) var(--space-5);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════
   HOME VIEW — Hero that Commands Attention
   ═══════════════════════════════════════════════════════════ */

.home-hero {
  text-align: center;
  padding: var(--space-30) var(--space-5) var(--space-20);
}

.home-hero .hero-title {
  margin-bottom: var(--space-4);
}

.home-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.home-subtext {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto var(--space-10);
  line-height: 1.7;
}

.home-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.home-note {
  font-size: 13px;
  color: var(--text-muted);
}

/* Quick access bar */
.quick-access {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-20);
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  text-decoration: none;
}

.quick-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.quick-card-amount {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.quick-card-label {
  font-size: 12px;
  color: var(--text-muted);
}

.quick-card-icon {
  font-size: 24px;
  margin-bottom: var(--space-1);
}

/* How it works - prose style */
.how-section {
  margin-bottom: var(--space-20);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.how-item {
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
}

.how-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.how-item p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Live stats */
.live-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-20);
}

.live-stat {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.live-stat-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.live-stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Why AZI grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-20);
}

.feature {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--duration-slow) var(--ease-out);
}

.feature:hover {
  border-color: var(--text-muted);
}

.feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Recent activity */
.activity-section {
  margin-bottom: var(--space-20);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-item {
  font-size: 14px;
  color: var(--text-muted);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.activity-item:hover {
  background: var(--border-subtle);
  padding-left: var(--space-3);
  margin-left: calc(var(--space-3) * -1);
  padding-right: var(--space-3);
  margin-right: calc(var(--space-3) * -1);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-player {
  color: var(--text-secondary);
}

.activity-amount {
  color: var(--accent);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.activity-time {
  color: var(--text-muted);
  font-size: 13px;
}

/* Footer */
.home-footer {
  text-align: center;
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-10);
}

.footer-brand {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  gap: var(--space-5);
  justify-content: center;
  margin-bottom: var(--space-5);
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
}

.home-section-title {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════
   LOBBY VIEW — Card Hierarchy
   ═══════════════════════════════════════════════════════════ */

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.lobby-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* Stake levels — horizontal cards */
.stake-levels {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-8);
  -webkit-overflow-scrolling: touch;
}

.stake-card {
  flex-shrink: 0;
  min-width: 120px;
  padding: var(--space-5) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  text-align: center;
}

.stake-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.stake-card.active {
  border-color: var(--accent);
  border-left-width: 3px;
  background: var(--accent-subtle);
}

.stake-amount {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.stake-info {
  font-size: 12px;
  color: var(--text-muted);
}

/* Room list */
.room-list {
  margin-bottom: var(--space-8);
}

.room-row {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.room-row:nth-child(even) {
  background: var(--bg-1);
}

.room-row:hover {
  background: var(--border-subtle);
}

.room-row:last-child {
  border-bottom: none;
}

.room-id {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  width: 100px;
}

.room-players {
  font-size: 14px;
  color: var(--text-secondary);
  flex: 1;
}

.room-stake {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  width: 80px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.room-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100px;
  justify-content: flex-end;
}

.room-join {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.room-row:hover .room-join {
  opacity: 1;
}

/* FAB - Quick Join */
.fab {
  position: fixed;
  bottom: var(--space-6);
  left: var(--space-5);
  right: var(--space-5);
  max-width: 400px;
  margin: 0 auto;
}

/* Quick Join Box */
.quick-join-box {
  padding: var(--space-5);
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-bottom: var(--space-6);
}

.quick-join-box .btn-primary {
  min-width: 160px;
}

/* ═══════════════════════════════════════════════════════════
   TABLE VIEW — The Playing Surface with Depth
   ═══════════════════════════════════════════════════════════ */

.table-view {
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

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

.table-room-id {
  font-size: 12px;
  color: var(--text-muted);
}

.table-pot {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.table-pot::before {
  content: 'POT ';
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.table-trump {
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-leave {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-leave:hover {
  color: var(--text);
}

/* Felt — with depth and light source */
.felt {
  flex: 1;
  position: relative;
  background: 
    radial-gradient(ellipse at center, rgba(21, 128, 61, 0.12), rgba(21, 128, 61, 0.04) 70%, transparent),
    linear-gradient(var(--felt-tint), var(--felt-tint-light)),
    var(--bg);
  min-height: 300px;
  overflow: hidden;
}

/* Light mode felt adjustment */
[data-theme="light"] .felt {
  background: 
    radial-gradient(ellipse at center, rgba(21, 128, 61, 0.1), rgba(21, 128, 61, 0.03) 70%, transparent),
    linear-gradient(rgba(21, 128, 61, 0.06), rgba(21, 128, 61, 0.02)),
    var(--bg);
}

/* Table shape with double border */
.felt::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 70%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

[data-theme="light"] .felt::before {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 40px rgba(0, 0, 0, 0.05);
}

/* Seats */
.seats {
  position: absolute;
  inset: 0;
}

.seat {
  position: absolute;
  width: 80px;
  text-align: center;
}

.seat-bottom { bottom: 8%; left: 50%; transform: translateX(-50%); }
.seat-bottom-left { bottom: 25%; left: 8%; }
.seat-top-left { top: 15%; left: 12%; }
.seat-top { top: 8%; left: 50%; transform: translateX(-50%); }
.seat-top-right { top: 15%; right: 12%; }
.seat-bottom-right { bottom: 25%; right: 8%; }

.seat-avatar {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-1);
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.seat.occupied .seat-avatar {
  border-style: solid;
  border-color: var(--text-muted);
  color: var(--text);
}

.seat.is-turn .seat-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.seat.is-me .seat-avatar {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.seat-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat.occupied .seat-name {
  color: var(--text-secondary);
}

.seat-tricks {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--space-1);
}

/* Table center */
.table-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.trick-cards {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  min-height: 84px;
  align-items: center;
  margin-bottom: var(--space-3);
}

.table-status {
  font-size: 14px;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

[data-theme="light"] .table-status {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
}

/* Playing cards — feel like objects */
.playing-card {
  width: 60px;
  height: 84px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: var(--card-shadow);
  position: relative;
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  user-select: none;
}

.playing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.playing-card.selected {
  transform: translateY(-12px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4), 0 0 0 2px var(--accent);
}

.playing-card.playable {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.playing-card.dimmed {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

.playing-card.played {
  animation: cardPlay 0.3s ease;
}

@keyframes cardPlay {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.card-inner {
  width: 100%;
  height: 100%;
  padding: 4px;
}

.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-corner-top { top: 4px; left: 5px; }
.card-corner-bottom { bottom: 4px; right: 5px; transform: rotate(180deg); }

.card-rank {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}

.card-suit {
  font-size: 12px;
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.playing-card.red { color: var(--suit-red); }
.playing-card.black { color: var(--suit-black); }

/* Card back */
.card-back {
  background: linear-gradient(135deg, #1e3a8a, #4c1d95);
  cursor: default;
}

.card-back::after {
  content: 'AZI';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.2);
}

/* Hand section — Your turn accent line */
.hand-section {
  padding: var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
  transition: border-color var(--duration-fast);
}

.hand-section.your-turn {
  border-top: 2px solid var(--accent);
}

.hand-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.hand-cards {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  min-height: 84px;
  align-items: flex-end;
}

.hand-empty {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 84px;
}

/* Action bar */
.action-bar {
  padding: var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.action-timer {
  height: 3px;
  background: var(--bg);
  border-radius: 2px;
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
}

.timer-fill.urgent {
  background: var(--danger);
}

.action-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.action-buttons .btn {
  min-height: 48px;
  min-width: 100px;
}

.action-prompt {
  text-align: center;
  font-size: 14px;
  color: var(--accent);
  padding: var(--space-3);
  background: var(--accent-subtle);
  border-radius: 4px;
  width: 100%;
  margin-bottom: var(--space-3);
}

.waiting-message {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════
   WALLET VIEW — Clean Data Presentation
   ═══════════════════════════════════════════════════════════ */

.wallet-balance {
  text-align: center;
  padding: var(--space-10) 0;
  margin-bottom: var(--space-8);
}

.wallet-balance-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wallet-balance-amount {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wallet-balance-currency {
  font-size: 16px;
  color: var(--text-muted);
  margin-left: var(--space-2);
  font-weight: 400;
}

/* Wallet tabs with animated indicator */
.wallet-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.wallet-tab {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast);
}

.wallet-tab:hover {
  color: var(--text-secondary);
}

.wallet-tab.active {
  color: var(--text);
}

.wallet-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  animation: tabSlide var(--duration-slow) var(--ease-out);
}

@keyframes tabSlide {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Deposit */
.deposit-box {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: var(--space-5);
}

.deposit-field {
  margin-bottom: var(--space-5);
}

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

.address-row {
  display: flex;
  gap: var(--space-2);
}

.address-row .input {
  flex: 1;
  font-size: 13px;
}

.address-row .btn {
  transition: all var(--duration-fast);
}

.address-row .btn.copied {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.memo-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: #f59e0b;
  margin-top: var(--space-3);
}

.deposit-notes {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.deposit-notes p {
  margin-bottom: var(--space-2);
}

/* Transaction list */
.tx-list {
  margin-top: var(--space-4);
}

.tx-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.tx-item:hover {
  background: var(--border-subtle);
  margin: 0 calc(var(--space-3) * -1);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-icon {
  font-size: 18px;
  width: 32px;
  text-align: center;
}

.tx-details {
  flex: 1;
  min-width: 0;
}

.tx-category {
  font-size: 14px;
  color: var(--text);
}

.tx-date {
  font-size: 12px;
  color: var(--text-muted);
}

.tx-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tx-amount.credit {
  color: var(--accent);
}

.tx-amount.debit {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   DOCS VIEW
   ═══════════════════════════════════════════════════════════ */

.docs-view {
  padding: var(--space-12) 0 var(--space-24);
}

.docs-header {
  margin-bottom: var(--space-10);
}

.docs-title {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
}

.docs-nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}

.docs-nav-item {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast);
}

.docs-nav-item:hover {
  color: var(--text-secondary);
}

.docs-nav-item.active {
  color: var(--text);
}

.docs-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.docs-content {
  line-height: 1.7;
}

.docs-content h2 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.docs-content ul,
.docs-content ol {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.docs-content li {
  margin-bottom: var(--space-2);
}

.docs-content strong {
  color: var(--text);
}

/* Code blocks */
.code-block {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-4);
  margin: var(--space-4) 0;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre;
}

.code-block-copy {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.code-block:hover .code-block-copy {
  opacity: 1;
}

.code-block-copy:hover {
  color: var(--text);
}

/* Inline code */
.docs-content code:not(.code-block code) {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* Verification tool */
.verify-tool {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: var(--space-6) 0;
}

.verify-result {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
}

.verify-result.success {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.verify-result.error {
  background: var(--danger-subtle);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Legal Content (Terms, Privacy) */
.legal-content section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.legal-content section:last-of-type {
  border-bottom: none;
}

.legal-content a {
  color: var(--accent);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-footer {
  margin-top: var(--space-8);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.legal-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.docs-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════
   PROFILE VIEW — Personal Touch
   ═══════════════════════════════════════════════════════════ */

.profile-header {
  text-align: center;
  padding: var(--space-8) 0;
  margin-bottom: var(--space-6);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-4);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--border);
}

.profile-name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.profile-wallet {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.stat-value.accent {
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Game history */
.history-list {
  margin-top: var(--space-4);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.history-item:hover {
  background: var(--border-subtle);
}

.history-item:last-child {
  border-bottom: none;
}

.history-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.history-details {
  font-size: 14px;
  color: var(--text-secondary);
}

.history-outcome {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.history-outcome.win {
  color: var(--accent);
}

.history-outcome.loss {
  color: var(--text-muted);
}

/* Settings section */
.profile-settings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-6);
}

.profile-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.profile-setting-row:last-child {
  border-bottom: none;
}

.profile-setting-row.danger-zone {
  border-left: 3px solid var(--danger);
  margin-left: calc(var(--space-6) * -1);
  padding-left: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════
   LEADERBOARD VIEW
   ═══════════════════════════════════════════════════════════ */

.leaderboard-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.leaderboard-tab {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast);
}

.leaderboard-tab:hover {
  color: var(--text-secondary);
}

.leaderboard-tab.active {
  color: var(--text);
}

.leaderboard-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.leaderboard-list {
  margin-top: var(--space-4);
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.leaderboard-row:hover {
  background: var(--border-subtle);
}

.leaderboard-row.is-you {
  background: var(--accent-subtle);
}


.rank {
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.rank.top-3 {
  font-size: 20px;
}

.player-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.player-avatar-sm {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.player-name {
  font-size: 14px;
  font-weight: 500;
}

.player-stats-mini {
  font-size: 12px;
  color: var(--text-muted);
}

.player-winnings {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   TOURNAMENTS VIEW
   ═══════════════════════════════════════════════════════════ */

.tournaments-grid {
  display: grid;
  gap: var(--space-4);
}

.tournament-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--duration-slow) var(--ease-out);
}

.tournament-card:hover {
  border-color: var(--text-muted);
}

.tournament-card.registered {
  border-color: var(--accent);
}

.tournament-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.tournament-name {
  font-size: 16px;
  font-weight: 600;
}

.tournament-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
}

.tournament-badge.live {
  background: var(--danger);
  color: #fff;
}

.tournament-badge.full {
  background: var(--text-muted);
  color: var(--bg);
}

.tournament-details {
  margin-bottom: var(--space-4);
}

.tournament-detail {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: var(--space-2);
}

.tournament-detail .label {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
}

.tournament-detail .value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tournament-detail .value.prize {
  color: var(--accent);
  font-weight: 600;
}

.tournament-progress {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.tournament-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width var(--duration-slow) var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════
   ADMIN VIEW
   ═══════════════════════════════════════════════════════════ */

.admin-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.admin-tab {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast);
}

.admin-tab:hover {
  color: var(--text-secondary);
}

.admin-tab.active {
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   MODALS — Proper Dimming
   ═══════════════════════════════════════════════════════════ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  transition: color var(--duration-fast);
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: var(--space-5);
}

/* ═══════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 72px;
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: calc(100vw - var(--space-8));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity var(--duration), transform var(--duration);
  position: relative;
  overflow: hidden;
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-leaving {
  opacity: 0;
  transform: translateX(100%);
}

/* Left indicator bar */
.toast-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-muted);
}

.toast-success .toast-indicator,
.toast.success .toast-indicator {
  background: var(--accent);
}

.toast-error .toast-indicator,
.toast.error .toast-indicator {
  background: var(--danger);
}

.toast-warning .toast-indicator,
.toast.warning .toast-indicator {
  background: #f59e0b;
}

.toast-info .toast-indicator,
.toast.info .toast-indicator {
  background: #3b82f6;
}

/* Icon */
.toast-icon {
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-success .toast-icon { color: var(--accent); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info .toast-icon { color: #3b82f6; }

/* Message */
.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

/* Close button */
.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.toast-close:hover {
  color: var(--text);
  background: var(--bg);
}

/* Legacy toast classes */
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.info { border-left: 3px solid #3b82f6; }

/* ═══════════════════════════════════════════════════════════
   RECONNECT OVERLAY
   ═══════════════════════════════════════════════════════════ */

.reconnect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="light"] .reconnect-overlay {
  background: rgba(255, 255, 255, 0.95);
}

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


.reconnect-text {
  font-size: 18px;
  font-weight: 500;
  margin-top: var(--space-5);
}

.reconnect-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════
   AUTH MODAL — The First Thing People See
   ═══════════════════════════════════════════════════════════ */

.auth-modal {
  display: flex;
}

.auth-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .auth-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.auth-modal-content {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease;
}

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

.modal-closing .auth-modal-content {
  animation: modalSlideOut 0.15s ease forwards;
}

@keyframes modalSlideOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.auth-modal-body {
  padding: var(--space-8);
  text-align: center;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.auth-modal-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.auth-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-slow) var(--ease-out);
  width: 100%;
  min-height: 48px;
}

.auth-option:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.auth-option-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.auth-option-primary:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.auth-option-primary .auth-option-label,
.auth-option-primary .auth-option-desc {
  color: #000;
}

.auth-option-primary .auth-option-desc {
  opacity: 0.8;
}

.auth-option-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.auth-option-text {
  flex: 1;
}

.auth-option-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text);
}

.auth-option-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-modal-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-6);
}

/* Username Step */
.username-input-wrapper {
  margin-bottom: var(--space-6);
}

.username-input {
  text-align: center;
  font-size: 18px;
  padding: var(--space-4);
}

.username-suggestions-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.username-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-3);
}

.username-chip {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.username-chip:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.shuffle-link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  margin-bottom: var(--space-4);
  transition: opacity var(--duration-fast);
}

.shuffle-link:hover {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED HEADER — Identity Bar + User Menu
   ═══════════════════════════════════════════════════════════ */

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--duration-fast);
  position: relative;
}

.header-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

/* Avatar color generation based on name - using data attributes */
.header-avatar[data-color="0"] { background: #ef4444; }
.header-avatar[data-color="1"] { background: #f97316; }
.header-avatar[data-color="2"] { background: #eab308; }
.header-avatar[data-color="3"] { background: #22c55e; }
.header-avatar[data-color="4"] { background: #14b8a6; }
.header-avatar[data-color="5"] { background: #3b82f6; }
.header-avatar[data-color="6"] { background: #8b5cf6; }
.header-avatar[data-color="7"] { background: #ec4899; }
.header-avatar[data-color="8"] { background: #6366f1; }
.header-avatar[data-color="9"] { background: #06b6d4; }
.header-avatar[data-color="10"] { background: #84cc16; }
.header-avatar[data-color="11"] { background: #f59e0b; }

.header-connect-btn {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.header-connect-btn:hover {
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* User dropdown */
.user-dropdown-wrapper {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-2) 0;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-md);
}

.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dropdown-type {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  color: var(--text-secondary);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast);
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg);
  color: var(--text);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

.dropdown-item.danger {
  color: var(--danger);
}

.dropdown-item.danger:hover {
  background: var(--danger-subtle);
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED PROFILE VIEW
   ═══════════════════════════════════════════════════════════ */

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-8);
  text-align: center;
  margin-bottom: var(--space-8);
}

.profile-avatar-large {
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--border);
}

/* Avatar colors */
.profile-avatar-large[data-color="0"] { background: #ef4444; }
.profile-avatar-large[data-color="1"] { background: #f97316; }
.profile-avatar-large[data-color="2"] { background: #eab308; }
.profile-avatar-large[data-color="3"] { background: #22c55e; }
.profile-avatar-large[data-color="4"] { background: #14b8a6; }
.profile-avatar-large[data-color="5"] { background: #3b82f6; }
.profile-avatar-large[data-color="6"] { background: #8b5cf6; }
.profile-avatar-large[data-color="7"] { background: #ec4899; }
.profile-avatar-large[data-color="8"] { background: #6366f1; }
.profile-avatar-large[data-color="9"] { background: #06b6d4; }
.profile-avatar-large[data-color="10"] { background: #84cc16; }
.profile-avatar-large[data-color="11"] { background: #f59e0b; }

.profile-display-name {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.profile-account-type {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.profile-joined {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.profile-wallet-address {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  background: var(--bg);
  border-radius: 6px;
}

.profile-wallet-copy {
  padding: var(--space-1);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity var(--duration-fast);
}

.profile-wallet-copy:hover {
  opacity: 1;
}

.profile-section {
  margin-bottom: var(--space-8);
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.profile-section-title {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.profile-section-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.profile-section-link:hover {
  text-decoration: underline;
}

/* Stats grid - 4 columns on desktop, 2x2 on mobile */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.profile-stat-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 8px;
  text-align: center;
}

.profile-stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums;
}

.profile-stat-value.accent {
  color: var(--accent);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Empty state for game history */
.profile-empty-state {
  padding: var(--space-10);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.profile-empty-text {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

/* Toggle switches */
.toggle-group {
  display: flex;
  gap: var(--space-1);
  background: var(--bg);
  padding: 2px;
  border-radius: 6px;
}

.toggle-option {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.toggle-option.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.toggle-option:hover:not(.active) {
  color: var(--text-secondary);
}

.danger-text {
  color: var(--danger);
}

.profile-setting-label {
  font-size: 14px;
  color: var(--text);
}

.profile-setting-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED LOBBY VIEW
   ═══════════════════════════════════════════════════════════ */

.lobby-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: var(--space-4);
  transition: color var(--duration-fast);
}

.lobby-back-btn:hover {
  color: var(--text);
}

.lobby-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.lobby-context-info {
  font-size: 14px;
  color: var(--text-muted);
}

.quick-join-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.quick-join-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* Create table inline form */
.create-table-inline {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: var(--space-6);
}

.create-table-header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.create-table-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.player-count-selector {
  display: flex;
  gap: var(--space-1);
  background: var(--bg);
  padding: 2px;
  border-radius: 6px;
}

.player-count-option {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.player-count-option.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.player-count-option:hover:not(.active) {
  color: var(--text-secondary);
}

/* Table row enhanced */
.room-row-enhanced {
  display: grid;
  grid-template-columns: 100px 1fr 80px 100px 80px;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-fast);
}

.room-row-enhanced:nth-child(even) {
  background: var(--bg-1);
}

.room-row-enhanced:hover {
  background: var(--border-subtle);
}

.room-state-waiting {
  color: var(--accent);
}

.room-state-playing {
  color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED TABLE VIEW
   ═══════════════════════════════════════════════════════════ */

.table-waiting-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.waiting-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.waiting-count {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-6);
  font-variant-numeric: tabular-nums;
}

.waiting-share {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.share-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.waiting-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* Your turn indicator */
.your-turn-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Trick winner announcement */
.trick-winner-announcement {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 8px;
  text-align: center;
  z-index: 10;
  animation: fadeInScale 0.3s ease;
  box-shadow: var(--shadow-lg);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.trick-winner-text {
  font-size: 18px;
  font-weight: 600;
}

.tricks-score {
  margin-top: var(--space-4);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Hand resolution */
.hand-result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 11, 0.95);
  z-index: 20;
}

[data-theme="light"] .hand-result-overlay {
  background: rgba(255, 255, 255, 0.95);
}

.hand-result-content {
  text-align: center;
  padding: var(--space-8);
}

.hand-result-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.hand-result-amount {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}

.hand-result-winner {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-8);
}

.hand-result-countdown {
  font-size: 14px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   LOADING PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}

.loading-bar-progress {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}

.loading-bar.active .loading-bar-progress {
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% { width: 0; margin-left: 0; }
  50% { width: 70%; margin-left: 0; }
  100% { width: 0; margin-left: 100%; }
}

/* Loading text state */
.loading-text {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY — Reduced Motion
   ═══════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (768px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .header-nav.desktop-nav {
    display: none;
  }
  
  .header-user {
    display: none;
  }
  
  .view {
    padding: var(--space-8) 0 var(--space-16);
  }
  
  .home-hero {
    padding: var(--space-16) var(--space-5) var(--space-12);
  }
  
  .hero-title {
    font-size: 48px;
  }
  
  .quick-access {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .how-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .live-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  .live-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  
  .live-stat-number {
    font-size: 24px;
  }
  
  .wallet-balance-amount {
    font-size: 36px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }
  
  .leaderboard-row {
    flex-wrap: wrap;
  }
  
  .room-row {
    flex-wrap: wrap;
  }
  
  .room-id,
  .room-stake,
  .room-status {
    width: auto;
  }
  
  .room-join {
    opacity: 1;
  }
  
  .seat {
    width: 60px;
  }
  
  .seat-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .playing-card {
    width: 50px;
    height: 70px;
  }
  
  .toast-container {
    left: var(--space-5);
    right: var(--space-5);
    max-width: none;
  }
  
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  
  .modal-content {
    border-radius: 12px 12px 0 0;
    max-height: 90vh;
  }
  
  .auth-modal-body {
    padding: var(--space-6);
  }
  
  .username-suggestions {
    gap: var(--space-1);
  }
  
  .username-chip {
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
  }
  
  .create-table-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .player-count-selector {
    justify-content: center;
  }
  
  .room-row-enhanced {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons .btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (480px and below)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .home-hero {
    padding: var(--space-12) var(--space-4) var(--space-10);
  }
  
  .hero-title {
    font-size: 48px;
  }
  
  .home-actions {
    flex-direction: column;
    width: 100%;
    padding: 0;
  }
  
  .home-actions .btn {
    width: 100%;
  }
  
  .stake-card {
    min-width: 100%;
  }
  
  .stake-levels {
    flex-direction: column;
  }
  
  .stake-amount {
    font-size: 20px;
  }
  
  .toast-container {
    top: auto;
    bottom: var(--space-6);
    right: var(--space-3);
    left: var(--space-3);
    max-width: none;
    width: auto;
  }

  .toast {
    transform: translateY(100%);
  }

  .toast-visible {
    transform: translateY(0);
  }

  .toast-leaving {
    transform: translateY(100%);
  }
  
  .waiting-share {
    flex-direction: column;
  }
  
  .waiting-count {
    font-size: 36px;
  }
  
  .profile-avatar,
  .profile-avatar-large {
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Ensure all touch targets are at least 44px */
  .btn,
  .auth-option,
  .nav-link,
  .mobile-nav-link,
  .dropdown-item,
  .wallet-tab,
  .leaderboard-tab,
  .docs-nav-item,
  .toggle-option,
  .player-count-option {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Fix felt overflow */
  .felt {
    max-width: 100vw;
    overflow: hidden;
  }
  
  .felt::before {
    width: 90%;
    height: 60%;
  }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */

/* Tabular numbers for all number displays */
.mono,
[class*="amount"],
[class*="balance"],
[class*="stat-value"],
[class*="stat-number"],
[class*="winnings"],
[class*="outcome"],
.tx-amount,
.rank {
  font-variant-numeric: tabular-nums;
}

/* Ensure cursor pointer on all interactive elements */
button,
[role="button"],
.btn,
.card-interactive,
.stake-card,
.quick-card,
.room-row,
.auth-option,
.username-chip,
.toggle-option,
.player-count-option,
.dropdown-item,
.nav-link,
.mobile-nav-link {
  cursor: pointer;
}

/* Disable user-select on buttons and interactive elements */
button,
.btn,
.toggle-option,
.player-count-option,
.username-chip {
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED LOBBY VIEW — All Stakes Visible
   ═══════════════════════════════════════════════════════════ */

.lobby-main-header {
  margin-bottom: var(--space-6);
}

.lobby-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.lobby-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.online-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.lobby-balance-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}

.balance-label {
  color: var(--text-muted);
}

.balance-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
}

/* Quick Play Section */
.quick-play-section {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: var(--space-5);
  margin-bottom: var(--space-8);
}

.quick-play-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.quick-play-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.quick-play-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.lobby-loading {
  text-align: center;
  padding: var(--space-8);
}

.loading-text {
  color: var(--text-muted);
  font-size: 14px;
}

/* Stake Sections */
.stakes-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.stake-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-5);
  background: var(--surface);
}

.stake-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.stake-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.stake-amount-label {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.stake-tier-label {
  font-size: 16px;
  color: var(--text-muted);
}

.stake-info-icon {
  font-size: 14px;
  color: var(--text-muted);
  cursor: help;
  opacity: 0.6;
}

.stake-room-count {
  font-size: 14px;
  color: var(--text-muted);
}

.stake-rooms-list {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

/* Room Row in Lobby */
.room-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px 80px 80px;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.room-row:last-child {
  border-bottom: none;
}

.room-row:hover {
  background: var(--border-subtle);
}

.room-row:nth-child(even) {
  background: var(--bg-1);
}

.room-row:nth-child(even):hover {
  background: var(--border-subtle);
}

.room-id-col {
  font-family: var(--font-mono);
}

.room-hash {
  font-size: 14px;
  color: var(--text-secondary);
}

.room-players-col {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.room-player-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.room-player-label {
  font-size: 13px;
  color: var(--text-muted);
}

.room-player-avatars {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: var(--space-2);
}

.room-status-col {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.room-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.room-status-dot.waiting {
  background: var(--accent);
}

.room-status-dot.playing {
  background: #f59e0b;
}

.room-status-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.room-age-col {
  font-size: 12px;
  color: var(--text-muted);
}

.room-action-col {
  text-align: right;
}

.room-join-btn {
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.room-row:hover .room-join-btn {
  opacity: 1;
}

/* Empty stake section */
.stake-empty {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-1);
  border-radius: 6px;
  margin-bottom: var(--space-4);
}

.stake-empty-text {
  font-size: 14px;
}

/* Create table button per stake */
.btn-create-table {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-create-table:hover {
  background: var(--accent-subtle);
  border-style: solid;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED HOME VIEW — How to Start Section
   ═══════════════════════════════════════════════════════════ */

.how-to-start-section {
  margin-bottom: var(--space-10);
}

.how-to-start-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.how-to-start-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.step-number {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
}

.step-text {
  font-size: 14px;
  line-height: 1.5;
}

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

.step-alt {
  color: var(--text-muted);
  font-size: 13px;
}

/* Current Tables Section */
.current-tables-section {
  margin-bottom: var(--space-10);
}

.current-tables-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.current-tables-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.current-tables-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.current-tables-text {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Launching notice */
.launching-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-bottom: var(--space-5);
  font-size: 14px;
  color: var(--accent);
}

.launching-icon {
  font-size: 18px;
}

/* Activity empty state */
.activity-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: 14px;
}

.activity-empty-icon {
  font-size: 24px;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED TABLE VIEW — More Context
   ═══════════════════════════════════════════════════════════ */

.table-room-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.table-stake-badge {
  font-size: 12px;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  background: var(--bg);
  border-radius: 4px;
}

.table-right-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.table-phase-indicator {
  font-size: 13px;
  color: var(--accent);
  padding: var(--space-1) var(--space-3);
  background: var(--accent-subtle);
  border-radius: 4px;
}

.trump-card {
  font-weight: 600;
}

.trump-card.red {
  color: var(--suit-red);
}

.trump-card.black {
  color: var(--text);
}

/* Trick score display */
.trick-score {
  display: none;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

[data-theme="light"] .trick-score {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
}

.trick-score-label {
  color: var(--text-muted);
  margin-right: var(--space-2);
}

/* Pot breakdown */
.pot-breakdown {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Hand label row */
.hand-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.hand-rule-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Ready button prominent */
.btn-ready-prominent {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
  animation: pulse 2s ease-in-out infinite;
}

/* Waiting overlay */
.table-waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 11, 0.9);
  z-index: 10;
}

[data-theme="light"] .table-waiting-overlay {
  background: rgba(255, 255, 255, 0.95);
}

.waiting-state-content {
  text-align: center;
  padding: var(--space-8);
}

.waiting-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.waiting-count {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-5);
}

.waiting-player-list {
  margin-bottom: var(--space-5);
}

.waiting-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-1);
  background: var(--surface);
  border-radius: 4px;
  min-width: 200px;
}

.waiting-player-row.is-me {
  border: 1px solid var(--accent);
}

.waiting-player-name {
  font-size: 14px;
  font-weight: 500;
}

.waiting-player-status {
  font-size: 12px;
}

.waiting-player-status.ready {
  color: var(--accent);
}

.waiting-player-status.not-ready {
  color: var(--text-muted);
}

.waiting-player-empty {
  font-size: 14px;
  color: var(--text-muted);
}

.waiting-share {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-5);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.share-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.waiting-hint {
  font-size: 14px;
  color: var(--text-muted);
}

/* Hand result box */
.hand-result-box {
  text-align: center;
  padding: var(--space-4);
  border-radius: 6px;
  margin-bottom: var(--space-4);
  width: 100%;
}

.hand-result-box.won {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
}

.hand-result-box.lost {
  background: var(--surface);
  border: 1px solid var(--border);
}

.result-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.result-amount {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.hand-result-box.lost .result-amount {
  color: var(--text);
}

.result-rake {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED HEADER — Online Count & Room Indicator
   ═══════════════════════════════════════════════════════════ */

.header-online-count {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 13px;
  color: var(--text-muted);
}

.online-icon {
  font-size: 14px;
}

.header-room-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--accent-subtle);
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
}

.room-indicator-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.header-balance-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-balance-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 4px;
  background: var(--bg);
  border-radius: 3px;
}

/* Mobile nav user section */
.mobile-nav-user {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

.mobile-nav-user-name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.mobile-nav-user-balance {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED WALLET VIEW — Mode Bar & Guest Notice
   ═══════════════════════════════════════════════════════════ */

.wallet-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  margin-bottom: var(--space-6);
}

.wallet-mode-bar.guest-mode {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.wallet-mode-bar.wallet-mode {
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
}

.mode-icon {
  font-size: 18px;
  margin-right: var(--space-2);
}

.mode-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.guest-mode .mode-text {
  color: #f59e0b;
}

.wallet-mode .mode-text {
  color: var(--accent);
}

.mode-check {
  color: var(--accent);
  font-weight: 600;
}

/* Guest wallet notice */
.guest-wallet-notice {
  text-align: center;
  padding: var(--space-10);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.guest-notice-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.guest-notice-content h3 {
  font-size: 18px;
  margin-bottom: var(--space-3);
}

.guest-notice-content p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.guest-notice-content p:last-of-type {
  margin-bottom: var(--space-6);
}

/* Withdraw summary */
.withdraw-summary {
  margin-bottom: var(--space-5);
}

.withdraw-summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: var(--space-2);
}

.withdraw-summary-row.total {
  border: 1px solid var(--border);
}

.summary-label {
  color: var(--text-muted);
}

.summary-value {
  font-family: var(--font-mono);
}

.summary-value.accent {
  color: var(--accent);
  font-weight: 600;
}

/* Transaction status badges */
.tx-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.tx-status-row:last-child {
  border-bottom: none;
}

.tx-status-amount {
  font-weight: 500;
}

.tx-status-badge {
  font-size: 12px;
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
}

.tx-status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.tx-status-badge.processing {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.tx-status-badge.confirmed,
.tx-status-badge.completed {
  background: var(--accent-subtle);
  color: var(--accent);
}

.tx-status-badge.failed {
  background: var(--danger-subtle);
  color: var(--danger);
}

.tx-link {
  color: var(--accent);
  font-size: 12px;
  margin-left: var(--space-2);
}

.tx-link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED PROFILE VIEW — Streak & Guest CTA
   ═══════════════════════════════════════════════════════════ */

.guest-upgrade-cta {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.guest-upgrade-text {
  font-size: 14px;
  line-height: 1.5;
}

.guest-upgrade-text strong {
  color: #f59e0b;
}

/* Stats extra row */
.profile-stats-extra {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.stat-extra-item {
  font-size: 14px;
}

.stat-extra-label {
  color: var(--text-muted);
  margin-right: var(--space-2);
}

.stat-extra-value {
  font-weight: 500;
}

.streak-win {
  color: var(--accent);
}

.streak-loss {
  color: var(--danger);
}

/* History item with win/loss indicator */
.history-item.won {
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--space-4) - 3px);
}

.history-item.lost {
  border-left: 3px solid var(--border);
  padding-left: calc(var(--space-4) - 3px);
}

/* ═══════════════════════════════════════════════════════════
   AUTH MODAL ENHANCEMENTS
   ═══════════════════════════════════════════════════════════ */

.auth-guest-note {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.username-helper {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE UPDATES
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .how-to-start-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .quick-play-content {
    flex-direction: column;
    text-align: center;
  }

  .current-tables-box {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .room-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    padding: var(--space-4);
  }

  .room-action-col {
    text-align: left;
  }

  .room-join-btn {
    opacity: 1;
    width: 100%;
  }

  .header-online-count {
    display: none;
  }

  .header-room-indicator {
    display: none;
  }

  .wallet-mode-bar {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .guest-upgrade-cta {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats-extra {
    flex-direction: column;
    gap: var(--space-2);
  }

  .table-right-info {
    display: none;
  }
}

@media (max-width: 480px) {
  .how-to-start-grid {
    grid-template-columns: 1fr;
  }

  .stake-section-title {
    flex-wrap: wrap;
  }

  .stake-amount-label {
    font-size: 20px;
  }

  .waiting-share {
    flex-direction: column;
  }

  .hand-label-row {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════════════════
   TABLE VIEW — Additional styles for polished game UI
   ═══════════════════════════════════════════════════════════ */

/* Center pot display */
.center-pot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
}

.center-pot-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.center-pot-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* Trump display */
.trump-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 4px 10px;
  background: var(--bg-2);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.trump-suit-icon {
  font-size: 18px;
}

/* Trick area — center of table */
.trick-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  z-index: 10;
  min-height: 120px;
}

.trick-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: trickCardIn 0.3s ease-out;
}

.trick-card-slot .player-label {
  font-size: 10px;
  color: var(--text-3);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes trickCardIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Table seats ring */
.table-seats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.table-seats > * {
  pointer-events: auto;
}

/* Seat positioning for 2-6 players */
.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 0.3s;
}

.seat.empty {
  opacity: 0.3;
}

.seat.folded {
  opacity: 0.4;
}

.seat.active-turn .seat-avatar {
  border-color: var(--accent) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.seat-name {
  font-size: 12px;
  color: var(--text-2);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.seat-status {
  font-size: 10px;
  color: var(--text-3);
}

.seat-tricks-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hand section */
.hand-section {
  padding: 12px 0;
}

.hand-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}

.hand-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.hand-empty {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.hand-hint {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 6px;
}

.hand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

/* Action bar */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.action-timer-bar {
  height: 3px;
  background: var(--accent);
  transition: width 0.1s linear;
  border-radius: 3px;
  margin-bottom: 8px;
}

.action-phase {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 6px;
}

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

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Result display */
.hand-result {
  text-align: center;
  padding: 20px;
  animation: resultIn 0.5s ease-out;
}

.hand-result.won {
  color: var(--accent);
}

.hand-result.lost {
  color: var(--danger);
}

.hand-result h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.hand-result p {
  font-size: 14px;
  color: var(--text-3);
}

@keyframes resultIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Trick winner glow */
.trick-card-slot.winner .playing-card {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  border-color: var(--accent);
}

/* Button leave */
.btn-leave {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.btn-leave:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

/* Share button */
.share-btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* Ready pulse */
.btn-ready-pulse {
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Table header */
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}

/* Countdown overlay */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  font-size: 64px;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  animation: countPulse 1s ease-in-out;
}

@keyframes countPulse {
  0% { transform: scale(1.5); opacity: 0; }
  50% { transform: scale(1); opacity: 1; }
  100% { opacity: 1; }
}

/* Trick info bar */
.trick-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px;
}

/* Discard prompt */
.discard-prompt {
  text-align: center;
  padding: 12px;
  color: var(--text-2);
  font-size: 14px;
}

/* Playing card enhancements */
.playing-card.mini {
  width: 45px;
  height: 63px;
}

.playing-card.mini .card-corner { font-size: 9px; }
.playing-card.mini .card-rank { font-size: 10px; }
.playing-card.mini .card-suit { font-size: 8px; }
.playing-card.mini .card-center { font-size: 18px; }

.playing-card.red { color: var(--suit-red, #ef4444); }
.playing-card.black { color: var(--suit-black, var(--text-1)); }

.playing-card.played {
  transform: scale(0.95);
  opacity: 0.7;
}

/* Suit color vars if not defined */
:root {
  --suit-red: #ef4444;
  --suit-black: #1f2937;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.12);
  --card-border: rgba(0,0,0,0.12);
  --felt-tint: rgba(16, 185, 129, 0.03);
  --felt-tint-light: rgba(16, 185, 129, 0.01);
}

[data-theme="dark"] {
  --suit-red: #f87171;
  --suit-black: #e5e7eb;
  --card-bg: #1e293b;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --card-border: rgba(255,255,255,0.1);
  --felt-tint: rgba(16, 185, 129, 0.06);
  --felt-tint-light: rgba(16, 185, 129, 0.02);
}
