/* style.css - Poki Style Redesign */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@500;700;800;900&display=swap');

:root {
  --bg-color: #f0f2f5;
  --bg-gradient: linear-gradient(135deg, #e6efff 0%, #ffe6eb 100%);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-bg-solid: #ffffff;
  --text-main: #2b3040;
  --text-muted: #64748b;
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --font-family: 'Nunito', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --glass-border: 1px solid rgba(255, 255, 255, 0.8);
  --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Base Layout (Column Stack) */
.app-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  flex: 1;
}

/* Sidebar Navigation */
.sidebar {
  width: 250px;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  padding: 20px 0;
  border-right: none;
}

.logo-container {
  padding: 0 20px 20px;
  text-align: center;
}

.logo {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-text {
  background: linear-gradient(to right, #3b82f6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  font-size: 1.4rem;
  margin-left: 5px;
}

.nav-menu {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 5px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(5px);
}

.nav-item.active {
  background: var(--card-bg-solid);
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  width: 6px;
  height: 20px;
  background: #fbbf24;
  border-radius: 3px;
}

.nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

/* Main Content Area */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* flex fix */
}

/* Top Header with Centered Logo */
.top-header {
  height: 80px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: var(--glass-border);
}

.logo-header {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: var(--transition);
}

.logo-header:hover {
  transform: scale(1.03);
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: 30px;
  padding: 12px 20px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  margin-left: 15px;
  width: 100%;
  color: var(--text-main);
}

/* Content Container */
.content-container {
  padding: 30px 50px;
  flex: 1;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page-heading {
  margin-bottom: 30px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
}

/* Category Filter Pills (Horizontal Alignment & Responsive) */
.nav-pills {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-bottom: 25px !important;
  align-items: center !important;
  width: 100% !important;
}

.category-pill,
.nav-pills .nav-item {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 22px !important;
  border-radius: 30px !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  color: var(--text-main, #2b3040) !important;
  background: var(--card-bg-solid, #ffffff) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  margin-bottom: 0 !important;
  white-space: nowrap !important;
  position: relative !important;
  width: auto !important;
  font-family: inherit !important;
}

.category-pill::before,
.nav-pills .nav-item::before {
  display: none !important;
  content: none !important;
}

.category-pill:hover,
.nav-pills .nav-item:hover {
  transform: translateY(-2px) !important;
  background: var(--card-bg-solid, #ffffff) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
}

.category-pill.active,
.nav-pills .nav-item.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
}

/* Game Grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  grid-auto-rows: minmax(290px, auto);
  gap: 24px;
}

.game-card {
  background: var(--card-bg);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  border: var(--glass-border);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.03);
  z-index: 10;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.6), 0 18px 36px rgba(0,0,0,0.18);
}

/* Large Featured Card (2x2) */
.game-card.featured {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.35rem;
  border: 1px solid rgba(255,255,255,0.3);
  z-index: 5;
}

.game-card:nth-child(even) .card-badge { color: #ffe4e6; }
.game-card:nth-child(3n) .card-badge { color: #fef3c7; }
.game-card:nth-child(4n) .card-badge { color: #dcfce7; }

.game-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  transition: transform 0.4s ease;
}

.game-card:hover .game-bg-img {
  transform: scale(1.05);
}

.game-emoji {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  text-shadow: 0 10px 20px rgba(0,0,0,0.3);
  z-index: 0;
}

/* Base gradients for small cards to look like 3D backgrounds */
.game-card:nth-child(1n) { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.game-card:nth-child(2n) { background: linear-gradient(135deg, #7c2d12, #ea580c); }
.game-card:nth-child(3n) { background: linear-gradient(135deg, #14532d, #22c55e); }
.game-card:nth-child(4n) { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.game-card:nth-child(5n) { background: linear-gradient(135deg, #831843, #ec4899); }
.game-card:nth-child(6n) { background: linear-gradient(135deg, #1e40af, #60a5fa); }

/* Remove background if it has an image (featured) */
.game-card.featured {
  background: var(--card-bg);
}

.game-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 30px 15px 15px;
  color: white;
  z-index: 5;
}

.game-title {
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.game-card.featured .game-title {
  font-size: 1.4rem;
  text-align: left;
}

/* Ads */





/* Game Page Specific */
.game-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 950px;
  margin: 0 auto;
}

.game-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px 20px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.dom-game-area, .game-canvas-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

canvas {
  max-width: 100%;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--bg-dark);
}

.game-layout {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.game-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.game-details {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.game-guide-section {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
}

#game-leaderboard-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
}

.game-details h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text-main);
}

.game-details p {
  color: var(--text-muted);
  margin-bottom: 15px;
  font-weight: 600;
  line-height: 1.6;
}

/* Playful High-Contrast Status Bar */
.status-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 600px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.status-bar .stat-display,
.status-bar .stat-box {
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 800;
}

.status-bar span {
  color: #38bdf8 !important;
  font-weight: 900;
}

.status-bar button, .status-bar .btn-restart {
  background: #3b82f6;
  color: #ffffff !important;
  border: none;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.status-bar button:hover, .status-bar .btn-restart:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.score-display {
  font-size: 1.2rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}
.modal-content h2 { color: var(--text-main); font-weight: 900; margin-bottom: 15px; }
.modal-content p { font-weight: 600; color: var(--text-muted); margin-bottom: 25px; }
.modal-input {
  width: 100%;
  padding: 15px;
  background: var(--bg-color);
  border: 2px solid transparent;
  color: var(--text-main);
  margin-bottom: 20px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
}
.modal-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 30px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

/* Fullscreen Styles overriden for Poki */
.is-fullscreen {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: #000 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.is-fullscreen .dom-game-area, .is-fullscreen .game-canvas-container {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100vh !important;
  padding: 0 20px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.is-fullscreen canvas {
  height: 85vh !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* Responsive */
@media (max-width: 768px) {
  .app-wrapper { flex-direction: column; }
  
  .sidebar {
    width: 100%; height: auto;
    flex-direction: column;
    position: static; padding: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }
  .logo-container { padding: 10px; text-align: center; }
  .logo { font-size: 1.4rem; justify-content: center; }
  
  .nav-menu { 
    flex-direction: row; 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    padding: 10px 5px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item { padding: 8px 12px; gap: 8px; font-size: 0.9rem; flex: 0 0 auto; }
  .nav-item.active::before { display: none; }
  
  .top-header {
    height: auto;
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }
  
  .search-bar { 
    width: 100%;
    margin: 0;
  }
  
  .user-actions {
    position: static;
    width: 100%;
    justify-content: space-between;
  }
  
  .content-container { padding: 20px; }
  
  .game-grid { 
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    grid-auto-rows: minmax(130px, auto); 
    gap: 15px; 
  }
  
  .game-card.featured {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
  }
  .game-card.featured .game-title {
    font-size: 1.1rem;
    text-align: center;
  }
  
  .section-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
  .game-layout {
    flex-direction: column;
  }
  .game-details {
    flex: none;
    width: 100%;
  }
  .game-container {
    width: 100%;
  }
  .hud-controls {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .content-container { padding: 15px 10px; }
  .game-details h1 { font-size: 1.4rem; }
  .game-details { padding: 15px; }
}

/* Bottom Footer */
.main-footer {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-top: 3px solid #3b82f6;
  padding: 40px 20px 30px;
  text-align: center;
  margin-top: 40px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 700;
  margin: -10px 0 4px 0;
  letter-spacing: 0.3px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 760px;
}

.footer-link {
  font-weight: 800;
  font-size: 0.92rem;
  color: #f1f5f9;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.footer-copy {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 6px;
}

/* Game Guide & SEO Content Container */
.game-guide-section {
  margin-top: 40px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 35px;
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
}

.game-guide-section h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  margin-top: 25px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-color, rgba(0,0,0,0.08));
  padding-bottom: 8px;
}

.game-guide-section h2:first-child {
  margin-top: 0;
}

.game-guide-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 18px;
  margin-bottom: 8px;
}

.game-guide-section p {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 14px;
}

.game-guide-section ul, .game-guide-section ol {
  margin-left: 24px;
  margin-bottom: 18px;
}

.game-guide-section li {
  margin-bottom: 6px;
  font-weight: 600;
}

/* Controls Table & Responsive Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

.controls-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-weight: 700;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-sizing: border-box;
}

.controls-table th, .controls-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.controls-table th {
  background: var(--accent-primary);
  color: white;
  font-weight: 900;
}

.controls-table tr:last-child td {
  border-bottom: none;
}

/* FAQ Accordion Section */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.faq-item {
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  border: 1px solid rgba(0,0,0,0.06);
}

.faq-question {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.faq-answer {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0 !important;
}

/* DOM Games Enhancements for Poki Theme */
.word-cell, .tile, .card {
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-dark);
  box-shadow: var(--shadow-sm);
  background: white;
  color: var(--text-main);
  font-weight: 800;
}
.word-cell.correct { background: #4ade80; border-color: #22c55e; color: white; }
.word-cell.present { background: #fbbf24; border-color: #f59e0b; color: white; }
.word-cell.absent { background: #9ca3af; border-color: #6b7280; color: white; }
.key, .btn {
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 800;
}

/* ==========================================
   DYNAMIC TOP 20 LEADERBOARD STYLES
   ========================================== */
.lb-section {
  width: 100%;
  margin-top: 30px;
  margin-bottom: 40px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 14px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}

.lb-header {
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(0,0,0,0.06);
  padding-bottom: 12px;
}

.lb-title-group h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 4px;
}

.lb-title-group p {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.lb-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
  box-sizing: border-box;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: fixed; /* Guarantees exact percentage width distribution */
}

.lb-table th {
  background: #1e293b;
  color: #f8fafc;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.76rem;
  padding: 12px 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

.lb-table td {
  padding: 10px 6px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-weight: 700;
  color: var(--text-main);
  vertical-align: middle;
  white-space: nowrap;
  box-sizing: border-box;
}

.lb-table th.lb-col-rank,
.lb-table td.lb-col-rank {
  text-align: center;
  width: 14%;
}

.lb-table th.lb-col-player,
.lb-table td.lb-col-player {
  text-align: left;
  width: 28%;
}

.lb-table th.lb-col-handle,
.lb-table td.lb-col-handle {
  text-align: left;
  width: 25%;
}

.lb-table th.lb-col-score,
.lb-table td.lb-col-score {
  text-align: center;
  width: 21%;
}

.lb-table th.lb-col-date,
.lb-table td.lb-col-date {
  text-align: center;
  width: 12%;
}

.lb-table tr:last-child td {
  border-bottom: none;
}

/* Rank Badges */
.rank-badge {
  font-weight: 900;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  background: var(--bg-dark);
}

.rank-gold .rank-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.rank-silver .rank-badge {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: white;
}

.rank-bronze .rank-badge {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}

.highlight-user-rank {
  background: rgba(59, 130, 246, 0.12) !important;
  border-left: 4px solid #3b82f6 !important;
  animation: pulseRank 1.5s infinite alternate;
}

@keyframes pulseRank {
  0% { background: rgba(59, 130, 246, 0.08); }
  100% { background: rgba(59, 130, 246, 0.22); }
}

.lb-player-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  vertical-align: middle;
}

.lb-avatar {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  flex-shrink: 0;
}

.lb-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.lb-handle-text {
  color: #3b82f6;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  display: inline-block;
  vertical-align: middle;
}

.lb-no-handle {
  color: #94a3b8;
}

/* High Score Qualification Modal */
.lb-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

.lb-modal-card {
  background: #1e293b;
  color: white;
  padding: 30px;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  text-align: center;
  position: relative;
  border: 1px solid #334155;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
}

@keyframes modalPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lb-modal-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.lb-modal-card h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: white;
}

.lb-modal-sub {
  color: #94a3b8;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.lb-modal-sub strong {
  color: #f59e0b;
}

.lb-field {
  text-align: left;
  margin-bottom: 18px;
}

.lb-field label {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.lb-field input {
  width: 100%;
  padding: 12px 16px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.lb-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.lb-avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.lb-avatar-btn {
  font-size: 1.4rem;
  padding: 8px 0;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.lb-avatar-btn:hover {
  transform: scale(1.1);
  border-color: #94a3b8;
}

.lb-avatar-btn.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transform: scale(1.1);
}

.lb-submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease;
}

.lb-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

/* ==========================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================== */
@media (max-width: 768px) {
  .content-container {
    padding: 20px 16px;
  }

  .nav-pills {
    gap: 8px;
    margin-bottom: 20px;
  }

  .nav-pills .nav-item {
    padding: 8px 16px;
    font-size: 0.88rem;
  }

  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-rows: minmax(160px, auto);
    gap: 14px;
  }

  .game-layout,
  .game-container,
  .game-details,
  .game-guide-section,
  #game-leaderboard-container {
    width: 100%;
    max-width: 100% !important;
  }

  .lb-section {
    padding: 20px 14px;
    margin-top: 24px;
    margin-bottom: 30px;
    border-radius: 16px;
  }

  .lb-title-group h2 {
    font-size: 1.5rem;
  }

  .game-details {
    padding: 20px 16px;
  }

  .game-details h1 {
    font-size: 1.6rem;
  }

  .game-guide-section {
    padding: 20px 16px;
  }
}

@media (max-width: 600px) {
  .main-footer {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 30px 12px 25px;
    box-sizing: border-box;
  }

  .footer-links {
    gap: 8px 10px;
    justify-content: center;
  }
  
  .footer-link {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .footer-logo {
    font-size: 1.4rem;
  }

  .footer-tagline {
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  .game-guide-section {
    padding: 22px 16px;
    margin-top: 25px;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
  }

  .controls-table th, .controls-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .content-container {
    padding: 16px 10px;
  }

  .game-guide-section {
    padding: 16px 12px;
    margin-top: 20px;
    border-radius: 14px;
  }

  .controls-table th, .controls-table td {
    padding: 6px 6px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .nav-pills {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-pills .nav-item {
    padding: 7px 14px;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 10px;
  }

  .lb-section {
    padding: 12px 6px;
    margin-top: 20px;
    margin-bottom: 25px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .lb-title-group h2 {
    font-size: 1.25rem;
  }

  .lb-title-group p {
    font-size: 0.8rem;
  }

  .lb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
  }

  .lb-table {
    width: 100%;
    min-width: 290px;
    table-layout: fixed;
  }

  .lb-table th {
    padding: 8px 4px;
    font-size: 0.72rem;
  }

  .lb-table td {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  .lb-col-rank { width: 14%; }
  .lb-col-player { width: 42%; }
  .lb-col-handle { width: 24%; }
  .lb-col-score { width: 20%; }
  .lb-col-date { display: none; }

  .lb-player-wrapper {
    gap: 4px;
  }

  .lb-avatar {
    width: 22px;
    height: 22px;
    font-size: 0.92rem;
    flex-shrink: 0;
  }

  .lb-player-name {
    max-width: 72px;
    font-size: 0.75rem;
  }

  .lb-handle-text, .lb-no-handle {
    max-width: 62px;
    font-size: 0.72rem;
  }

  .lb-modal-card {
    padding: 18px 12px;
    border-radius: 16px;
  }

  .lb-modal-card h2 {
    font-size: 1.35rem;
  }

  .lb-avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  /* Game Board & Control Adjustments on Small Screens */
  .ludo-container {
    padding: 10px 6px !important;
  }

  .ludo-controls {
    padding: 8px 10px !important;
    gap: 6px;
  }

  .ludo-controls select, .ludo-controls button {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
  }

  .hud-controls {
    gap: 6px !important;
  }

  .hud-controls select, .hud-controls button {
    font-size: 0.82rem !important;
    padding: 8px 10px !important;
  }

  .ws-hud {
    padding: 8px 10px !important;
    gap: 6px !important;
  }

  .ws-stat {
    font-size: 0.9rem !important;
  }

  .ws-controls-row select, .ws-controls-row button {
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
  }

  .mole-grid {
    gap: 8px !important;
    padding: 10px !important;
  }

  .game-board {
    gap: 8px !important;
  }

  .status-bar {
    padding: 8px 10px !important;
    font-size: 0.88rem !important;
  }

  /* Game Start Overlay & Card Mobile Scaling */
  .wm-start-overlay, .ws-start-overlay, .overlay {
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  .wm-start-card, .ws-start-card {
    padding: 12px 14px !important;
    max-width: 95% !important;
    border-radius: 14px !important;
  }

  .wm-start-card h2, .ws-start-card h2, .overlay h2 {
    font-size: 1.25rem !important;
    margin-bottom: 4px !important;
  }

  .wm-start-card p, .ws-start-card p, .overlay p {
    font-size: 0.8rem !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
  }

  .wm-start-card div, .ws-start-card div {
    font-size: 2rem !important;
    margin-bottom: 4px !important;
  }

  .wm-btn-start, .ws-btn-start, .overlay button {
    padding: 8px 20px !important;
    font-size: 0.92rem !important;
  }
}

@media (max-width: 360px) {
  .wm-start-card h2, .ws-start-card h2 {
    font-size: 1.1rem !important;
  }

  .wm-start-card p, .ws-start-card p {
    font-size: 0.75rem !important;
    margin-bottom: 8px !important;
  }

  .wm-btn-start, .ws-btn-start {
    padding: 6px 16px !important;
    font-size: 0.85rem !important;
  }
}

/* ==========================================
   LUDO MODE BAR & MOBILE ANTI-OVERFLOW RULES
   ========================================== */
.ludo-mode-bar {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  width: 100%;
  flex-wrap: wrap;
  background: #1e293b;
  padding: 12px 18px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  box-sizing: border-box;
}

.ludo-mode-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.ludo-mode-label {
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ludo-mode-select {
  padding: 8px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  max-width: 100%;
  flex: 1;
  min-width: 0;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.ludo-reset-btn {
  padding: 8px 16px;
  border-radius: 10px;
  background: #3b82f6;
  color: white;
  border: none;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .game-container {
    padding: 12px 8px !important;
  }
  .ludo-mode-bar {
    padding: 10px 10px !important;
    gap: 8px !important;
  }
  .ludo-mode-select {
    padding: 6px 8px !important;
    font-size: 0.82rem !important;
  }
  .ludo-reset-btn {
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
  }
}

/* ==========================================
   SEO FAQ ACCORDION DESIGN SYSTEM (30% Compact)
   ========================================== */
/* ==========================================
   SEO FAQ ACCORDION DESIGN SYSTEM (Poki Theme)
   ========================================== */
.faq-section {
  margin: 40px auto;
  max-width: 760px;
  padding: 0 20px;
  box-sizing: border-box;
}

.faq-header {
  text-align: center;
  margin-bottom: 24px;
}

.faq-header h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main, #2b3040);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.faq-header p {
  color: var(--text-muted, #64748b);
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 600px;
  margin: 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--card-bg-solid, #ffffff);
  border: 1.5px solid #3b82f6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.faq-item:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.faq-question {
  width: 100%;
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-main, #2b3040);
  font-size: 1.02rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  gap: 12px;
  font-family: inherit;
}

.faq-question .faq-icon {
  font-size: 1.3rem;
  font-weight: 900;
  transition: transform 0.3s ease;
  color: #8b5cf6;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 22px;
  color: var(--text-muted, #475569);
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 600;
  box-sizing: border-box;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 22px 18px 22px;
}

@media (max-width: 480px) {
  .faq-header h2 { font-size: 1.2rem; }
  .faq-question { padding: 9px 12px; font-size: 0.82rem; }
  .faq-answer { padding: 0 12px; font-size: 0.78rem; }
  .faq-item.active .faq-answer { padding: 0 12px 10px 12px; }
}
