/* ==========================================================================
   3D floating-island hub (index page)
   ========================================================================== */

.hub-page {
  height: 100%;
  overflow: hidden; /* the hub owns the viewport; the page itself never scrolls */
}
.hub-page body {
  height: 100%;
  overflow: hidden;
  background: #0a1424;
}

#hub-root {
  position: fixed;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
}
#hub-root.ready { opacity: 1; }

#hub {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none; /* let OrbitControls own touch gestures */
}
#hub:active { cursor: grabbing; }

/* Sky wash behind the canvas. The renderer clears to a flat colour, so this
   gradient is what gives the sky its vertical falloff. */
.hub-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 12%, #2d4f80 0%, #16273f 46%, #0a1424 100%);
}

/* Vignette, to keep attention in the middle. */
.hub-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(120% 100% at 50% 50%, transparent 52%, rgba(4, 8, 16, 0.62) 100%);
}

/* ── labels ─────────────────────────────────────────────────────────── */
#hub-labels {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none; /* individual labels re-enable this themselves */
}

.hub-label {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  padding: 9px 16px 10px;
  min-width: 132px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 3px solid var(--gold, #ffd100);
  border-radius: 4px;
  background: rgba(10, 18, 30, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #f2f5fa;
  text-decoration: none;
  /* Positioned every frame from JS; transitioning transform would fight it. */
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.22s ease;
  will-change: transform, opacity;
}

.hub-label-title-text {
  display: block;
  font-family: 'Press Start 2P', 'Inter', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #fff;
}

.hub-label-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #9fb0c6;
}

a.hub-label:hover,
.hub-label.hot {
  background: rgba(20, 32, 52, 0.94);
  border-color: rgba(255, 209, 0, 0.55);
  box-shadow: 0 14px 40px rgba(255, 209, 0, 0.20);
}
a.hub-label:hover .hub-label-sub,
.hub-label.hot .hub-label-sub { color: #ffd100; }

/* The centre island's label is the site title, not a link. */
.hub-label-title {
  border: none;
  border-left: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  pointer-events: none;
}
.hub-label-title .hub-label-title-text {
  font-size: clamp(20px, 3.4vw, 40px);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.85), 0 0 42px rgba(255, 209, 0, 0.42);
}
.hub-label-title .hub-label-sub {
  margin-top: 12px;
  font-size: clamp(11px, 1.3vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #94a3b8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.hub-label-title:hover { background: none; box-shadow: none; }

/* ── chrome over the scene ──────────────────────────────────────────── */
.hub-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8;
  display: flex;
  /* Top-aligned, not centred: the env controls on the right are a three-row
     stack, and centring against them dragged the brand halfway down the bar. */
  align-items: flex-start;
  gap: 16px;
  padding: 14px 24px;
  pointer-events: none;
}
.hub-top > * { pointer-events: auto; }
.hub-top .brand img { width: 30px; height: 30px; }
/* Nudge so the wordmark sits optically level with the Discord stat opposite. */
.hub-top .brand { margin-top: -2px; }

.hub-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.hub-nav a {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #a8b2c4;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}
.hub-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.hub-hint {
  position: fixed;
  left: 24px;
  bottom: 108px;
  z-index: 8;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.9;
  pointer-events: none;
}

.hub-corner {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 8;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── loading ────────────────────────────────────────────────────────── */
#hub-loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #0a1424;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
#hub-loading.gone { opacity: 0; visibility: hidden; }
#hub-loading .lt {
  font-family: 'Press Start 2P', system-ui, sans-serif;
  font-size: 13px;
  color: #ffd100;
  letter-spacing: 0.05em;
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ── no WebGL ───────────────────────────────────────────────────────── */
#hub-fallback {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 30px;
  background: radial-gradient(120% 90% at 50% 10%, #24406b 0%, #0a1424 70%);
  text-align: center;
}
#hub-fallback.show { display: grid; }
#hub-fallback img { width: 96px; height: 96px; margin: 0 auto 22px; }
#hub-fallback h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; margin-bottom: 10px; }
#hub-fallback p { color: #a8b2c4; margin: 0 auto 26px; max-width: 420px; }
.fallback-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 780px) {
  .hub-nav a { padding: 7px 10px; font-size: 12.5px; }
  .hub-label { min-width: 108px; padding: 7px 12px 8px; }
  .hub-label-title-text { font-size: 9px; }
  .hub-label-sub { font-size: 10px; margin-top: 4px; }
  .hub-hint { display: none; }
  .hub-top { padding: 14px 16px; }
  .hub-corner { right: 16px; bottom: 16px; }
}

/* ── stat + world controls (top right) ──────────────────────────────── */
/* Deliberately flat and square: hard edges, no glass, no rounding — the look
   is a game HUD, not a web widget. */
.hub-env {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
  margin-left: auto;
  font-family: 'Press Start 2P', ui-monospace, Consolas, monospace;
}

/* Live Discord count */
.env-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 2px 4px 0;
}
.env-stat-key {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.env-stat-val {
  font-size: 15px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.env-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.env-row .env-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding-right: 7px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.env-btn {
  padding: 7px 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(28, 28, 30, 0.86);
  color: #d5d5d5;
  font-family: inherit;
  font-size: 8.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.env-btn:hover {
  background: rgba(58, 58, 60, 0.94);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.env-btn.on {
  background: var(--gold, #ffd100);
  border-color: var(--gold, #ffd100);
  color: #1a1400;
}
.env-btn.on:hover { background: #ffdc33; }

/* ── hotbar ─────────────────────────────────────────────────────────── */
.hub-hotbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 2px solid rgba(0, 0, 0, 0.55);
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hub-hotbar .slot {
  width: 84px;
  padding: 9px 6px 7px;
  border: 2px solid transparent;
  background: rgba(46, 46, 48, 0.72);
  color: #cfcfcf;
  font-family: 'Press Start 2P', ui-monospace, Consolas, monospace;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.hub-hotbar .slot:hover,
.hub-hotbar .slot.hot {
  background: rgba(72, 72, 76, 0.86);
  color: #fff;
}
/* Selected slot: the thick pale outline Minecraft uses. */
.hub-hotbar .slot.on {
  border-color: #ffd100;
  background: rgba(72, 64, 26, 0.8);
  color: #fff;
}

.slot-icon {
  width: 30px;
  height: 30px;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

.slot-name {
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  text-align: center;
}

/* ── label hover growth ─────────────────────────────────────────────── */
/* The anchor is repositioned every frame by JS, so the scale lives on the
   inner card where a CSS transition can actually run. */
.hub-label-anchor {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
}

.hub-label {
  position: static;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.18s ease, background 0.18s ease, box-shadow 0.22s ease;
  cursor: pointer;
  font: inherit;
}
.hub-label:hover,
.hub-label.hot { transform: scale(1.16); }

/* The centre title is plain text — no card, no border. Hovering only grows it. */
.hub-label-title {
  pointer-events: auto;
  cursor: default;
}
.hub-label-title:hover,
.hub-label-title.hot {
  transform: scale(1.09);
  background: none;
  box-shadow: none;
}

/* Lightning flash overlay */
#hub-flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: #dce8ff;
  opacity: 0;
  transition: opacity 0.09s linear;
}

/* ── content panel ──────────────────────────────────────────────────── */
/* Styled as an in-game tool window: warm near-black, hairline borders,
   monospace labels, one amber accent. */
#hub-panel {
  /* Translucent so the world stays visible behind the window. The blur is what
     keeps text readable over a moving scene. */
  --p-bg: rgba(17, 17, 17, 0.82);
  --p-raise: rgba(30, 30, 30, 0.72);
  --p-line: rgba(255, 255, 255, 0.10);
  --p-line-soft: rgba(255, 255, 255, 0.06);
  --p-ink: #e9e9e9;
  --p-dim: #8b8b8b;
  --p-faint: #616161;
  --p-amber: #e8b33a;
  --p-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 20px;
  /* Light scrim only — the sheet's own blur does the readability work, and a
     heavy backdrop would defeat the point of making it see-through. */
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}
#hub-panel.show { opacity: 1; visibility: visible; }

.panel-sheet {
  position: relative;
  width: min(880px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--p-line);
  border-radius: 6px;
  background: var(--p-bg);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(18px) scale(0.99);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
#hub-panel.show .panel-sheet { transform: none; }

/* ── header ─────────────────────────────────────────────────────────── */
.panel-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--p-line);
  background: var(--p-raise);
  flex: none;
}

/* A real block texture as the window icon. */
.panel-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px var(--p-line);
}

.panel-heads { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

#hub-panel-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.1;
}

#hub-panel-sub {
  font-family: var(--p-mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--p-faint);
  line-height: 1.4;
}

.panel-close {
  margin-left: auto;
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--p-line);
  border-radius: 4px;
  background: transparent;
  color: var(--p-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.panel-close:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255,255,255,0.05); }
.panel-close svg { width: 15px; height: 15px; }

/* ── body ───────────────────────────────────────────────────────────── */
#hub-panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  color: var(--p-ink);
}
#hub-panel-body::-webkit-scrollbar { width: 10px; }
#hub-panel-body::-webkit-scrollbar-track { background: transparent; }
#hub-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16); border-radius: 5px; border: 2px solid transparent;
  background-clip: padding-box;
}
#hub-panel-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); background-clip: padding-box; }

/* The injected markup was written for a full page, so its page-level spacing
   and glassy card treatment are flattened to the tool-window look. */
#hub-panel-body section { padding: 0 0 20px; }
#hub-panel-body section:last-child { padding-bottom: 0; }
#hub-panel-body .wrap { padding: 0; max-width: none; }

#hub-panel-body .section-head {
  text-align: left;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--p-line-soft);
}
#hub-panel-body .section-head h2 {
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--p-faint);
  margin: 0;
}
#hub-panel-body .eyebrow { display: none; }
#hub-panel-body .lede { margin: 8px 0 0; color: var(--p-dim); font-size: 14px; }

#hub-panel-body .card,
#hub-panel-body .qa {
  background: var(--p-raise);
  border: 1px solid var(--p-line);
  border-radius: 5px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

#hub-panel-body .flow-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
#hub-panel-body .feat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
#hub-panel-body .feat { padding: 18px; transition: border-color 0.16s ease; }
#hub-panel-body .feat:hover { transform: none; border-color: rgba(232, 179, 58, 0.4); }
#hub-panel-body .feat h3 { font-size: 14.5px; color: #fff; }
#hub-panel-body .feat p { font-size: 13px; color: var(--p-dim); }

#hub-panel-body .feat-icon {
  width: 34px; height: 34px;
  border-radius: 4px;
  background: rgba(232, 179, 58, 0.11);
  color: var(--p-amber);
  margin-bottom: 12px;
}
#hub-panel-body .feat-icon svg { width: 17px; height: 17px; }

#hub-panel-body .flow { padding: 20px; }
#hub-panel-body .flow-title { margin-bottom: 16px; }
#hub-panel-body .flow-title h3 { font-size: 15px; color: #fff; }
#hub-panel-body .flow-badge {
  width: 34px; height: 34px;
  border-radius: 4px;
  font-family: var(--p-mono);
  font-size: 10px;
  background: rgba(232, 179, 58, 0.13);
  color: var(--p-amber);
}
#hub-panel-body .flow.buy .flow-badge { background: rgba(102, 169, 255, 0.14); color: #66a9ff; }

#hub-panel-body .steps li { font-size: 13.5px; color: var(--p-dim); padding-bottom: 18px; }
#hub-panel-body .steps li b { color: var(--p-ink); }
#hub-panel-body .steps li::before {
  font-family: var(--p-mono);
  background: rgba(232, 179, 58, 0.1);
  border-color: rgba(232, 179, 58, 0.34);
  color: var(--p-amber);
}
#hub-panel-body .flow.buy .steps li::before {
  background: rgba(102, 169, 255, 0.11);
  border-color: rgba(102, 169, 255, 0.32);
  color: #66a9ff;
}

/* FAQ / terms accordions */
#hub-panel-body .faq { max-width: none; gap: 8px; }
#hub-panel-body .qa summary { padding: 14px 16px; font-size: 14px; color: var(--p-ink); }
#hub-panel-body .qa summary:hover { color: var(--p-amber); }
#hub-panel-body .qa[open] { border-color: rgba(232, 179, 58, 0.34); }
#hub-panel-body .qa-body { padding: 0 16px 15px; font-size: 13.5px; color: var(--p-dim); }
#hub-panel-body .qa-body b { color: var(--p-ink); }

/* Closing call to action */
#hub-panel-body .cta-band {
  background: var(--p-raise);
  border: 1px solid rgba(232, 179, 58, 0.28);
  border-radius: 5px;
  padding: 26px 22px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#hub-panel-body .cta-band h2 { font-size: 20px; color: #fff; }
#hub-panel-body .cta-band p { font-size: 14px; color: var(--p-dim); margin-bottom: 18px; }
#hub-panel-body .btn-gold {
  background: var(--p-amber);
  color: #171003;
  border-radius: 4px;
  box-shadow: none;
}
#hub-panel-body .btn-gold:hover { background: #f2c353; transform: none; box-shadow: none; }

.panel-status {
  padding: 70px 20px;
  text-align: center;
  font-family: var(--p-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.panel-status a { color: var(--p-amber); text-decoration: underline; }

body.panel-open #hub { pointer-events: none; }

@media (max-width: 900px) {
  #hub-panel-body .feat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  #hub-panel { padding: 0; }
  .panel-sheet { max-height: 100vh; height: 100%; border-radius: 0; border: 0; width: 100%; }
  #hub-panel-body .wrap { padding: 0 18px; }
  #hub-panel-body .feat-grid { grid-template-columns: 1fr; }
  .hub-env { gap: 6px; }
  .env-row .env-label { display: none; }
  .env-btn { width: 27px; height: 26px; }
}

/* ── HUD legibility ─────────────────────────────────────────────────── */
/* The sky ranges from near-white at noon to near-black at night, so the HUD
   needs its own contrast rather than relying on the scene behind it. Soft dark
   gradients top and bottom do it without boxing anything in. */
.hub-top::before,
.hub-hotbar::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: -1;
}
.hub-top::before {
  top: 0;
  height: 190px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}
.hub-hotbar::before {
  bottom: 0;
  height: 190px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.hub-top .brand span { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85); }

.hub-hint {
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 20px rgba(0, 0, 0, 0.6);
}

/* The centre title sits over open sky, which can be almost white at noon. */
.hub-label-title .hub-label-title-text {
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.95),
    0 4px 22px rgba(0, 0, 0, 0.8),
    0 0 46px rgba(0, 0, 0, 0.55);
}
.hub-label-title .hub-label-sub {
  color: #dfe6ef;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 18px rgba(0, 0, 0, 0.7);
}

/* ── jukebox ────────────────────────────────────────────────────────── */
.jukebox { position: relative; }

/* Now-playing bar: wide and short, same flat square language as the SKY /
   WEATHER controls. Icon, track name, then the arrow that opens the list. */
.jb-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 2px 0 7px;
  min-width: 186px;
  max-width: 260px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(28, 28, 30, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.13s ease, border-color 0.13s ease;
}
.jb-bar:hover { background: rgba(58, 58, 60, 0.94); border-color: rgba(255, 255, 255, 0.28); }
.jb-bar.open {
  border-color: var(--gold, #ffd100);
  background: rgba(72, 64, 26, 0.9);
}

.jb-face {
  width: 24px;
  height: 24px;
  flex: none;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
/* Nothing selected: a small vinyl mark rather than an empty gap. */
.jb-face.empty {
  background: radial-gradient(circle at 50% 50%,
    #0d0d0d 0 22%, #8b8b8b 22% 27%, #2a2a2a 27% 100%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.jb-bar.playing .jb-face { animation: spin 3.6s linear infinite; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .jb-bar.playing .jb-face { animation: none; }
}

.jb-current {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #e8e8e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jb-bar.playing .jb-current { color: var(--gold, #ffd100); }

.jb-arrow {
  width: 30px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: color 0.13s ease, transform 0.2s ease;
}
.jb-bar:hover .jb-arrow { color: #fff; }
.jb-arrow svg { width: 15px; height: 15px; }
.jb-arrow[aria-expanded='true'] { transform: rotate(180deg); color: var(--gold, #ffd100); }


/* ── dropdown ───────────────────────────────────────────────────────── */
.jb-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 268px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(15, 15, 17, 0.9);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.18s ease;
}
.jb-menu.show { opacity: 1; visibility: visible; transform: none; }

.jb-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.jb-head-title {
  font-family: 'Press Start 2P', ui-monospace, Consolas, monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.jb-now {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold, #ffd100);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.jb-list {
  max-height: 296px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
}
.jb-list::-webkit-scrollbar { width: 8px; }
.jb-list::-webkit-scrollbar-track { background: transparent; }
.jb-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.jb-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
}

.jb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: #d8d8d8;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.13s ease, color 0.13s ease, border-color 0.13s ease;
}
.jb-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.jb-item.on {
  background: rgba(255, 209, 0, 0.11);
  border-left-color: var(--gold, #ffd100);
  color: #fff;
}

.jb-icon {
  width: 26px;
  height: 26px;
  flex: none;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
.jb-item.on .jb-icon { animation: spin 3.6s linear infinite; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) {
  .jb-item.on .jb-icon { animation: none; }
}

.jb-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.jb-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jb-artist {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.3;
}
.jb-item.on .jb-artist { color: rgba(255, 209, 0, 0.72); }

/* "Off" has no disc art, so it gets a muted dot to keep the rows aligned. */
.jb-off .jb-icon {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

@media (max-width: 780px) {
  .jb-menu { width: 232px; }
  .jb-list { max-height: 232px; }
}

/* Master-muted: the disc keeps spinning (it is still playing) but the bar
   reads as silenced. */
.jb-bar.muted .jb-current { color: rgba(255, 255, 255, 0.4); }
.jb-bar.muted .jb-face { opacity: 0.45; }

/* Labels and HUD are scene furniture, not prose. Letting a drag select the
   text meant orbiting the world highlighted "HOW IT WORKS" instead. */
.hub-label,
.hub-label-anchor,
.hub-hotbar,
.hub-env,
.hub-hint,
.hub-top .brand,
#hub-loading {
  -webkit-user-select: none;
  user-select: none;
}
