/* ========== RABOKAMI.BET — Professional Warm Theme ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --bg-base: #0f1117;
  --bg-surface: #181a24;
  --bg-card: #1e2030;
  --bg-card-hover: #252840;
  --bg-elevated: #272a3a;
  --bg-input: #1a1c28;

  --accent: #e94560;
  --accent-hover: #ff5a75;
  --accent-soft: rgba(233, 69, 96, 0.12);
  --gold: #f5c518;
  --gold-soft: rgba(245, 197, 24, 0.12);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.12);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.12);

  --text-primary: #f0f0f5;
  --text-secondary: #9ca3b4;
  --text-muted: #5c6278;
  --text-inverse: #0f1117;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(233, 69, 96, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.25);

  --transition: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --chat-width: 340px;
  --navbar-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding-top: var(--navbar-h);
  min-width: 0;
  transition: margin-right var(--transition-slow);
}

.main-content.chat-open {
  margin-right: var(--chat-width);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 1rem;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav Menu Tabs */
.nav-tabs {
  display: flex; align-items: center; gap: 4px;
  margin-left: 1.5rem;
}

.nav-tab {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--accent);
  color: white;
}

/* Nav Right Area */
.nav-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

/* Coin Display */
.coin-display {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-soft);
  border: 1px solid rgba(245,197,24,0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
}

.coin-display .coin-icon { font-size: 1rem; }
.coin-display .coin-rate {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 4px;
}

/* User Profile (Navbar) */
.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
}

.nav-user:hover { border-color: var(--border-hover); }

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  overflow: hidden;
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.nav-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.nav-btn.primary:hover { background: var(--accent-hover); }

/* Chat Toggle Button */
.chat-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  transition: var(--transition);
  position: relative;
}

.chat-toggle:hover { border-color: var(--accent); color: var(--accent); }
.chat-toggle.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.chat-toggle .badge {
  position: absolute; top: -4px; right: -4px;
  width: 8px; height: 8px;
  background: var(--emerald);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}

/* ---------- Radio Widget ---------- */
.radio-widget {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(15,17,23,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 16px;
  z-index: 90;
  transition: right var(--transition-slow);
}

.radio-widget.chat-open { right: var(--chat-width); }

.radio-play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.radio-play-btn:hover { background: var(--accent-hover); transform: scale(1.05); }

.radio-info {
  flex: 1; min-width: 0;
}

.radio-station-name {
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.radio-status {
  font-size: 0.7rem; color: var(--text-muted);
}

.radio-selector {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  max-width: 200px;
}

.radio-selector:focus { outline: none; border-color: var(--accent); }

.radio-volume {
  width: 80px;
  accent-color: var(--accent);
}

.radio-mute-btn {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 4px;
  transition: var(--transition);
}

.radio-mute-btn:hover { color: var(--text-primary); }

/* Visualizer bars */
.radio-viz { display: flex; align-items: flex-end; gap: 2px; height: 20px; }
.radio-viz-bar {
  width: 3px; background: var(--accent); border-radius: 2px;
  transition: height 0.1s ease;
  height: 4px;
}
.radio-viz.playing .radio-viz-bar { animation: vizBounce 0.6s ease-in-out infinite alternate; }
.radio-viz.playing .radio-viz-bar:nth-child(1) { animation-delay: 0s; }
.radio-viz.playing .radio-viz-bar:nth-child(2) { animation-delay: 0.15s; }
.radio-viz.playing .radio-viz-bar:nth-child(3) { animation-delay: 0.08s; }
.radio-viz.playing .radio-viz-bar:nth-child(4) { animation-delay: 0.22s; }
.radio-viz.playing .radio-viz-bar:nth-child(5) { animation-delay: 0.12s; }

@keyframes vizBounce {
  0% { height: 4px; }
  100% { height: 20px; }
}

/* ---------- Chat Sidebar ---------- */
.chat-sidebar {
  position: fixed;
  top: var(--navbar-h); right: 0;
  width: var(--chat-width);
  height: calc(100vh - var(--navbar-h));
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 80;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}

.chat-sidebar.open { transform: translateX(0); }

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

.chat-header-title {
  font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}

.chat-online {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; color: var(--emerald); font-weight: 500;
}

.chat-online-dot {
  width: 6px; height: 6px;
  background: var(--emerald);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

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

.chat-close-btn {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.1rem;
  padding: 4px; transition: var(--transition);
}
.chat-close-btn:hover { color: var(--text-primary); }

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

.chat-msg { animation: msgIn 0.25s ease-out; }

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

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

.chat-msg-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}

.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-msg-author {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
}

.chat-msg-time {
  font-size: 0.65rem; color: var(--text-muted); margin-left: auto;
}

.chat-msg-body {
  background: var(--bg-card);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
  margin-left: 28px;
}

.chat-msg.system .chat-msg-body {
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.75rem;
  margin-left: 0;
  text-align: center;
  border-radius: var(--radius-full);
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
}

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

.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.chat-send-btn:hover { background: var(--accent-hover); }

/* ---------- Content Sections ---------- */
.page-content {
  padding: 2rem 2rem 80px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Page section (tab pane) */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Section Header */
.section-title {
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.section-desc {
  font-size: 0.9rem; color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ---------- Game Cards Grid ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-slow);
  position: relative;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.game-card-thumb {
  width: 100%; height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.game-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, var(--bg-card));
}

.game-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.game-card-body h3 {
  font-size: 0.95rem; font-weight: 700;
  margin-bottom: 4px;
}

.game-card-body p {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 12px;
}

.game-card-badge {
  position: absolute; top: 12px; right: 12px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; z-index: 2;
}

.badge-ai { background: var(--purple-soft); color: var(--purple); }
.badge-multi { background: var(--emerald-soft); color: var(--emerald); }
.badge-hot { background: var(--accent-soft); color: var(--accent); }

.game-card-play {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.game-card-play:hover { background: var(--accent-hover); }

/* ---------- Upgrade / Idle Section ---------- */
.upgrade-section {
  margin-top: 2.5rem;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.upgrade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
}

.upgrade-card:hover { border-color: var(--border-hover); }

.upgrade-level {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  color: var(--gold); letter-spacing: 1px;
  margin-bottom: 8px;
}

.upgrade-card h4 {
  font-size: 0.95rem; font-weight: 700;
  margin-bottom: 4px;
}

.upgrade-card p {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 12px;
}

.upgrade-cost {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8rem; color: var(--gold); font-weight: 600;
  margin-bottom: 10px;
}

.upgrade-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.upgrade-btn.available {
  background: var(--gold);
  color: var(--text-inverse);
}

.upgrade-btn.available:hover { filter: brightness(1.1); }

.upgrade-btn.locked {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.upgrade-btn.owned {
  background: var(--emerald-soft);
  color: var(--emerald);
  cursor: default;
}

/* ---------- Memory Wall ---------- */
.memory-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.memory-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
}

.memory-textarea:focus { outline: none; border-color: var(--accent); }

.memory-submit {
  padding: 8px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.memory-submit:hover { background: var(--accent-hover); }

.memory-list { display: flex; flex-direction: column; gap: 1rem; }

.memory-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
}

.memory-item:hover { border-color: var(--border-hover); }

.memory-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.memory-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

.memory-avatar img { width: 100%; height: 100%; object-fit: cover; }

.memory-author { font-size: 0.85rem; font-weight: 600; }
.memory-date { font-size: 0.7rem; color: var(--text-muted); }

.memory-text {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.memory-like-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.75rem; color: var(--text-muted);
  font-family: inherit;
  transition: var(--transition);
}

.memory-like-btn:hover { border-color: var(--accent); color: var(--accent); }
.memory-like-btn.liked { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Auth Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

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

.modal-header h2 {
  font-size: 1.1rem; font-weight: 700;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

.modal-close:hover { background: var(--accent); color: white; border-color: var(--accent); }

.modal-body { padding: 1.5rem; }

/* Auth Tabs */
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1; padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.auth-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }

.auth-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

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

.form-hint {
  font-size: 0.7rem; color: var(--text-muted);
  margin-top: 2px;
}

.form-hint.error { color: var(--accent); }

/* Avatar Upload */
.avatar-upload {
  display: flex; align-items: center; gap: 16px;
}

.avatar-preview {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
}

.avatar-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

.auth-submit {
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.auth-submit:hover { background: var(--accent-hover); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Game Modal (Large) ---------- */
.game-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}

.game-modal-overlay.active { opacity: 1; visibility: visible; }

.game-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 95vw;
  max-width: 900px;
  max-height: 92vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.game-modal-overlay.active .game-modal { transform: scale(1); }

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

.game-modal-header h2 { font-size: 1rem; font-weight: 700; }

.game-modal-body {
  padding: 1.5rem;
}

/* ---------- Blackjack Styles ---------- */
.bj-table {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.bj-info-bar {
  display: flex; justify-content: center; gap: 2rem;
  margin-bottom: 1.5rem;
}

.bj-info-item { text-align: center; }
.bj-info-label { font-size: 0.75rem; color: var(--text-muted); }
.bj-info-value { font-size: 1.1rem; font-weight: 700; color: var(--gold); }

.bj-zone {
  margin: 1rem 0;
}

.bj-zone-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px;
}

.card-hand {
  display: flex; justify-content: center; gap: 8px;
  min-height: 110px; flex-wrap: wrap;
  perspective: 800px;
}

.playing-card {
  width: 70px; height: 100px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #1a1a2e;
  box-shadow: var(--shadow-md);
  animation: dealCard 0.35s ease-out;
  position: relative;
  border: 1px solid #ddd;
  font-weight: 700;
}

.playing-card.red { color: #e94560; }

.playing-card .card-val {
  position: absolute; top: 5px; left: 7px;
  font-size: 0.8rem; font-weight: 800;
}

.playing-card .card-suit {
  font-size: 1.8rem;
}

.playing-card.face-down {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--border-hover);
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 6px,
    rgba(255,255,255,0.03) 6px, rgba(255,255,255,0.03) 7px
  );
}

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

.bj-score {
  font-size: 0.85rem; font-weight: 600;
  color: var(--blue); margin-top: 6px;
}

.bj-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.bj-bet-area {
  display: flex; gap: 6px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1rem;
}

.bj-bet-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.bj-bet-chip:hover { border-color: var(--gold); color: var(--gold); }
.bj-bet-chip.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }

.bj-actions {
  display: flex; gap: 8px; justify-content: center;
  flex-wrap: wrap; margin-top: 1rem;
}

.bj-action-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem; font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.bj-action-btn.hit { background: var(--blue); color: white; }
.bj-action-btn.stand { background: var(--accent); color: white; }
.bj-action-btn.double { background: var(--gold); color: var(--text-inverse); }
.bj-action-btn.split { background: var(--purple); color: white; }
.bj-action-btn.deal { background: var(--emerald); color: white; }
.bj-action-btn.free { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(245,197,24,0.3); }

.bj-action-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.bj-action-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }

.bj-result {
  margin-top: 1rem;
  font-size: 1rem; font-weight: 700;
  min-height: 1.5rem;
}

.bj-result.win { color: var(--emerald); }
.bj-result.lose { color: var(--accent); }
.bj-result.push { color: var(--gold); }

/* ---------- Chess & Dama Board ---------- */
.board-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 1rem;
}

.board-status {
  font-size: 0.9rem; font-weight: 600;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.game-board {
  display: grid;
  border: 2px solid var(--border-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.board-cell {
  width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.1s ease;
  user-select: none;
  position: relative;
}

.board-cell.light { background: #e8dcc8; }
.board-cell.dark { background: #b58863; }

.board-cell.selected { box-shadow: inset 0 0 0 3px var(--accent); }
.board-cell.valid-move::after {
  content: '';
  width: 16px; height: 16px;
  background: rgba(52,211,153,0.5);
  border-radius: 50%;
  position: absolute;
}

.board-cell.last-move { box-shadow: inset 0 0 0 3px rgba(245,197,24,0.4); }

.board-cell .piece {
  font-size: 2rem;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.3));
  cursor: grab;
  transition: transform 0.1s ease;
}

.board-cell .piece:hover { transform: scale(1.1); }

.board-controls {
  display: flex; gap: 8px;
  margin-top: 0.5rem;
}

.board-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.board-btn:hover { border-color: var(--accent); color: var(--accent); }
.board-btn.primary { background: var(--accent); color: white; border-color: var(--accent); }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  bottom: 72px; left: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease-out;
  display: flex; align-items: center; gap: 8px;
}

.toast.success { border-color: var(--emerald); }
.toast.error { border-color: var(--accent); }

@keyframes toastIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------- Coming Soon ---------- */
.game-card.coming-soon {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

/* ---------- Stats Section ---------- */
.stats-section { margin-top: 2.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); }
.stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Lobby System ---------- */
.lobby-actions {
  display: flex; gap: 10px; margin-bottom: 1.5rem;
}

.lobby-create-btn {
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.lobby-create-btn:hover { background: var(--accent-hover); }

.lobby-refresh-btn {
  padding: 10px 18px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
}

.lobby-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

.lobby-list {
  display: flex; flex-direction: column; gap: 10px;
}

.lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.lobby-card:hover { border-color: var(--border-hover); }

.lobby-game-icon {
  font-size: 2rem;
  width: 48px; height: 48px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.lobby-info { flex: 1; min-width: 0; }
.lobby-info h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }

.lobby-meta {
  display: flex; gap: 12px;
  font-size: 0.75rem; color: var(--text-muted);
}

.lobby-join-btn {
  padding: 8px 18px;
  background: var(--emerald);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  flex-shrink: 0;
}

.lobby-join-btn:hover { filter: brightness(1.1); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem;
  font-size: 0.9rem;
}

/* ---------- Admin Panel ---------- */
.admin-btn {
  background: var(--gold-soft) !important;
  border-color: rgba(245,197,24,0.3) !important;
  color: var(--gold) !important;
}

.admin-btn:hover { background: var(--gold) !important; color: var(--text-inverse) !important; }

.admin-section { min-height: 200px; }

.admin-search { margin-bottom: 1rem; }

.admin-users-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 400px; overflow-y: auto;
}

.admin-user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.admin-user-info { flex: 1; }
.admin-user-info strong { font-size: 0.85rem; display: block; }
.admin-user-info small { font-size: 0.7rem; color: var(--text-muted); }

.admin-user-coins {
  font-size: 0.85rem; font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.admin-user-badge {
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
}

.admin-logs-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 400px; overflow-y: auto;
}

.admin-log-row {
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--gold);
}

.admin-log-row .log-time {
  font-size: 0.65rem; color: var(--text-muted);
}

/* ---------- Char Counter ---------- */
.memory-form-footer {
  display: flex; align-items: center; justify-content: space-between;
}

.char-count { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- Mobile Menu ---------- */
.mobile-menu-btn {
  display: none;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.2rem;
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-btn:hover { border-color: var(--accent); }

.nav-tabs.mobile-open {
  display: flex !important;
  position: absolute;
  top: var(--navbar-h);
  left: 0; right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  flex-direction: column;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-tabs { display: none; }
  .mobile-menu-btn { display: flex; }
  .page-content { padding: 1rem 1rem 80px; }
  .board-cell { width: 42px; height: 42px; font-size: 1.3rem; }
  .board-cell .piece { font-size: 1.4rem; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .chat-sidebar { width: 100%; }
  .main-content.chat-open { margin-right: 0; }
  .radio-widget { gap: 8px; padding: 0 0.75rem; }
  .radio-selector { max-width: 120px; }
  .lobby-card { flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .game-modal { width: 100vw; max-width: 100%; border-radius: 0; max-height: 100vh; }
}
