/* ── app-theme.css ───────────────────────────────────────────────────────────
   Brand theme for every screen except the admin pages: purple background,
   orange accent. The router puts `admin-route` on <html> for admin screens, so
   they keep the global theme. Only colour tokens are set here (no layout,
   overflow or sizing). The player adds its own wallpaper-style finish in
   player.css. Loaded after themes.css so these tokens win over [data-theme].
*/
html:not(.admin-route) {
  --player-bg:           #46257b;
  --player-bg-deep:      #35195f;
  --player-accent:       #f49237;
  --player-accent-light: #f7a95c;
  --player-on-accent:    #2a1250;
  --player-panel:        rgba(53, 25, 95, 0.55);
  --player-control:      rgba(255, 255, 255, 0.07);
  --player-border:       rgba(244, 146, 55, 0.40);

  /* Re-point the global theme tokens the player and its chrome consume */
  --bg:               var(--player-bg);
  --bg-surface:       rgba(53, 25, 95, 0.92);
  --surface-bg:       linear-gradient(135deg, rgba(244, 146, 55, 0.28), rgba(244, 146, 55, 0.14));
  --card-bg:          rgba(53, 25, 95, 0.90);
  --bg-card:          rgba(53, 25, 95, 0.90);
  --card-border:      var(--player-border);
  --surface-border:   var(--player-border);
  --accent-1:         var(--player-accent);
  --accent-2:         var(--player-accent-light);
  --accent-gradient:  linear-gradient(90deg, var(--player-accent), var(--player-accent-light));
  --primary:          var(--player-accent);
  --primary-text:     var(--player-on-accent);
  --btn-primary-bg:   var(--player-accent);
  --btn-primary-text: var(--player-on-accent);
  --btn-primary-shadow: rgba(244, 146, 55, 0.35);
  --btn-secondary-text:   #ece4ff;
  --btn-secondary-border: rgba(244, 146, 55, 0.45);
  --header-accent:    var(--player-accent);
  --scrollbar-thumb:  rgba(244, 146, 55, 0.35);
  --scrollbar-track:  rgba(53, 25, 95, 0.5);
  --bg-deep:          var(--player-bg-deep);
  --bg-input:         rgba(53, 25, 95, 0.60);
  --surface-subtle:   rgba(255, 255, 255, 0.08);
  --surface-hover:    rgba(244, 146, 55, 0.20);
  --divider:          rgba(255, 255, 255, 0.10);
  --text-muted:       #cbbfe6;
  --muted:            #d9cff0;
}

html:not(.admin-route),
html:not(.admin-route) body {
  background: var(--player-bg);
}

/* Page chrome on every non-admin screen: footer status bar and header menu icon */
/* !important: the mobile footer rule in style.css sets its background with !important */
html:not(.admin-route) footer#status-bar-root {
  background: var(--player-bg) !important;
  background-color: var(--player-bg) !important;
  box-shadow: 0 -4px 20px rgba(20, 8, 45, 0.45) !important;
}

html:not(.admin-route) .network-status-container,
html:not(.admin-route) .session-timer-container {
  background: rgba(53, 25, 95, 0.55);
  border-color: rgba(255, 255, 255, 0.16);
}

html:not(.admin-route) .session-timer-container {
  border-color: var(--player-border);
}

html:not(.admin-route) .session-timer-icon {
  color: var(--player-accent);
}

/* #menu-toggle .line in style.css is id-specific, so match it */
html:not(.admin-route) #menu-toggle .line,
html:not(.admin-route) .menu-icon-btn .line {
  background: var(--player-accent);
  background-color: var(--player-accent);
}

/* Hamburger: three equal bars, evenly spaced and centred in a 44px touch target.
   style.css has two rule sets for this icon (staggered widths with auto margins, and a centred
   column with +/-5px offsets); together they left the bars unaligned and ~19px apart. */
html:not(.admin-route) #menu-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
html:not(.admin-route) #menu-toggle .line,
html:not(.admin-route) #menu-toggle .line:nth-child(1),
html:not(.admin-route) #menu-toggle .line:nth-child(2),
html:not(.admin-route) #menu-toggle .line:nth-child(3) {
  width: 22px;
  height: 3px;
  margin: 0;
  border-radius: 2px;
  transform: none;
}
/* open: the outer bars cross into an X (bar height 3 + gap 4 = 7px to the middle) */
html:not(.admin-route) #menu-toggle.open .line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
html:not(.admin-route) #menu-toggle.open .line:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
html:not(.admin-route) #menu-toggle.open .line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* On phones, sit the icon on the same row as the page label and back button,
   between the header's two rules instead of on top of one */
@media (max-width: 768px) {
  html:not(.admin-route) #menu-toggle {
    top: calc(max(32px, calc(16px + env(safe-area-inset-top, 0px))) + 4px) !important;
  }
}

