:root, html[data-theme="dark"] {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #2d333b;
  --text: #e6edf3;
  --muted: #8b949e;
  --primary: #f0b90b;
  --primary-2: #ffcf4d;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --green: #2ea043;
  --gold: #fbbf24;
  --red: #f85149;
  --radius: 14px;
  --topbar-bg: rgba(22, 27, 34, .92);
  --hover-bg: rgba(255, 255, 255, .05);
  --card-grad-to: #4c1d95;
  --shadow: 0 6px 20px rgba(240, 185, 11, .15);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f3f6fb;
  --border: #d9e1ea;
  --text: #1b2430;
  --muted: #5f6d7c;
  --primary: #b8860b;
  --primary-2: #d9a520;
  --accent: #6d28d9;
  --accent-2: #6d28d9;
  --green: #1f8f4a;
  --gold: #d97706;
  --red: #dc2626;
  --radius: 14px;
  --topbar-bg: rgba(255, 255, 255, .92);
  --hover-bg: rgba(0, 0, 0, .045);
  --card-grad-to: #8b5cf6;
  --shadow: 0 6px 20px rgba(124, 58, 237, .14);
  color-scheme: light;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ============ TOPBAR ============ */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand { font-size: 1.2rem; letter-spacing: .5px; white-space: nowrap; }
.brand b { color: var(--primary); }

.search-box {
  flex: 1; max-width: 400px; position: relative;
}
.search-box input {
  width: 100%; padding: 9px 14px 9px 36px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: .9rem; outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .85rem; }

.top-right { display: flex; gap: 8px; align-items: center; }

.points-chip {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #241a02; font-weight: 800; padding: 8px 16px;
  border-radius: 999px; white-space: nowrap; font-size: .9rem;
}

.nav-btn {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font-size: .85rem; transition: .15s;
}
.nav-btn:hover { color: var(--text); background: var(--panel-2); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 1rem; transition: .15s; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--primary); transform: scale(1.05); }

.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 1.15rem; transition: .15s; flex-shrink: 0;
}
.menu-toggle:hover { border-color: var(--primary); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, .5); z-index: 120;
}

/* ============ 3-COLUMN LAYOUT ============ */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  min-height: calc(100vh - 56px);
  background:
    linear-gradient(var(--panel), var(--panel)) 0 0 / 220px 100% no-repeat,
    linear-gradient(var(--panel), var(--panel)) 100% 0 / 280px 100% no-repeat;
}

/* --- Left Sidebar --- */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--muted);
  text-decoration: none; font-size: .9rem; cursor: pointer;
  transition: .15s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--text); background: var(--panel-2); }
.sidebar-link.active {
  color: var(--primary); background: rgba(240,185,11,.08);
  border-left-color: var(--primary); font-weight: 600;
}
.sidebar-divider { height: 1px; background: var(--border); margin: 10px 20px; }
.sidebar-ad { padding: 16px 20px; }

/* --- Main Content --- */
.main-content {
  padding: 20px;
  overflow-y: auto;
}

/* --- Right Sidebar --- */
.right-sidebar {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 16px;
  position: sticky; top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.right-panel {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.right-panel h3 { font-size: .95rem; margin-bottom: 10px; }
.trending-list { display: flex; flex-direction: column; gap: 8px; }
.trending-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: .15s;
}
.trending-item:hover { background: var(--hover-bg); }
.t-icon { font-size: 1.4rem; }
.t-name { flex: 1; font-size: .85rem; font-weight: 600; }
.t-plays { font-size: .75rem; color: var(--muted); }

/* ============ SECTIONS ============ */
.section { display: none; }
.section.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ============ HOME / DASHBOARD ============ */
.hero-banner {
  text-align: center; padding: 30px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(240,185,11,.1));
  border-radius: var(--radius); margin-bottom: 20px;
}
.hero-banner h1 { font-size: 1.8rem; }
.hero-banner h1 span { color: var(--primary); }
.hero-banner p { color: var(--muted); margin: 10px 0 18px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.card.stat.mini { text-align: center; padding: 14px; }
.card.stat.mini .label { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; }
.card.stat.mini .value { display: block; font-size: 1.3rem; font-weight: 800; color: var(--primary); margin: 2px 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

/* ============ HOME BLOCKS ============ */
.home-block { margin-bottom: 24px; }
.block-title { font-size: 1.15rem; margin-bottom: 12px; }

/* ============ GAMES GRID ============ */
.games-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.game-count { color: var(--muted); font-size: .9rem; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.game-thumb {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: .2s;
  text-align: center;
}
.game-thumb:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.thumb-icon { font-size: 2.8rem; margin-bottom: 10px; }
.thumb-name { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.thumb-meta { display: flex; justify-content: center; gap: 6px; align-items: center; }
.thumb-coins { font-size: .75rem; color: var(--primary); }

/* ============ GAME DETAIL ============ */
.detail-top { margin-bottom: 14px; }
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 0; }
.detail-main { min-width: 0; }

.game-player {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 400px;
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
}
.game-embed { width: 100%; padding: 16px; position: relative; }

/* Game-over prompt: shows ABOVE the game window with a "Watch Ad &
   Play Again" button. Playing after the ad restarts the round. */
.game-over-prompt {
  position: absolute; top: 0; left: 0; right: 0; z-index: 15;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
}
.game-over-title { font-size: 1.1rem; font-weight: 800; }
.game-over-note { color: var(--muted); font-size: .85rem; }

/* Platform controls: floating fullscreen button, bottom-right of the game
   area. The play-area "Play" overlay handles starting. */
.game-controls {
  position: absolute; right: 14px; bottom: 14px; z-index: 30;
  display: flex; gap: 8px;
}
.game-controls .btn + .btn { margin: 0; }
.game-fs-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 30, .72); color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 21px; line-height: 1; cursor: pointer;
  backdrop-filter: blur(4px); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.game-fs-btn:hover { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #241a02; border-color: transparent; }

/* Play-area start overlay: covers an embedded game until the user taps
   the big "Play" button. First play is ad-free. */
.game-start-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(13, 17, 23, .62);
  border-radius: 10px; cursor: pointer;
}
.game-start-overlay.hidden { display: none; }
.game-play-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-size: 1rem; font-weight: 800;
  padding: 14px 36px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #241a02; cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}
.game-play-ico { font-size: 1.35rem; }
.game-start-hint { color: rgba(255, 255, 255, .8); font-size: .8rem; letter-spacing: .4px; }

/* ============ VAST VIDEO AD GATE (pre-retry) ============ */
.ad-gate {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 20px;
  background: #000;
}
.ad-gate video {
  width: 100%; max-width: 720px; aspect-ratio: 16/9;
  border-radius: 10px; background: #000; outline: none;
}
.ad-gate video.ad-clickable { cursor: pointer; }
.ad-gate-badge {
  font-size: .6rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: #ffcf4d; background: rgba(240,185,11,.12);
  border: 1px solid rgba(240,185,11,.4);
  padding: 4px 10px; border-radius: 999px;
}
.ad-gate-timer {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  min-height: 32px; text-align: center;
}
.ad-gate-timer .s { color: #ffcf4d; }
.ad-gate-note { color: #b6bdc7; font-size: .82rem; text-align: center; }
.ad-progress {
  width: 100%; max-width: 480px; height: 6px;
  background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden;
}
.ad-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #f0b90b, #ffcf4d); transition: width .4s linear; }
.ad-gate .btn { opacity: .45; pointer-events: none; }
.ad-gate .btn.unlocked { opacity: 1; pointer-events: auto; }

/* ============ FULLSCREEN GAME ============ */
#gamePlayer:fullscreen {
  background: #000;
  padding: 0;
  border: none;
  border-radius: 0;
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
#gamePlayer:fullscreen .game-embed {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%; padding: 6px;
  display: flex; align-items: center; justify-content: center;
}
#gamePlayer:fullscreen .game-controls {
  position: fixed; right: 18px; bottom: 18px;
}
#gamePlayer:fullscreen .game-embed iframe,
#gamePlayer:fullscreen iframe.game-full {
  width: 100%; height: 100% !important; border: none;
}
#gamePlayer:fullscreen .engine-memory,
#gamePlayer:fullscreen .engine-catch,
#gamePlayer:fullscreen .engine-typing,
#gamePlayer:fullscreen .engine-brick,
#gamePlayer:fullscreen .engine-trivia,
#gamePlayer:fullscreen .engine-scratch,
#gamePlayer:fullscreen .engine-spin,
#gamePlayer:fullscreen .engine-snake,
#gamePlayer:fullscreen .engine-whack {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; height: 100%; width: 100%;
}
#gamePlayer:fullscreen .ad-gate { height: 100%; }
#gamePlayer:-webkit-full-screen {
  background: #000; width: 100%; height: 100%;
}
#gamePlayer:-moz-full-screen {
  background: #000; width: 100%; height: 100%;
}
#gamePlayer:-ms-fullscreen {
  background: #000; width: 100%; height: 100%;
}

.game-info { margin-top: 14px; }
.game-meta { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.coins-earned { color: var(--primary); font-weight: 700; font-size: .9rem; }
.game-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.detail-sidebar { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.detail-sidebar h3 { font-size: .95rem; }
.related-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.related-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: .15s;
}
.related-item:hover { border-color: var(--primary); }
.r-icon { font-size: 1.6rem; }
.r-name { font-weight: 700; font-size: .85rem; }
.r-meta { font-size: .75rem; color: var(--muted); }

/* ============ ADS ============ */
.ad-banner {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  margin: 14px 0;
}
.game-info + .ad-banner {
  margin-top: 150px;
}
.ad-panel { border: 1px dashed var(--border); }
.ad-label {
  display: block; font-size: .6rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px;
}
.ad-placeholder {
  color: var(--muted); font-size: .8rem;
  padding: 20px 0; border-radius: 6px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-block; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
  font-size: .9rem; font-weight: 600; transition: .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #241a02; border: none; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; }
.btn.gold { background: linear-gradient(135deg, #f59e0b, var(--gold)); color: #241a02; border: none; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.muted { color: var(--muted); }
.tiny { font-size: .75rem; margin-top: 6px; }
.tag { font-size: .7rem; background: rgba(124,58,237,.2); color: var(--accent-2); padding: 3px 8px; border-radius: 6px; }
.tag.small { font-size: .65rem; padding: 2px 6px; }

h2 { margin-bottom: 14px; }
h3 { margin-bottom: 8px; }

/* ============ GAME ENGINES ============ */

/* ============ MEMORY ============ */
.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; margin: 14px auto; }
.mcard {
  aspect-ratio: 1; border-radius: 10px; cursor: pointer;
  background: linear-gradient(145deg, var(--accent), var(--card-grad-to));
  display: grid; place-items: center; font-size: 1.6rem;
  border: 1px solid rgba(255,255,255,.1); transition: .15s; user-select: none;
}
.mcard.flipped, .mcard.matched { background: var(--panel-2); }
.mcard.matched { background: rgba(46,160,67,.25); border-color: var(--green); }

/* ============ COLOR CATCH ============ */
.catch-score { font-size: 1rem; margin-bottom: 8px; }
.catch-target { font-size: 2.5rem; margin: 8px 0; }
.catch-zone {
  position: relative; width: 100%; height: 150px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 12px;
}
.faller { position: absolute; top: -40px; font-size: 1.8rem; cursor: pointer; animation: fall linear forwards; }
@keyframes fall { to { top: 160px; } }

/* ============ TYPING ============ */
.typing-text {
  font-size: 1rem; padding: 12px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; font-family: monospace;
  letter-spacing: 1px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.typing-input {
  width: 100%; padding: 10px; font-size: .95rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: monospace; margin-bottom: 8px;
}
.typing-input:focus { border-color: var(--primary); outline: none; }
.typing-input:disabled { opacity: .5; }
.typing-stats { display: flex; gap: 16px; justify-content: center; color: var(--muted); font-size: .85rem; margin-bottom: 10px; }

/* ============ BRICK BREAKER ============ */
.brick-canvas {
  width: 100%; max-width: 400px; height: 300px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; display: block; margin: 10px auto; cursor: none;
}

/* ============ TRIVIA ============ */
.trivia-progress { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.trivia-question {
  font-size: 1.05rem; padding: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 12px; min-height: 50px;
  display: flex; align-items: center; justify-content: center;
}
.trivia-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.trivia-btn {
  padding: 10px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: .9rem; transition: .15s;
}
.trivia-btn:hover { border-color: var(--primary); background: rgba(240,185,11,.1); }
.trivia-score { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }

/* ============ SCRATCH CARDS ============ */
.scratch-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 240px; margin: 0 auto 12px; }
.scratch-cell {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 1.8rem;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: .2s; user-select: none;
}
.scratch-cell:hover:not(.revealed) { border-color: var(--primary); transform: scale(1.05); }
.scratch-cell.revealed { background: rgba(240,185,11,.08); border-color: var(--primary); }
.scratch-cell.winning { background: rgba(46,160,67,.2); border-color: var(--green); animation: pulse .5s ease infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.scratch-prize { font-size: 1.1rem; color: var(--gold); margin: 8px 0; min-height: 24px; text-align: center; }

/* ============ WHEEL ============ */
.wheel-wrap { position: relative; max-width: 260px; margin: 14px auto; }
.wheel {
  aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--border);
  transition: transform 3.2s cubic-bezier(.15,.6,.2,1);
  position: relative; overflow: hidden;
}
.pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  border-left: 10px solid transparent; border-right: 10px solid transparent;
  border-top: 18px solid var(--red); z-index: 2;
}
.wheel-seg { position: absolute; width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.wheel-seg i { transform: translateY(-70px); }

/* ============ SNAKE ============ */
.snake-score { text-align: center; font-size: 1rem; margin: 8px 0; }
.snake-score span { font-weight: 800; color: var(--primary); }
.snake-canvas {
  width: 100%; max-width: 400px; height: 400px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; display: block; margin: 10px auto;
}

/* ============ WHACK ============ */
.whack-score { text-align: center; font-size: 1rem; margin-bottom: 8px; }
.whack-score span { font-weight: 800; color: var(--primary); }
.whack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto 12px; }
.whack-hole {
  aspect-ratio: 1; background: var(--panel-2);
  border: 2px solid var(--border); border-radius: 14px;
  display: grid; place-items: center; font-size: 2.2rem;
  cursor: pointer; transition: .15s; user-select: none;
}
.whack-hole:hover { border-color: var(--primary); }
.whack-hole.mole { background: rgba(240,185,11,.15); border-color: var(--primary); animation: moleUp .3s ease; }
.whack-hole.hit { background: rgba(46,160,67,.2); border-color: var(--green); }
@keyframes moleUp { from { transform: scale(0.7); } to { transform: scale(1); } }

/* ============ SHOP ============ */
.shop-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px;
}
.shop-item .price { color: var(--primary); font-weight: 800; font-size: 1.1rem; }
.shop-item .btn { margin-top: auto; }

/* ============ LEADERBOARD ============ */
.lb { width: 100%; border-collapse: collapse; }
.lb th, .lb td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.lb th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.lb tr:last-child td { border-bottom: none; }
.lb .rank1 td { color: var(--primary); font-weight: 800; }

.vip { background: linear-gradient(135deg, rgba(251,191,36,.12), var(--panel)); border-color: rgba(251,191,36,.4); }

.mini-promo { text-align: center; }
.mini-promo h4 { margin-bottom: 6px; }
.mini-promo p { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 40px 24px 20px; margin-top: 40px;
}
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px; max-width: 1100px; margin: 0 auto 30px;
}
.footer-brand p { color: var(--muted); margin-top: 8px; font-size: .85rem; }
.footer-col h4 { color: var(--text); font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: .85rem; margin-bottom: 6px; transition: .15s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: .75rem; color: var(--muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 200px 1fr; background: linear-gradient(var(--panel), var(--panel)) 0 0 / 200px 100% no-repeat; }
  .right-sidebar { display: none; }
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; background: none; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand { font-size: 1.05rem; }
  .menu-toggle { display: inline-flex; }
  .search-box { order: 3; max-width: 100%; flex-basis: 100%; }

  .sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0;
    width: min(280px, 82vw); max-height: none; height: 100vh;
    z-index: 130; transform: translateX(-110%);
    transition: transform .28s ease; padding-bottom: 24px;
    border-right: 1px solid var(--border); box-shadow: 4px 0 30px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-open .sidebar-overlay { display: block; }

  .stats-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .related-list { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .game-player { min-height: 320px; }
  .ad-gate { min-height: 320px; padding: 12px; }
  .ad-gate-timer { font-size: 1.2rem; }
  .main-content { padding: 14px 12px; }
  .points-chip { padding: 7px 12px; font-size: .82rem; }
  .footer-bottom p { font-size: .7rem; }
}
@media (max-width: 420px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .related-list { grid-template-columns: 1fr; }
  .thumb-icon { font-size: 2.2rem; }
  .block-title { font-size: 1rem; }
}
