/* ==========================================================================
   PLAYTOFU V2 — UI/UX PRO MAX DESIGN SYSTEM
   Style: Neo-Arcade Glassmorphism + Retro-Futurism + Bento Grid
   Typography: Fredoka (Display/Headings) + Nunito (Body/UI)
   Themes: Dark Mode (OLED Cyber Arcade) & Light Mode (Crisp Daylight Arcade)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-main: #090a14;
  --bg-elevated: #0f1123;
  --bg-surface: #13162b;
  --bg-glass: rgba(19, 22, 43, 0.86);
  --bg-card: #171b34;
  --bg-card-hover: #202648;
  --bg-input: #101326;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(167, 139, 250, 0.38);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-soft: rgba(124, 58, 237, 0.18);
  --secondary: #a78bfa;
  --cta-rose: #f43f5e;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --kofi-color: #ff5e5b;
  --shadow-card: 0 10px 30px -6px rgba(0, 0, 0, 0.55);
  --shadow-hover: 0 18px 38px -8px rgba(124, 58, 237, 0.32), 0 8px 20px rgba(0, 0, 0, 0.6);
  --shadow-navbar: 0 12px 32px rgba(0, 0, 0, 0.48);
  --hero-gradient: linear-gradient(135deg, #151936 0%, #1e1b4b 52%, #2e1045 100%);
  --daily-card-bg: rgba(15, 18, 38, 0.82);
  --grid-pattern: radial-gradient(rgba(167, 139, 250, 0.09) 1px, transparent 1px);
  --navbar-h: 68px;
  --navbar-offset: 84px;
  --sidebar-w: 248px;
  --font-heading: 'Fredoka', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* LIGHT MODE — Strictly follows UI/UX Pro Max Contrast Rules (4.5:1+ WCAG AA/AAA) */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-elevated: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border: #e2e8f0;
  --border-strong: rgba(124, 58, 237, 0.45);
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --primary-soft: rgba(109, 40, 217, 0.1);
  --secondary: #6d28d9;
  --cta-rose: #e11d48;
  --accent-green: #059669;
  --accent-amber: #d97706;
  --accent-pink: #db2777;
  --accent-cyan: #0891b2;
  --shadow-card: 0 4px 18px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 16px 32px -6px rgba(109, 40, 217, 0.18), 0 6px 16px -4px rgba(15, 23, 42, 0.08);
  --shadow-navbar: 0 8px 26px rgba(15, 23, 42, 0.08);
  --hero-gradient: linear-gradient(135deg, #ede9fe 0%, #fae8ff 52%, #ffe4e6 100%);
  --daily-card-bg: rgba(255, 255, 255, 0.92);
  --grid-pattern: radial-gradient(rgba(109, 40, 217, 0.08) 1px, transparent 1px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  background-image: var(--grid-pattern);
  background-size: 24px 24px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, .brand-logo, .daily-status-pill, .game-badge, .cat-pill {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

button,
select,
input[type="button"],
input[type="submit"] {
  font-family: inherit;
  cursor: pointer;
}

/* SCREEN READER ONLY UTILITY */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ACCESSIBILITY: VISIBLE FOCUS STATES FOR KEYBOARD NAVIGATION */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* VECTOR SVG ICON SYSTEM */
.ui-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.18s ease, color 0.18s ease;
}

.ui-icon-xs {
  width: 14px;
  height: 14px;
}

.icon-star-fill {
  color: #fbbf24;
}

/* Theme toggle icon swap */
[data-theme="dark"] .icon-sun {
  display: inline-block;
  color: #fbbf24;
}
[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="light"] .icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: inline-block;
  color: #475569;
}

/* ==========================================================================
   FLOATING GLASS NAVBAR (UI/UX Pro Max Layout Rule)
   ========================================================================== */
.navbar {
  position: fixed;
  top: 10px;
  left: 14px;
  right: 14px;
  height: var(--navbar-h);
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-navbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  gap: 14px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.menu-toggle:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
}

.brand-name-text {
  background: linear-gradient(135deg, var(--text-main) 30%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-name-text {
  background: linear-gradient(135deg, #0f172a 20%, #6d28d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 55%, #f43f5e 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
  flex-shrink: 0;
}

.brand-icon .ui-icon {
  width: 22px;
  height: 22px;
}

.brand-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.brand-icon-sm .ui-icon {
  width: 16px;
  height: 16px;
}

.brand-badge {
  font-family: var(--font-body);
  font-size: 0.68rem;
  background: var(--primary-soft);
  color: var(--secondary);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--border-strong);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* SEARCH BAR */
.search-wrapper {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 10px 42px 10px 42px;
  border-radius: 99px;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}

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

.search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  padding: 8px;
}

.search-dropdown.open {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  transition: background 0.16s ease;
}

.search-item:hover {
  background: var(--bg-card-hover);
}

.search-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

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

.search-item-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f59e0b;
  font-weight: 800;
}

.inline-star .ui-icon {
  width: 13px;
  height: 13px;
}

/* NAV RIGHT ACTIONS */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #fbbf24;
  padding: 8px 13px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

[data-theme="light"] .streak-pill {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}

.streak-pill .ui-icon {
  color: #f59e0b;
}

.streak-pill:hover {
  background: rgba(245, 158, 11, 0.24);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 13px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

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

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
}

.btn-leaderboard-nav .ui-icon {
  color: #f59e0b;
}

.count-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 99px;
  font-weight: 800;
}

.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
  transition: box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-kofi:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
}

/* ==========================================================================
   APP SHELL & FLOATING BENTO SIDEBAR
   ========================================================================== */
.app-shell {
  display: flex;
  padding-top: var(--navbar-offset);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: var(--navbar-offset);
  bottom: 14px;
  left: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  padding: 0 12px;
  margin-bottom: 6px;
}

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

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.side-link-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.side-link-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-link-left .ui-icon {
  color: var(--text-muted);
}

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

.side-link:hover .side-link-left .ui-icon {
  color: var(--secondary);
}

.side-link.active {
  background: var(--primary-soft);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.side-link.active .side-link-left .ui-icon {
  color: var(--primary);
}

[data-theme="dark"] .side-link.active .side-link-left .ui-icon {
  color: #a78bfa;
}

.side-badge {
  font-size: 0.65rem;
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.32);
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 800;
  flex-shrink: 0;
}

[data-theme="light"] .side-badge {
  color: #be123c;
}

.side-badge-emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .side-badge-emerald {
  color: #047857;
}

.sidebar-kofi-card {
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.12), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(244, 63, 94, 0.32);
  border-radius: 16px;
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sidebar-kofi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.sidebar-kofi-icon {
  color: #f43f5e;
  display: inline-flex;
}

.sidebar-kofi-card p {
  margin-bottom: 12px;
  line-height: 1.45;
}

/* ==========================================================================
   MAIN CONTENT AREA & QUICK CATEGORY PILLS BAR
   ========================================================================== */
.main-content {
  flex: 1;
  margin-left: calc(var(--sidebar-w) + 22px);
  padding: 8px 24px 64px 12px;
  max-width: calc(100vw - var(--sidebar-w) - 22px);
}

.category-quickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scrollbar-width: none;
}

.category-quickbar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 15px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cat-pill .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.cat-pill:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.cat-pill.active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-color: #8b5cf6;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.cat-pill.active .ui-icon {
  color: #ffffff;
}

.cat-pill-badge {
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 800;
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  padding: 1px 6px;
  border-radius: 99px;
}

.cat-pill.active .cat-pill-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Collapse unfilled or empty Google AdSense containers */
ins.adsbygoogle[data-ad-status="unfilled"],
ins.adsbygoogle:empty,
.ad-slot:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
}

/* AD SLOTS (Zero CLS) */
.ad-slot {
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px auto;
  overflow: hidden;
  position: relative;
}

.ad-slot-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ad-slot-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 14px;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

.ad-infeed {
  width: 100%;
  max-width: 970px;
  min-height: 90px;
}

.ad-rect {
  width: 100%;
  max-width: 300px;
  min-height: 250px;
}

.ad-skyscraper {
  width: 100%;
  max-width: 300px;
  min-height: 480px;
}

.ad-below-game {
  margin-top: 24px;
}

.ad-inarticle {
  width: 100%;
  min-height: 250px;
  margin: 20px auto;
}

.player-layout.theater-mode .ad-slot {
  display: none !important;
}

/* ==========================================================================
   DAILY PUZZLE HUB HERO (NEO-ARCADE BENTO HERO)
   ========================================================================== */
.daily-hub-hero {
  background: var(--hero-gradient);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.daily-hub-glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.26) 0%, rgba(244, 63, 94, 0.12) 45%, transparent 70%);
  pointer-events: none;
}

.daily-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.daily-hub-title {
  max-width: 680px;
  flex: 1;
}

.daily-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.daily-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="light"] .daily-hero-icon {
  color: #d97706;
}

.daily-hub-title h2,
.category-hero-h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.daily-hub-title p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-top: 6px;
}

.daily-progress-track {
  margin-top: 12px;
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}

[data-theme="light"] .daily-progress-track {
  background: rgba(15, 23, 42, 0.1);
}

.daily-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.daily-hub-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-hero-secondary {
  background: var(--daily-card-bg);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

[data-theme="light"] .btn-hero-secondary {
  color: #b45309;
}

.btn-hero-secondary:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.btn-combo-share {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: filter 0.18s ease, box-shadow 0.18s ease;
}

.btn-combo-share:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
}

.daily-card {
  background: var(--daily-card-bg);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.daily-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.daily-card.completed {
  border-color: var(--accent-green);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.16), var(--daily-card-bg));
}

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

.daily-emoji-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.daily-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.daily-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.daily-card.completed .daily-status-pill {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

[data-theme="light"] .daily-card.completed .daily-status-pill {
  color: #047857;
}

.daily-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.daily-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.daily-play-cta {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.daily-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fbbf24;
  font-weight: 800;
}

[data-theme="light"] .daily-rating-chip {
  color: #d97706;
}

.daily-rating-chip .ui-icon {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   SECTION HEADERS & BENTO GAME CARDS (NO LAYOUT SHIFT ON HOVER)
   ========================================================================== */
.section-block {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.32rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.section-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon-wrap.rose {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #f43f5e;
}

.section-action {
  font-size: 0.86rem;
  color: var(--secondary);
  font-weight: 800;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.section-action:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  color: var(--text-main);
}

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

.game-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.game-thumb {
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-card:hover .game-thumb-img {
  transform: scale(1.07);
}

.game-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 10, 20, 0.72) 0%, rgba(9, 10, 20, 0.15) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.game-card:hover .game-thumb-overlay {
  opacity: 1;
}

.game-play-fab {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #f43f5e);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.6);
  transform: scale(0.88);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-play-fab .ui-icon {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.game-card:hover .game-play-fab {
  transform: scale(1);
}

.game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(9, 10, 20, 0.84);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.03em;
  z-index: 2;
}

.game-rating-pill {
  position: absolute;
  bottom: 9px;
  right: 10px;
  background: rgba(9, 10, 20, 0.84);
  backdrop-filter: blur(6px);
  color: #fbbf24;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.game-rating-pill .ui-icon {
  width: 13px;
  height: 13px;
}

.game-card-body {
  padding: 13px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

/* ==========================================================================
   GAME DETAIL / ARCADE CABINET STAGE PAGE
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-weight: 700;
  transition: color 0.15s ease;
}

.breadcrumb-link .ui-icon {
  width: 15px;
  height: 15px;
}

.breadcrumb-link:hover {
  color: var(--primary);
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 800;
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

.player-layout.theater-mode {
  grid-template-columns: 1fr;
}

.game-stage-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.game-viewport {
  width: 100%;
  height: 610px;
  background: #050711;
  position: relative;
}

.player-layout.theater-mode .game-viewport {
  height: 78vh;
}

.game-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toolbar-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.toolbar-title h1 {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
}

.toolbar-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.meta-rating-chip,
.meta-plays-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-rating-chip .ui-icon,
.meta-plays-chip .ui-icon {
  width: 15px;
  height: 15px;
}

.meta-plays-chip .ui-icon {
  color: var(--secondary);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

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

.tool-btn-emerald {
  border-color: rgba(16, 185, 129, 0.42);
  color: #34d399;
}

[data-theme="light"] .tool-btn-emerald {
  color: #047857;
}

.tool-btn.favorited {
  background: rgba(244, 63, 94, 0.16);
  border-color: #f43f5e;
  color: #fb7185;
}

[data-theme="light"] .tool-btn.favorited {
  color: #e11d48;
}

/* STAR RATING WIDGET */
.star-rate-box {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  min-height: 40px;
  border-radius: 12px;
}

.star-rate-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 4px;
  font-weight: 800;
}

.star-btn {
  background: none;
  border: none;
  color: #475569;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .star-btn {
  color: #cbd5e1;
}

.star-btn .ui-icon {
  width: 17px;
  height: 17px;
  color: inherit;
}

.star-btn:hover,
.star-btn.active {
  color: #fbbf24;
  transform: scale(1.16);
}

/* SEO ARTICLE CARD BELOW GAME */
.seo-article {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
}

.seo-article h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 22px 0 10px;
  color: var(--text-main);
}

.seo-article h2:first-child {
  margin-top: 0;
}

.seo-article p,
.seo-article li {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
  max-width: 75ch;
}

.seo-article ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.seo-game-figure {
  margin: 20px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.seo-game-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.seo-game-figure figcaption {
  padding: 12px 16px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

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

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.faq-item h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* PLAYER RIGHT SIDEBAR */
.player-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mini-games-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.sidebar-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sidebar-box-header h3 {
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-main);
}

.sidebar-box-header h3 .ui-icon {
  color: #f59e0b;
}

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

.mini-game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.mini-game-row:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.mini-game-thumb {
  width: 68px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* ==========================================================================
   MODALS (KO-FI, HISTORY, LEADERBOARD, GOOGLE AUTH)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 16, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 24px;
  width: 100%;
  max-width: 490px;
  padding: 26px;
  position: relative;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.65);
}

.modal-card-lg {
  max-width: 660px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.modal-close:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-right: 36px;
}

.modal-title-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon-badge.gold-accent {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.modal-icon-badge.kofi-accent {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.kofi-embed-frame {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  height: 370px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.kofi-modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.crypto-donate-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

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

.crypto-network-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-green);
}

.crypto-wallet-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-main);
  word-break: break-all;
  margin-top: 2px;
  user-select: all;
}

.history-modal-list {
  max-height: 310px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.btn-danger-outline {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

[data-theme="light"] .btn-danger-outline {
  color: #dc2626;
}

/* ==========================================================================
   GOOGLE AUTH, LEADERBOARD & RATING UI (CLOUDFLARE D1)
   ========================================================================== */
.btn-google-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-google-nav:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

.g-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.g-icon-svg .ui-icon {
  width: 17px;
  height: 17px;
}

.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 5px 12px 5px 6px;
  min-height: 40px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 800;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.user-pill-btn:hover {
  border-color: var(--primary);
}

.user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 900;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
}

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

.xp-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 800;
}

[data-theme="light"] .xp-tag {
  color: #047857;
}

.lb-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.lb-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.lb-tab.active,
.lb-tab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.lb-panel {
  display: none;
}

.lb-panel.active {
  display: block;
}

.lb-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lb-select {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
}

.lb-period-group {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: 2px;
}

.lb-period-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease;
}

.lb-period-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.lb-list-container {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.lb-row:hover {
  border-color: var(--border-strong);
}

.lb-row.is-me {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
}

.lb-rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  flex-shrink: 0;
}

.lb-rank.r-1 { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #0f172a; border: none; }
.lb-rank.r-2 { background: linear-gradient(135deg, #94a3b8, #e2e8f0); color: #0f172a; border: none; }
.lb-rank.r-3 { background: linear-gradient(135deg, #b45309, #d97706); color: #ffffff; border: none; }

.lb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.lb-user-info {
  min-width: 0;
}

.lb-user-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-user-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.lb-score-badge {
  font-size: 0.84rem;
  font-weight: 900;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 4px 11px;
  border-radius: 99px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-theme="light"] .lb-score-badge {
  color: #047857;
}

.lb-modal-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-auth-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 14px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 10px;
}

.demo-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.btn-google-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #ffffff;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  transition: filter 0.18s ease;
}

.btn-google-submit:hover {
  filter: brightness(1.08);
}

.profile-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.auth-logged-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

/* SORT PILLS */
.sort-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  min-height: 38px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sort-pill .ui-icon {
  width: 15px;
  height: 15px;
}

.sort-pill.active,
.sort-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.sort-pill.active .ui-icon,
.sort-pill:hover .ui-icon {
  color: #ffffff;
}

/* TOAST NOTIFICATION */
.toast-floating {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #052e16;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 11px 20px;
  border-radius: 99px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.toast-floating.show {
  opacity: 1;
}

/* ==========================================================================
   LANGUAGE SWITCHER (CLOUDFLARE GEO + MULTI-LANGUAGE)
   ========================================================================== */
.lang-switcher {
  position: relative;
}

.lang-btn {
  padding: 7px 12px;
  font-weight: 800;
  gap: 6px;
}

.lang-btn .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 245px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-hover);
  padding: 8px;
  display: none;
  z-index: 250;
  max-height: 420px;
  overflow-y: auto;
}

.lang-dropdown.open {
  display: block;
}

.lang-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.geo-country-pill {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 99px;
}

[data-theme="light"] .geo-country-pill {
  color: #047857;
}

.lang-divider {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}

.lang-option {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 0.14s ease, color 0.14s ease;
  text-align: left;
}

.lang-option-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.lang-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.lang-option.active {
  background: var(--primary-soft);
  color: var(--secondary);
  font-weight: 800;
}

.lang-code-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

/* ==========================================================================
   COMPETITIVE LEADERBOARD & DAILY RETENTION UI
   ========================================================================== */
.lb-meta-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.lb-countdown-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--secondary);
}

.lb-podium-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 0.76rem;
  color: #fbbf24;
}

[data-theme="light"] .lb-podium-strip {
  color: #b45309;
}

.lb-podium-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 800;
  color: var(--text-main);
}

.lb-pinned-me {
  margin-top: 10px;
}

.lb-pinned-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), var(--primary-soft));
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 14px;
  padding: 10px 15px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.sidebar-me-gap {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), var(--primary-soft));
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.45;
}

.overtaken-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(244, 63, 94, 0.16));
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 16px;
  padding: 12px 18px;
  margin-bottom: 18px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 800;
}

.overtaken-banner-cta {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 99px;
  text-decoration: none;
  white-space: nowrap;
}

.daily-leader-tag {
  margin-top: 8px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 3px 9px;
  border-radius: 8px;
  display: none;
}

[data-theme="light"] .daily-leader-tag {
  color: #b45309;
}

.daily-leader-tag.visible {
  display: inline-block;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 52px;
  padding: 24px 0 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.footer-dot {
  color: var(--text-muted);
}

.footer-subtext {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (375px, 768px, 1024px, 1440px)
   ========================================================================== */
@media (max-width: 1120px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
  .player-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .player-sidebar > * {
    flex: 1 1 300px;
  }
  .ad-skyscraper {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .navbar {
    top: 8px;
    left: 10px;
    right: 10px;
    padding: 0 12px;
    gap: 8px;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .brand-badge {
    display: none;
  }
  .search-kbd {
    display: none;
  }
  .sidebar {
    top: var(--navbar-offset);
    left: 10px;
    bottom: 10px;
    transform: translateX(calc(-100% - 24px));
    box-shadow: 20px 0 48px rgba(0, 0, 0, 0.65);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 8px 14px 56px;
  }
  .nav-btn span.hide-mobile,
  .btn-google-nav span.hide-mobile,
  .btn-kofi span.hide-mobile {
    display: none;
  }
  .game-viewport {
    height: 460px;
  }
}

@media (max-width: 540px) {
  .brand-name-text {
    display: none;
  }
  .search-input {
    padding: 9px 14px 9px 36px;
    font-size: 0.85rem;
  }
  .daily-hub-hero {
    padding: 18px;
    border-radius: 20px;
  }
  .daily-hub-title h2,
  .category-hero-h1 {
    font-size: 1.25rem;
  }
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 12px;
  }
  .game-thumb {
    height: 112px;
  }
  .game-viewport {
    height: 390px;
  }
}

/* ==========================================================================
   ACCESSIBILITY: RESPECT PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
