:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: #1a243b;
  --bg-card-hover: #23304d;
  --border: #26334d;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #6c47ff;
  --primary-hover: #5835e5;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;
  --kofi-color: #ff5e5b;
  --navbar-h: 64px;
  --sidebar-w: 230px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* TOP NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-h);
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  gap: 14px;
}

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

.menu-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c47ff, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(108, 71, 255, 0.45);
}

.brand-badge {
  font-size: 0.65rem;
  background: rgba(108, 71, 255, 0.2);
  color: #c4b5fd;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(108, 71, 255, 0.4);
  font-weight: 700;
  text-transform: uppercase;
}

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

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 9px 16px 9px 38px;
  border-radius: 99px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 71, 255, 0.2);
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  max-height: 360px;
  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: 10px;
  transition: background 0.15s;
}

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

.search-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.search-item-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.search-item-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* NAV RIGHT */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 7px 13px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.streak-pill:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.nav-btn:hover {
  border-color: #475569;
  color: #fff;
}

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

.btn-kofi {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #ff5e5b, #f97316);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 94, 91, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-kofi:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 94, 91, 0.5);
}

/* LAYOUT SHELL */
.app-shell {
  display: flex;
  padding-top: var(--navbar-h);
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: var(--navbar-h);
  bottom: 0;
  left: 0;
  background: var(--bg-main);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.side-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-link:hover,
.side-link.active {
  background: var(--bg-surface);
  color: #fff;
}

.side-link.active {
  border-left: 3px solid var(--primary);
}

.side-badge {
  font-size: 0.65rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 2px 6px;
  border-radius: 99px;
  font-weight: 800;
}

.sidebar-kofi-card {
  background: linear-gradient(145deg, rgba(255, 94, 91, 0.14), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(255, 94, 91, 0.35);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sidebar-kofi-card p {
  margin-bottom: 10px;
  line-height: 1.4;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 20px 24px 60px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* Collapse unfilled or empty Google AdSense containers so they never leave blank gaps */
ins.adsbygoogle[data-ad-status="unfilled"],
ins.adsbygoogle:empty {
  display: none !important;
}

.kofi-floating-wrap {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 250;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

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

.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;
}

/* AD SLOTS (Fixed Aspect Ratio / Min-Height to prevent CLS for SEO) */
.ad-slot {
  background: rgba(19, 27, 46, 0.75);
  border: 1px dashed #334155;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 14px auto;
  overflow: hidden;
  position: relative;
}

.ad-slot-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748b;
  margin-bottom: 4px;
}

.ad-slot-placeholder {
  font-size: 0.8rem;
  color: #94a3b8;
  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;
}

/* DAILY PUZZLE HUB HERO */
.daily-hub-hero {
  background: linear-gradient(135deg, #171f36 0%, #1e1b4b 55%, #311042 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 28px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.daily-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.daily-hub-title h2 {
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.btn-combo-share {
  background: var(--accent-green);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s;
}

.btn-combo-share:hover {
  transform: translateY(-2px);
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.daily-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.daily-card:hover {
  transform: translateY(-4px);
  border-color: #a78bfa;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.daily-card.completed {
  border-color: var(--accent-green);
  background: rgba(6, 78, 59, 0.3);
}

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

.daily-emoji-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
}

.daily-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

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

.daily-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.daily-play-cta {
  font-size: 0.82rem;
  font-weight: 800;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* SECTION HEADERS & GAME GRID (CRAZYGAMES BENTO STYLE) */
.section-block {
  margin-bottom: 32px;
}

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

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-action {
  font-size: 0.84rem;
  color: #a78bfa;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
}

.section-action:hover {
  text-decoration: underline;
}

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

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

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

.game-thumb-emoji {
  font-size: 3.4rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s;
}

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

.game-card:hover .game-thumb-emoji,
.game-card:hover .game-thumb-img {
  transform: scale(1.08);
}

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

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

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

.mini-game-thumb {
  width: 64px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-rating-pill {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(11, 15, 25, 0.78);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

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

.game-card-body h3 {
  font-size: 0.96rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-main);
}

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

/* GAME DETAIL / PLAYER PAGE */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: #fff;
}

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

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

.game-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.game-viewport {
  width: 100%;
  height: 600px;
  background: #050811;
  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: 12px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

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

.toolbar-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.toolbar-title h1 {
  font-size: 1.15rem;
  font-weight: 800;
}

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

.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 13px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.15s;
}

.tool-btn:hover {
  border-color: var(--primary);
  color: #fff;
}

.tool-btn.favorited {
  background: rgba(236, 72, 153, 0.18);
  border-color: #ec4899;
  color: #f472b6;
}

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

.seo-article h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 18px 0 10px;
  color: #fff;
}

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

.seo-article p,
.seo-article li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.seo-article ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

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

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

.faq-item h3 {
  font-size: 0.96rem;
  font-weight: 800;
  color: #a78bfa;
  margin-bottom: 6px;
}

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

.tag-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

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

.mini-games-box h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
}

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

.mini-game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-card);
  transition: background 0.15s;
}

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

/* MODALS (KO-FI & STREAK) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.8);
  backdrop-filter: blur(8px);
  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: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 99px;
  cursor: pointer;
  font-weight: 800;
}

/* FOOTER */
.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* GOOGLE AUTH, LEADERBOARD & RATING UI (CLOUDFLARE D1) */
.btn-google-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  padding: 7px 13px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-google-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

.g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from -45deg, #ea4335 110deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108, 71, 255, 0.16);
  border: 1px solid rgba(108, 71, 255, 0.45);
  color: #fff;
  padding: 5px 12px 5px 6px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.user-pill-btn:hover {
  background: rgba(108, 71, 255, 0.28);
}

.user-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c47ff, #ec4899);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  overflow: hidden;
}

.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.7rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 800;
}

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

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

.lb-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s;
}

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

.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: 8px 12px;
  border-radius: 10px;
  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: 10px;
  overflow: hidden;
}

.lb-period-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

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

.lb-list-container {
  max-height: 350px;
  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: 12px;
  padding: 9px 12px;
}

.lb-row.is-me {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.lb-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-surface);
  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; }
.lb-rank.r-2 { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #0f172a; }
.lb-rank.r-3 { background: linear-gradient(135deg, #b45309, #d97706); color: #fff; }

.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.88rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-user-sub {
  font-size: 0.74rem;
  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.3);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  margin: 12px 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;
}

.btn-google-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #6c47ff, #ec4899);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

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

.star-rate-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 10px;
}

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

.star-btn {
  background: none;
  border: none;
  color: #475569;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.12s, color 0.12s;
}

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

.sort-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

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

.toast-floating {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #052e16;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 10px 18px;
  border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

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

/* RESPONSIVE */
@media (max-width: 1080px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
  .player-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.7);
  }
  .main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 16px;
  }
  .nav-btn span.hide-mobile {
    display: none;
  }
  .game-viewport {
    height: 460px;
  }
}
