:root {
  --bg-dark: #090d16;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.78);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 243, 255, 0.3);
  --primary-cyan: #00f3ff;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.4);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-body); overflow-x: hidden; line-height: 1.6; width: 100%; min-height: 100vh; }
#bg-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
#emote-layer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 999; overflow: hidden; }
.floating-emote { position: absolute; font-size: clamp(2rem, 6vw, 3.5rem); animation: floatUp 2.5s ease-out forwards; filter: drop-shadow(0 0 10px rgba(0,243,255,0.8)); }

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  20% { opacity: 1; transform: translateY(0) scale(1.2); }
  80% { opacity: 1; transform: translateY(-80px) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.8); }
}

h1, h2, h3, .logo-text { font-family: var(--font-heading); letter-spacing: 0.5px; }
.gold-icon { color: var(--gold); filter: drop-shadow(0 0 6px var(--gold-glow)); }
.primary-cyan { color: var(--primary-cyan); }
.gradient-text { background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--accent-purple) 50%, var(--accent-pink) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.navbar { position: sticky; top: 0; z-index: 1000; background: rgba(9, 13, 22, 0.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-color); padding: 0.7rem 1rem; }
.nav-container { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; position: relative; z-index: 2000; }
.brand-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: clamp(1.1rem, 3.5vw, 1.5rem); font-weight: 900; color: #fff; white-space: nowrap; }
.logo-icon { color: var(--primary-cyan); font-size: 1.4rem; text-shadow: 0 0 10px var(--primary-cyan); }
.logo-text .highlight { color: var(--primary-cyan); }

.mobile-nav-toggle { display: none; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-color); color: #fff; font-size: 1.2rem; width: 44px; height: 44px; border-radius: var(--radius-sm); cursor: pointer; align-items: center; justify-content: center; }
.nav-links { display: flex; gap: 1.2rem; align-items: center; }
.nav-item { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: var(--transition-fast); white-space: nowrap; position: relative; }
.nav-item::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary-cyan); transition: width var(--transition-normal); }
.nav-item:hover::after, .nav-item.active::after { width: 100%; }
.nav-item:hover, .nav-item.active { color: var(--primary-cyan); text-shadow: 0 0 8px rgba(0, 243, 255, 0.5); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.coin-badge, .ticket-badge { display: flex; align-items: center; gap: 5px; background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.3); padding: 5px 10px; border-radius: 20px; font-family: var(--font-heading); font-size: 0.78rem; color: #fff; white-space: nowrap; }
.coin-label, .ticket-label { font-size: 0.62rem; color: var(--gold); font-weight: 700; }
.auth-group { display: flex; align-items: center; gap: 6px; }
.user-profile-wrapper { position: relative; display: inline-block; }
.user-profile-btn { background: rgba(0, 243, 255, 0.1); border: 1px solid var(--primary-cyan); padding: 5px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; transition: var(--transition-fast); }
.user-profile-btn:hover { background: rgba(0, 243, 255, 0.2); box-shadow: 0 0 12px rgba(0, 243, 255, 0.3); }
.badge-role { background: var(--primary-cyan); color: #000; padding: 2px 6px; border-radius: 10px; font-size: 0.62rem; font-weight: 900; }

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid var(--primary-cyan);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 243, 255, 0.2);
  backdrop-filter: blur(16px);
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.dropdown-header { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.dropdown-username { font-weight: 700; color: #fff; font-size: 0.95rem; word-break: break-word; }
.dropdown-role { font-size: 0.72rem; color: var(--primary-cyan); font-weight: 700; font-family: var(--font-heading); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-stats { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--text-main); }
.dropdown-stats .stat-item { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dropdown-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition-fast);
}
.dropdown-link:hover, .dropdown-link:active {
  background: rgba(0, 243, 255, 0.15);
  color: var(--primary-cyan);
}
.dropdown-link.logout-btn { color: #ef4444; }
.dropdown-link.logout-btn:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0.6rem 1.2rem; min-height: 44px; border-radius: var(--radius-md); font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; cursor: pointer; border: none; text-decoration: none; transition: var(--transition-fast); white-space: nowrap; touch-action: manipulation; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary-cyan) 0%, #00a8ff 100%); color: #000; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 243, 255, 0.6); }
.btn-primary:active { transform: translateY(-2px) scale(0.97); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); border-color: var(--primary-cyan); transform: translateY(-2px); }
.btn-secondary:active { background: rgba(255, 255, 255, 0.15); border-color: var(--primary-cyan); transform: translateY(-2px) scale(0.97); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-glow { box-shadow: 0 0 15px rgba(0, 243, 255, 0.4); }
.btn-lg { padding: 0.8rem 1.8rem; font-size: 1rem; min-height: 48px; }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; min-height: 36px; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid var(--border-color); flex-shrink: 0; }

.hero-section { padding: clamp(1.8rem, 4vw, 4.5rem) 1rem; max-width: 1280px; margin: 0 auto; }
.hero-container { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; }

@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.badge-pill { animation: fadeSlideIn 0.5s ease-out; display: inline-flex; align-items: center; gap: 8px; background: rgba(0, 243, 255, 0.08); border: 1px solid rgba(0, 243, 255, 0.2); padding: 5px 14px; border-radius: 30px; font-size: 0.82rem; color: var(--primary-cyan); margin-bottom: 1rem; font-weight: 600; }
.pulse-dot { width: 8px; height: 8px; background-color: var(--primary-cyan); border-radius: 50%; box-shadow: 0 0 10px var(--primary-cyan); animation: pulse 1.5s infinite; }

@keyframes pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 243, 255, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 243, 255, 0); } }

.hero-title { font-size: clamp(1.8rem, 4.5vw, 3.2rem); line-height: 1.15; margin-bottom: 1rem; }
.hero-subtitle { font-size: clamp(0.9rem, 2vw, 1.1rem); color: var(--text-muted); margin-bottom: 1.8rem; max-width: 580px; }
.hero-cta-group { display: flex; gap: 0.8rem; margin-bottom: 2rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 1.2rem; border-top: 1px solid var(--border-color); padding-top: 1.2rem; flex-wrap: wrap; }
.stat-number { display: block; font-family: var(--font-heading); font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; color: var(--primary-cyan); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); }

.visual-grid-card { position: relative; background: var(--bg-card); border: 1px solid var(--border-glow); border-radius: var(--radius-lg); padding: 1.2rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 243, 255, 0.15); backdrop-filter: blur(16px); transform: perspective(1000px) rotateY(-5deg) rotateX(2deg); transition: var(--transition-normal); }
.visual-grid-card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg); box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 243, 255, 0.25); }

.preview-header { display: flex; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.preview-tag { color: var(--primary-cyan); font-family: var(--font-heading); }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: rgba(0, 0, 0, 0.4); padding: 8px; border-radius: var(--radius-md); margin-bottom: 1rem; }
.mini-cell { aspect-ratio: 1; background: rgba(255, 255, 255, 0.05); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; border: 1px solid rgba(255, 255, 255, 0.05); }
.cell-x { color: var(--primary-cyan); text-shadow: 0 0 10px var(--primary-cyan); }
.cell-o { color: var(--accent-pink); text-shadow: 0 0 10px var(--accent-pink); }
.winning-cell { background: rgba(0, 243, 255, 0.2); border-color: var(--primary-cyan); animation: pulseGlow 1s infinite alternate; }

@keyframes pulseGlow { from { box-shadow: 0 0 5px var(--primary-cyan); } to { box-shadow: 0 0 20px var(--primary-cyan); } }
.preview-footer { text-align: center; font-size: 0.82rem; font-weight: 600; }

.arena-section, .hub-section, .leaderboard-section, .active-rooms-section, .admin-section { padding: clamp(2rem, 4vw, 4.5rem) 1rem; max-width: 1280px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-title { font-size: clamp(1.4rem, 3.8vw, 2.1rem); margin-bottom: 0.4rem; }
.section-subtitle { color: var(--text-muted); font-size: clamp(0.85rem, 1.8vw, 1rem); }

.arena-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: clamp(0.8rem, 2.5vw, 1.8rem); backdrop-filter: blur(12px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.arena-main-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }

.game-controls { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.3); padding: 0.8rem 1rem; border-radius: var(--radius-md); margin-bottom: 1.2rem; border: 1px solid var(--border-color); }
.control-group { display: flex; flex-direction: column; gap: 4px; }
.control-group label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.segmented-control { display: flex; background: rgba(255, 255, 255, 0.05); padding: 4px; border-radius: var(--radius-sm); gap: 4px; flex-wrap: wrap; }
.segment-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 12px; min-height: 38px; border-radius: 6px; font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: var(--transition-fast); }
.segment-btn.active { background: var(--primary-cyan); color: #000; font-weight: 700; box-shadow: 0 0 10px rgba(0, 243, 255, 0.4); }
.cyber-select, .cyber-input { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-color); color: #fff; padding: 8px 12px; min-height: 44px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.88rem; outline: none; }
.cyber-select:focus, .cyber-input:focus { border-color: var(--primary-cyan); box-shadow: 0 0 10px rgba(0, 243, 255, 0.3); }

.online-panel { background: rgba(0, 243, 255, 0.05); border: 1px dashed var(--primary-cyan); padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1.2rem; }
.hidden { display: none !important; }
.room-box { display: flex; flex-direction: column; gap: 0.8rem; }
.room-action-btns { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.join-group { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.room-status { font-weight: 600; color: var(--primary-cyan); word-break: break-word; font-size: 0.88rem; }

.game-dashboard { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.player-card { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-color); padding: 6px 14px; border-radius: var(--radius-md); min-width: 130px; transition: var(--transition-fast); }
.player-card.active { border-color: var(--primary-cyan); background: rgba(0, 243, 255, 0.08); box-shadow: 0 0 15px rgba(0, 243, 255, 0.2); }
.symbol-badge { font-size: 1.2rem; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.4); flex-shrink: 0; }
.symbol-x { color: var(--primary-cyan); }
.symbol-o { color: var(--accent-pink); }
.player-name { display: block; font-weight: 700; font-size: 0.85rem; }
.player-score { font-size: 0.75rem; color: var(--text-muted); }
.vs-badge { font-family: var(--font-heading); font-weight: 900; color: var(--text-muted); font-size: 1rem; }

.status-banner { display: flex; justify-content: center; align-items: center; gap: 1rem; font-family: var(--font-heading); font-size: clamp(0.88rem, 2.2vw, 1.05rem); font-weight: 700; color: var(--primary-cyan); margin-bottom: 1rem; flex-wrap: wrap; }
.spectator-badge { font-size: 0.75rem; color: var(--gold); background: rgba(255, 215, 0, 0.1); padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(255, 215, 0, 0.3); }

.board-wrapper { display: flex; justify-content: center; margin-bottom: 1rem; width: 100%; }
.game-board { display: grid; gap: clamp(4px, 1.2vw, 10px); background: rgba(0, 0, 0, 0.5); padding: clamp(8px, 1.8vw, 14px); border-radius: var(--radius-lg); border: 2px solid var(--border-color); box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8); width: clamp(240px, 90vw, 440px); max-width: 100%; aspect-ratio: 1; margin: 0 auto; }
.grid-3x3 { grid-template-columns: repeat(3, 1fr); }
.grid-4x4 { grid-template-columns: repeat(4, 1fr); }
.grid-5x5 { grid-template-columns: repeat(5, 1fr); }
.cell { background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-md); border: 1px solid rgba(255, 255, 255, 0.06); display: flex; align-items: center; justify-content: center; font-size: clamp(1.2rem, 5vw, 2.5rem); cursor: pointer; user-select: none; aspect-ratio: 1; transition: var(--transition-fast); }
.grid-5x5 .cell { font-size: clamp(0.9rem, 3.8vw, 1.6rem); }
.cell:hover:not(.taken), .cell:active:not(.taken) { background: rgba(0, 243, 255, 0.15); border-color: var(--primary-cyan); transform: scale(1.03); }
.cell.taken { cursor: not-allowed; }

.theme-neon .cell.cell-x { color: var(--primary-cyan); text-shadow: 0 0 15px var(--primary-cyan); }
.theme-neon .cell.cell-o { color: var(--accent-pink); text-shadow: 0 0 15px var(--accent-pink); }
.theme-matrix .cell.cell-x { color: #10b981; text-shadow: 0 0 15px #10b981; }
.theme-matrix .cell.cell-o { color: #06b6d4; text-shadow: 0 0 15px #06b6d4; }
.theme-gold .cell.cell-x { color: var(--gold); text-shadow: 0 0 15px var(--gold); }
.theme-gold .cell.cell-o { color: #f97316; text-shadow: 0 0 15px #f97316; }
.theme-retro .cell.cell-x { color: #e11d48; text-shadow: 0 0 15px #e11d48; }
.theme-retro .cell.cell-o { color: #8b5cf6; text-shadow: 0 0 15px #8b5cf6; }

.cell.win-highlight { background: rgba(255, 215, 0, 0.25) !important; border-color: var(--gold) !important; animation: winPulse 0.8s infinite alternate; }
@keyframes winPulse { from { box-shadow: 0 0 10px var(--gold); transform: scale(1.02); } to { box-shadow: 0 0 25px var(--gold); transform: scale(1.08); } }

.emote-bar { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 1.2rem; flex-wrap: wrap; }
.emote-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.emote-btn { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 40px; font-size: 0.95rem; cursor: pointer; color: #fff; transition: var(--transition-fast); }
.emote-btn:hover, .emote-btn:active { background: rgba(0, 243, 255, 0.2); border-color: var(--primary-cyan); transform: scale(1.12); }
.arena-footer-controls { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }

.chat-side { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border-color); border-radius: var(--radius-lg); display: flex; flex-direction: column; height: clamp(320px, 40vh, 460px); min-height: 280px; overflow: hidden; width: 100%; }
.chat-header { background: rgba(255, 255, 255, 0.05); padding: 0.8rem; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }
.chat-messages { flex: 1; padding: 0.8rem; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.82rem; }
.chat-msg { background: rgba(255, 255, 255, 0.06); padding: 7px 10px; border-radius: var(--radius-md); word-break: break-word; }
.chat-msg.system-msg { background: rgba(0, 243, 255, 0.08); color: var(--primary-cyan); font-style: italic; font-size: 0.75rem; }
.chat-author { font-weight: 700; color: var(--primary-cyan); display: block; margin-bottom: 2px; font-size: 0.72rem; }
.chat-time { font-size: 0.68rem; color: var(--text-muted); float: right; }
.chat-input-bar { display: flex; gap: 6px; padding: 0.7rem; border-top: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.3); }
.chat-input-bar input { flex: 1; }

.rooms-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: clamp(0.8rem, 2.5vw, 1.8rem); }
.rooms-header-actions { display: flex; justify-content: flex-end; margin-bottom: 1.2rem; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

.room-card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-color); border-left: 3px solid var(--primary-cyan); border-radius: var(--radius-md); padding: 1rem; display: flex; flex-direction: column; gap: 8px; transition: var(--transition-fast); }
.room-card:hover { border-color: var(--primary-cyan); transform: translateY(-3px); box-shadow: -4px 0 15px rgba(0, 243, 255, 0.25); }
.room-card-header { display: flex; justify-content: space-between; font-family: var(--font-heading); font-size: 0.85rem; font-weight: 700; }
.room-card-players { font-size: 0.82rem; color: var(--text-muted); }

.hub-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.hub-card { background: var(--bg-card); background-image: radial-gradient(circle at top right, rgba(0, 243, 255, 0.05), transparent 60%); border: 1px solid var(--border-color); padding: 1.5rem; border-radius: var(--radius-lg); transition: var(--transition-normal); }
.hub-card:hover, .hub-card:active { transform: translateY(-4px); border-color: var(--primary-cyan); box-shadow: 0 10px 20px rgba(0, 243, 255, 0.15); }
.daily-box { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card-icon { font-size: 2.6rem; margin-bottom: 0.8rem; }
.reward-feedback { margin-top: 0.8rem; font-weight: 700; color: var(--gold); }
.quests-box h3 { margin-bottom: 1rem; }
.quest-item { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--border-color); gap: 8px; }
.quest-item:last-child { border-bottom: none; }
.quest-title { display: block; font-weight: 700; font-size: 0.85rem; }
.quest-desc { font-size: 0.78rem; color: var(--text-muted); }
.quest-reward { font-family: var(--font-heading); font-weight: 700; color: var(--gold); white-space: nowrap; font-size: 0.85rem; }

.leaderboard-container, .admin-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }

.visitor-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.metric-card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1rem; transition: var(--transition-fast); }
.metric-card:hover { transform: translateY(-3px); border-color: var(--primary-cyan); box-shadow: 0 10px 25px rgba(0, 243, 255, 0.15); }
.metric-today { border-left: 4px solid var(--primary-cyan); }
.metric-week { border-left: 4px solid var(--accent-purple); }
.metric-month { border-left: 4px solid var(--accent-pink); }
.metric-alltime { border-left: 4px solid var(--gold); }
.metric-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.metric-title { font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.metric-icon { font-size: 1.1rem; color: var(--primary-cyan); }
.metric-number { display: block; font-family: var(--font-heading); font-size: 1.6rem; font-weight: 900; color: #fff; line-height: 1.1; }
.metric-sub { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.visitor-log-section { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1rem; }
.section-sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; flex-wrap: wrap; gap: 0.6rem; }
.section-sub-header h3 { font-size: 0.92rem; color: var(--primary-cyan); }

.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cyber-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 500px; }
.cyber-table th, .cyber-table td { padding: 0.8rem 1rem; font-size: 0.85rem; }
.cyber-table th { background: rgba(0, 0, 0, 0.4); font-family: var(--font-heading); font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; white-space: nowrap; }
.cyber-table tbody tr { border-bottom: 1px solid var(--border-color); transition: var(--transition-fast); }
.cyber-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.cyber-table tbody tr:hover { background: rgba(0, 243, 255, 0.05); }

.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-family: var(--font-heading); font-weight: 700; font-size: 0.78rem; }
.rank-1 { background: var(--gold); color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #000; }

.admin-container { padding: clamp(0.8rem, 2.5vw, 1.8rem); }
.admin-tabs { display: flex; gap: 0.8rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.admin-table { min-width: 650px; }

.auth-modal-card { position: relative; text-align: left; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 1.2rem; }
.auth-tab-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition-fast); }
.auth-tab-btn.active { color: var(--primary-cyan); border-bottom-color: var(--primary-cyan); }
.auth-title { font-size: 1.15rem; margin-bottom: 0.8rem; }

.bonus-banner { background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.3); padding: 8px; border-radius: var(--radius-sm); font-size: 0.8rem; color: #fff; margin-bottom: 1rem; text-align: center; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.form-group input { width: 100%; }
.form-feedback { margin-bottom: 0.8rem; font-weight: 600; font-size: 0.82rem; }
.form-feedback.error { color: #ef4444; }
.form-feedback.success { color: #10b981; }
.modal-close-btn { position: absolute; top: 12px; right: 12px; background: transparent; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.modal-close-btn:hover { color: #fff; }

.footer { border-top: 1px solid var(--border-color); padding: 2rem 1rem; background: rgba(0, 0, 0, 0.6); }
.footer-container { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; }
.status-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-indicator.online { background-color: #10b981; box-shadow: 0 0 10px #10b981; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 1rem; }
.modal-card { background: var(--bg-surface); border: 1px solid var(--primary-cyan); border-radius: var(--radius-lg); padding: clamp(1.2rem, 3.5vw, 2.2rem); width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 243, 255, 0.3); animation: modalIn 0.3s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.modal-icon { font-size: 2.6rem; color: var(--gold); margin-bottom: 0.6rem; }
.ticket-earned-box { background: rgba(255, 215, 0, 0.1); border: 1px solid rgba(255, 215, 0, 0.3); padding: 0.7rem; border-radius: var(--radius-md); margin: 1rem 0; font-family: var(--font-heading); font-size: 0.95rem; color: #fff; }
.modal-footer { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 992px) {
  .mobile-nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: rgba(9, 13, 22, 0.98); backdrop-filter: blur(24px); flex-direction: column; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--primary-cyan); gap: 1rem; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9); z-index: 1001; }
  .nav-links.mobile-open { display: flex !important; }
  .nav-links .nav-item { min-height: 48px; display: flex; align-items: center; width: 100%; }
  .hero-container { grid-template-columns: 1fr; }
  .hero-visual { display: flex; justify-content: center; width: 100%; overflow: hidden; }
  .visual-grid-card { transform: none; }
  .arena-main-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .hero-section { padding-top: 1.5rem; }
  .game-controls { flex-direction: column; align-items: stretch; }
  .control-group label { margin-bottom: 4px; }
  .segmented-control { width: 100%; }
  .segment-btn { flex: 1; text-align: center; }
  .cyber-select { width: 100%; }
  .room-action-btns { flex-direction: column; align-items: stretch; }
  .join-group { width: 100%; }
  .join-group input { flex: 1; }
  .hero-stats { justify-content: space-around; }
  .nav-actions { display: flex; align-items: center; gap: 4px; }
  .coin-badge .coin-label, .ticket-badge .ticket-label { display: none; }
}

@media (max-width: 480px) {
  .navbar { padding: 0.5rem 0.8rem; }
  .brand-logo { font-size: 1.1rem; }
  .hero-title { font-size: 1.6rem; }
  .hero-cta-group { flex-direction: column; }
  .admin-tabs { flex-direction: column; }
  .admin-tabs .btn { width: 100%; }
  .hero-cta-group .btn { width: 100%; }
  .game-dashboard { gap: 0.6rem; }
  .player-card { min-width: 110px; padding: 5px 8px; }
  .arena-footer-controls .btn { width: 100%; }
  .footer-container { flex-direction: column; text-align: center; }
  .footer-status { line-height: 1.8; max-width: 220px; margin: 0 auto; word-break: break-word; }
  .coin-badge, .ticket-badge { display: none !important; }
}

.fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
