/* App navigation, shared by the games hub, the landing page and the reports:
   the header's section tabs, and on a phone a tab bar fixed to the bottom of the
   screen, as in a mobile app. Loaded on every page with the theme (theme.head_snippet). */

.tab-icon { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor;
            -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }

/* the header's tabs */
.app-bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent);
           -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.app-bar .home-nav, .app-bar .reports-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.app-bar .nav-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
           color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: 0;
           transition: background .15s, color .15s; }
.app-bar .nav-tab .tab-icon { width: 16px; height: 16px; }
.app-bar .nav-tab:hover { color: var(--ink); background: var(--raise); }
.app-bar .nav-tab.is-current { color: var(--ink); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }

/* the phone's bottom tab bar */
.app-tabs { display: none; }
@media (max-width: 760px) {
  .app-bar .home-nav, .app-bar .reports-nav { display: none; }
  .app-bar .theme-cycle { margin-left: auto; }
  .app-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid;
              grid-template-columns: repeat(4, minmax(0, 1fr));
              padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
              background: color-mix(in srgb, var(--panel) 92%, transparent);
              -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
              border-top: 1px solid var(--line); }
  .app-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px;
             border-radius: 12px; color: var(--dim); text-decoration: none; font-size: 11.5px; font-weight: 600; }
  .app-tab .tab-icon { width: 22px; height: 22px; }
  .app-tab.is-current { color: var(--accent); }
  .app-tab:active { background: var(--raise); }
  .has-tabs { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
}

/* small status chips: the daily countdown, "free, no sign-up" */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.app-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
            border: 1px solid var(--line); background: var(--raise); color: var(--muted); font-size: 13px; }
.app-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.app-chip.quiet { background: transparent; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up);
            box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Legends drawn as page text under a chart (see ui.js): they wrap on any width. */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 2px 6px 4px 8px;
  font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.35; color: var(--ink); }
.chart-legend button { all: unset; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 2px 0; border-radius: 4px; }
.chart-legend button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-legend button.off { opacity: .45; text-decoration: line-through; }
.chart-legend .sw { flex: none; display: inline-block; }
.chart-legend .sw-line { width: 22px; height: 0; border-top-width: 3px; }
.chart-legend .sw-dot { width: 11px; height: 11px; border-radius: 50%; }
.chart-legend .sw-diamond { width: 9px; height: 9px; margin: 0 1px; transform: rotate(45deg); }
.chart-legend .sw-bar { width: 12px; height: 12px; border-radius: 2px; }
