:root {
  --bg0: #0b1020;
  --bg1: #0f1733;
  --card: rgba(255,255,255,0.07);
  --card2: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.55);
  --accent: #7c5cff;
  --accent2: #33d1ff;
  --ok: #40d47e;
  --warn: #ffcc66;
  --err: #ff6b6b;
  --shadow: 0 12px 34px rgba(0,0,0,0.35);
  --ring: 0 0 0 3px rgba(124,92,255,0.25);
  --radius: 18px;
  --radius2: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: transparent;
  position: relative;
  isolation: isolate;
}
/* Fixed background layer so expanding/collapsing content doesn't "re-map" the gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(124,92,255,0.35), transparent 60%),
    radial-gradient(900px 600px at 92% 10%, rgba(51,209,255,0.22), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 18px 56px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
}
.brand-logo {
  height: 30px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.25));
}
.brand h1 { margin: 0; font-size: 14px; letter-spacing: 0.2px; }
.brand .sub { margin: 0; color: var(--muted2); font-size: 12px; }
/* Topbar navigation (desktop) */
.topbar nav.nav-desktop {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.lang-switch {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-left: 8px;
  margin-left: 6px;
  border-left: 1px solid rgba(255,255,255,0.10);
}
.pill { -webkit-tap-highlight-color: transparent; }
button.pill {
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

/* --- Mobile hamburger menu --- */
.nav-mobile-btn {
  display: none; /* shown only on mobile */
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  min-width: 44px;
}
.hamburger {
  width: 18px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}
.hamburger > span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 1px 0 rgba(0,0,0,0.20);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}
.mobile-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 9991;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,14,28,0.92);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-10px);
  opacity: 0;
  transition: transform .14s ease, opacity .14s ease;
  max-height: calc(100vh - 24px);
  overflow: auto;
}
.mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
}
.mobile-menu-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.mobile-menu-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 15px;
}
.mobile-menu-bd {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.mobile-menu-link {
  width: 100%;
  justify-content: space-between;
}
.mobile-menu-sep {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 2px 0;
}
.mobile-menu-lang {
  display: flex;
  gap: 10px;
}
.mobile-menu-lang .pill {
  flex: 1 1 0;
  justify-content: center;
}

/* --- Singleplayer --- */
.sp-app {
  display: grid;
  gap: 18px;
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 6px;
}
.sp-screen {
  display: grid;
  gap: 16px;
  justify-items: center;
}
.sp-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  max-width: 720px;
  margin: 0 auto;
}
.sp-screen[hidden] { display: none !important; }
.sp-variant-row {
  align-items: stretch;
  gap: 12px;
}
.sp-btn {
  width: auto;
  min-width: 160px;
}
.sp-next-btn {
  width: min(520px, 100%);
  margin: 0 auto;
}
.sp-next-btn[hidden] {
  display: none !important;
}
.sp-variant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
  min-height: 100px;
  justify-content: center;
  text-align: center;
}
.sp-variant-card:hover {
  border-color: rgba(124,92,255,0.55);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.sp-variant-card.is-selected {
  border-color: rgba(124,92,255,0.95);
  background: linear-gradient(135deg, rgba(124,92,255,0.22), rgba(51,209,255,0.18));
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}
.sp-variant-card:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.sp-variant-emoji {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 2px;
}
.sp-variant-title {
  font-weight: 900;
  letter-spacing: -0.01em;
  font-size: 17px;
  text-align: center;
}
.sp-variant-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.sp-mode-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 6px;
}
.sp-blocked-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 6px;
}
.sp-blocked-note { margin-bottom: 10px; }
.sp-blocked-score {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
}
.sp-round-hd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 10px;
  width: min(520px, 100%);
}
.sp-round-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.sp-round-label {
  font-size: 12px;
  color: var(--muted);
}
.sp-round-value {
  font-size: 14px;
  color: rgba(255,255,255,0.92);
}
.sp-card {
  width: min(360px, 100%);
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  perspective: 1200px;
  cursor: pointer;
}
.sp-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .6s ease;
}
.sp-card.is-flipped .sp-card-inner {
  transform: rotateY(180deg);
}
.sp-card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 10px;
}
.sp-card-front {
  background: #ffffff;
  color: #0b1020;
  border-color: rgba(0,0,0,0.08);
}
.sp-card-front .sp-qr-note {
  color: rgba(0,0,0,0.55);
}
.sp-card-back {
  transform: rotateY(180deg);
  background: #ffffff;
  color: #0b1020;
  border-color: rgba(0,0,0,0.08);
}
.sp-card-back .sp-reveal {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 16px 20px;
  text-align: center;
}
.sp-card-back .sp-reveal-song {
  font-size: 20px;
  font-weight: 900;
}
.sp-card-back .sp-reveal-year {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.sp-card-back .sp-reveal-artist {
  font-size: 15px;
  color: rgba(0,0,0,0.65);
}
.sp-card-back .sp-reveal-meta {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
}
.sp-card-back .sp-reveal-links {
  margin-top: 4px;
}
.sp-card-back .sp-reveal-links-label {
  font-size: 12px;
  color: rgba(0,0,0,0.50);
  margin-bottom: 6px;
  font-weight: 600;
}
.sp-card-back .sp-reveal-links-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
}
.sp-card-back .sp-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.55);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  padding: 4px;
  border-radius: 8px;
}
.sp-card-back .sp-link-icon:hover {
  color: rgba(0,0,0,0.85);
  transform: scale(1.15);
}
.sp-card-back .sp-link-icon svg {
  display: block;
}
.sp-qr-wrap {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.sp-qr-box {
  position: relative;
}
.sp-qr-box canvas,
.sp-qr-box img {
  width: 220px;
  height: 220px;
  display: block;
}
.qr-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.qr-center-icon svg {
  width: 48px;
  height: 48px;
  display: block;
}
.sp-qr-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ---- Deezer preview player ---- */
.sp-preview-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}
.sp-preview-divider {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.35);
}
.sp-preview-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.65);
}

/* --- Button / progress bar --- */
.sp-preview-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  border: 2px solid var(--sp-prev-base, #0b1020);
  background: var(--sp-prev-base, #0b1020);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  padding: 0;
  line-height: 1;
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.sp-preview-btn:active {
  transform: scale(0.96);
}

/* Expanded bar state */
.sp-preview-btn.is-bar {
  width: 180px;
}

/* Progress fill */
.sp-preview-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--sp-prev-fill, #2a3f6a);
  pointer-events: none;
  z-index: 0;
}

/* Icon layer — absolute-fill so centering is independent of content size */
.sp-preview-btn .sp-preview-icon {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  /* play ▶ triangle is visually left-heavy; nudge right */
  padding-left: 3px;
  padding-top: 0;
  box-sizing: border-box;
}
/* play ▶ inside the expanded bar — nudge down a touch */
.sp-preview-btn.is-bar .sp-preview-icon {
  padding-top: 2px;
}
/* pause ▮▮ — stretch vertically, compensate letter-spacing + nudge up */
.sp-preview-btn.is-bar.is-pause .sp-preview-icon {
  font-size: 16px;
  letter-spacing: 3px;
  padding-left: 3px;
  padding-top: 0;
  transform: scaleY(1.8) translateY(-1px);
}
/* replay ↻ — centered, no nudge needed */
.sp-preview-btn.is-replay .sp-preview-icon {
  font-size: 22px;
  padding-left: 0;
  padding-top: 0;
}

.sp-preview-unavailable {
  font-size: 12px;
  color: rgba(0,0,0,0.45);
  text-align: center;
  padding: 4px 8px;
  font-style: italic;
}

.sp-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  width: min(520px, 100%);
}
.sp-input-row > div {
  flex: 1 1 220px;
}
#spYearInput {
  font-size: 16px;
}
.sp-confirm-btn {
  height: 44px;
}
.sp-input-row[hidden] { display: none !important; }
.sp-guess-row[hidden] { display: none !important; }
.sp-guess-row {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  width: min(520px, 100%);
}
.sp-guess-label {
  font-size: 12px;
  color: var(--muted);
}
.sp-guess-value {
  font-size: 20px;
  font-weight: 900;
}
.sp-guess-points {
  font-size: 14px;
  color: rgba(124,92,255,0.95);
  font-weight: 800;
}
.sp-reveal-song {
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}
.sp-reveal-year {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.sp-reveal-artist {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.sp-reveal-meta {
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}
.sp-results-score {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 12px;
}
.sp-score-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sp-results-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  width: min(520px, 100%);
  justify-items: center;
}
.sp-results-meta span:last-child {
  color: rgba(255,255,255,0.92);
}
.sp-score-row {
  font-size: 20px;
  font-weight: 900;
  color: rgba(255,255,255,0.92);
}
.sp-results-meta #spFinalScore {
  font-size: 26px;
  font-weight: 900;
}
.sp-grid-wrap {
  margin: 10px 0 16px;
  width: min(460px, 100%);
}
.sp-results-list {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0 12px;
  margin: 8px 0 16px;
}
.sp-result-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sp-result-left {
  display: grid;
  gap: 4px;
  font-size: 13px;
  min-width: 0;
}
.sp-result-song {
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-result-artist {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-result-right {
  display: grid;
  gap: 4px;
  font-size: 12px;
  text-align: right;
  color: var(--muted);
}
.sp-result-line {
  color: rgba(255,255,255,0.92);
}
.sp-mini-grid {
  display: grid;
  grid-template-columns: repeat(10, 10px);
  gap: 3px;
  justify-self: end;
}
.sp-mini-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
}
.sp-mini-cell.is-on {
  background: rgba(124,92,255,0.65);
  border-color: rgba(124,92,255,0.85);
}
.sp-result-links {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sp-result-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  padding: 2px;
  border-radius: 6px;
}
.sp-result-link-icon:hover {
  color: rgba(255,255,255,0.9);
  transform: scale(1.15);
}
.sp-result-link-icon svg {
  display: block;
}
.sp-share-btn {
  width: min(460px, 100%);
  margin: 0 auto;
}

@media (max-width: 720px) {
  .sp-results-list {
    grid-template-columns: 1fr;
  }
  .sp-result-row {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 6px;
  }
  .sp-result-right {
    text-align: center;
  }
  .sp-result-links {
    justify-content: center;
  }
  .sp-mini-grid {
    justify-self: center;
  }
}
.sp-grid-title {
  font-weight: 800;
  margin-bottom: 8px;
}
.sp-grid {
  display: grid;
  gap: 6px;
}
.sp-grid-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.sp-cell {
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
}
.sp-cell.is-on {
  background: rgba(124,92,255,0.65);
  border-color: rgba(124,92,255,0.85);
}
.sp-countdown {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ---- Mode tabs (results screen) ---- */
.sp-mode-tabs {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 4px;
  width: min(520px, 100%);
  margin: 0 auto;
}
.sp-mode-tab {
  flex: 1 1 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.sp-mode-tab:hover:not(.is-active) {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
}
.sp-mode-tab.is-active {
  background: rgba(124,92,255,0.85);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,92,255,0.3);
}

/* ---- Tab played / not-played wrappers ---- */
#spTabPlayed {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
}
#spTabPlayed[hidden] { display: none !important; }
#spTabNotPlayed[hidden] { display: none !important; }
#spSongDetailsSection {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 100%;
}
#spSongDetailsSection[hidden] { display: none !important; }

.sp-tab-not-played {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: min(32px, 6vw) min(20px, 4vw);
  border: 2px dashed rgba(255,255,255,0.10);
  border-radius: 18px;
  background: rgba(124,92,255,0.04);
  width: 100%;
}
.sp-not-played-icon {
  font-size: 36px;
  line-height: 1;
}
.sp-not-played-title {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.sp-not-played-note {
  font-size: 13px;
  color: var(--muted);
}
.sp-play-other-btn {
  width: min(280px, 100%);
  margin-top: 4px;
}
@media (max-width: 560px) {
  .sp-play-other-btn {
    width: 100%;
  }
}

/* ---- Results heading ---- */
.sp-results-heading {
  font-size: 20px;
  font-weight: 900;
  color: rgba(255,255,255,0.92);
  text-align: center;
  letter-spacing: 0.01em;
}

/* ---- Results top: two-column on desktop ---- */
.sp-results-top {
  display: contents;
}
.sp-results-left {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: min(460px, 100%);
}

@media (min-width: 900px) {
  .sp-results-top {
    display: flex;
    gap: 36px;
    align-items: stretch;
    justify-content: center;
    width: 100%;
  }
  .sp-results-left {
    flex: 0 0 auto;
    width: 280px;
    align-content: center;
  }
  .sp-results-left .sp-grid-wrap {
    width: 100%;
  }
  .sp-results-left .sp-results-meta {
    width: 100%;
  }
  .sp-results-left .sp-share-btn {
    width: 100%;
  }
  .sp-leaderboard {
    flex: 0 1 420px;
    max-width: 420px;
    margin: 0;
  }
}

.sp-song-details-title {
  font-weight: 800;
  font-size: 17px;
  color: rgba(255,255,255,0.92);
  text-align: center;
  margin-top: 8px;
}

/* ---- Singleplayer FAQ ---- */
.sp-faq {
  max-width: 720px;
  margin: 32px auto 0;
  padding: 0 6px 24px;
}
.sp-faq-heading {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.50);
  text-align: center;
  margin: 0 0 14px;
}
.sp-faq-list {
  display: grid;
  gap: 8px;
}
.sp-faq-list details {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  padding: 14px 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.sp-faq-list details:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}
.sp-faq-list details[open] {
  border-color: rgba(124,92,255,0.25);
  background: rgba(124,92,255,0.04);
}
.sp-faq-list summary {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.90);
  padding: 0;
}
.sp-faq-list details[open] summary {
  margin-bottom: 8px;
}
.sp-faq-list p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
}

/* ---- Leaderboard ---- */
.sp-leaderboard {
  width: min(560px, 100%);
  max-width: 100%;
  margin: 20px 0 12px;
  overflow: hidden;
}
.sp-lb-title {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.92);
  text-align: center;
}
.sp-lb-unavailable {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  padding: 24px 12px;
  font-style: italic;
}
.sp-lb-table {
  display: grid;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}
.sp-lb-row {
  display: grid;
  grid-template-columns: 54px 1fr 84px 52px 50px;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  font-size: 16px;
  transition: background 0.15s ease;
}
/* Prevent grid items from expanding beyond their track size */
.sp-lb-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-lb-row:last-child {
  border-bottom: none;
}
.sp-lb-row:not(.sp-lb-header):not(.sp-lb-separator):hover {
  background: rgba(255,255,255,0.03);
}
.sp-lb-header {
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.03);
  padding: 9px 16px;
}
.sp-lb-rank {
  font-weight: 800;
  text-align: center;
  font-size: 17px;
}
.sp-lb-header .sp-lb-rank {
  font-size: 11px;
  font-weight: 700;
}
.sp-lb-nick {
  font-weight: 600;
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-lb-header .sp-lb-nick {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.sp-lb-mode {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.sp-lb-date {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  white-space: nowrap;
}
.sp-lb-score {
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
}
.sp-lb-header .sp-lb-mode,
.sp-lb-header .sp-lb-date,
.sp-lb-header .sp-lb-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: normal;
}

/* Current user highlight */
.sp-lb-row.is-current {
  background: rgba(124,92,255,0.10);
  box-shadow:
    inset 0 0 0 2px rgba(124,92,255,0.50),
    0 0 20px rgba(124,92,255,0.18);
  border-radius: 10px;
  border-bottom-color: transparent;
  z-index: 1;
}
.sp-lb-row.is-current .sp-lb-score {
  color: rgba(180,160,255,1);
}
.sp-lb-badge {
  position: absolute;
  right: -6px;
  top: -10px;
  background: linear-gradient(135deg, rgba(124,92,255,0.92), rgba(165,130,255,0.92));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(124,92,255,0.45);
  pointer-events: none;
}

/* Gap separator (⋮) */
.sp-lb-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  color: var(--muted);
  font-size: 22px;
  letter-spacing: 3px;
  border-bottom: none;
}

/* Nickname editor */
.sp-nick-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.sp-nick-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}
.sp-nick-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.sp-nick-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.92);
  /* 16px minimum prevents iOS Safari auto-zoom on focus */
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  line-height: normal;
  outline: none;
  -webkit-text-size-adjust: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sp-nick-input::placeholder {
  color: rgba(255,255,255,0.28);
  font-weight: 400;
}
.sp-nick-input:focus {
  border-color: rgba(124,92,255,0.6);
  box-shadow: 0 0 0 2px rgba(124,92,255,0.18);
}
.sp-nick-input.sp-nick-invalid {
  border-color: rgba(255,80,80,0.6);
  box-shadow: 0 0 0 2px rgba(255,80,80,0.15);
}
.sp-nick-save-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124,92,255,0.85), rgba(165,130,255,0.85));
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.sp-nick-save-btn:hover {
  opacity: 0.88;
}
.sp-nick-save-btn:active {
  transform: scale(0.94);
}
.sp-nick-save-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.sp-nick-status {
  font-size: 11px;
  color: rgba(130,220,130,0.9);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  transition: opacity 0.2s ease;
}
.sp-nick-status.is-error {
  color: rgba(255,100,100,0.9);
}

@media (max-width: 720px) {
  .sp-lb-row {
    grid-template-columns: 42px 1fr 70px 46px 44px;
    padding: 10px 8px;
    gap: 12px;
    font-size: 15px;
  }
  .sp-lb-rank {
    font-size: 17px;
  }
  .sp-lb-nick {
    font-size: 14px;
  }
  .sp-lb-mode,
  .sp-lb-date {
    font-size: 14px;
  }
  .sp-lb-score {
    font-size: 15px;
  }
  .sp-lb-badge {
    right: -4px;
    top: -9px;
    font-size: 9px;
    padding: 2px 7px;
  }
  .sp-nick-save-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
  }
}

html.menu-open,
body.menu-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .topbar nav.nav-desktop { display: none; }
  .nav-mobile-btn { display: inline-flex; }
  .lang-switch { border-left: none; padding-left: 0; margin-left: 0; }
}

@media (max-width: 480px) {
  .topbar { padding: 8px 10px; }
  .brand { padding: 6px 8px; }
  .brand-logo { height: 26px; }
  /* Try keeping the subtitle visible on mobile (like desktop) with smaller type */
  .brand .sub {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 2px;
  }
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 13px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
/* Desktop default: `.pill` sets display, so re-hide the hamburger unless we're on mobile. */
@media (min-width: 721px) {
  .nav-mobile-btn { display: none; }
}
.pill.pill-network {
  background: rgba(51,209,255,0.14);
  border-color: rgba(51,209,255,0.28);
  color: rgba(255,255,255,0.90);
}
.pill[aria-current="page"] {
  background: rgba(124,92,255,0.16);
  border-color: rgba(124,92,255,0.35);
  color: var(--text);
}
.pill:hover { transform: translateY(-1px); background: rgba(255,255,255,0.06); }
.pill.pill-network:hover {
  background: rgba(51,209,255,0.20);
  border-color: rgba(51,209,255,0.40);
}
.pill.pill-network[aria-current="page"] {
  background: rgba(51,209,255,0.22);
  border-color: rgba(51,209,255,0.48);
}
.hero {
  margin-top: 18px;
  padding: 18px 18px 10px;
}
.hero h2 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.3px;
}
.hero h2.hero-logo-wrap {
  margin: 6px 0 10px;
  line-height: 1;
  font-size: inherit;
  letter-spacing: inherit;
}
.hero-logo {
  display: block;
  width: clamp(240px, 40%, 640px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 34px rgba(0,0,0,0.35));
}
.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 70ch;
}
.grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}
/* Home page: keep cards natural-height; stack the right column without grid row stretching */
.home-grid { align-items: start; }
.home-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.donate-options {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-bottom: 34px; /* space for the (absolutely positioned) card-note under the button */
}
.donate-qr {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.donate-qr img {
  width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.donate-sep {
  color: var(--muted2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  text-align: center;
}
.donate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Keep the grid item height equal to the button height so it can be centered next to "nebo" */
}
.donate-card-note {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  text-align: center;
  margin: 0;
}
.bmc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(37,99,235,0.92));
  color: rgba(255,255,255,0.96);
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(59,130,246,0.18);
}
.bmc-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
@media (max-width: 940px) {
  .donate-options {
    grid-template-columns: 1fr;
    align-items: start;
  }
  /* Keep the "NEBO" separator on mobile too (as a divider between bank/QR and card button). */
  .donate-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 6px;
    font-size: 12px;
  }
  .donate-sep::before,
  .donate-sep::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255,255,255,0.10);
  }
  /* Mobile: give the BuyMeACoffee note a bit of breathing room and avoid cramped absolute positioning */
  .donate-options { padding-bottom: 0; }
  .donate-card { align-items: stretch; }
  .donate-card-note {
    position: static;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0,0,0,0.14);
  }
}
@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; }
}

/* Contact page: two cards side-by-side on desktop, stacked on mobile */
.contact-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
@media (max-width: 940px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  /* Allow tooltips/popovers to extend outside the card without being clipped */
  overflow: visible;
  /* Create an explicit stacking context we can raise on hover so wide tooltips
     don't get painted behind the neighboring column card (backdrop-filter creates
     its own stacking context, and DOM order otherwise wins). */
  position: relative;
  z-index: 0;
}
.card:hover {
  z-index: 20;
}
.card .hd {
  padding: 16px 16px 0;
}
.card .hd h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.86);
  text-transform: uppercase;
}
.card .bd {
  padding: 14px 16px 16px;
}
.row { display: grid; gap: 10px; }
.row.cols2 { grid-template-columns: 1fr 1fr; }
.row.cols3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) {
  .row.cols2 { grid-template-columns: 1fr; }
  .row.cols3 { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.80);
  font-size: 11px;
  line-height: 1;
  cursor: help;
  user-select: none;
  position: relative;
  z-index: 30;
  transform: translateY(-0.5px);
}
.info-tip:hover {
  border-color: rgba(124,92,255,0.45);
  background: rgba(124,92,255,0.14);
  color: rgba(255,255,255,0.92);
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,14,28,0.92);
  color: rgba(255,255,255,0.90);
  box-shadow: 0 14px 34px rgba(0,0,0,0.40);
  backdrop-filter: blur(10px);
  white-space: normal;
  line-height: 1.35;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  transform-origin: 50% 100%;
}
.info-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  z-index: 40;
  width: 10px;
  height: 10px;
  background: rgba(10,14,28,0.92);
  border-left: 1px solid rgba(255,255,255,0.12);
  border-top: 1px solid rgba(255,255,255,0.12);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.info-tip:hover::after,
.info-tip:hover::before {
  opacity: 1;
}
.ctrl {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.ctrl:focus { box-shadow: var(--ring); border-color: rgba(124,92,255,0.55); }
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* --- Genre tri-state UI --- */
.genreLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: flex-start;
}
.genreLegend .legendItem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 700;
}
.genreStatePill, .genreStateBtn {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-family: var(--sans);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  user-select: none;
}
button.genreStateBtn {
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
  transition: transform .06s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
button.genreStateBtn:active { transform: translateY(1px); }
button.genreStateBtn:focus-visible { outline: none; box-shadow: var(--ring); }
.genreStatePill[data-state="1"], .genreStateBtn[data-state="1"] {
  background: rgba(64,212,126,0.14);
  border-color: rgba(64,212,126,0.40);
  color: rgba(170,255,210,0.95);
}
.genreStatePill[data-state="0"], .genreStateBtn[data-state="0"] {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.80);
}
.genreStatePill[data-state="-1"], .genreStateBtn[data-state="-1"] {
  background: rgba(255,107,107,0.14);
  border-color: rgba(255,107,107,0.42);
  color: rgba(255,190,190,0.96);
}
.genreRow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.genreRow:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}
.genreLabel {
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, rgba(124,92,255,0.95), rgba(51,209,255,0.85));
  color: #0b1020;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.sp-btn { width: auto; }
details {
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
}
summary {
  cursor: pointer;
  color: rgba(255,255,255,0.86);
  font-weight: 650;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "▸";
  flex: 0 0 auto;
  color: rgba(255,255,255,0.70);
  transform: rotate(0deg);
  transition: transform .14s ease, color .14s ease;
}
details[open] summary::after {
  transform: rotate(90deg);
  color: rgba(255,255,255,0.88);
}
.range-wrap {
  position: relative;
  height: 40px;
  padding: 0 6px;
}
.range-track {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
}
.range-selected {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  right: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124,92,255,0.95), rgba(51,209,255,0.85));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset;
}
.range-wrap input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  /* Allow interacting with each thumb even though the two inputs overlap */
  pointer-events: none;
  touch-action: none;
}
.range-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 7px;
  background: transparent;
  border: none;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(124,92,255,0.85);
  box-shadow: 0 10px 18px rgba(0,0,0,0.25);
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.range-wrap input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(124,92,255,0.25), 0 10px 18px rgba(0,0,0,0.25);
}
.range-wrap input[type="range"]::-moz-range-track {
  height: 7px;
  background: transparent;
  border: none;
}
.range-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(124,92,255,0.85);
  box-shadow: 0 10px 18px rgba(0,0,0,0.25);
  cursor: pointer;
  pointer-events: auto;
}
.note {
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.45;
  margin-top: 10px;
}
.kpi {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
}
.kpi .big {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  width: fit-content;
}
.status {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.ok { border-color: rgba(64,212,126,0.35); }
.status.warn { border-color: rgba(255,204,102,0.35); }
.status.err { border-color: rgba(255,107,107,0.35); }
footer {
  margin-top: 18px;
  color: var(--muted2);
  font-size: 12px;
  text-align: center;
}

/* --- Cross-project linking ("network") --- */
.projects-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}
.projects-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: min(920px, calc(100vw - 24px));
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,14,28,0.92);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
}
.projects-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 12px;
}
.projects-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 18px;
  margin-top: 2px;
}
.projects-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: 6px;
  max-width: 72ch;
}
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
.project-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
a.project-card:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(124,92,255,0.35);
}
.project-card.is-current {
  border-color: rgba(64,212,126,0.30);
  background: rgba(64,212,126,0.08);
}
.project-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -0.02em;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.16);
  color: rgba(255,255,255,0.92);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.project-badge-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}
.project-meta { min-width: 0; }
.project-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
}
.project-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.project-current,
.project-visit {
  font-weight: 900;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.86);
  flex: 0 0 auto;
}
.project-current {
  border-color: rgba(64,212,126,0.35);
  background: rgba(64,212,126,0.14);
  color: rgba(170,255,210,0.95);
}
.project-visit {
  border-color: rgba(124,92,255,0.35);
  background: rgba(124,92,255,0.16);
}

html.modal-open,
body.modal-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .projects-modal {
    left: 12px;
    right: 12px;
    top: 50%;
    bottom: auto;
    /* With left+right set, do NOT translateX (it would push the modal off-screen). */
    transform: translateY(-50%);
    width: auto;
    max-height: min(82vh, 760px);
  }
}


