/* Look and feel: chunky, glossy shapes with dark outlines, like the logo and
   the sticker icons. The accent is the cyan at the bottom of "Friends" in the
   logo; the background is a deep purple that sits behind it the same way the
   logo's outline does. */
:root {
  --bg: #150823;
  --bg-2: #28103f;
  --panel-top: #2e1250;
  --panel-bot: #210b3a;
  --edge: #53297d;
  --outline: #0d0317;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.12);
  --text: #fdf9ff;
  --muted: rgba(236, 224, 255, 0.68);
  --faint: rgba(236, 224, 255, 0.42);
  --accent: #00cce9;
  --accent-2: #a8effa;
  --accent-ink: #24063a;
  --accent-grad: linear-gradient(180deg, #ffffff 0%, #f6fbfc 22%, #a8effa 56%, #00cce9 100%);
  --accent-glow: rgba(0, 204, 233, 0.3);
  --pink: #ff1682;
  --good: #4fdca6;
  --bad: #ff6f7d;
  --radius: 26px;
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(255, 22, 130, 0.16), transparent 60%),
    radial-gradient(900px 700px at 100% 110%, rgba(0, 204, 233, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }

.hidden { display: none !important; }

/* Buttons: glossy pills with a dark outline and a little "3D" lip that
   presses down when tapped. */
.btn {
  appearance: none;
  border: 3px solid var(--outline);
  background: linear-gradient(180deg, #6c3aa0, #47207a);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24), inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 4px 0 var(--outline), 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.24), inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 1px 0 var(--outline), 0 4px 10px rgba(0, 0, 0, 0.28); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; filter: none; }
.btn.primary {
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-weight: 900;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), inset 0 -4px 0 rgba(0, 110, 150, 0.35), 0 4px 0 var(--outline), 0 10px 28px var(--accent-glow);
}
.btn.primary:active { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), inset 0 -4px 0 rgba(0, 110, 150, 0.35), 0 1px 0 var(--outline), 0 6px 16px var(--accent-glow); }
.btn.big { font-size: 1.25rem; padding: 14px 30px; }
.btn.ghost { background: linear-gradient(180deg, #3b1a5e, #2a1046); }
.btn.danger { color: var(--bad); }

/* Cards: a thick rounded edge and a solid drop shadow, like a sticker. */
.card {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 3px solid var(--edge);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 6px 0 var(--outline), 0 18px 40px rgba(0, 0, 0, 0.3);
}

/* Glossy gradient text with a dark lip, for the big numbers. */
.pop-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 var(--outline)) drop-shadow(0 10px 30px var(--accent-glow));
}

.crown { height: 1.15em; width: auto; vertical-align: -0.22em; }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.dot.online { background: var(--good); box-shadow: 0 0 0 3px rgba(79, 220, 166, 0.18); }
.dot.offline { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 111, 125, 0.18); }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 2px solid rgba(13, 3, 23, 0.55);
  background: var(--c, #888);
  color: var(--ink, #fff);
  font-weight: 900;
  font-size: 0.88rem;
  line-height: 1.3;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.15), 0 2px 0 rgba(13, 3, 23, 0.5);
}
/* Real bells: how many times a bell rings, as a bubble on the chip's top-right corner. */
.chip.has-count { position: relative; }
.chip-count {
  position: absolute;
  top: -0.8em;
  right: -1.1em;
  min-width: 1.6em;
  padding: 0 0.35em;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #1a0b2e;
  color: #fff;
  font-size: 0.6em;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 2px 0 rgba(13, 3, 23, 0.5);
}

/* Your bells (real bells mode): common sets across the top, then every bell
   from C4 to C7, one octave a row. Bells you don't have are greyed out; a dot
   marks the notes in the current song. */
.bell-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.bell-set {
  appearance: none;
  font: inherit;
  color: var(--text);
  text-align: left;
  padding: 7px 12px;
  border-radius: 16px;
  border: 2px solid var(--edge);
  background: rgba(10, 2, 20, 0.3);
  box-shadow: 0 3px 0 var(--outline);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bell-set b { display: block; font-size: 0.92rem; line-height: 1.25; }
.bell-set small { display: block; color: var(--muted); font-size: 0.74rem; line-height: 1.3; }
.bell-set:hover { background: rgba(255, 255, 255, 0.08); }
.bell-set.on { border-color: var(--accent); background: rgba(0, 204, 233, 0.14); box-shadow: 0 0 0 1px var(--accent) inset, 0 3px 0 var(--outline); }
.bell-set.clear { border-style: dashed; box-shadow: none; }
.bell-set:disabled { opacity: 0.4; cursor: default; background: none; }
.bell-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 4px; margin-top: 12px; }
.bell-pick {
  position: relative;
  appearance: none;
  font: inherit;
  font-weight: 900;
  font-size: 0.74rem;
  padding: 6px 0;
  border-radius: 999px;
  border: 2px solid rgba(13, 3, 23, 0.55);
  background: rgba(255, 255, 255, 0.06);
  color: var(--faint);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.bell-pick:hover { background: rgba(255, 255, 255, 0.12); color: var(--muted); }
.bell-pick.on { background: var(--c); color: var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.15), 0 2px 0 rgba(13, 3, 23, 0.5); }
.bell-pick.need::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent-2); }

/* "Fits your bells" (real bells): the song list filter, and each song's
   "4/6" badge, bright when your bells ring at least half its notes. */
.fit-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  appearance: none;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 5px 16px 5px 8px;
  border-radius: 999px;
  border: 2px solid var(--edge);
  background: rgba(10, 2, 20, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fit-toggle img { width: 26px; height: 26px; filter: grayscale(0.7) opacity(0.75); }
.fit-toggle:hover { color: var(--text); }
.fit-toggle.on { color: var(--accent-ink); background: var(--accent-grad); border-color: var(--outline); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 2px 0 var(--outline); }
.fit-toggle.on img { filter: none; }
.fit-badge {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: -2px -4px 4px 8px;
  padding: 1px 8px 1px 3px;
  border-radius: 999px;
  border: 2px solid rgba(13, 3, 23, 0.5);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.fit-badge img { width: 18px; height: 18px; filter: grayscale(0.7) opacity(0.75); }
.fit-badge.fits { color: var(--accent-ink); background: var(--accent-2); }
.fit-badge.fits img { filter: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 3px solid var(--edge);
  box-shadow: 0 5px 0 var(--outline), 0 16px 40px rgba(0, 0, 0, 0.4);
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: min(90vw, 560px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.linked.show { pointer-events: auto; }
.toast a { color: var(--accent); }

input[type='range'] { accent-color: var(--accent); }
input[type='checkbox'] { accent-color: var(--accent); width: 18px; height: 18px; }
select, input[type='text'], input[type='search'], input:not([type]) {
  font: inherit;
  color: var(--text);
  background: rgba(10, 2, 20, 0.45);
  border: 2px solid var(--edge);
  border-radius: 14px;
  padding: 7px 10px;
}
select:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
input[type='search'] { -webkit-appearance: none; appearance: none; }
