/* ==========================================================================
   Peak Recline Portal — Design System
   ========================================================================== */

:root {
  /* Colors */
  --bg-primary: #080b12;
  --bg-secondary: rgba(13, 17, 25, 0.85);
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(26, 34, 54, 0.85);
  --bg-input: rgba(21, 29, 46, 0.9);
  --border: rgba(30, 45, 68, 0.7);
  --border-focus: #2563eb;

  --text-primary: #e2e8f0;
  --text-secondary: #8898aa;
  --text-muted: #4a5e78;

  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-gradient: linear-gradient(135deg, #1d4ed8, #2563eb);

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ==========================================================================
   Landing Page
   ========================================================================== */

.landing-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

.logo-wrapper {
  position: relative;
}

.landing-logo {
  max-width: 320px;
  width: 90vw;
  height: auto;
  filter: drop-shadow(0 0 40px rgba(37, 99, 235, 0.15));
  transition: filter 0.4s ease;
}

.landing-logo:hover {
  filter: drop-shadow(0 0 60px rgba(37, 99, 235, 0.3));
}

.landing-actions {
  display: flex;
  gap: 1rem;
}

.landing-ambience {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(37, 99, 235, 0.06), transparent),
    radial-gradient(ellipse 500px 300px at 70% 80%, rgba(29, 78, 216, 0.04), transparent);
  pointer-events: none;
}

/* ==========================================================================
   Register / Form Page
   ========================================================================== */

.register-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.form-container {
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.6s ease-out;
}

.form-logo-link {
  display: block;
  text-align: center;
  margin-bottom: 2rem;
}

.form-logo {
  max-width: 160px;
  height: auto;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.form-logo:hover {
  opacity: 1;
}

.form-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.form-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.form-message.success {
  background: var(--success-bg);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.form-message.error {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

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

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 32px;
  width: auto;
  opacity: 0.9;
}

.dashboard-page .nav-logo {
  display: none;
}

/* Background watermark logo */
.bg-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(50vw, 400px);
  height: auto;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  animation: fadeInUp 0.3s ease-out;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-username {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */

.dashboard-main {
  max-width: 1200px; /* widened for sidebar */
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Profile Card */
.profile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
}

.profile-avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 3px solid var(--border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

.avatar-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  text-align: center;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  transform: translateY(100%);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.profile-avatar-container:hover .avatar-overlay {
  transform: translateY(0);
}

.profile-username {
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
}

.profile-balance {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

.balance-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.balance-amount {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--success);
}

.profile-stats {
  width: 100%;
}

.profile-stats h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.stat-label {
  color: var(--text-secondary);
}

.stat-value {
  color: var(--text-primary);
  font-weight: 500;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out both;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }

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

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-header h2 svg {
  color: var(--accent);
}

.card-body {
  padding: 1.5rem;
}

/* ==========================================================================
   Status
   ========================================================================== */

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--danger);
}

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

.player-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.player-card.online {
  border-color: rgba(34, 197, 94, 0.3);
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.player-device {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

/* Now Playing - RA Detail */
.now-playing-ra {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  margin-top: 10px;
}

.now-playing-game-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(34, 197, 94, 0.3);
  flex-shrink: 0;
}

.now-playing-ra-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.now-playing-game-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #22c55e;
}

.now-playing-presence {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ==========================================================================
   RetroAchievements
   ========================================================================== */

.ra-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.ra-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.ra-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.ra-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ra-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ra-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ra-now-playing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.now-playing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.now-playing-text {
  font-size: 0.85rem;
  color: #22c55e;
  font-weight: 500;
}

.ra-section {
  margin-top: 1.5rem;
}

.ra-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.player-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.player-stat-item:hover {
  border-color: var(--accent);
}

.player-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.player-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 4px;
}

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

.game-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.game-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

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

.game-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-console {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  margin: 0.4rem 0 0.2rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.6s ease;
}

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

/* Clickable game cards */
.game-card-wrapper {
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.game-card-wrapper.expanded {
  box-shadow: 0 0 0 1px var(--accent);
}

.game-card-clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.game-card-clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.game-expand-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.game-card-wrapper.expanded .game-expand-icon {
  transform: rotate(180deg);
}

/* Achievement expansion panel */
.game-achievements-panel {
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  padding: 1rem;
}

.game-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}

.game-ach-badge {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  cursor: help;
  transition: transform 0.15s, box-shadow 0.15s;
}

.game-ach-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-ach-badge.earned {
  box-shadow: 0 0 0 2px var(--accent);
}

.game-ach-badge.earned:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--accent);
  z-index: 2;
}

.game-ach-badge.locked {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.game-ach-badge.locked:hover {
  opacity: 0.7;
  transform: scale(1.2);
  z-index: 2;
}

.game-ach-summary {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.achievement-badge {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.achievement-badge-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.achievement-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.achievement-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.achievement-game {
  font-size: 0.78rem;
  color: var(--accent);
}

.achievement-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   Getting Started Steps
   ========================================================================== */

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.staff-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.staff-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.staff-tag small {
  opacity: 0.7;
  font-weight: 400;
}

.staff-admin {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.staff-moderator {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.code-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin: 0.5rem 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

.code-block code {
  flex: 1;
  color: var(--accent);
  word-break: break-all;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.copy-btn:hover {
  opacity: 1;
}

/* ==========================================================================
   Optimization Table
   ========================================================================== */

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

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.tip {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.85rem;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tip p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

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

.admin-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-item-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-item-actions {
  display: flex;
  gap: 0.5rem;
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.role-badge.moderator {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.role-badge.member {
  background: rgba(136, 136, 160, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(136, 136, 160, 0.2);
}

.badge {
  background: var(--accent-gradient);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

.inline-form .form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 440px;
  width: 90vw;
  animation: fadeInUp 0.3s ease-out;
}

.modal-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.modal-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0.75rem 0 1.25rem;
}

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

/* ==========================================================================
   Utilities
   ========================================================================== */

.loading-spinner {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

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

/* ==========================================================================
   Animations
   ========================================================================== */

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 16px rgba(34, 197, 94, 0.8); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .nav-bar {
    padding: 0 1rem;
  }

  .nav-username {
    display: none;
  }

  .dashboard-main {
    padding: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .landing-actions {
    flex-direction: column;
    width: 80vw;
    max-width: 280px;
  }

  .landing-actions .btn {
    justify-content: center;
  }

  .ra-stats {
    flex-direction: column;
    text-align: center;
  }

  .ra-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

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

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

  .inline-form .form-row {
    flex-direction: column;
  }

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

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

/* ==========================================================================
   Game Database
   ========================================================================== */

.games-stats-row {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.games-stat {
  text-align: center;
}

.games-stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search bar — full width row */
.games-search-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 0.75rem;
}

/* Filter row — fixed-width dropdowns */
.games-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.games-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.games-search {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.games-search:focus {
  outline: none;
  border-color: var(--accent);
}

.games-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  width: 150px;
}

.games-select:focus {
  outline: none;
  border-color: var(--accent);
}

.games-filter-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* Game List */
.games-list-scroll {
  max-height: 70vh;
  overflow-y: auto;
  border-radius: 6px;
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.15s, background 0.15s;
}

.game-list-row.has-detail {
  cursor: pointer;
}

.game-list-row:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.game-list-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.game-list-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Fixed-width columns for alignment */
.game-list-col.genre {
  width: 100px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-list-col.rating {
  width: 70px;
  font-size: 0.8rem;
  color: #f5b731;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 1px;
}

.game-list-details .console-badge {
  min-width: 80px;
  text-align: center;
  box-sizing: border-box;
}

/* Game Detail Modal */
.gd-modal {
  max-width: 640px;
  width: 92vw;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.gd-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  z-index: 1;
}

.gd-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.gd-modal-layout {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.gd-modal-cover-wrap {
  flex-shrink: 0;
  width: 160px;
}

.gd-modal-cover {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

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

.gd-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 30px;
}

.gd-modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.gd-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 20px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.gd-meta-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.gd-meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.gd-meta-value {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.gd-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Console Badges */
.console-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

/* Rating Badge (shown when filtering single console) */
.rating-badge {
  font-size: 0.75rem;
  color: #f5b731;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 1px;
}

/* Recently Added */
.recently-added-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.recently-added-scroll::-webkit-scrollbar {
  height: 6px;
}

.recently-added-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.recently-added-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.recent-game-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  max-width: 220px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.recent-game-card:hover {
  border-color: var(--accent);
}

.recent-game-card .console-badge {
  align-self: flex-start;
}

.recent-game-title {
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Load More */
.games-load-more-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 0 0.5rem;
}

.games-load-more {
  padding: 8px 28px;
}

.games-showing {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Scan button on admin */
.scan-result {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

@media (max-width: 640px) {
  .games-stats-row {
    gap: 1.5rem;
  }

  .games-stat-value {
    font-size: 1.3rem;
  }

  .games-filters {
    flex-direction: column;
  }

  .games-select {
    width: 100%;
  }

  .game-list-col.genre,
  .game-list-col.rating {
    display: none;
  }

  .gd-modal-layout {
    flex-direction: column;
    align-items: center;
  }

  .gd-modal-cover-wrap {
    width: 120px;
  }
}

/* ==========================================================================
   Casino — Design System
   ========================================================================== */

.casino-page {
  background: #060a10;
}

/* Balance Chip */
.casino-balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1a2744, #0d1a30);
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffd700;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

.chip-icon {
  font-size: 1rem;
}

/* Casino Hero */
.casino-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.casino-hero-logo {
  width: 100px;
  opacity: 0.7;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.25));
}

.casino-hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.casino-hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Casino Floor */
.casino-floor {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.casino-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.casino-section-title svg {
  stroke: var(--accent);
}

/* Game Card Grid */
.casino-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.casino-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2rem 1.5rem 1.5rem;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  overflow: hidden;
}

.casino-game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.casino-game-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

.casino-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #60a5fa;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(37, 99, 235, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.casino-card-icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 2px;
  filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.4));
  transition: all 0.3s ease;
}

.casino-game-card:hover .casino-card-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(30, 58, 138, 0.8));
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff;
  transform: scale(1.15) translateY(-6px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4), inset 0 0 15px rgba(96, 165, 250, 0.3);
}

.casino-game-card:hover .casino-card-icon svg {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
  transform: scale(1.05);
}

/* Custom CSS Icons Framework */
.mini-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  transform: translateY(2px);
}

.mini-card {
  width: 24px;
  height: 34px;
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border-radius: 3px;
  border: 1px solid #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1px 0;
  font-size: 11px;
  font-family: 'Arial Black', Impact, sans-serif;
  box-shadow: -2px 2px 4px rgba(0,0,0,0.5);
  position: relative;
  transform-origin: bottom center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
}
.mini-card.red { color: #dc2626; }
.mini-card.black { color: #0f172a; }
.mini-card::before { content: attr(data-val); line-height: 1; margin-top: 1px; }
.mini-card::after { content: attr(data-suit); font-size: 14px; line-height: 1; margin-bottom: 1px; }

/* Fan configurations based on number of cards */
/* 2 cards */
.mini-hand[data-cards="2"] .mini-card:nth-child(1) { transform: rotate(-8deg) translateX(4px); z-index: 1; }
.mini-hand[data-cards="2"] .mini-card:nth-child(2) { transform: rotate(8deg) translateX(-4px); z-index: 2; margin-left: -12px; }

/* 3 cards */
.mini-hand[data-cards="3"] .mini-card:nth-child(1) { transform: rotate(-12deg) translateX(4px) translateY(2px); z-index: 1; }
.mini-hand[data-cards="3"] .mini-card:nth-child(2) { transform: rotate(0deg); z-index: 2; margin-left: -12px; }
.mini-hand[data-cards="3"] .mini-card:nth-child(3) { transform: rotate(12deg) translateX(-4px) translateY(2px); z-index: 3; margin-left: -12px; }

/* 4 cards */
.mini-hand[data-cards="4"] .mini-card:nth-child(1) { transform: rotate(-15deg) translateX(6px) translateY(3px); z-index: 1; }
.mini-hand[data-cards="4"] .mini-card:nth-child(2) { transform: rotate(-5deg) translateX(2px); z-index: 2; margin-left: -14px; }
.mini-hand[data-cards="4"] .mini-card:nth-child(3) { transform: rotate(5deg) translateX(-2px); z-index: 3; margin-left: -14px; }
.mini-hand[data-cards="4"] .mini-card:nth-child(4) { transform: rotate(15deg) translateX(-6px) translateY(3px); z-index: 4; margin-left: -14px; }

/* 5 cards */
.mini-hand[data-cards="5"] .mini-card:nth-child(1) { transform: rotate(-20deg) translateX(8px) translateY(5px); z-index: 1; }
.mini-hand[data-cards="5"] .mini-card:nth-child(2) { transform: rotate(-10deg) translateX(4px) translateY(1px); z-index: 2; margin-left: -16px; }
.mini-hand[data-cards="5"] .mini-card:nth-child(3) { transform: rotate(0deg); z-index: 3; margin-left: -16px; }
.mini-hand[data-cards="5"] .mini-card:nth-child(4) { transform: rotate(10deg) translateX(-4px) translateY(1px); z-index: 4; margin-left: -16px; }
.mini-hand[data-cards="5"] .mini-card:nth-child(5) { transform: rotate(20deg) translateX(-8px) translateY(5px); z-index: 5; margin-left: -16px; }

.casino-game-card:hover .mini-hand .mini-card {
  box-shadow: -4px 6px 10px rgba(0,0,0,0.6);
}
/* Enhance fan spread on hover */
.casino-game-card:hover .mini-hand[data-cards="2"] .mini-card:nth-child(1) { transform: rotate(-12deg) translateX(2px) translateY(-2px); }
.casino-game-card:hover .mini-hand[data-cards="2"] .mini-card:nth-child(2) { transform: rotate(12deg) translateX(-2px) translateY(-2px); }

/* CSS Roulette Wheel */
.css-roulette {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(
    #dc2626 0deg 30deg, #111 30deg 60deg, 
    #dc2626 60deg 90deg, #111 90deg 120deg, 
    #dc2626 120deg 150deg, #111 150deg 180deg, 
    #16a34a 180deg 210deg, 
    #111 210deg 240deg, #dc2626 240deg 270deg, 
    #111 270deg 300deg, #dc2626 300deg 330deg, 
    #111 330deg 360deg
  );
  border: 4px solid #b45309; 
  box-shadow: inset 0 0 6px rgba(0,0,0,0.9), 0 4px 10px rgba(0,0,0,0.5);
  position: relative;
  transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.css-roulette::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  background: radial-gradient(circle, #facc15, #854d0e);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.casino-game-card:hover .css-roulette {
  transform: rotate(360deg) scale(1.1);
}

/* CSS Craps Dice */
.css-dice-wrap {
  display: flex;
  gap: 3px;
  transform: rotate(-10deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.casino-game-card:hover .css-dice-wrap {
  transform: rotate(5deg) scale(1.1);
}
.css-die {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #ffffff, #e2e8f0);
  border-radius: 4px;
  box-shadow: inset -2px -2px 4px rgba(0,0,0,0.2), 2px 2px 6px rgba(0,0,0,0.5);
  position: relative;
  display: grid;
  padding: 3px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
}
.css-die-2 { transform: translateY(6px) rotate(15deg); }
.casino-game-card:hover .css-die-2 { transform: translateY(2px) rotate(25deg); }
.css-die .dot {
  width: 4px; height: 4px;
  background: #dc2626;
  border-radius: 50%;
  margin: auto;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}
.css-die.five .dot:nth-child(1) { grid-area: 1 / 1; }
.css-die.five .dot:nth-child(2) { grid-area: 1 / 3; }
.css-die.five .dot:nth-child(3) { grid-area: 2 / 2; }
.css-die.five .dot:nth-child(4) { grid-area: 3 / 1; }
.css-die.five .dot:nth-child(5) { grid-area: 3 / 3; }
.css-die.six .dot:nth-child(1) { grid-area: 1 / 1; }
.css-die.six .dot:nth-child(2) { grid-area: 2 / 1; }
.css-die.six .dot:nth-child(3) { grid-area: 3 / 1; }
.css-die.six .dot:nth-child(4) { grid-area: 1 / 3; }
.css-die.six .dot:nth-child(5) { grid-area: 2 / 3; }
.css-die.six .dot:nth-child(6) { grid-area: 3 / 3; }

/* CSS UFC Octagon */
.css-ufc-wrap {
  width: 38px; height: 38px;
  background: #dc2626;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.casino-game-card:hover .css-ufc-wrap {
  transform: scale(1.1) rotate(22.5deg);
}
.css-ufc-inner {
  width: 34px; height: 34px;
  background: #111;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  font-family: Arial, sans-serif;
  letter-spacing: 0.5px;
}
.casino-game-card:hover .css-ufc-inner {
  transform: rotate(-22.5deg); /* Counter-rotate text so it stays straight */
}

.casino-game-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8e0d0;
}

.casino-game-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.casino-card-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-hover);
  border: 1px solid rgba(37, 99, 235, 0.3);
  margin-top: 4px;
}

.casino-card-badge.solo {
  background: rgba(100, 100, 45, 0.3);
  color: #d4c76a;
  border-color: rgba(180, 160, 45, 0.3);
}

.casino-card-badge.pvp {
  background: rgba(45, 45, 107, 0.3);
  color: #6a8abf;
  border-color: rgba(45, 60, 130, 0.4);
}

.casino-card-badge.live {
  background: rgba(180, 40, 40, 0.25);
  color: #e06060;
  border-color: rgba(180, 40, 40, 0.4);
}

/* UFC Card special styling */
.ufc-card {
  grid-column: 1 / -1;
  max-width: 480px;
}

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

.coming-soon-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

/* ==========================================================================
   Chatroom
   ========================================================================== */
.chat-card {
  display: flex;
  flex-direction: column;
  height: 840px;
}
.chat-body {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100%;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
}
.chat-message {
  display: flex;
  gap: 0.8rem;
  background: var(--bg-card);
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-user {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}
.chat-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.chat-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}
.chat-del-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: auto;
}
.chat-del-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}
.chat-composer {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.chat-toolbar {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-main);
}
.toolbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.toolbar-btn:hover {
  background: var(--bg-card);
  color: var(--accent);
}
.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.chat-input-area {
  display: flex;
  padding: 0.8rem;
  gap: 0.5rem;
  align-items: flex-end;
}
.chat-editor {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.6rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
  outline: none;
  word-break: break-word;
}
.chat-editor:empty:before {
  content: attr(placeholder);
  color: #666;
  pointer-events: none;
  display: block; /* For Firefox */
}
.chat-editor:focus {
  border-color: var(--accent);
}
.chat-inline-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  display: block;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}


@media (max-width: 768px) {
  .casino-hero-title {
    font-size: 1.6rem;
  }

  .casino-game-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ufc-card {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .casino-game-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   Arcade UI (Toasts & Modals)
   ========================================= */
.arcade-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-left: 4px solid var(--primary);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  color: white;
  font-weight: bold;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.arcade-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.arcade-toast .toast-mult { color: var(--primary); font-size: 0.9rem; }
.arcade-toast .toast-amt { font-size: 1.3rem; margin-top: 5px; }

.arcade-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.arcade-modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.arcade-modal {
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  border: 2px solid #fbbf24;
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.3), inset 0 0 20px rgba(251, 191, 36, 0.1);
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: pulse-border 2s infinite;
}
.arcade-modal-overlay.show .arcade-modal {
  transform: scale(1);
}
.arcade-modal h2 {
  color: #fbbf24;
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}
.arcade-modal .big-mult {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.arcade-modal .big-amt {
  font-size: 4rem;
  font-weight: bold;
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}
.arcade-modal button {
  margin-top: 30px;
  background: #fbbf24;
  color: #000;
  border: none;
  padding: 12px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s;
}
.arcade-modal button:hover { background: #fde68a; }
.arcade-modal button:active { transform: scale(0.95); }

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 50px rgba(251, 191, 36, 0.3), inset 0 0 20px rgba(251, 191, 36, 0.1); }
  50% { box-shadow: 0 0 70px rgba(251, 191, 36, 0.5), inset 0 0 40px rgba(251, 191, 36, 0.2); }
}
