/* ── FLOYD SHARED DESIGN SYSTEM ─────────────────────────── */
:root {
  --bg:         #FDF6EE;
  --bg-sub:     #FFF9F3;
  --header-bg:  #FFF4E6;
  --card:       #FFFFFF;
  --card-alt:   #FFF9F4;
  --border:     rgba(210,155,80,0.13);
  --text-1:     #3D2B1F;
  --text-2:     #9A7A65;
  --text-3:     #C4A882;
  --teal:       #2BAD9A;
  --teal-d:     #1E9484;
  --orange:     #E8823A;
  --orange-d:   #D0712A;
  --pink:       #F2789F;
  --purple:     #9B7EC8;
  --yellow:     #F5C542;
  --peach:      #F9C784;
  --mint:       #B7E4C7;
  --sky:        #BEE3F8;
  --shadow-sm:  0 2px 10px rgba(80,40,10,0.07);
  --shadow-md:  0 4px 20px rgba(80,40,10,0.09);
  --shadow-lg:  0 8px 32px rgba(80,40,10,0.11);
  --transition: 0.25s cubic-bezier(0.22,1,0.36,1);
}
[data-theme="dark"] {
  --bg:         #1C1510;
  --bg-sub:     #231A12;
  --header-bg:  #2A1E14;
  --card:       #2C2218;
  --card-alt:   #362A1C;
  --border:     rgba(255,215,140,0.09);
  --text-1:     #F5EDE0;
  --text-2:     #A08870;
  --text-3:     #6A5040;
  --shadow-sm:  0 2px 10px rgba(0,0,0,0.30);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.36);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.42);
}

/* reset */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ── SIDEBAR (desktop) ─────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 230px;
  background: var(--header-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: background var(--transition), border-color var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { width: 40px; height: 40px; border-radius: 14px; object-fit: contain; }
.sidebar-logo-text { line-height: 1.1; }
.sidebar-logo-name { font-family: 'Bubblegum Sans', cursive; font-size: 16px; color: var(--orange); }
.sidebar-logo-sub { font-size: 9px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1px; }

.sidebar-user {
  margin: 12px 14px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--pink));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; font-weight: 900;
  flex-shrink: 0;
}
.user-name { font-family: 'Bubblegum Sans', cursive; font-size: 14px; color: var(--text-1); }
.user-level { font-size: 10px; font-weight: 700; color: var(--text-2); margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }
.nav-section-label {
  font-size: 9px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.09em;
  padding: 8px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 12px; margin-bottom: 2px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(128,80,20,0.06); color: var(--text-1); }
.nav-item.active { background: rgba(232,130,58,0.12); color: var(--orange); font-weight: 800; }
[data-theme="dark"] .nav-item:hover { background: rgba(255,210,140,0.07); }
[data-theme="dark"] .nav-item.active { background: rgba(232,130,58,0.14); }
.nav-item-icon {
  width: 28px; height: 28px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.nav-item-icon img { width: 24px; height: 24px; object-fit: contain; }
.nav-item-icon.plain { font-size: 16px; }
.gi-quiz       { background: #FDE8E8; }
.gi-memory     { background: #DBEAFE; }
.gi-adivinha   { background: #EDE9FE; }
.gi-photopick  { background: #FEE2E2; }
.gi-lightning  { background: #FEF3C7; }
.gi-wordsearch { background: #D1FAE5; }
[data-theme="dark"] .gi-quiz       { background: #3b1c1c; }
[data-theme="dark"] .gi-memory     { background: #1c2a3e; }
[data-theme="dark"] .gi-adivinha   { background: #2a2440; }
[data-theme="dark"] .gi-photopick  { background: #3d2528; }
[data-theme="dark"] .gi-lightning  { background: #3a3020; }
[data-theme="dark"] .gi-wordsearch { background: #1c3a2e; }
.nav-badge {
  margin-left: auto; font-size: 9px;
  background: rgba(232,130,58,0.18); color: var(--orange);
  border-radius: 6px; padding: 1px 6px; font-weight: 800;
}
.nav-divider { height: 1px; background: var(--border); margin: 8px 10px; }

.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.sidebar-pills { display: flex; gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 800;
  border: 1px solid transparent;
  transition: filter var(--transition);
}
.pill:hover { filter: brightness(1.06); }
.pill-fire  { background: rgba(245,197,66,0.18); color: #D97706; border-color: rgba(217,119,6,0.18); }
.pill-coin  { background: rgba(5,150,105,0.12);  color: #059669; border-color: rgba(5,150,105,0.18); }
[data-theme="dark"] .pill-fire { background: rgba(58,42,24,1); border-color: rgba(217,119,6,0.22); }
[data-theme="dark"] .pill-coin { background: rgba(30,46,30,1); border-color: rgba(5,150,105,0.22); }

.btn-play-sidebar {
  width: 100%;
  background: linear-gradient(135deg, var(--teal), var(--teal-d));
  color: white; border: none; border-radius: 16px;
  padding: 12px;
  font-size: 15px; font-family: 'Bubblegum Sans', cursive;
  box-shadow: 0 5px 18px rgba(43,173,154,0.38);
  transition: filter var(--transition), transform var(--transition);
}
.btn-play-sidebar:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ── TOP BAR ─────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 230px; right: 0; height: 60px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  z-index: 150;
  transition: background var(--transition), border-color var(--transition), left var(--transition);
}
.topbar-greeting { flex: 1; }
.topbar-greeting-main { font-family: 'Bubblegum Sans', cursive; font-size: 20px; color: var(--text-1); line-height: 1; }
.topbar-greeting-sub { font-size: 11px; font-weight: 600; color: var(--text-2); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.btn-ghost-sm {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px; padding: 7px 16px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.btn-ghost-sm:hover { background: rgba(128,80,20,0.06); color: var(--text-1); }
[data-theme="dark"] .btn-ghost-sm:hover { background: rgba(255,210,140,0.07); }

/* ── MOBILE HEADER ─────────────────────────────────────── */
#mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  z-index: 150;
  transition: background var(--transition);
}
.mobile-status {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  font-size: 12px; font-weight: 700; color: var(--text-2);
}
.mobile-status-time { color: var(--text-1); }
.mobile-status-icons { display: flex; gap: 5px; align-items: center; font-size: 13px; }
.mobile-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 18px 12px; gap: 10px;
}
.mobile-topbar-level { font-size: 9px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 1px; }
.mobile-topbar-name { font-family: 'Bubblegum Sans', cursive; font-size: 20px; color: var(--orange); line-height: 1; }
.mobile-topbar-right { display: flex; gap: 7px; align-items: center; }

/* ── BOTTOM TABS (mobile) ──────────────────────────────── */
#bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 66px;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -3px 16px rgba(0,0,0,0.07);
  transition: background var(--transition);
}
.bottom-tabs { display: flex; height: 66px; }
.bottom-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: none; border: none; padding: 4px 0;
  color: var(--text-2); font-size: 10px; font-weight: 700;
  transition: color var(--transition);
}
.bottom-tab.active { color: var(--orange); }
.bottom-tab-icon { font-size: 22px; line-height: 1; }
.bottom-tab-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }

/* ── MAIN ─────────────────────────────────────── */
#main {
  margin-left: 230px; margin-top: 60px;
  min-height: calc(100vh - 60px);
  display: flex; gap: 0;
  transition: margin var(--transition);
}
#content { flex: 1; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; }

/* page header */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.page-eyebrow { font-size: 10px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.page-title { font-family: 'Bubblegum Sans', cursive; font-size: 38px; color: var(--text-1); line-height: 1; }
.page-sub { font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: 8px; max-width: 540px; line-height: 1.5; }
.page-meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* TABLET */
@media (max-width: 1080px) {
  #sidebar { display: none; }
  #topbar { left: 0; height: auto; flex-wrap: wrap; padding: 0 18px; }
  #topbar-desktop-greeting { display: none !important; }
  #tablet-nav {
    display: flex; align-items: center; gap: 2px;
    overflow-x: auto; scrollbar-width: none;
    padding: 10px 0; flex: 1;
  }
  #tablet-nav::-webkit-scrollbar { display: none; }
  .tablet-nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 20px;
    border: none; background: transparent;
    color: var(--text-2); font-size: 13px; font-weight: 700;
    white-space: nowrap; font-family: inherit;
    transition: background var(--transition), color var(--transition);
  }
  .tablet-nav-item.active { background: rgba(232,130,58,0.12); color: var(--orange); }
  .tablet-nav-item:hover:not(.active) { background: rgba(128,80,20,0.06); color: var(--text-1); }
  [data-theme="dark"] .tablet-nav-item.active { background: rgba(232,130,58,0.15); }
  #topbar-right { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
  #main { margin-left: 0; margin-top: 60px; flex-direction: column; }
  #content { padding: 20px 20px 16px; }
  .page-title { font-size: 30px; }
}
@media (min-width: 1081px) {
  #tablet-nav { display: none; }
  #topbar-right { display: none; }
}

/* MOBILE */
@media (max-width: 640px) {
  #topbar { display: none; }
  #mobile-header { display: block; }
  #bottom-nav { display: block; }
  #main { margin-left: 0; margin-top: 100px; padding-bottom: 76px; }
  #content { padding: 14px 15px; gap: 16px; }
  .page-title { font-size: 26px; }
  .page-sub { font-size: 13px; }
}
@media (min-width: 641px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 640px) {
  .hidden-mobile { display: none !important; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── PREMIUM DIM — sidebar nav items ────────────────────── */
.nav-item.dim {
  opacity: 0.55;
  transition: opacity var(--transition), background var(--transition);
}
.nav-item.dim:hover { opacity: 0.85; }
[data-theme="dark"] .nav-item.dim { opacity: 0.5; }
[data-theme="dark"] .nav-item.dim:hover { opacity: 0.8; }

/* ── PREMIUM DIM — game cards ───────────────────────────── */
.game-card.dim {
  opacity: 0.6;
  filter: saturate(0.8);
  position: relative;
  transition: opacity var(--transition), filter var(--transition);
}
.game-card.dim:hover { opacity: 0.9; filter: saturate(1); }
.game-card-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  pointer-events: none;
}
[data-theme="dark"] .game-card-lock { background: rgba(0,0,0,0.55); }

/* ── GAMES SECTION wrapper ──────────────────────────────── */
.games-section { margin-bottom: 24px; }
.games-section + .games-section { margin-top: 28px; }

/* ── MINI PLAYER (floating corner card) ─────────────────── */
.miniplayer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 8px 10px 6px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transition: opacity var(--transition), transform var(--transition), width 0.3s ease, padding 0.3s ease;
}
.miniplayer.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.miniplayer-row {
  display: flex;
  align-items: center;
  gap: 1px;
}
.miniplayer-nome {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 3px;
}
.miniplayer-btn {
  background: none;
  border: none;
  padding: 5px 6px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 10px;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.miniplayer-btn:hover { background: rgba(128,80,20,0.08); color: var(--text-1); }
[data-theme="dark"] .miniplayer-btn:hover { background: rgba(255,210,140,0.08); }
.miniplayer-pp { font-size: 17px; color: var(--purple); }

/* Volume popup — opens upward */
.miniplayer-vol-wrap { position: relative; }
.miniplayer-vol-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.miniplayer-vol-popup.open { display: flex; }
.miniplayer-volume {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 20px;
  height: 80px;
  cursor: pointer;
  accent-color: var(--purple);
}

/* Scrub bar */
.miniplayer-progress {
  display: block;
  width: 100%;
  margin-top: 5px;
  accent-color: var(--orange);
  cursor: pointer;
  height: 3px;
}

/* Minimized state — collapses to pill showing only play/pause */
.miniplayer.minimized {
  width: 44px;
  padding: 6px;
  cursor: pointer;
}
.miniplayer.minimized .miniplayer-row {
  justify-content: center;
}
.miniplayer.minimized .miniplayer-btn:not(.miniplayer-pp),
.miniplayer.minimized .miniplayer-nome,
.miniplayer.minimized .miniplayer-vol-wrap,
.miniplayer.minimized #miniplayer-progress {
  display: none;
}

/* Mobile — float above bottom nav */
@media (max-width: 640px) {
  .miniplayer { bottom: calc(66px + 10px); right: 10px; width: 220px; }
  .miniplayer.minimized { width: 44px; }
}
