/* ============================================================
   AnthemForge — "Stadium Glass" design system
   Apple-clean glassmorphism on a night-match backdrop:
   frosted translucent cards, floodlight glows, volt + cyan
   sport accents, minimal type, big rounded geometry.
   ============================================================ */

:root {
  --bg-0: #04060d;
  --bg-1: #0a1122;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7ff;
  --muted: rgba(214, 224, 248, 0.62);
  --accent: #a3ff3c;      /* volt — pitch-line green */
  --accent-2: #2fd9ff;    /* floodlight cyan */
  --accent-3: #ff4d8d;    /* flare magenta */
  --error: #ff8089;
  --radius-xl: 26px;
  --radius-md: 15px;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.45);
  --glow-accent: 0 8px 34px rgba(163, 255, 60, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  min-height: 100vh;
  background: var(--bg-0);
  background-image:
    radial-gradient(900px 520px at 12% -6%, rgba(47, 217, 255, 0.16), transparent 62%),
    radial-gradient(820px 540px at 88% 4%, rgba(163, 255, 60, 0.13), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(255, 77, 141, 0.1), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 45%);
  background-attachment: fixed;
}

::selection { background: rgba(163, 255, 60, 0.35); }

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 4rem 1.25rem 2rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  background: linear-gradient(115deg, #ffffff 25%, var(--accent) 60%, var(--accent-2) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--muted);
  margin: 0.9rem auto 0;
  max-width: 34rem;
  font-size: 1.02rem;
  line-height: 1.5;
}

.mock-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--accent) !important;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.1rem 4rem;
}

/* ---------- Glass cards ---------- */

.card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  padding: 1.7rem 1.6rem;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.card h2 {
  margin: 1.9rem 0 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card h2::before {
  content: "";
  width: 1.4rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

.card h2:first-child { margin-top: 0; }

.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

/* ---------- Form ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}

label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  align-self: end;
  padding-bottom: 0.7rem;
  color: var(--text);
}

input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }
input[type="email"] { min-width: 220px; }

input[type="text"], input[type="email"], input:not([type]), select, textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 0.72rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

select option { background: #0c1326; color: var(--text); }

textarea {
  width: 100%;
  resize: vertical;
  margin-top: 0.7rem;
  line-height: 1.55;
}

input::placeholder, textarea::placeholder { color: rgba(214, 224, 248, 0.35); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(163, 255, 60, 0.65);
  box-shadow: 0 0 0 3px rgba(163, 255, 60, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Advanced options accordion ---------- */
details.advanced {
  margin-top: 1.6rem;
  border-top: 1px solid var(--stroke);
}
details.advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--accent);
  font-weight: 800;
}
details.advanced[open] > summary::before { content: "–"; }
details.advanced[open] > summary { color: var(--text); }

/* The lyrics-options accordion tucks directly under the lyrics box. */
#lyricsOptions { margin-top: 0.5rem; border-top: none; }
#lyricsOptions > summary { padding-top: 0.4rem; }


.lyrics-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

/* ---------- Buttons ---------- */

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.68rem 1.3rem;
  font-family: inherit;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

button:active:not(:disabled) { transform: scale(0.97); }

button.primary {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #071200;
  background: linear-gradient(115deg, var(--accent), #d3ff44 50%, var(--accent-2) 130%);
  box-shadow: var(--glow-accent);
}

button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 44px rgba(163, 255, 60, 0.5);
}

button.primary:disabled { opacity: 0.55; cursor: wait; box-shadow: none; }

button.secondary {
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: 0.87rem;
  padding: 0.52rem 1.05rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

button.secondary:hover:not(:disabled) {
  border-color: rgba(163, 255, 60, 0.55);
  color: var(--accent);
}

/* Funny-mode pill: same secondary shape, with an obvious accent "on" state. */
.funny-toggle[aria-pressed="true"],
.funny-toggle[aria-pressed="true"]:hover:not(:disabled) {
  background: linear-gradient(115deg, rgba(163, 255, 60, 0.92), rgba(47, 217, 255, 0.85));
  border-color: transparent;
  color: #071200;
  font-weight: 700;
}

/* ---------- Progress ---------- */

.progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(from 0deg, transparent 12%, var(--accent), var(--accent-2));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tracks / anthem wall ---------- */

.results { display: grid; gap: 1rem; }

.track {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 1rem 1.05rem;
  flex-wrap: wrap;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.track:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }

.track img {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

/* Cover photo links through to the anthem's own page. */
.track a.track-photo { flex: none; display: inline-flex; border-radius: 14px; transition: transform 0.2s ease; }
.track a.track-photo:hover { transform: translateY(-2px); }
.track a.track-photo:hover img { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55); }

.track .info { flex: 1; min-width: 200px; }
.track .info strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.track .info > span.muted { display: block; margin-bottom: 0.5rem; font-size: 0.78rem; }

/* ---------- Custom compact anthem player ---------- */
.afp {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin: 0.15rem 0 0.1rem;
  padding: 0.45rem 0.7rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.3s ease;
}
.afp.is-playing {
  border-color: rgba(163, 255, 60, 0.42);
  box-shadow: 0 6px 28px rgba(163, 255, 60, 0.16);
}
.afp audio { display: none; }

.afp-play {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  color: #052407;
  background: radial-gradient(125% 125% at 30% 18%, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(163, 255, 60, 0.42);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.afp-play:hover { transform: scale(1.07); box-shadow: 0 8px 24px rgba(163, 255, 60, 0.55); }
.afp-play:active { transform: scale(0.93); }
.afp-play svg { width: 19px; height: 19px; fill: currentColor; }

.afp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.34rem; }

.afp-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
  touch-action: none;
}
.afp-bar:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.afp-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.afp-thumb {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.afp:hover .afp-thumb,
.afp-bar:focus-visible .afp-thumb,
.afp.is-playing .afp-thumb { transform: translateY(-50%) scale(1); }

.afp-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.afp-eq {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 18px;
  height: 22px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.afp.is-playing .afp-eq { opacity: 0.95; }
.afp-eq i {
  flex: 1;
  height: 30%;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.afp.is-playing .afp-eq i { animation: afp-eq 0.9s ease-in-out infinite; }
.afp-eq i:nth-child(2) { animation-delay: 0.18s; }
.afp-eq i:nth-child(3) { animation-delay: 0.36s; }
.afp-eq i:nth-child(4) { animation-delay: 0.54s; }
@keyframes afp-eq {
  0%, 100% { height: 22%; }
  50% { height: 95%; }
}
@media (prefers-reduced-motion: reduce) {
  .afp.is-playing .afp-eq i { animation: none; height: 55%; }
}

.track a.download {
  display: inline-block;
  margin-top: 0.55rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}
.track a.download:hover { color: var(--accent-2); }

/* ---------- TikTok-branded button (official black + glitch note logo) ---------- */
.tiktok-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0.62rem 1.05rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tiktok-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); border-color: rgba(255, 255, 255, 0.28); }
.tiktok-btn:active { transform: translateY(0); }
.tiktok-btn .tt-logo { width: 20px; height: 20px; flex: none; }
.tiktok-btn.tiktok-btn--sm { padding: 0.42rem 0.82rem; font-size: 0.82rem; border-radius: 9px; }
.tiktok-btn.tiktok-btn--sm .tt-logo { width: 17px; height: 17px; }
.track a.anthem-page-link {
  display: inline-block;
  margin-top: 0.55rem;
  margin-left: 0.9rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}
.track a.anthem-page-link:hover { color: var(--accent-2); }
.seo-latest-list { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.seo-latest-list li { padding: 0.4rem 0; border-bottom: 1px solid rgba(127,127,127,.15); }
.seo-latest-list a { color: var(--accent); text-decoration: none; font-weight: 600; }
.seo-latest-list a:hover { color: var(--accent-2); }

.error { color: var(--error); font-size: 0.9rem; }
.hidden { display: none !important; }

/* ---------- Team search combobox ---------- */

.combobox { position: relative; display: block; }
.combobox input { width: 100%; }

.combobox-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: rgba(13, 19, 38, 0.88);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--stroke-strong);
  border-radius: 16px;
  max-height: 290px;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.combobox-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.92rem;
}

.combobox-list .team-icon {
  flex: none;
  width: 1.6em;
  text-align: center;
  font-size: 1.05rem;
}
.combobox-list .team-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.combobox-list .team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combobox-list li:hover,
.combobox-list li.active { background: rgba(163, 255, 60, 0.12); }

.combobox-list .team-meta {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Chips (chants + styles) ---------- */

.chant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.chant-chip {
  background: var(--glass);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.chant-chip:hover { border-color: rgba(163, 255, 60, 0.55); }

.chant-chip.selected {
  background: linear-gradient(115deg, rgba(163, 255, 60, 0.92), rgba(47, 217, 255, 0.85));
  border-color: transparent;
  color: #071200;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(163, 255, 60, 0.3);
}

/* ---------- Grouped, searchable style dropdown ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.style-field { display: flex; flex-direction: column; gap: 0.4rem; }
.style-field .field-label { font-size: 0.84rem; font-weight: 500; color: var(--muted); }
.style-select { position: relative; }

.style-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke); border-radius: var(--radius-md);
  color: var(--text); padding: 0.72rem 0.85rem; font: inherit; font-size: 0.95rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.style-trigger:hover { border-color: rgba(163, 255, 60, 0.55); }
.style-trigger:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(163, 255, 60, 0.25);
}
.style-trigger-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.style-select.has-selection .style-trigger-text { color: var(--text); font-weight: 600; }
.style-trigger-caret { color: var(--muted); transition: transform 0.2s ease; }
.style-trigger[aria-expanded="true"] .style-trigger-caret { transform: rotate(180deg); }

.style-panel {
  box-sizing: border-box; inset: auto; margin: 0;
  max-height: min(60vh, 430px); overflow-y: auto;
  padding: 0; border: 1px solid var(--stroke); border-radius: var(--radius-md);
  background: rgba(10, 17, 34, 0.97);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  color: var(--text);
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease,
    overlay 0.16s allow-discrete, display 0.16s allow-discrete;
}
.style-panel:popover-open, .style-panel.is-open { opacity: 1; transform: none; }
@starting-style { .style-panel:popover-open { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .style-panel { transition: none; } }

.style-search-row {
  position: sticky; top: 0; z-index: 3; padding: 0.6rem;
  background: rgba(10, 17, 34, 0.98); border-bottom: 1px solid var(--stroke);
}
.style-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.style-panel-title {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.style-panel-count {
  flex: none; font-size: 0.72rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #071200;
  padding: 0.16rem 0.5rem; border-radius: 999px;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
}
.style-panel-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.style-close {
  flex: none; padding: 0.3rem 0.85rem;
  font-size: 0.78rem; font-weight: 700;
  border: none; border-radius: 999px; cursor: pointer;
  color: #071200;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
}
.style-close:hover { filter: brightness(1.06); }
.style-close:active { transform: scale(0.97); }
.style-search { width: 100%; font-size: 0.9rem; }

.style-group-h {
  position: sticky; top: 3.1rem; z-index: 1;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); padding: 0.55rem 0.85rem 0.3rem;
  background: rgba(10, 17, 34, 0.97);
}
.style-option {
  display: flex; align-items: center; gap: 0.6rem; cursor: pointer;
  padding: 0.5rem 0.85rem; font-size: 0.9rem; color: var(--text);
  transition: background 0.12s ease;
}
.style-option-name { flex: 1; }
.style-check { opacity: 0; color: var(--accent); font-weight: 800; }
.style-option[aria-selected="true"] { background: rgba(163, 255, 60, 0.10); }
.style-option[aria-selected="true"] .style-check { opacity: 1; }
.style-option:hover { background: rgba(255, 255, 255, 0.06); }
.style-option.active { background: rgba(163, 255, 60, 0.18); }
.style-option.is-hidden, .style-group.is-hidden { display: none; }
.style-option.is-disabled {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
}
.style-empty { padding: 1.1rem 0.85rem; color: var(--muted); text-align: center; }
.style-empty.hidden { display: none; }

/* Selected styles as removable chips below the trigger. */
.style-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.style-chips[hidden] { display: none; }
.style-chip {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  padding: 0.34rem 0.4rem 0.34rem 0.7rem; font: inherit; font-size: 0.82rem;
  color: var(--text); background: rgba(163, 255, 60, 0.10);
  border: 1px solid rgba(163, 255, 60, 0.45); border-radius: 999px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.style-chip:hover, .style-chip:focus-visible {
  outline: none; border-color: var(--accent); background: rgba(163, 255, 60, 0.18);
}
.style-chip-name { white-space: nowrap; }
.style-chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05rem; height: 1.05rem; border-radius: 50%; font-size: 0.7rem; line-height: 1;
  color: var(--accent); background: rgba(163, 255, 60, 0.16); transition: background 0.15s ease, color 0.15s ease;
}
.style-chip:hover .style-chip-x, .style-chip:focus-visible .style-chip-x {
  background: var(--accent); color: #0a1122;
}

/* Mobile: render the panel as a bottom sheet. */
@media (max-width: 640px) {
  .style-panel {
    position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%;
    max-height: 78vh; border-radius: 18px 18px 0 0; transform: translateY(100%);
  }
  .style-panel:popover-open { transform: none; }
  @starting-style { .style-panel:popover-open { transform: translateY(100%); } }
}

/* ---------- Footer & misc ---------- */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0 1.25rem 2.5rem;
  line-height: 1.5;
}

/* Heading above each style's tracks when several styles are queued. */
.style-head {
  margin: 1.4rem 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.style-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(163, 255, 60, 0.4), transparent);
}

/* Subtle, modern scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 480px) {
  .card { padding: 1.25rem 1.05rem; border-radius: 22px; }
  .hero { padding-top: 2.8rem; }
}

/* Interface language picker — frosted pill pinned to the top corner. */
.ui-lang {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

/* Light / dark mode toggle — a round button matching the language pill height. */
.theme-toggle {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  flex: none;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 999px;
  color: var(--text);
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: border-color 0.18s ease, transform 0.12s ease;
}
.theme-toggle:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
[dir="rtl"] .ui-lang { right: auto; left: 14px; }
.ui-lang select {
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.4rem 2rem 0.4rem 0.9rem;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* ============================================================
   Light mode — overrides the dark palette + the few components
   that hardcode dark surfaces. Toggled via <html data-theme="light">.
   ============================================================ */
[data-theme="light"] {
  --bg-0: #eef1f8;
  --bg-1: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --stroke: rgba(12, 20, 48, 0.12);
  --stroke-strong: rgba(12, 20, 48, 0.22);
  --text: #0c1430;
  --muted: rgba(20, 30, 65, 0.62);
  --error: #d12f4a;
  --shadow-card: 0 18px 45px rgba(20, 35, 80, 0.12);
  --glow-accent: 0 8px 30px rgba(163, 255, 60, 0.28);
}

[data-theme="light"] body {
  background: var(--bg-0);
  background-image:
    radial-gradient(900px 520px at 12% -6%, rgba(47, 217, 255, 0.14), transparent 62%),
    radial-gradient(820px 540px at 88% 4%, rgba(120, 210, 40, 0.14), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(255, 77, 141, 0.08), transparent 55%),
    linear-gradient(180deg, #ffffff, #eef1f8 45%);
}

/* Hero title gradient starts white in dark mode — invisible on light, so flip it. */
[data-theme="light"] .hero h1 {
  background: linear-gradient(115deg, #0c1430 18%, #1f9a3c 60%, #1597b8 95%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Form fields: the dark theme uses near-white translucency that vanishes on a
   light background — give them a solid frosted-white fill instead. */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input:not([type]),
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.85);
}
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  background: #ffffff;
  border-color: rgba(31, 154, 60, 0.7);
  box-shadow: 0 0 0 3px rgba(31, 154, 60, 0.16);
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder { color: rgba(20, 30, 65, 0.4); }
[data-theme="light"] select option { background: #ffffff; color: var(--text); }

/* Dropdown / combobox panels hardcode a dark navy fill. */
[data-theme="light"] .combobox-list,
[data-theme="light"] .style-panel,
[data-theme="light"] .style-search-row,
[data-theme="light"] .style-group-h {
  background: rgba(255, 255, 255, 0.98);
}
[data-theme="light"] .style-trigger { background: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .combobox-list li:hover,
[data-theme="light"] .combobox-list li.active,
[data-theme="light"] .style-option[aria-selected="true"] { background: rgba(31, 154, 60, 0.12); }
[data-theme="light"] .style-option:hover { background: rgba(12, 20, 48, 0.05); }

/* Accent-colored text needs a deeper shade to stay legible on white. */
[data-theme="light"] .style-group-h { color: #1f9a3c; }
[data-theme="light"] .track a.download { color: #127a93; }

/* Compact audio player surfaces are tuned for dark; soften for light. */
[data-theme="light"] .afp { background: linear-gradient(180deg, rgba(12, 20, 48, 0.05), rgba(12, 20, 48, 0.02)); }
[data-theme="light"] .afp-bar { background: rgba(12, 20, 48, 0.13); }
[data-theme="light"] .afp-thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
