/* ============================================================================
 * Copyright (c) 2026 Patrick Reese (Retroboi64). All Rights Reserved.
 * PROPRIETARY AND CONFIDENTIAL.
 * This software, source code, UI layout, custom rules text, and branding for "Super Stupid Idiot"
 * are the exclusive intellectual property of Patrick Reese (Retroboi64).
 * Unauthorized copying, modification, redistribution, or commercial use is strictly prohibited.
 * Original Tabletop Concept Co-Created with Caden.
 * ============================================================================ */

/* SSI Arena (Super Stupid Idiot) - Chess.com-Style Competitive Platform Stylesheet */

:root {
  --gold: #f4c430;
  --gold-glow: rgba(244, 196, 48, 0.45);
  --crimson: #c92a2a;
  --card-w: 72px;
  --card-h: 106px;
  --mini-w: 36px;
  --mini-h: 53px;
  --card-radius: 8px;
  --card-border: #d0d7de;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #38bdf8;
  --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.55);

  /* Chess.com Inspired Palette */
  --chess-bg-sidebar: #1b1a17;
  --chess-bg-sidebar-hover: #262420;
  --chess-bg-header: rgba(22, 21, 18, 0.95);
  --chess-card-bg: #272522;
  --chess-card-border: rgba(255, 255, 255, 0.08);
  --chess-green: #81b64c;
  --chess-green-hover: #9ad15c;
  --chess-gold: #f5c518;
  --chess-orange: #f97316;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
[hidden], .hidden { display: none !important; }
.auth-error:empty, .auth-success:empty { display: none !important; }
input { user-select: text; }

/* Base Body */
body {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: #121417;
  transition: background 0.3s ease;
}

/* ==========================================================================
   THEMES: Table Arenas
   ========================================================================== */

/* Theme 1: Homeroom Desk (Default) - Matte scuffed classroom tabletop */
body.theme-homeroom {
  background-color: #121417;
  background-image:
    radial-gradient(ellipse 95% 75% at 50% 42%, rgba(38, 43, 50, 0.7) 0%, rgba(18, 20, 24, 0.95) 65%, #08090b 100%),
    repeating-linear-gradient(42deg, transparent, transparent 23px, rgba(255, 255, 255, 0.015) 23px, rgba(255, 255, 255, 0.015) 24px),
    repeating-linear-gradient(-48deg, transparent, transparent 37px, rgba(255, 255, 255, 0.012) 37px, rgba(255, 255, 255, 0.012) 38px),
    repeating-radial-gradient(circle at 35% 25%, transparent 0, transparent 4px, rgba(255, 255, 255, 0.006) 4px, rgba(255, 255, 255, 0.006) 5px),
    radial-gradient(circle at 15% 75%, rgba(255, 255, 255, 0.025) 0%, transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 30%);
  background-attachment: fixed;
}
body.theme-homeroom .pod {
  background: rgba(18, 21, 27, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}
body.theme-homeroom .center-dashboard {
  background: rgba(18, 21, 27, 0.92);
  border: 1px solid rgba(244, 196, 48, 0.28);
}

/* Theme 2: Casino Felt - Classic green casino felt */
body.theme-felt {
  background: radial-gradient(circle at 50% 45%, #165b38 0%, #0c4328 60%, #072a19 100%);
  background-attachment: fixed;
}
body.theme-felt .pod {
  background: rgba(4, 25, 15, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.16);
}
body.theme-felt .center-dashboard {
  background: rgba(4, 25, 15, 0.92);
  border: 1px solid rgba(244, 196, 48, 0.35);
}

/* Theme 3: Neon Cyber Felt - Futuristic holographic cyber table */
body.theme-cyber {
  background-color: #0b0914;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 40%, rgba(45, 18, 77, 0.8) 0%, rgba(11, 9, 20, 0.95) 75%),
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
}
body.theme-cyber .pod {
  background: rgba(22, 14, 38, 0.9);
  border: 2px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}
body.theme-cyber .center-dashboard {
  background: rgba(22, 14, 38, 0.94);
  border: 1px solid #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

/* Theme 4: Gold VIP Obsidian Table - Polished black marble with solid gold trim */
body.theme-gold {
  background-color: #0a0908;
  background-image:
    radial-gradient(circle at 50% 45%, #2a2215 0%, #15110a 60%, #080604 100%),
    repeating-linear-gradient(60deg, transparent, transparent 40px, rgba(244, 196, 48, 0.02) 40px, rgba(244, 196, 48, 0.02) 41px);
  background-attachment: fixed;
}
body.theme-gold .pod {
  background: rgba(26, 21, 14, 0.92);
  border: 2px solid rgba(244, 196, 48, 0.4);
  box-shadow: 0 6px 20px rgba(244, 196, 48, 0.2);
}
body.theme-gold .center-dashboard {
  background: rgba(26, 21, 14, 0.95);
  border: 2px solid var(--gold);
  box-shadow: 0 0 25px rgba(244, 196, 48, 0.4);
}

/* ==========================================================================
   APP LAYOUT: Chess.com Sidebar + Main Content Area
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  flex: 1;
  position: relative;
}

/* Sidebar */
.app-sidebar {
  width: 210px;
  background: var(--chess-bg-sidebar);
  border-right: 1px solid var(--chess-card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
  z-index: 100;
  flex-shrink: 0;
}

.app-sidebar.collapsed {
  width: 68px;
}

.app-sidebar.collapsed .brand-text-wrap,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .sidebar-copyright,
.app-sidebar.collapsed .pill-text {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
}
.app-sidebar.collapsed .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(244, 196, 48, 0.4));
}

.brand-title {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.sidebar-toggle-btn:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  position: relative;
  width: 100%;
}

.sidebar-nav-item:hover {
  background: var(--chess-bg-sidebar-hover);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-nav-item.active {
  background: rgba(129, 182, 76, 0.18);
  color: #a3d160;
  border-left: 3px solid var(--chess-green);
  box-shadow: inset 0 0 12px rgba(129, 182, 76, 0.12);
}

.nav-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  white-space: nowrap;
  flex: 1;
}

.nav-badge {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-badge.ready {
  background: #22c55e;
  color: #0f172a;
  animation: pulse-badge 1.5s infinite;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.homeroom-origin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 196, 48, 0.12);
  border: 1px solid rgba(244, 196, 48, 0.3);
  color: var(--gold);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-copyright {
  font-size: 0.65rem;
  color: #64748b;
  line-height: 1.3;
}

/* Main Content Area */
.app-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* ==========================================================================
   TOP STATUS HEADER
   ========================================================================== */
.arena-top-header {
  background: var(--chess-bg-header);
  border-bottom: 1px solid var(--chess-card-border);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 50;
  min-height: 58px;
  flex-wrap: wrap;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
}

.arena-view-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f1f5f9;
}

.header-table-pot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 196, 48, 0.16);
  border: 1.5px solid var(--gold);
  border-radius: 20px;
  padding: 4px 12px;
  animation: glow-pulse-gold 2s infinite;
}
@keyframes glow-pulse-gold {
  0%, 100% { box-shadow: 0 0 10px rgba(244, 196, 48, 0.2); }
  50% { box-shadow: 0 0 18px rgba(244, 196, 48, 0.5); }
}
.pot-chip-icon { font-size: 1.1rem; }
.pot-label { font-size: 0.75rem; text-transform: uppercase; color: #fde047; font-weight: 700; }
.pot-amount { font-size: 1.05rem; font-weight: 900; color: #fff; }
.pot-side-bets { font-size: 0.7rem; color: #cbd5e1; opacity: 0.85; margin-left: 4px; }

.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Live Daily Wheel Button in Header */
.hdr-wheel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: 1px solid #fdba74;
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
  transition: all 0.2s;
}
.hdr-wheel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.55);
}
.hdr-wheel-btn.ready {
  animation: pulse-wheel-btn 2s infinite;
}
@keyframes pulse-wheel-btn {
  0%, 100% { box-shadow: 0 0 6px #f97316; }
  50% { box-shadow: 0 0 18px #ea580c; }
}

/* 2X Multiplier Tag */
.hdr-multiplier-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  border: 1px solid #c084fc;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  animation: pulse-multiplier 1.4s infinite;
}
@keyframes pulse-multiplier {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px #a855f7; }
  50% { transform: scale(1.06); box-shadow: 0 0 14px #c084fc; }
}

/* Header Stat Badges */
.hdr-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 0.86rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.balance-badge {
  border-color: rgba(244, 196, 48, 0.4);
  background: rgba(244, 196, 48, 0.12);
  color: #fde047;
}

.elo-badge {
  border-color: rgba(129, 182, 76, 0.4);
  background: rgba(129, 182, 76, 0.14);
  color: #a3d160;
}
.elo-badge .stat-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
}

/* User Profile Chip */
.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 3px 10px 3px 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.user-profile-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}
.user-avatar {
  font-size: 1.25rem;
}
.user-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.user-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}
.user-title {
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 600;
}

/* Cloud Status Badge */
.cloud-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cloud-status-badge.cloud {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid #22c55e;
  color: #4ade80;
}
.cloud-status-badge.local {
  background: rgba(234, 179, 8, 0.18);
  border: 1px solid #eab308;
  color: #fde047;
}

.header-utility-btns {
  display: flex;
  gap: 4px;
}

/* ==========================================================================
   VIEW 1: DASHBOARD & MATCHMAKING
   ========================================================================== */
.view-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view-dashboard {
  padding: 24px;
  overflow-y: auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Center Column */
.hub-center-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero Banner */
.hub-hero-banner {
  background: linear-gradient(135deg, rgba(39, 37, 34, 0.95) 0%, rgba(22, 20, 18, 0.95) 100%);
  border: 1px solid rgba(244, 196, 48, 0.25);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.hub-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(244, 196, 48, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: 1.85rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 0.92rem;
  color: #cbd5e1;
  max-width: 560px;
  line-height: 1.45;
  margin-bottom: 18px;
}

.hero-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stat-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  min-width: 90px;
}
.hero-stat-box .box-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #f8fafc;
}
.hero-stat-box .box-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-card-art {
  font-size: 4.8rem;
  opacity: 0.85;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

/* Stake Tiers Section */
.stake-tiers-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}
.section-sub {
  font-size: 0.82rem;
  color: #94a3b8;
}

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

.stake-card {
  background: var(--chess-card-bg);
  border: 1px solid var(--chess-card-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.stake-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 196, 48, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.tier-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tier-icon {
  font-size: 1.75rem;
}

.tier-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
}
.tier-badge.roller {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.4);
}
.tier-badge.vip {
  background: rgba(244, 196, 48, 0.18);
  color: #fde047;
  border-color: rgba(244, 196, 48, 0.4);
}
.tier-badge.custom {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.4);
}

.tier-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.tier-buyin {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.buyin-label {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

.tier-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 14px;
}

.tier-specs {
  list-style: none;
  font-size: 0.78rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.tier-play-btn {
  width: 100%;
}
.roller-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #fb923c;
}
.vip-btn {
  background: linear-gradient(135deg, #f5c518 0%, #d97706 100%);
  border-color: #fde047;
  color: #1a1500;
}
.custom-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Right Dashboard Column */
.hub-right-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-card {
  background: var(--chess-card-bg);
  border: 1px solid var(--chess-card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.dash-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  justify-content: space-between;
}

.dash-icon {
  font-size: 1.35rem;
}

.dash-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.dash-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
}

.dash-p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 12px;
}

.online-btn-row {
  display: flex;
  gap: 8px;
}

.full-btn {
  width: 100%;
}

/* Snippet Leaderboard List */
.snippet-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.snippet-lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
}

.snippet-lb-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.snippet-rank {
  font-weight: 900;
  width: 20px;
  color: #94a3b8;
}
.snippet-rank.podium-1 { color: #fbbf24; }
.snippet-rank.podium-2 { color: #cbd5e1; }
.snippet-rank.podium-3 { color: #d97706; }

.snippet-user {
  font-weight: 700;
  color: #f1f5f9;
}

.snippet-elo {
  font-weight: 800;
  color: #a3d160;
}

/* Recent Match History List */
.recent-matches-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}
.history-pill.win { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.history-pill.loss { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.history-tier {
  color: #cbd5e1;
  font-weight: 600;
}

.history-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.history-payout {
  font-weight: 900;
}
.history-payout.pos { color: #4ade80; }
.history-payout.neg { color: #f87171; }

.history-elo {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
}

.history-empty {
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
  padding: 14px 6px;
  line-height: 1.4;
}

/* Homeroom Lore Mini-Card */
.dash-credit-inner {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.homeroom-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.dash-credit-text {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
}

/* ==========================================================================
   VIEW 2: LIVE TABLETOP GAME ARENA
   ========================================================================== */
.view-tabletop {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tabletop-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-wrap: wrap;
}

.table-arena-pot-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(244, 196, 48, 0.15);
  border: 1px solid rgba(244, 196, 48, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
}
.table-pot-chip { font-size: 1.1rem; }
.table-pot-text { font-size: 0.85rem; font-weight: 800; color: #fde047; }
.table-pot-sub { font-size: 0.72rem; color: #94a3b8; margin-left: 6px; }

/* Table Arena */
.table-arena {
  flex: 1;
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  overflow: hidden;
}

/* Opponent Ring - Clean, responsive arc/flex across the top of table */
.opponent-ring {
  position: relative;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px 16px;
  padding: 8px 12px 12px;
  margin: 0 auto;
  pointer-events: auto;
  z-index: 10;
}

.pod {
  position: relative !important;
  flex: 0 1 auto;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 148px;
  min-width: 132px;
  max-width: 160px;
  transition: all 0.25s ease;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.pod.active-turn {
  border-color: var(--gold) !important;
  box-shadow: 0 0 20px var(--gold-glow), 0 0 35px rgba(244, 196, 48, 0.35) !important;
  transform: translateY(-2px) scale(1.03);
}

.pod.safe-pod {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.15) !important;
  opacity: 0.85;
}

.pod-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.pod-avatar { font-size: 1.25rem; flex-shrink: 0; }
.pod-name {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.pod-hand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.pod-table-cards {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.mini-slot {
  width: var(--mini-w);
  height: var(--mini-h);
  border-radius: 4px;
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

/* Enforce strict miniature sizing on cards rendered inside pods */
.card.mini-card {
  width: var(--mini-w) !important;
  height: var(--mini-h) !important;
  min-width: var(--mini-w) !important;
  max-width: var(--mini-w) !important;
  border-radius: 4px !important;
  padding: 2px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  pointer-events: none !important;
  cursor: default !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
  transition: none !important;
}

.card.mini-card:hover {
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Center Arena */
.center-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 15;
  margin-top: 50px;
}

.piles-and-status {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.pile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pile-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold);
}

.pile-card-stack {
  width: var(--card-w);
  height: var(--card-h);
  position: relative;
}

.draw-pile-box {
  cursor: pointer;
  transition: transform 0.15s;
}
.draw-pile-box:hover {
  transform: scale(1.05);
}

.center-dashboard {
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 180px;
  text-align: center;
}

.turn-indicator {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
}

.required-rank-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.required-rank-box .label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}
.required-rank-box .val-highlight {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--gold);
}

.pile-info {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.log-container {
  border-radius: 10px;
  padding: 8px 12px;
  width: 320px;
  max-height: 80px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.log-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}
.log-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  color: #cbd5e1;
}

/* Human Zone */
.human-zone {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

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

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.play-hint {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 600;
}

.human-board {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}

.table-cards-container, .hand-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.hand-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
}

.table-slots {
  display: flex;
  gap: 8px;
}

.table-slot {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  position: relative;
}

.cards-row {
  display: flex;
  gap: 6px;
  min-height: var(--card-h);
  padding: 4px;
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gamble-action-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: #fbbf24 !important;
}

/* ==========================================================================
   CARD SYSTEM & 3D STYLING
   ========================================================================== */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--card-radius);
  background: #ffffff;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  color: #1e293b;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card.selected {
  transform: translateY(-16px) !important;
  box-shadow: 0 12px 24px var(--gold-glow), 0 0 0 2px var(--gold) !important;
}

.card.red { color: #dc2626; }
.card.black { color: #1e293b; }

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.card-corner.bottom { transform: rotate(180deg); }
.card-rank { font-size: 0.95rem; font-weight: 800; }
.card-suit { font-size: 0.75rem; }

.card-center {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.6rem;
}

/* Card Backs */
.card-back {
  background: #1e3a8a;
  border: 2px solid #ffffff;
  background-size: cover;
}

/* 1. Classic Diamond (Default) */
.card-back-classic .card-back,
.card-preview-classic {
  background: repeating-linear-gradient(45deg, #1e3a8a, #1e3a8a 6px, #172554 6px, #172554 12px);
  border: 2px solid #93c5fd;
}

/* 2. SPED Homeroom Notebook */
.card-back-notebook .card-back,
.card-preview-notebook {
  background-color: #f8fafc;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 11px, #93c5fd 11px, #93c5fd 12px),
    linear-gradient(90deg, transparent 18px, #f87171 18px, #f87171 20px, transparent 20px);
  border: 2px solid #cbd5e1;
}
.card-back-notebook .card-back::after,
.card-preview-notebook::after {
  content: '☠️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  opacity: 0.65;
}

/* 3. Golden Ace Luxury */
.card-back-gold .card-back,
.card-preview-gold {
  background: radial-gradient(circle at 50% 50%, #fde047 0%, #ca8a04 70%, #854d0e 100%);
  border: 2px solid #fef08a;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.card-back-gold .card-back::after,
.card-preview-gold::after {
  content: '♠';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #713f12;
}

/* 4. Inferno Foil */
.card-back-inferno .card-back,
.card-preview-inferno {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 50%, #b91c1c 100%);
  border: 2px solid #fca5a5;
  animation: inferno-sheen 3s infinite linear;
}
@keyframes inferno-sheen {
  0% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(25deg); }
  100% { filter: hue-rotate(0deg); }
}

/* ==========================================================================
   MODAL 1: DAILY LOGIN PRIZE WHEEL
   ========================================================================== */
.wheel-modal-card {
  max-width: 520px;
  text-align: center;
  position: relative;
}

.wheel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.wheel-header-icon { font-size: 1.6rem; }

.bankruptcy-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid #ef4444;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: left;
  animation: pulse-danger 1.5s infinite;
}
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 18px rgba(239, 68, 68, 0.7); }
}
.banner-alert-icon { font-size: 1.8rem; }
.bankruptcy-text { display: flex; flex-direction: column; font-size: 0.8rem; line-height: 1.3; }
.bankruptcy-text strong { color: #fca5a5; font-size: 0.88rem; }

.wheel-stage-container {
  position: relative;
  width: 440px;
  height: 440px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-canvas {
  width: 440px;
  height: 440px;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 0 8px #262421;
}

.wheel-pointer-arrow {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  color: var(--gold);
  z-index: 20;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
}

.wheel-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, #f5c518 0%, #b45309 100%);
  border: 4px solid #fff;
  color: #1e1b09;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  z-index: 25;
  transition: transform 0.15s;
}
.wheel-center-hub:hover {
  transform: translate(-50%, -50%) scale(1.08);
}
.wheel-center-hub:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: translate(-50%, -50%);
}

.wheel-result-banner {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 24, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  z-index: 30;
  animation: pop-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.result-badge-anim { font-size: 3.5rem; animation: bounce-badge 1s infinite alternate; }
@keyframes bounce-badge { from { transform: translateY(0); } to { transform: translateY(-10px); } }

.wheel-footer-status {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wheel-cooldown-timer {
  font-size: 0.84rem;
  color: #94a3b8;
}
.wheel-cooldown-timer strong {
  color: var(--gold);
}
.wheel-wedges-legend {
  font-size: 0.72rem;
  color: #64748b;
}

/* ==========================================================================
   MODAL 2: COSMETICS CHIP SHOP
   ========================================================================== */
.shop-modal-card {
  max-width: 720px;
}

.shop-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-header-icon { font-size: 1.6rem; }

.shop-balance-display {
  background: rgba(244, 196, 48, 0.15);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 4px 14px;
  display: flex;
  gap: 6px;
  font-size: 0.85rem;
}
.shop-balance-display strong { color: #fde047; }

.shop-tabs {
  display: flex;
  gap: 10px;
  padding: 12px 24px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.shop-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.shop-tab:hover { color: #fff; }
.shop-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.shop-item-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.item-preview {
  height: 90px;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-preview-homeroom { background: #121417; border: 2px solid #334155; }
.theme-preview-felt { background: #0c4328; border: 2px solid #22c55e; }
.theme-preview-cyber { background: #0b0914; border: 2px solid #a855f7; }
.theme-preview-gold { background: #15110a; border: 2px solid #f5c518; }

.card-preview {
  width: 58px;
  height: 85px;
  margin: 0 auto;
  border-radius: 6px;
  position: relative;
}

.preview-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.item-info h4 { font-size: 0.95rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.item-info p { font-size: 0.75rem; color: #94a3b8; line-height: 1.35; margin-bottom: 6px; }
.item-price { font-size: 0.85rem; font-weight: 900; color: var(--gold); }
.item-price.free { color: #4ade80; }

/* ==========================================================================
   MODAL 3: PROFILE & ACCOUNT
   ========================================================================== */
.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.profile-avatar-big { font-size: 3rem; }
.profile-identity { flex: 1; }
.profile-name { font-size: 1.3rem; font-weight: 900; color: #fff; }
.profile-title-tag { font-size: 0.75rem; color: var(--gold); font-weight: 700; display: block; margin-bottom: 4px; }
.profile-elo-tag { font-size: 0.85rem; color: #a3d160; font-weight: 800; }
.profile-bucks-box {
  background: rgba(244, 196, 48, 0.12);
  border: 1px solid rgba(244, 196, 48, 0.4);
  border-radius: 12px;
  padding: 8px 14px;
  text-align: right;
}
.bucks-lbl { font-size: 0.68rem; color: #fde047; text-transform: uppercase; font-weight: 700; display: block; }
.bucks-val { font-size: 1.2rem; font-weight: 900; color: #fff; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.profile-stat-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.profile-stat-cell .cell-val { font-size: 1.15rem; font-weight: 900; color: #fff; }
.profile-stat-cell .cell-lbl { font-size: 0.68rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; }

/* Match Summary Box in Victory Modal */
.match-payout-summary {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(244, 196, 48, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.payout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #cbd5e1;
}
.payout-row.highlight {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fde047;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
  margin-top: 2px;
}

/* Floating Side-Bet Toasts */
.floating-sidebet {
  position: absolute;
  pointer-events: none;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 1000;
  animation: float-sidebet 2.4s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}
.floating-sidebet.win {
  background: rgba(34, 197, 94, 0.95);
  color: #fff;
  border: 2px solid #86efac;
}
.floating-sidebet.bust {
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  border: 2px solid #fca5a5;
}
@keyframes float-sidebet {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 1; transform: translateY(-20px) scale(1.15); }
  75% { opacity: 1; transform: translateY(-60px) scale(1); }
  100% { opacity: 0; transform: translateY(-90px) scale(0.8); }
}

/* Common Modal Styles */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 16px;
}
.modal-card {
  background: #1e1c19;
  border: 1px solid rgba(244, 196, 48, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 800; color: #fff; }
.modal-subtitle { font-size: 0.75rem; color: #94a3b8; display: block; }
.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 16px 20px; flex: 1; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Button System */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
}
.primary-btn {
  background: var(--chess-green);
  color: #fff;
  border-color: #9ad15c;
}
.primary-btn:hover {
  background: var(--chess-green-hover);
  transform: translateY(-1px);
}
.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.danger-action {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border-color: #ef4444;
}
.danger-action:hover {
  background: #dc2626;
}
.btn-large {
  padding: 12px 22px;
  font-size: 1rem;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}
.btn-xs {
  padding: 2px 7px;
  font-size: 0.7rem;
}

/* Auth Modal */
.auth-card { max-width: 460px; }
.auth-header { text-align: center; padding: 20px 20px 10px 20px; }
.auth-brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
}
.auth-d1-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  margin-left: 6px;
}
.auth-title { font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 900; color: #fff; margin: 4px 0 6px 0; }
.auth-subtitle { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; }
.auth-tabs { display: flex; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
}
.auth-tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.form-group label { font-size: 0.78rem; font-weight: 700; color: #cbd5e1; }
.auth-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}
.auth-input:focus { border-color: var(--gold); }
.auth-input-hint { font-size: 0.68rem; color: #64748b; }
.avatar-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.avatar-opt {
  font-size: 1.4rem;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.avatar-opt.selected { border-color: var(--gold); background: rgba(244, 196, 48, 0.2); }
.cf-turnstile-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #cbd5e1;
}
.auth-error { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fca5a5; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; }
.auth-success { background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #86efac; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; }
.auth-legal-notice { font-size: 0.68rem; color: #64748b; padding: 12px 20px; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* Leaderboard Modal */
.leaderboard-card { max-width: 780px; }
.leaderboard-title-wrap { display: flex; align-items: center; gap: 10px; }
.lb-header-icon { font-size: 1.6rem; }
.leaderboard-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #94a3b8;
}
.leaderboard-body { padding: 14px 20px; max-height: 550px; overflow-y: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lb-table th { text-align: left; padding: 8px 10px; color: #94a3b8; font-size: 0.72rem; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.08); }
.lb-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #cbd5e1; }
.lb-table tr.current-user-row { background: rgba(244, 196, 48, 0.12); font-weight: 800; color: #fff; }

/* Lore Modal */
.origin-quote-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.origin-quote-text { font-style: italic; font-size: 0.95rem; line-height: 1.5; color: #f1f5f9; }
.quote-signature { font-size: 0.8rem; color: var(--gold); font-weight: 700; margin-top: 8px; text-align: right; }
.official-credits-box { background: rgba(0, 0, 0, 0.25); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.credits-heading { font-size: 0.78rem; font-weight: 800; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.credits-grid { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; }
.lore-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.lore-fact-card { background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 10px; font-size: 0.78rem; }
.fact-icon { font-size: 1.4rem; margin-bottom: 4px; }
.fact-title { font-weight: 800; color: #fff; margin-bottom: 2px; }
.fact-desc { color: #94a3b8; line-height: 1.35; }

/* Online Multiplayer Hub */
.online-modal-card { max-width: 650px; }
.online-hub-tabs { display: flex; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.online-hub-tab { flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; color: #94a3b8; font-family: inherit; font-size: 0.88rem; font-weight: 700; padding: 10px; cursor: pointer; }
.online-hub-tab.active { color: #38bdf8; border-bottom-color: #38bdf8; }
.host-config-card { background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.config-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.room-code-display { display: flex; align-items: center; gap: 8px; }
.room-code-val { font-family: 'Cinzel', serif; font-size: 1.25rem; font-weight: 900; color: var(--gold); letter-spacing: 2px; }
.online-slots-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.online-slot-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px; text-align: center; }
.online-status-message { font-size: 0.82rem; color: #94a3b8; text-align: center; margin-bottom: 12px; }
.join-room-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 20px; }
.join-icon { font-size: 2.5rem; }
.join-input-wrap { display: flex; gap: 10px; max-width: 380px; width: 100%; }
.join-code-input { flex: 1; background: rgba(0, 0, 0, 0.4); border: 2px solid var(--gold); border-radius: 8px; color: var(--gold); font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 900; text-align: center; letter-spacing: 2px; padding: 8px; outline: none; }

/* Privacy Overlay */
.privacy-overlay {
  position: fixed;
  inset: 0;
  background: #121417;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 300;
  padding: 20px;
}
.privacy-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.privacy-icon { font-size: 3.5rem; }

/* Victory / Game Over */
.victory-card { text-align: center; max-width: 480px; }
.victory-icon { font-size: 3.5rem; margin-bottom: 6px; }
.standings { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 14px 0; text-align: left; }
.standings li { display: flex; justify-content: space-between; padding: 6px 12px; border-radius: 8px; background: rgba(0,0,0,0.25); font-size: 0.85rem; }
.standings li.standing-idiot { background: rgba(220, 38, 38, 0.25); color: #fca5a5; font-weight: 800; }
.standings li.standing-safe { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.victory-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 3D Reveal overlay */
.reveal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 250;
  gap: 16px;
}
.reveal-overlay.active { display: flex; }
.reveal-caption { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.reveal-stage { perspective: 1000px; width: 140px; height: 210px; }
.reveal-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-card.flipped { transform: rotateY(180deg); }
.reveal-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
}
.reveal-face.front-face { transform: rotateY(180deg); }

/* Live Emote Bar */
.online-emote-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2px 10px;
}
.emote-bar-label { font-size: 0.68rem; font-weight: 800; color: var(--gold); }
.emote-btn { background: none; border: none; font-size: 1.15rem; cursor: pointer; padding: 2px; transition: transform 0.15s; }
.emote-btn:hover { transform: scale(1.3); }

/* Floating Live Emotes */
.floating-emote {
  position: absolute;
  pointer-events: none;
  font-size: 2.2rem;
  z-index: 1000;
  animation: float-up-fade 2.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.floating-emote .emote-sender {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 1px 6px;
  white-space: nowrap;
}
@keyframes float-up-fade {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  15% { opacity: 1; transform: translateY(-20px) scale(1.25); }
  75% { opacity: 1; transform: translateY(-75px) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.7); }
}

/* Footer */
.app-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f1013;
  padding: 8px 16px;
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
}
.footer-content { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-lore-link { background: none; border: none; color: var(--gold); font-size: 0.75rem; cursor: pointer; text-decoration: underline; font-family: inherit; }

/* Sidebar Online Counter Badge */
.sidebar-online-status {
  margin: 12px 14px 4px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.online-indicator-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.online-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-online-dot 2s infinite ease-in-out;
}
@keyframes pulse-online-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}
.online-number {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f1f5f9;
}
.online-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.online-tables-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Ranked Matchmaking Hero */
.ranked-matchmaking-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(244, 196, 48, 0.12) 0%, rgba(244, 196, 48, 0.03) 100%);
  border: 1px solid rgba(244, 196, 48, 0.35);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-badge {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(244, 196, 48, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
}
.hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px 0;
}
.hero-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0;
  max-width: 620px;
}
.hero-cta-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #111827 !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4) !important;
  white-space: nowrap;
}
.hero-cta-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6) !important;
}

/* Matchmaking Modal */
.matchmaking-card {
  max-width: 480px;
  text-align: center;
  padding: 24px;
}
.matchmaking-radar {
  font-size: 2.8rem;
  display: inline-block;
  animation: rotate-radar 3s linear infinite;
  margin-bottom: 8px;
}
@keyframes rotate-radar {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.matchmaking-header h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin: 4px 0;
}
.matchmaking-subtitle {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
}
.matchmaking-slots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 20px;
}
.mm-slot {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}
.mm-slot.filled {
  background: rgba(244, 196, 48, 0.1);
  border: 1px solid var(--gold);
  transform: scale(1.05);
}
.mm-slot-avatar { font-size: 1.8rem; }
.mm-slot-name { font-size: 0.78rem; font-weight: 800; color: #ffffff; }
.mm-slot-elo { font-size: 0.68rem; font-weight: 700; color: var(--gold); }
.mm-slot-status { font-size: 0.65rem; color: #10b981; font-weight: 800; text-transform: uppercase; }

/* Match Mode Badge on Table */
.match-mode-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.match-mode-badge.public {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
}
.match-mode-badge.practice {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid #eab308;
  color: #fde047;
}

/* 80s Retro Arcade Theme */
body.theme-arcade {
  background-color: #0d061a;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 35%, rgba(139, 92, 246, 0.3) 0%, rgba(13, 6, 26, 0.95) 75%),
    linear-gradient(to right, rgba(236, 72, 153, 0.15) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 182, 212, 0.15) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}
body.theme-arcade .pod {
  background: rgba(26, 14, 46, 0.9);
  border: 2px solid #ec4899;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}
body.theme-arcade .center-dashboard {
  background: rgba(26, 14, 46, 0.95);
  border: 2px solid #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Galactic Cosmic Void Theme */
body.theme-galactic {
  background-color: #030712;
  background-image:
    radial-gradient(circle at 50% 40%, rgba(79, 70, 229, 0.35) 0%, rgba(17, 24, 39, 0.9) 65%, #030712 100%),
    radial-gradient(circle at 20% 80%, rgba(219, 39, 119, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.2) 0%, transparent 40%);
}
body.theme-galactic .pod {
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid #6366f1;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.35);
}
body.theme-galactic .center-dashboard {
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #8b5cf6;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
}

/* Pure Diamond Glass Theme */
body.theme-diamond {
  background-color: #0b1329;
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(56, 189, 248, 0.3) 0%, rgba(15, 23, 42, 0.95) 75%),
    repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(255, 255, 255, 0.03) 30px, rgba(255, 255, 255, 0.03) 31px);
}
body.theme-diamond .pod {
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}
body.theme-diamond .center-dashboard {
  background: rgba(30, 41, 59, 0.95);
  border: 2px solid #7dd3fc;
  box-shadow: 0 0 30px rgba(125, 211, 252, 0.5);
}

/* New Card Backs */
.card-back-galaxy .card-back,
.card-preview-galaxy {
  background: radial-gradient(circle at 50% 50%, #8b5cf6 0%, #3b82f6 50%, #0f172a 100%) !important;
  border: 2px solid #c084fc !important;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.5) !important;
}
.card-back-galaxy .card-back::after,
.card-preview-galaxy::after {
  content: '✨';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
}

.card-back-royal .card-back,
.card-preview-royal {
  background: linear-gradient(135deg, #1e1b4b 0%, #431407 50%, #78350f 100%) !important;
  border: 2px solid #fbbf24 !important;
  box-shadow: inset 0 0 8px #f59e0b !important;
}
.card-back-royal .card-back::after,
.card-preview-royal::after {
  content: '👑';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
}

.card-back-diamond_back .card-back,
.card-preview-diamond_back {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 30%, #e0f2fe 50%, #0ea5e9 100%) !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7) !important;
}
.card-back-diamond_back .card-back::after,
.card-preview-diamond_back::after {
  content: '💎';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
}

/* Turn Timer & Active Matchmaker UI */
.turn-indicator-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.turn-timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 14px;
  min-width: 170px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s;
}
.timer-clock-icon {
  font-size: 0.95rem;
}
.timer-seconds {
  font-size: 0.85rem;
  font-weight: 800;
  color: #f1f5f9;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.turn-timer-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.turn-timer-bar .timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 4px;
  transition: width 1s linear, background 0.3s;
}
.turn-timer-wrap.warning {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}
.turn-timer-wrap.warning .timer-fill {
  background: #ef4444;
}
.turn-timer-wrap.warning .timer-seconds {
  color: #ef4444;
  animation: timerBlink 0.6s infinite alternate;
}
@keyframes timerBlink {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

/* Matchmaking Modal Timer & Actions */
.matchmaking-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.matchmaking-actions-row {
  display: flex;
  justify-content: center;
  margin: 12px 0 6px 0;
}

/* Profile Tab Bar & Customizations */
.profile-tab-bar {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin: -10px 0 16px 0;
}
.profile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.profile-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}
.customize-section {
  margin-bottom: 18px;
}
.customize-section h4 {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.custom-avatar-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.custom-avatar-option {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.custom-avatar-option:hover {
  background: rgba(255, 255, 255, 0.12);
}
.custom-avatar-option.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
  transform: scale(1.08);
}
.customize-save-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}
.customize-status-msg {
  font-size: 0.88rem;
  color: #10b981;
  font-weight: 700;
}

/* Public Profile Modal Details */
.profile-cosmetics-row {
  display: flex;
  gap: 12px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.cosmetic-pill {
  flex: 1;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
}
.cosmetic-pill strong {
  color: #f1f5f9;
}

/* Forfeit Confirmation Modal */
.forfeit-card {
  max-width: 460px;
  text-align: center;
  background: #0f172a;
  border: 2px solid #ef4444;
  padding: 28px;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}
.forfeit-icon {
  font-size: 3.2rem;
  margin-bottom: 10px;
  animation: pulse 1.2s infinite;
}
.forfeit-card h2 {
  color: #fca5a5;
  margin-bottom: 12px;
}
.forfeit-card p {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.5;
}
.forfeit-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.forfeit-actions .btn {
  flex: 1;
}

/* Responsive Adjustments & Better Mobile Support */
@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .table-arena { min-height: 420px; }
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-menu-btn { display: inline-flex; }
  .view-dashboard { padding: 12px; }
  :root { --card-w: 52px; --card-h: 76px; --mini-w: 28px; --mini-h: 40px; }
  .wheel-stage-container, .wheel-canvas { width: 320px; height: 320px; }

  /* Header mobile adjustments */
  .arena-top-header {
    padding: 8px 10px;
  }
  .arena-view-title .view-text {
    display: none;
  }
  .user-text-wrap {
    display: none;
  }
  .hdr-stat-badge {
    padding: 3px 6px;
    font-size: 0.72rem;
  }
  #hdr-balance-badge .stat-val {
    font-size: 0.8rem;
  }
  .cloud-status-badge {
    display: none;
  }

  /* Tabletop mobile layout */
  .tabletop-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 10px;
  }
  .table-arena-pot-banner {
    order: -1;
    font-size: 0.78rem;
    padding: 4px 8px;
    justify-content: center;
  }
  .opponent-ring {
    overflow-x: auto;
    justify-content: flex-start;
    padding: 4px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
  }
  .pod {
    min-width: 110px !important;
    width: 110px !important;
    padding: 4px !important;
    flex-shrink: 0;
  }
  .pod .player-badge {
    font-size: 0.72rem;
  }
  .center-arena {
    margin: 4px auto;
  }
  .piles-and-status {
    gap: 6px;
  }
  .pile-box {
    min-width: 65px;
    padding: 4px;
  }
  .turn-timer-wrap {
    min-width: 140px;
    padding: 3px 8px;
  }

  /* Human player zone on mobile */
  .human-zone {
    padding: 8px 6px;
    background: rgba(10, 15, 29, 0.96);
  }
  .human-board {
    gap: 6px;
  }
  .table-cards-container {
    padding: 4px;
  }
  .interactive-hand {
    padding: 6px 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 84px;
  }
  .interactive-hand .card {
    margin-left: -20px;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.6);
  }
  .interactive-hand .card:first-child {
    margin-left: 0;
  }

  /* Action bar mobile touch grid */
  .action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px 0;
  }
  .action-bar .btn {
    min-height: 48px;
    font-size: 0.88rem;
    padding: 8px 4px;
    font-weight: 800;
  }

  /* Modals on mobile */
  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
    padding: 16px 14px;
    border-radius: 12px;
  }
  .matchmaking-slots {
    grid-template-columns: 1fr;
  }
  .shop-items-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DROPDOWNS & FORM CONTROLS REFINEMENT
   ========================================================================== */
select, .setup-select, .slot-pers-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #1e222a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5c518' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 36px 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

select:hover, .setup-select:hover, .slot-pers-select:hover {
  border-color: rgba(245, 197, 24, 0.5);
  background-color: #252b36;
}

select:focus, .setup-select:focus, .slot-pers-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
}

select option {
  background-color: #1a1e24;
  color: #f1f5f9;
  padding: 10px;
}

/* ==========================================================================
   QUICK AI BATTLE HERO CARD
   ========================================================================== */
.ai-battle-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ai-battle-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.ai-battle-left {
  flex: 1;
  min-width: 260px;
}

.ai-battle-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 6px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-battle-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.ai-battle-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-battle-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 10px 16px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ai-battle-btn .ab-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.ai-battle-btn strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #38bdf8;
}

.ai-battle-btn small {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
}

.ai-battle-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.2);
}

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

/* ==========================================================================
   DEDICATED PROFILE PAGE VIEW (.view-profile)
   ========================================================================== */
.view-profile {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pp-back {
  align-self: flex-start;
  margin-bottom: 4px;
}

.pp-hero {
  background: #181b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pp-banner {
  height: 120px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
  position: relative;
}

.pp-hero-body {
  padding: 0 24px 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  flex-wrap: wrap;
}

.pp-avatar-wrap {
  position: relative;
  margin-top: -50px;
  flex-shrink: 0;
}

.pp-avatar {
  width: 96px;
  height: 96px;
  background: #252b36;
  border: 4px solid #181b21;
  border-radius: 50%;
  display: flex;
  align-center: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 88px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.pp-online-dot {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #64748b;
  border: 3px solid #181b21;
}

.pp-online-dot.online {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.pp-identity {
  flex: 1;
  min-width: 280px;
  padding-top: 10px;
}

.pp-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pp-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-badge.owner {
  background: rgba(245, 197, 24, 0.2);
  color: #f5c518;
  border: 1px solid rgba(245, 197, 24, 0.5);
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.2);
}

.role-badge.mod {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.pp-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

.pp-bio {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 8px 0 12px 0;
  max-width: 600px;
}

.pp-bio.empty {
  color: #64748b;
  font-style: italic;
}

.pp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pp-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.pp-chip strong {
  color: #f8fafc;
}

.pp-chip.streak {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.pp-chip.win-streak {
  background: rgba(245, 197, 24, 0.15);
  border-color: rgba(245, 197, 24, 0.35);
  color: #fde047;
}

.pp-follow-counts {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.pp-count {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.pp-count strong {
  color: #f8fafc;
}

.pp-count:hover {
  color: var(--gold);
  text-decoration: underline;
}

.pp-joined {
  font-size: 0.78rem;
  color: #64748b;
}

.pp-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
}

.pp-actions .btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.pp-actions .btn.active.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

.pp-mod-bar {
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pp-mod-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  margin-right: 6px;
}

.btn-xs {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.pp-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0;
}

.pp-tab {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.pp-tab:hover {
  color: #f1f5f9;
}

.pp-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.pp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.pp-card {
  background: #181b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 20px;
}

.pp-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 12px;
}

.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pp-badge-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Comments Section */
.pp-comment-form {
  background: #181b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.pp-comment-form textarea {
  width: 100%;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  user-select: text;
}

.pp-comment-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.pp-comment-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}

.pp-comment-hint {
  font-size: 0.76rem;
  color: #64748b;
}

.pp-comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-comment-item {
  background: #181b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
}

.pp-ci-avatar {
  font-size: 1.8rem;
  cursor: pointer;
}

.pp-ci-body {
  flex: 1;
}

.pp-ci-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pp-ci-user {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
  cursor: pointer;
}

.pp-ci-user:hover {
  color: var(--gold);
}

.pp-ci-time {
  font-size: 0.75rem;
  color: #64748b;
  margin-left: auto;
}

.pp-comment-del {
  margin-left: 8px;
}

.pp-ci-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.45;
  user-select: text;
}

/* Friends Panel */
.pp-friend-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pp-subtab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pp-subtab.active {
  background: rgba(245, 197, 24, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.pp-friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-list-row {
  background: #181b21;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fl-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex: 1;
}

.fl-avatar-wrap {
  position: relative;
}

.fl-avatar {
  font-size: 1.6rem;
}

.fl-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #181b21;
}

.fl-online-dot.online {
  background: #22c55e;
}

.fl-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fl-name {
  color: #f8fafc;
  font-size: 0.92rem;
}

.fl-sub {
  font-size: 0.78rem;
  color: #64748b;
}

.fl-streak-badge {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   GLOBAL CHAT DOCK
   ========================================================================== */
.chat-dock {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 340px;
  background: #15181e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 480px;
}

.chat-dock.collapsed {
  transform: translateY(calc(100% - 46px));
}

.chat-dock-head {
  height: 46px;
  background: #1c2028;
  border-radius: 14px 14px 0 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-dock-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
}

.chat-unread {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.chat-dock-spacer {
  flex: 1;
}

.chat-icon-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  border-radius: 4px;
}

.chat-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.chat-settings {
  background: #181c24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
}

.chat-settings-note {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.4;
}

.chat-body {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: #64748b;
  padding: 20px;
}

.chat-empty .ce-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.chat-empty p {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.chat-empty small {
  font-size: 0.72rem;
  color: #64748b;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-msg-avatar {
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-msg-user {
  font-weight: 700;
  font-size: 0.82rem;
  color: #f1f5f9;
  cursor: pointer;
}

.chat-msg-user:hover {
  color: var(--gold);
}

.chat-msg-time {
  font-size: 0.7rem;
  color: #64748b;
}

.chat-del-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  padding: 0 4px;
}

.chat-del-btn:hover {
  opacity: 1;
}

.chat-msg-text {
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
  user-select: text;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #181c24;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-form input {
  flex: 1;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.84rem;
  user-select: text;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ==========================================================================
   TABLETOP & MISC BADGES
   ========================================================================== */
.fast-rules-badge {
  background: rgba(245, 197, 24, 0.2);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.match-clock {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.fast-rules-tag {
  color: var(--gold);
  font-weight: 700;
}

.streak-badge {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #fca5a5 !important;
}

.wheel-extra-spins {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-top: 6px;
}

.wheel-extra-spins strong {
  color: var(--gold);
}

.wheel-extra-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.cust-textarea {
  width: 100%;
  background: #181c24;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  resize: none;
  user-select: text;
}

.cust-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.cust-hint {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: normal;
}


/* ============================================================================
 * Standalone Electron Desktop Titlebar & Window Controls
 * ============================================================================ */
.desktop-titlebar {
  display: none !important;
}

body.is-electron .desktop-titlebar {
  display: flex !important;
  height: 36px;
  width: 100%;
  background: #090b0f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 12px;
  user-select: none;
  -webkit-app-region: drag;
  position: relative;
  z-index: 100000;
  box-sizing: border-box;
}

body.is-electron .app-layout {
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
}

.titlebar-drag-region {
  display: flex;
  align-items: center;
  flex: 1;
  height: 100%;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.titlebar-logo-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.titlebar-title {
  color: #f8fafc;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  letter-spacing: 1px;
}

.titlebar-badge {
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.16);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.titlebar-version {
  font-size: 0.72rem;
  color: #64748b;
  font-family: monospace;
}

.titlebar-controls {
  display: flex;
  height: 100%;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  width: 46px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

.titlebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.titlebar-btn.btn-close:hover {
  background: #e81123;
  color: #fff;
}

/* ============================================================================
 * Vector SVG Art & Custom Avatar Styling
 * ============================================================================ */
.ssi-icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.ssi-brand-logo-svg {
  width: 170px;
  height: 48px;
  display: block;
}

.ssi-brand-icon-svg {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}

.user-avatar,
.pp-avatar,
.pod-avatar,
.chat-msg-avatar,
.pp-ci-avatar,
.fl-avatar,
.custom-avatar-option,
.mm-slot-avatar,
.avatar-opt {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #181f2c;
  border: 2px solid rgba(244, 196, 48, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.user-avatar svg {
  width: 100%;
  height: 100%;
}

.pod-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pp-ci-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fl-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.custom-avatar-option {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #1a202c;
  border: 2px solid transparent;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.custom-avatar-option:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 196, 48, 0.5);
}

.custom-avatar-option.selected {
  border-color: var(--gold);
  background: rgba(244, 196, 48, 0.15);
  box-shadow: 0 0 14px rgba(244, 196, 48, 0.3);
}

/* ============================================================================
 * Shareable Profile Link Button & Feedback Toast
 * ============================================================================ */
#pp-btn-share {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(0, 188, 212, 0.08));
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: all 0.2s ease;
}

#pp-btn-share:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(0, 188, 212, 0.15));
  border-color: #00e5ff;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.25);
}

#pp-btn-share.copied {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.3), rgba(0, 200, 83, 0.15)) !important;
  border-color: #00e676 !important;
  color: #00e676 !important;
}

.btn-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
