/* ═══════════════════════════════════════════════════════════════════════════
   THE GROTTO - BRIDGE CARD GAME
   Dark Haunting Theme | Analog Distortions by Wrath
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Teko:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&family=Press+Start+2P&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ============================================ */
/* VARIABLES                                    */
/* ============================================ */
:root {
  /* Fire Accents (Primary) - matching Auto Pets */
  --fire-bright: #ff6347;
  --fire: #ff4500;
  --rust: #8b4513;
  --rust-dark: #5c2e0a;

  /* Spectral Accents (Secondary) */
  --spectral: #9370db;
  --phantom: #8a2be2;
  --necrotic: #4a0080;

  /* Blood & Crimson */
  --blood: #8b0000;
  --crimson: #dc143c;
  --blood-glow: rgba(139, 0, 0, 0.4);

  /* Ancient Gold */
  --gold: #d4af37;
  --gold-bright: #ffd700;
  --gold-dark: #b8860b;

  /* Backgrounds - deep green (casino felt) */
  --darker: #0a1a0f;
  --dark: #0e2415;
  --gray: #122e1a;
  --light-gray: #1a3d24;
  --panel: rgba(10, 26, 15, 0.95);

  /* Neutrals */
  --bone: #e8e4d9;
  --black: #020204;
  --green: #39ff14;
  --sulfur: #ffd700;
  --red-warn: #ff4444;
  --purple: #9370db;
  --ember: #ff8c42;

  /* Glows */
  --glow-fire: 0 0 10px var(--fire-bright), 0 0 20px var(--fire);
  --glow-spectral: 0 0 10px var(--spectral), 0 0 20px var(--phantom);
  --glow-gold: 0 0 10px var(--gold), 0 0 20px var(--gold-dark);
  --glow-blood: 0 0 10px var(--crimson), 0 0 20px var(--blood);

  /* Shadows & Radii */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(255, 69, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --card-w: 72px;
  --card-h: 102px;
}

/* ============================================ */
/* RESET & BASE                                 */
/* ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--darker);
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  -webkit-font-smoothing: antialiased;
}

/* Custom cursor */
* { cursor: none; }
a, button, input, select, textarea, [role="button"], [onclick] { cursor: none !important; }

@media (pointer: coarse), (hover: none) {
  * { cursor: auto !important; }
  a, button, input, select, textarea, [role="button"], [onclick] { cursor: pointer !important; }
  #cursor, #cursor-aura { display: none !important; }
}

#cursor {
  position: fixed;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid var(--fire-bright);
  pointer-events: none;
  z-index: 99999;
  transform: translate(-30%, -15%) rotate(-35deg);
  filter: drop-shadow(0 0 6px var(--sulfur)) drop-shadow(0 0 12px var(--fire-bright)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
  transition: transform 0.05s ease-out;
  animation: cursor-glitch 3s infinite, cursor-flicker 0.15s infinite;
  will-change: transform;
}

#cursor::after {
  content: '';
  position: absolute;
  top: 6px; left: -2px;
  width: 0; height: 0;
  border-left: 2px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid var(--sulfur);
  opacity: 0.6;
  filter: drop-shadow(0 0 3px var(--sulfur));
}

#cursor-aura {
  position: fixed;
  width: 40px; height: 40px;
  background: radial-gradient(ellipse at 30% 30%, rgba(255, 102, 0, 0.3) 0%, rgba(255, 204, 0, 0.1) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  animation: aura-pulse 1.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes cursor-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.97; }
  87% { opacity: 0.94; }
}

@keyframes cursor-glitch {
  0%, 100% { transform: translate(-30%, -15%) rotate(-35deg); }
  7% { transform: translate(-32%, -15%) rotate(-35deg) skewX(5deg); }
  8% { transform: translate(-28%, -15%) rotate(-33deg) skewX(-3deg); }
  9% { transform: translate(-30%, -15%) rotate(-35deg); }
}

@keyframes aura-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.2; }
}

/* ============================================ */
/* BACKGROUND EFFECTS                           */
/* ============================================ */
#bg-darkness {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(8, 18, 12, 0.7) 0%, rgba(8, 18, 12, 1) 70%);
  z-index: 0;
}

#fog-layer {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(139, 0, 0, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 69, 0, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(147, 112, 219, 0.03) 0%, transparent 60%);
  animation: fog-drift 20s ease-in-out infinite alternate;
  z-index: 1;
  pointer-events: none;
}

@keyframes fog-drift {
  0% { opacity: 0.6; transform: scale(1) translateX(0); }
  100% { opacity: 1; transform: scale(1.05) translateX(-20px); }
}

#particles {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px; height: 2px;
  background: var(--fire-bright);
  border-radius: 50%;
  animation: particle-float linear infinite;
  box-shadow: 0 0 4px var(--fire-bright);
}
.particle:nth-child(odd) { background: var(--spectral); box-shadow: 0 0 4px var(--spectral); }
.particle:nth-child(3n) { background: var(--crimson); box-shadow: 0 0 4px var(--crimson); width: 1px; height: 1px; }

@keyframes particle-float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Scanlines */
#scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
  z-index: 9998;
}

/* ============================================ */
/* SCREENS                                      */
/* ============================================ */
.screen {
  position: fixed; inset: 0;
  display: none;
  z-index: 10;
}
.screen.active { display: flex; }

/* ============================================ */
/* MAIN MENU                                    */
/* ============================================ */
#screen-menu {
  align-items: center;
  justify-content: center;
}

.menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
  max-width: 700px;
  width: 100%;
  z-index: 10;
}

.game-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: linear-gradient(90deg, rgba(255, 69, 0, 0.1), rgba(147, 112, 219, 0.1));
  border: 1px solid rgba(255, 69, 0, 0.3);
  border-radius: 20px;
  font-family: 'Teko', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--fire-bright);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.glitch-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(180deg, var(--fire-bright) 0%, var(--fire) 50%, var(--rust) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.5)) drop-shadow(0 4px 8px rgba(0,0,0,0.8));
  animation: title-pulse 4s ease-in-out infinite;
  line-height: 1.1;
}

@keyframes title-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 69, 0, 0.5)) drop-shadow(0 4px 8px rgba(0,0,0,0.8)); }
  50% { filter: drop-shadow(0 0 30px rgba(255, 69, 0, 0.7)) drop-shadow(0 4px 8px rgba(0,0,0,0.8)); }
}

.subtitle {
  font-family: 'Teko', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--spectral);
  letter-spacing: 8px;
  text-shadow: 0 0 15px var(--spectral);
  text-transform: uppercase;
}

/* Profile Bar */
.profile-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(15, 30, 20, 0.9), rgba(8, 18, 12, 0.95));
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.profile-icon {
  font-size: 1.4rem;
  color: var(--gold);
  text-shadow: var(--glow-gold);
}

.profile-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--fire-bright);
  letter-spacing: 1px;
}

.profile-stats {
  display: flex;
  gap: 16px;
  flex: 1;
  justify-content: center;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mini-stat-val {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--gold);
}

.mini-stat-label {
  font-size: 0.45rem;
  color: #555;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--fire), var(--rust));
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--darker);
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-wallet:hover {
  box-shadow: var(--glow-fire);
  transform: translateY(-1px);
}

.btn-wallet.connected {
  background: linear-gradient(135deg, var(--green), #009955);
}

.wallet-icon-text { font-size: 0.7rem; }

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px;
  background: linear-gradient(145deg, var(--gray), var(--darker));
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.menu-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 99, 71, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-btn:hover::before { opacity: 1; }

.menu-btn:hover {
  border-color: var(--fire);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 69, 0, 0.15);
}

.menu-btn.primary:hover { border-color: var(--fire-bright); box-shadow: 0 4px 20px rgba(255, 99, 71, 0.2); }
.menu-btn.secondary:hover { border-color: var(--spectral); box-shadow: 0 4px 20px rgba(147, 112, 219, 0.2); }
.menu-btn.accent:hover { border-color: var(--gold); box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2); }
.menu-btn.dark:hover { border-color: var(--crimson); box-shadow: 0 4px 20px rgba(220, 20, 60, 0.2); }

.menu-btn-icon {
  font-size: 2rem;
  color: var(--fire);
  text-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}

.menu-btn.primary .menu-btn-icon { color: var(--fire-bright); }
.menu-btn.secondary .menu-btn-icon { color: var(--spectral); }
.menu-btn.accent .menu-btn-icon { color: var(--gold); text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
.menu-btn.dark .menu-btn-icon { color: var(--crimson); text-shadow: 0 0 10px rgba(220, 20, 60, 0.5); }

.menu-btn-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--bone);
  letter-spacing: 1px;
}

.menu-btn-desc {
  font-size: 0.6rem;
  color: #666;
  line-height: 1.4;
}

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

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 50%;
  color: #666;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
  box-shadow: 0 0 15px rgba(255, 99, 71, 0.2);
}

/* Footer */
.site-footer {
  font-family: 'Teko', sans-serif;
  font-size: 0.5rem;
  color: #444;
  letter-spacing: 2px;
}

.site-footer a {
  color: var(--fire);
  text-decoration: none;
  transition: color 0.3s;
}

.site-footer a:hover { color: var(--fire-bright); }

.site-footer .nav-dropdown { display: inline-block; position: relative; }
.site-footer .nav-dropdown-btn {
  font-family: 'Teko', sans-serif;
  font-size: inherit;
  color: var(--fire);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 2px;
  transition: color 0.3s;
}
.site-footer .nav-dropdown-btn:hover { color: var(--fire-bright); }
.site-footer .nav-dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(10, 10, 18, 0.95);
  border: 1px solid rgba(139, 0, 0, 0.4);
  border-radius: 8px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  z-index: 200;
  min-width: 120px;
}
.site-footer .nav-dropdown.open .nav-dropdown-menu { display: flex; }
.site-footer .nav-dropdown-menu a {
  display: block;
  padding: 6px 10px;
  color: #888;
  text-decoration: none;
  font-size: 0.6rem;
  white-space: nowrap;
  text-align: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.site-footer .nav-dropdown-menu a:hover {
  color: var(--fire-bright);
  background: rgba(255, 99, 71, 0.05);
}

/* ============================================ */
/* GAME SCREEN                                  */
/* ============================================ */
#screen-game {
  flex-direction: column;
}

.game-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

/* HUD */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(10, 26, 15, 0.92);
  border-bottom: 1px solid rgba(196, 80, 48, 0.3);
  z-index: 20;
  flex-shrink: 0;
}

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

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn-sm {
  padding: 5px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #aaa;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.btn-sm:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
}

.hud-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #aaa;
  letter-spacing: 1px;
}

.hud-seat-indicator {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--fire-bright, #ff6a00);
  background: rgba(255, 106, 0, 0.1);
  border: 1px solid rgba(255, 106, 0, 0.3);
  border-radius: 3px;
  padding: 2px 6px;
  letter-spacing: 1px;
}

.hud-contract {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.contract-suit {
  font-family: 'JetBrains Mono', serif;
  font-size: 1.1rem;
  vertical-align: -1px;
}
.suit-symbol-H { color: #ff3344; }
.suit-symbol-D { color: #ff6633; }
.suit-symbol-S, .suit-symbol-C { color: #ccccd8; }

.hud-dealer, .hud-vuln {
  font-size: 0.55rem;
  color: #aaa;
}

.hud-vuln { color: var(--crimson); }

.hud-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.score-label {
  font-size: 0.45rem;
  color: #bbb;
  letter-spacing: 1px;
}

.score-val {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--fire-bright);
}

.hud-score.my-team {
  background: rgba(255, 106, 0, 0.08);
  border: 1px solid rgba(255, 106, 0, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
}

.hud-score.my-team .score-label {
  color: var(--fire-bright, #ff6a00);
  font-weight: 700;
}

.hud-hand-num {
  font-size: 0.5rem;
  color: #999;
}

/* Sound Toggle */
.sound-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: 50%;
  font-size: 0.9rem;
  color: #aaa;
  transition: all 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.sound-toggle:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
  box-shadow: 0 0 12px rgba(255, 99, 71, 0.2);
  background: rgba(255, 69, 0, 0.05);
}

/* ============================================ */
/* BRIDGE TABLE                                 */
/* ============================================ */
.bridge-table {
  flex: 1;
  display: grid;
  grid-template-areas:
    "west north east"
    "west center east"
    "west south east";
  grid-template-columns: minmax(60px, 0.8fr) 2.4fr minmax(60px, 0.8fr);
  grid-template-rows: auto 1fr auto;
  gap: 2px;
  padding: 6px 8px;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Seats */
.seat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.seat-north { grid-area: north; }
.seat-south { grid-area: south; }
.seat-west { grid-area: west; grid-row: 1 / 4; justify-content: center; overflow: hidden; }
.seat-east { grid-area: east; grid-row: 1 / 4; justify-content: center; overflow: hidden; }

.seat-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.seat-name {
  font-family: 'Teko', sans-serif;
  font-size: 0.7rem;
  color: #ccc;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.seat-badge {
  font-size: 0.5rem;
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 3px;
}

.seat-badge.declarer {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-dark);
  color: var(--gold);
}

.seat-badge.dummy {
  background: rgba(255, 69, 0, 0.1);
  border: 1px solid var(--rust);
  color: var(--fire);
}

/* Active turn indicator */
.seat.active-turn .seat-name {
  color: var(--fire-bright);
  text-shadow: 0 0 10px rgba(255, 99, 71, 0.5);
  animation: turn-pulse 1.5s ease-in-out infinite;
}

@keyframes turn-pulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 99, 71, 0.3); }
  50% { text-shadow: 0 0 20px rgba(255, 99, 71, 0.7); }
}

/* ============================================ */
/* CARDS                                        */
/* ============================================ */
.hand {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  min-height: 0;
  padding: 2px;
}

.hand-north, .hand-south {
  flex-direction: row;
}

.hand-west, .hand-east {
  flex-direction: column;
  min-height: 0;
  align-items: center;
}

/* Vertical hands: corners already visible through overlap with absolute positioning */

.playing-card {
  width: var(--card-w);
  height: var(--card-h);
  background: linear-gradient(145deg, #e8e0d0, #d4cbb8);
  border: 1.5px solid rgba(139, 0, 0, 0.4);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, margin 0.15s ease;
  flex-shrink: 0;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 4px rgba(139, 0, 0, 0.15);
  overflow: hidden;
}

/* Corner labels */
.card-corner {
  position: absolute;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  pointer-events: none;
}
.card-corner-tl { top: 3px; left: 4px; }
.card-corner-br { bottom: 3px; right: 4px; transform: rotate(180deg); }

/* Card body — fills the middle area */
.card-body {
  position: absolute;
  top: 16px; bottom: 16px; left: 6px; right: 6px;
  pointer-events: none;
}

/* Pips for number cards */
.card-pip {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  line-height: 1;
}

/* Ace — big centered symbol */
.card-ace-pip {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Face card art */
.card-face-art {
  position: absolute;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.card-face-label {
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.7;
}

/* Face card horror accents — subtle gradient overlay */
.playing-card.suit-S .card-face-art,
.playing-card.suit-C .card-face-art {
  text-shadow: 0 0 8px rgba(20, 20, 40, 0.4);
}
.playing-card.suit-H .card-face-art,
.playing-card.suit-D .card-face-art {
  text-shadow: 0 0 8px rgba(180, 0, 30, 0.3);
}

/* Overlap cards in hand */
.hand-south .playing-card { margin-left: -20px; }
.hand-south .playing-card:first-child { margin-left: 0; }
.hand-north .playing-card { margin-left: -20px; }
.hand-north .playing-card:first-child { margin-left: 0; }

.hand-west .playing-card { margin-top: -72px; }
.hand-west .playing-card:first-child { margin-top: 0; }
.hand-east .playing-card { margin-top: -72px; }
.hand-east .playing-card:first-child { margin-top: 0; }

/* ============================================ */
/* DUMMY HAND - Traditional Bridge Layout       */
/* ============================================ */
.dummy-layout {
  flex-direction: column !important;
  align-items: center;
  gap: 2px;
  padding: 4px;
}

.dummy-suit-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.dummy-suit-label {
  font-size: 1.5rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.dummy-suit-label.suit-S, .dummy-suit-label.suit-C {
  color: #ccccd8;
}

.dummy-suit-label.suit-H {
  color: #ff3344;
}

.dummy-suit-label.suit-D {
  color: #ff6633;
}

.dummy-card {
  width: 42px;
  height: 42px;
  background: linear-gradient(145deg, #e8e0d0, #d4cbb8);
  border: 1.5px solid rgba(139, 0, 0, 0.35);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  cursor: default;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.dummy-card.suit-S, .dummy-card.suit-C {
  color: #1a1a2e;
}

.dummy-card.suit-H {
  color: #cc0022;
  border-color: rgba(139, 0, 0, 0.35);
}

.dummy-card.suit-D {
  color: #cc0022;
  border-color: rgba(139, 0, 0, 0.35);
}

.dummy-card.face-rank {
  font-size: 0.5rem;
  letter-spacing: 0.3px;
}

.dummy-card.playable {
  cursor: pointer;
  border-color: rgba(0, 255, 127, 0.6);
  box-shadow: 0 0 8px rgba(0, 255, 127, 0.3);
}

.dummy-card.playable:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(0, 255, 127, 0.5);
}

/* East/West dummy: rotate layout to horizontal suit columns */
.hand-east.dummy-layout,
.hand-west.dummy-layout {
  flex-direction: row !important;
  gap: 2px;
}

.hand-east.dummy-layout .dummy-suit-row,
.hand-west.dummy-layout .dummy-suit-row {
  flex-direction: column;
}

.hand-east.dummy-layout .dummy-suit-label,
.hand-west.dummy-layout .dummy-suit-label {
  font-size: 1.1rem;
  width: auto;
  height: 22px;
}

.hand-east.dummy-layout .dummy-card,
.hand-west.dummy-layout .dummy-card {
  width: 30px;
  height: 30px;
  font-size: 0.8rem;
}

/* Suit colors */
.playing-card.suit-S, .playing-card.suit-C {
  color: #1a1a2e;
}

.playing-card.suit-H {
  color: #cc0022;
  border-color: rgba(139, 0, 0, 0.4);
}

.playing-card.suit-D {
  color: #cc0022;
  border-color: rgba(139, 0, 0, 0.4);
}

/* Playable cards */
.playing-card.playable {
  border-color: rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.25), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.playing-card.playable:hover {
  animation: none;
  transform: translateY(-10px);
  border-color: var(--green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4), 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 10;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Card back */
.playing-card.face-down {
  background: linear-gradient(145deg, #1a1525, #0e0e18);
  border-color: rgba(139, 0, 0, 0.5);
  color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(139, 0, 0, 0.1);
}

.playing-card.face-down::after {
  content: '\2666';
  position: absolute;
  font-size: 1.2rem;
  color: rgba(139, 0, 0, 0.5);
  text-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
}

/* Card played animation */
.playing-card.card-played {
  animation: card-play 0.3s ease-out;
}

@keyframes card-play {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================ */
/* PLAY AREA (center)                           */
/* ============================================ */
.play-area {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Mini compass showing absolute seat positions in the play area */
.mini-compass {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  opacity: 0.5;
  z-index: 5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.4rem;
  pointer-events: none;
}

.mini-compass span {
  position: absolute;
  color: #666;
  font-weight: 500;
}

.mini-compass .compass-n { top: 0; left: 50%; transform: translateX(-50%); }
.mini-compass .compass-s { bottom: 0; left: 50%; transform: translateX(-50%); }
.mini-compass .compass-w { top: 50%; left: 0; transform: translateY(-50%); }
.mini-compass .compass-e { top: 50%; right: 0; transform: translateY(-50%); }

.mini-compass .compass-you {
  color: var(--fire-bright, #ff6a00);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(255, 106, 0, 0.4);
}

.trick-cards {
  position: relative;
  width: 180px;
  height: 170px;
}

.trick-card {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trick-north { top: 0; left: 50%; transform: translateX(-50%); }
.trick-south { bottom: 0; left: 50%; transform: translateX(-50%); }
.trick-west { top: 50%; left: 0; transform: translateY(-50%); }
.trick-east { top: 50%; right: 0; transform: translateY(-50%); }

.trick-count {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
}

.tc-ns { color: var(--fire); }
.tc-ew { color: var(--spectral); }
.tc-ns b, .tc-ew b { font-size: 0.6rem; }

/* ============================================ */
/* BIDDING PANEL                                */
/* ============================================ */
.bidding-panel {
  position: absolute;
  bottom: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: 420px;
  max-width: 90vw;
  background: linear-gradient(145deg, rgba(15, 30, 20, 0.97), rgba(8, 18, 12, 0.98));
  border: 1px solid rgba(255, 69, 0, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  z-index: 30;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 69, 0, 0.12);
  animation: bidding-appear 0.3s ease-out;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@keyframes bidding-appear {
  0% { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
}

.bidding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bidding-header h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--fire-bright);
  letter-spacing: 2px;
}

.bidding-turn {
  font-size: 0.55rem;
  color: var(--gold);
}

/* Bidding History */
.bidding-history {
  background: rgba(8, 18, 12, 0.6);
  border: 1px solid rgba(255, 69, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 10px;
  max-height: 80px;
  overflow-y: auto;
}

.bid-history-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-size: 0.6rem;
  color: #aaa;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.bid-header-you {
  color: var(--fire-bright, #ff6a00);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(255, 106, 0, 0.4);
}

.bid-history-body {
  font-size: 0.65rem;
}

.bid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  padding: 2px 0;
}

.bid-cell { color: #bbb; }
.bid-cell.pass { color: #888; }
.bid-cell.suit-H { color: #ff3344; }
.bid-cell.suit-D { color: #ff6633; }
.bid-cell.suit-S { color: #ccccd8; }
.bid-cell.suit-C { color: var(--green); }
.bid-cell.suit-NT { color: var(--gold); }
.bid-cell.dbl { color: var(--crimson); font-weight: 700; }
.bid-cell.rdbl { color: var(--fire-bright); font-weight: 700; }

/* Bidding Controls */
.bidding-controls { display: flex; flex-direction: column; gap: 6px; }

.bid-level-row, .bid-suit-row, .bid-action-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.bid-level-btn {
  width: 38px; height: 32px;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: 4px;
  color: #bbb;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  transition: all 0.2s ease;
}

.bid-level-btn:hover { border-color: var(--fire); color: var(--fire-bright); }
.bid-level-btn.active { background: var(--rust); border-color: var(--fire-bright); color: var(--bone); box-shadow: 0 0 10px rgba(255, 99, 71, 0.2); }

.bid-suit-btn {
  width: 52px; height: 38px;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 4px;
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.bid-suit-btn:hover { border-color: var(--fire); transform: translateY(-2px); }
.bid-suit-btn.active { background: var(--rust); border-color: var(--fire-bright); box-shadow: 0 0 10px rgba(255, 99, 71, 0.2); }

.suit-c { color: var(--green); }
.suit-d { color: #ff6633; }
.suit-h { color: #ff3344; }
.suit-s { color: #ccccd8; }
.suit-nt { color: var(--gold); font-family: 'Press Start 2P', monospace; font-size: 0.55rem; }

.bid-action-btn {
  padding: 6px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  border: 1px solid;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.bid-pass { color: #aaa; border-color: #555; background: rgba(15, 30, 20, 0.8); }
.bid-pass:hover { color: var(--bone); border-color: #999; }

.bid-double { color: var(--crimson); border-color: rgba(220, 20, 60, 0.3); background: rgba(15, 30, 20, 0.8); }
.bid-double:hover:not(:disabled) { border-color: var(--crimson); box-shadow: 0 0 10px rgba(220, 20, 60, 0.2); }

.bid-redouble { color: var(--fire-bright); border-color: rgba(255, 99, 71, 0.3); background: rgba(15, 30, 20, 0.8); }
.bid-redouble:hover:not(:disabled) { border-color: var(--fire-bright); box-shadow: 0 0 10px rgba(255, 99, 71, 0.2); }

.bid-confirm { color: var(--darker); background: linear-gradient(135deg, var(--fire), var(--rust)); border-color: var(--fire); }
.bid-confirm:hover { box-shadow: var(--glow-fire); }

.bid-action-btn:disabled { opacity: 0.3; }

/* Compact mode: when it's NOT player's turn, shrink to just history in corner */
.bidding-panel.bidding-compact {
  top: auto;
  bottom: 8px;
  left: auto;
  right: 8px;
  transform: none;
  width: 240px;
  max-width: 40vw;
  padding: 10px 12px;
  opacity: 0.75;
  animation: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.bidding-panel.bidding-compact .bidding-header h3 {
  font-size: 0.4rem;
}

.bidding-panel.bidding-compact .bidding-turn {
  font-size: 0.4rem;
}

.bidding-panel.bidding-compact .bidding-history {
  max-height: 60px;
  margin-bottom: 0;
}

.bidding-panel.hidden { display: none; }

/* ============================================ */
/* GAME MESSAGE                                 */
/* ============================================ */
.game-message {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, rgba(15, 30, 20, 0.98), rgba(8, 18, 12, 0.99));
  border: 2px solid var(--fire-bright);
  border-radius: var(--radius-lg);
  padding: 30px 40px;
  text-align: center;
  z-index: 50;
  box-shadow: 0 0 40px rgba(255, 99, 71, 0.2);
  animation: msg-appear 0.3s ease-out;
}

.game-message.hidden { display: none; }

.game-message-text {
  font-family: 'Teko', sans-serif;
  font-size: 1rem;
  color: var(--bone);
  margin-bottom: 16px;
  line-height: 1.6;
}

@keyframes msg-appear {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============================================ */
/* MODALS                                       */
/* ============================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.modal-box {
  position: relative;
  background: linear-gradient(180deg, rgba(55, 40, 30, 0.98) 0%, rgba(28, 20, 14, 0.99) 100%);
  border: 2px solid var(--rust);
  box-shadow: 0 8px 50px rgba(255, 100, 50, 0.25);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(255, 69, 0, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: modal-enter 0.3s ease-out;
}

@keyframes modal-enter {
  0% { transform: scale(0.95) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.5rem;
  color: #555;
  background: none;
  border: none;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover { color: var(--fire-bright); text-shadow: 0 0 10px var(--fire-bright); }

.modal-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: var(--fire-bright);
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 20px;
}

/* ============================================ */
/* RESULT MODAL                                 */
/* ============================================ */
.result-box { text-align: center; }

.result-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.result-title.made {
  color: var(--green);
  text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

.result-title.down {
  color: var(--crimson);
  text-shadow: 0 0 20px rgba(220, 20, 60, 0.4);
}

.result-details, .result-running {
  margin-bottom: 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.result-row span:first-child { color: #888; }
.result-row span:last-child { color: var(--bone); font-weight: 600; }

.result-highlight span:last-child {
  color: var(--gold);
  font-size: 0.85rem;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* ============================================ */
/* MULTIPLAYER                                  */
/* ============================================ */
.mp-section.hidden { display: none; }

.mp-btn { width: 100%; margin-bottom: 10px; }

.mp-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--fire);
  margin-bottom: 16px;
  text-align: center;
}

.mp-desc {
  font-size: 0.7rem;
  color: #666;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
}

.mp-field {
  margin-bottom: 14px;
}

.mp-field label {
  display: block;
  font-size: 0.55rem;
  color: #888;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.mp-field input, .mp-field select {
  width: 100%;
  padding: 10px 14px;
  background: var(--darker);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: var(--radius-sm);
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.mp-field input:focus, .mp-field select:focus {
  outline: none;
  border-color: var(--fire-bright);
  box-shadow: 0 0 15px rgba(255, 99, 71, 0.2);
}

/* Room code display */
.room-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(8, 18, 12, 0.6);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.room-code-label {
  font-size: 0.5rem;
  color: #555;
  letter-spacing: 1px;
}

.room-code-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  color: var(--fire-bright);
  letter-spacing: 6px;
  text-shadow: 0 0 10px rgba(255, 99, 71, 0.4);
}

.btn-copy {
  padding: 4px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #888;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.btn-copy:hover { color: var(--fire-bright); border-color: var(--fire); }

/* Lobby Share */
.lobby-share {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0;
}

.btn-share {
  padding: 6px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #bbb;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: 4px;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.btn-share:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.15);
}

.btn-share-twitter {
  color: #1da1f2;
  border-color: rgba(29, 161, 242, 0.3);
}

.btn-share-twitter:hover {
  color: #fff;
  background: rgba(29, 161, 242, 0.15);
  border-color: #1da1f2;
  box-shadow: 0 0 10px rgba(29, 161, 242, 0.2);
}

/* Lobby */
.lobby-seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.lobby-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: rgba(8, 18, 12, 0.6);
  border: 1px solid rgba(255, 69, 0, 0.1);
  border-radius: var(--radius-sm);
}

.lobby-seat.occupied { border-color: rgba(57, 255, 20, 0.3); }

.lobby-seat-pos {
  font-size: 0.5rem;
  color: #555;
  letter-spacing: 1px;
}

.lobby-seat-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--fire);
}

.lobby-seat-name.waiting { color: #444; font-style: italic; }

.lobby-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  animation: lobby-pulse 2s ease-in-out infinite;
}

.lobby-status.ready {
  background: rgba(57, 255, 20, 0.05);
  border-color: rgba(57, 255, 20, 0.3);
  animation: none;
}

@keyframes lobby-pulse {
  0%, 100% { border-color: rgba(212, 175, 55, 0.2); }
  50% { border-color: rgba(212, 175, 55, 0.5); }
}

.lobby-status-icon {
  font-size: 1rem;
  animation: spin-slow 2s linear infinite;
}

.lobby-status.ready .lobby-status-icon { animation: none; }

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.lobby-status-text {
  font-size: 0.6rem;
  color: var(--gold);
}

.lobby-status.ready .lobby-status-text { color: var(--green); }

.lobby-fill-ai {
  text-align: center;
  margin-bottom: 12px;
  font-size: 0.65rem;
  color: #888;
}

.lobby-fill-ai input { margin-right: 6px; }

/* ============================================ */
/* LEADERBOARD                                  */
/* ============================================ */
/* Game selector tabs */
.lb-game-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  justify-content: center;
}

.lb-game-tab {
  padding: 8px 18px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #555;
  background: rgba(15, 30, 20, 0.6);
  border: 1px solid rgba(255, 69, 0, 0.1);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.lb-game-tab:hover { color: var(--fire); border-color: rgba(255, 69, 0, 0.3); }

.lb-game-tab.active {
  color: var(--bone);
  background: linear-gradient(135deg, var(--rust), var(--rust-dark));
  border-color: var(--fire);
  box-shadow: 0 0 12px rgba(255, 69, 0, 0.15);
}

/* Sort tabs */
.lb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  justify-content: center;
}

.lb-tab {
  padding: 6px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #555;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.1);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.lb-tab:hover { color: var(--fire); border-color: rgba(255, 69, 0, 0.3); }

.lb-tab.active {
  color: var(--fire-bright);
  background: var(--rust);
  border-color: var(--fire-bright);
}

.lb-list { min-height: 200px; }

.lb-loading {
  text-align: center;
  padding: 40px;
  color: #555;
  font-size: 0.7rem;
}

.lb-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}

.lb-entry:hover { background: rgba(255, 69, 0, 0.03); }

.lb-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #555;
  width: 30px;
  text-align: center;
}

.lb-entry:nth-child(1) .lb-rank { color: var(--gold); text-shadow: 0 0 8px rgba(212, 175, 55, 0.4); }
.lb-entry:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-entry:nth-child(3) .lb-rank { color: #cd7f32; }

.lb-name {
  flex: 1;
  font-size: 0.7rem;
  color: var(--bone);
}

.lb-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--fire-bright);
}

/* ============================================ */
/* SHOP                                         */
/* ============================================ */
.shop-coming-soon {
  text-align: center;
  padding: 20px 0;
}

.shop-icon {
  font-size: 3rem;
  color: var(--crimson);
  text-shadow: var(--glow-blood);
  margin-bottom: 12px;
  animation: shop-pulse 3s ease-in-out infinite;
}

@keyframes shop-pulse {
  0%, 100% { text-shadow: 0 0 10px rgba(220, 20, 60, 0.3); }
  50% { text-shadow: 0 0 30px rgba(220, 20, 60, 0.6); }
}

.shop-coming-soon h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.shop-coming-soon p {
  font-size: 0.7rem;
  color: #888;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 20px;
}

.shop-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.shop-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.shop-preview-item span {
  font-size: 0.5rem;
  color: #666;
}

.preview-card-back {
  width: 60px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 6px;
  border: 1px solid;
  transition: all 0.3s ease;
}

.preview-card-back:hover { transform: translateY(-4px); }

.back-blood {
  background: linear-gradient(145deg, #1a0505, #0a0000);
  border-color: rgba(139, 0, 0, 0.5);
  color: rgba(220, 20, 60, 0.6);
  box-shadow: inset 0 0 15px rgba(139, 0, 0, 0.2);
}

.back-void {
  background: linear-gradient(145deg, #05020a, #000205);
  border-color: rgba(147, 112, 219, 0.3);
  color: rgba(147, 112, 219, 0.6);
  box-shadow: inset 0 0 15px rgba(147, 112, 219, 0.1);
}

.back-cyber {
  background: linear-gradient(145deg, #150a05, #0a0500);
  border-color: rgba(255, 99, 71, 0.3);
  color: rgba(255, 99, 71, 0.6);
  box-shadow: inset 0 0 15px rgba(255, 99, 71, 0.1);
}

.back-grotto {
  background: linear-gradient(145deg, #151005, #0a0800);
  border-color: rgba(212, 175, 55, 0.4);
  color: rgba(212, 175, 55, 0.6);
  box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.1);
}

.shop-note {
  font-size: 0.6rem !important;
  color: #555 !important;
}

/* ============================================ */
/* PROFILE MODAL                                */
/* ============================================ */
.profile-section {
  margin-bottom: 20px;
}

.profile-label {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: #555;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

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

.profile-input-row input {
  flex: 1;
  padding: 10px 14px;
  background: var(--darker);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: var(--radius-sm);
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.profile-input-row input:focus {
  outline: none;
  border-color: var(--fire-bright);
  box-shadow: 0 0 15px rgba(255, 99, 71, 0.2);
}

.profile-wallet-status {
  font-size: 0.7rem;
  color: #555;
  margin-bottom: 10px;
  word-break: break-all;
}

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

.ps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  background: rgba(8, 18, 12, 0.6);
  border: 1px solid rgba(255, 69, 0, 0.08);
  border-radius: var(--radius-sm);
}

.ps-val {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--fire-bright);
}

.ps-lab {
  font-size: 0.5rem;
  color: #555;
  text-align: center;
}

/* ============================================ */
/* WALLET MODAL                                 */
/* ============================================ */
.wallet-desc {
  text-align: center;
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wallet-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.wallet-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.15);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.wallet-option:hover {
  border-color: var(--fire);
  background: rgba(255, 69, 0, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 69, 0, 0.1);
}

.wo-icon { font-size: 1.8rem; }

.wo-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--bone);
}

.wallet-connected {
  text-align: center;
  padding: 16px;
  background: rgba(57, 255, 20, 0.05);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: var(--radius-md);
}

.wallet-connected.hidden { display: none; }

.wc-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--green);
  margin-bottom: 10px;
  word-break: break-all;
}

/* ============================================ */
/* RULES MODAL                                  */
/* ============================================ */
.rules-content {
  max-height: 60vh;
  overflow-y: auto;
}

.rules-section {
  margin-bottom: 16px;
}

.rules-section h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--fire);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.rules-section p {
  font-size: 0.7rem;
  color: #999;
  line-height: 1.7;
  margin-bottom: 6px;
}

/* ============================================ */
/* BUTTONS (shared)                             */
/* ============================================ */
.btn-fire {
  padding: 12px 30px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: #fff;
  background: linear-gradient(180deg, #8b0000 0%, #660000 40%, #4a0000 100%);
  border: 2px solid var(--crimson);
  border-radius: 5px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4), 0 0 40px rgba(220, 20, 60, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-fire::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: fire-shine 2s ease-in-out infinite;
}

@keyframes fire-shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.btn-fire:hover {
  transform: translateY(-3px) scale(1.02);
  background: linear-gradient(180deg, #a50000 0%, #7a0000 40%, #5a0000 100%);
  box-shadow: 0 8px 30px rgba(139, 0, 0, 0.5), 0 0 50px rgba(220, 20, 60, 0.3);
}

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

.btn-secondary {
  padding: 8px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: #888;
  background: var(--gray);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  color: var(--bone);
  border-color: var(--fire);
}

/* ============================================ */
/* TOAST NOTIFICATIONS                          */
/* ============================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(25, 15, 20, 0.95), rgba(8, 18, 12, 0.98));
  border: 1px solid rgba(255, 69, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  color: var(--bone);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s ease-out;
  max-width: 300px;
}

.toast.error { border-color: rgba(220, 20, 60, 0.5); }
.toast.success { border-color: rgba(57, 255, 20, 0.5); }

.toast.removing { animation: toast-out 0.3s ease-in forwards; }

@keyframes toast-in {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* ============================================ */
/* LOADING SCREEN                              */
/* ============================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--darker);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-suits {
  display: flex;
  gap: 16px;
  font-size: 2.5rem;
}

.loading-suit {
  animation: loading-suit-bounce 1.2s ease-in-out infinite;
  opacity: 0;
}

.ls-1 { color: var(--fire-bright); animation-delay: 0s; }
.ls-2 { color: var(--crimson); animation-delay: 0.15s; }
.ls-3 { color: var(--gold); animation-delay: 0.3s; }
.ls-4 { color: var(--spectral); animation-delay: 0.45s; }

@keyframes loading-suit-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-12px); opacity: 1; }
}

.loading-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  color: var(--fire-bright);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 69, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fire), var(--fire-bright));
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--fire-bright);
}

/* ============================================ */
/* AI THINKING INDICATOR                       */
/* ============================================ */
.ai-thinking {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: rgba(15, 8, 20, 0.9);
  border: 1px solid rgba(255, 69, 0, 0.2);
  border-radius: 20px;
  z-index: 25;
  animation: thinking-appear 0.2s ease-out;
}

.ai-thinking.hidden { display: none; }

.ai-thinking-dots {
  display: flex;
  gap: 4px;
}

.ai-thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--fire);
  border-radius: 50%;
  animation: thinking-dot 1.2s ease-in-out infinite;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes thinking-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ai-thinking-text {
  font-size: 0.55rem;
  color: var(--fire);
  letter-spacing: 1px;
}

/* ============================================ */
/* HCP DISPLAY                                 */
/* ============================================ */
.hcp-display {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--gold);
  padding: 2px 6px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 3px;
}

/* ============================================ */
/* LAST TRICK BUTTON                           */
/* ============================================ */
.btn-last-trick {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 5px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #aaa;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: var(--radius-sm);
  z-index: 20;
  transition: all 0.3s ease;
}

.btn-last-trick:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
}

.btn-last-trick.hidden { display: none; }

/* Last Trick Modal */
.last-trick-box {
  max-width: 400px;
  text-align: center;
}

.last-trick-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.last-trick-cards .playing-card {
  margin: 0 !important;
}

.last-trick-winner {
  font-family: 'Teko', sans-serif;
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 8px;
}

/* ============================================ */
/* YOUR TURN FLASH                             */
/* ============================================ */
.your-turn-flash {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--fire-bright);
  text-shadow: 0 0 20px rgba(255, 99, 71, 0.6), 0 0 40px rgba(255, 99, 71, 0.3);
  z-index: 25;
  pointer-events: none;
  animation: your-turn-anim 1.5s ease-out forwards;
}

.your-turn-flash.hidden { display: none; }

@keyframes your-turn-anim {
  0% { opacity: 0; transform: translateX(-50%) scale(1.5); }
  20% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ============================================ */
/* MULTIPLAYER TURN TIMER                      */
/* ============================================ */
.turn-timer {
  position: absolute;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  z-index: 26;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.turn-timer.hidden { display: none; }

.timer-ring {
  position: absolute;
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 99, 71, 0.15);
  stroke-width: 3;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--fire-bright);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(255, 99, 71, 0.5));
}

.timer-ring-progress.urgent {
  stroke: #ff2200;
  filter: drop-shadow(0 0 8px rgba(255, 34, 0, 0.8));
}

.timer-seconds {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--fire-bright);
  text-shadow: 0 0 8px rgba(255, 99, 71, 0.5);
  z-index: 1;
}

.timer-seconds.urgent {
  color: #ff2200;
  text-shadow: 0 0 10px rgba(255, 34, 0, 0.7);
  animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

/* ============================================ */
/* DEALING OVERLAY                             */
/* ============================================ */
.dealing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 18, 12, 0.7);
  z-index: 35;
  animation: dealing-fade 0.3s ease;
}

.dealing-overlay.hidden { display: none; }

.dealing-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--fire);
  letter-spacing: 4px;
  animation: dealing-pulse 0.8s ease-in-out infinite;
}

@keyframes dealing-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes dealing-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================ */
/* TRICK WINNER TEXT                            */
/* ============================================ */
.trick-winner-text {
  font-family: 'Teko', sans-serif;
  font-size: 0.7rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  animation: trick-winner-appear 0.3s ease-out;
  margin-bottom: 4px;
}

.trick-winner-text.hidden { display: none; }

@keyframes trick-winner-appear {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================ */
/* QUIT DIALOG                                 */
/* ============================================ */
.quit-box {
  max-width: 380px;
  text-align: center;
}

.quit-desc {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 20px;
  line-height: 1.5;
}

.quit-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-quit-confirm {
  color: var(--crimson) !important;
  border-color: rgba(220, 20, 60, 0.3) !important;
}

.btn-quit-confirm:hover {
  border-color: var(--crimson) !important;
}

/* ============================================ */
/* KEYBOARD HINTS                              */
/* ============================================ */
kbd {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.35rem;
  color: #666;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.2;
}

/* ============================================ */
/* SCREEN TRANSITIONS                          */
/* ============================================ */
.screen {
  transition: opacity 0.3s ease;
}

.screen.active {
  animation: screen-enter 0.3s ease-out;
}

@keyframes screen-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================ */
/* ENHANCED CARD ANIMATIONS                    */
/* ============================================ */
.playing-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, margin 0.15s ease, opacity 0.2s ease;
}

/* Card deal animation */
.playing-card.dealing {
  animation: card-deal 0.3s ease-out;
}

@keyframes card-deal {
  0% { opacity: 0; transform: translateY(-30px) rotate(-5deg) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

/* Card play enhanced */
.playing-card.card-played {
  animation: card-play-enhanced 0.35s ease-out;
}

@keyframes card-play-enhanced {
  0% { transform: scale(0.6) rotate(-3deg); opacity: 0.3; }
  60% { transform: scale(1.05) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Trick collect animation */
.trick-card.collecting .playing-card {
  animation: trick-collect 0.5s ease-in forwards;
}

@keyframes trick-collect {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5) translateY(-20px); }
}

/* Playable card jiggle + glow */
.playing-card.playable {
  animation: playable-jiggle 1.8s ease-in-out infinite;
  cursor: pointer;
}

@keyframes playable-jiggle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    border-color: rgba(57, 255, 20, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 6px rgba(57, 255, 20, 0.15);
  }
  15% {
    transform: translateY(-3px) rotate(-1deg);
  }
  30% {
    transform: translateY(0) rotate(0.5deg);
    border-color: rgba(57, 255, 20, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(57, 255, 20, 0.25);
  }
  45% {
    transform: translateY(-2px) rotate(-0.5deg);
  }
  60% {
    transform: translateY(0) rotate(0deg);
    border-color: rgba(57, 255, 20, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 6px rgba(57, 255, 20, 0.15);
  }
}

/* ============================================ */
/* ENHANCED ACTIVE TURN                        */
/* ============================================ */
.seat.active-turn {
  position: relative;
}

.seat.active-turn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--fire-bright);
  box-shadow: 0 0 8px var(--fire-bright);
  border-radius: 1px;
  animation: turn-bar-pulse 1.5s ease-in-out infinite;
}

@keyframes turn-bar-pulse {
  0%, 100% { opacity: 0.5; width: 40px; }
  50% { opacity: 1; width: 60px; }
}

/* ============================================ */
/* SCROLLBAR                                    */
/* ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--darker); }
::-webkit-scrollbar-thumb { background: var(--rust); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fire); }

/* ============================================ */
/* TIPS PANEL                                   */
/* ============================================ */
.btn-tips {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 5px 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: #aaa;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: var(--radius-sm);
  z-index: 20;
  transition: all 0.3s ease;
}

.btn-tips:hover {
  color: var(--fire-bright);
  border-color: var(--fire);
}

.tips-panel {
  position: absolute;
  bottom: 36px;
  left: 8px;
  width: 280px;
  background: linear-gradient(145deg, rgba(15, 30, 20, 0.97), rgba(8, 18, 12, 0.99));
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: var(--radius-md);
  z-index: 25;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  animation: tips-slide-in 0.2s ease-out;
  overflow: hidden;
}

.tips-panel.hidden { display: none; }

@keyframes tips-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 69, 0, 0.1);
}

.tips-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--fire-bright);
  letter-spacing: 2px;
}

.tips-close {
  font-size: 1rem;
  color: #555;
  background: none;
  border: none;
  transition: color 0.2s;
  line-height: 1;
}

.tips-close:hover { color: var(--fire-bright); }

.tips-body {
  padding: 12px;
  min-height: 60px;
}

.tip-item {
  font-size: 0.65rem;
  color: #bbb;
  line-height: 1.6;
}

.tip-item b, .tip-item strong {
  color: var(--fire-bright);
}

.tips-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 12px 10px;
}

.tips-nav-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #666;
  background: rgba(15, 30, 20, 0.8);
  border: 1px solid rgba(255, 69, 0, 0.15);
  border-radius: 3px;
  transition: all 0.2s;
}

.tips-nav-btn:hover { color: var(--fire-bright); border-color: var(--fire); }

.tips-counter {
  font-size: 0.45rem;
  color: #555;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================ */
/* 16:9 ASPECT RATIO GAME CONTAINER            */
/* ============================================ */
#screen-game {
  align-items: center;
  justify-content: center;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 768px) {
  :root {
    --card-w: 56px;
    --card-h: 82px;
  }

  * { cursor: auto !important; }
  #cursor, #cursor-aura { display: none !important; }

  .glitch-text { font-size: 2.5rem; }
  .subtitle { font-size: 0.55rem; letter-spacing: 4px; }

  .menu-grid { grid-template-columns: 1fr; }

  .profile-bar {
    flex-direction: column;
    gap: 10px;
  }

  .profile-stats { gap: 10px; }

  .game-hud {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }

  .bridge-table {
    grid-template-columns: auto 2fr auto;
  }

  .bidding-panel {
    width: 95%;
    max-width: 380px;
    border-radius: var(--radius-md);
    top: 40%;
    transform: translate(-50%, -60%);
    padding: 10px 12px;
  }

  .card-corner { font-size: 0.45rem; }
  .card-pip { font-size: 0.6rem; }
  .card-ace-pip { font-size: 1.6rem; }
  .card-face-art { font-size: 1.3rem; }
  .card-face-label { font-size: 0.45rem; }
  .card-body { top: 14px; bottom: 14px; left: 4px; right: 4px; }

  .hand-south .playing-card { margin-left: -14px; }
  .hand-north .playing-card { margin-left: -14px; }
  .hand-west .playing-card { margin-top: -56px; }
  .hand-east .playing-card { margin-top: -56px; }

  .dummy-card { width: 34px; height: 34px; font-size: 0.85rem; }
  .dummy-card.face-rank { font-size: 0.42rem; }
  .dummy-suit-label { font-size: 1.2rem; width: 22px; }

  .trick-cards { width: 140px; height: 130px; }

  .shop-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }

  .wallet-options { grid-template-columns: 1fr; }

  .lobby-seats { grid-template-columns: 1fr; }

  .ai-thinking { top: 50px; }

  .your-turn-flash { bottom: 100px; font-size: 0.55rem; }
  .turn-timer { bottom: 105px; width: 38px; height: 38px; }
  .timer-ring { width: 38px; height: 38px; }
  .timer-seconds { font-size: 0.45rem; }

  .btn-last-trick { bottom: 4px; right: 4px; font-size: 0.35rem; }

  .btn-tips { bottom: 4px; left: 4px; font-size: 0.35rem; }
  .tips-panel { bottom: 30px; left: 4px; width: 240px; }

  kbd { display: none; }
}

@media (max-width: 480px) {
  :root {
    --card-w: 48px;
    --card-h: 70px;
  }

  .glitch-text { font-size: 1.8rem; }

  .hand-south .playing-card { margin-left: -14px; }
  .hand-north .playing-card { margin-left: -14px; }
  .card-corner { font-size: 0.4rem; }
  .card-pip { font-size: 0.5rem; }
  .card-ace-pip { font-size: 1.3rem; }
  .card-face-art { font-size: 1.1rem; }
  .card-face-label { font-size: 0.4rem; }
  .card-body { top: 12px; bottom: 12px; left: 3px; right: 3px; }

  .bidding-panel {
    top: 35%;
    transform: translate(-50%, -60%);
    padding: 8px 10px;
  }

  .bid-level-btn { width: 30px; height: 28px; font-size: 0.45rem; }
  .bid-suit-btn { width: 42px; height: 32px; font-size: 1rem; }
  .bid-action-btn { padding: 6px 10px; font-size: 0.4rem; }

  .your-turn-flash { bottom: 80px; font-size: 0.45rem; }
  .turn-timer { bottom: 85px; width: 34px; height: 34px; }
  .timer-ring { width: 34px; height: 34px; }
  .timer-seconds { font-size: 0.4rem; }

  .dummy-card { width: 30px; height: 30px; font-size: 0.75rem; border-radius: 3px; }
  .dummy-card.face-rank { font-size: 0.38rem; }
  .dummy-suit-label { font-size: 1rem; width: 18px; }
  .dummy-suit-row { gap: 1px; }
}
