/* ============ tiggysurf — liquid glass / flat ============ */

:root {
  --bg: #07080c;
  --ink: #f4f6fa;
  --muted: #9aa1ad;
  --accent: #ffffff;
  --accent-ink: #0a0c12;   /* text on white surfaces */
  --gold: #e8c66a;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.13);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-strong: rgba(255, 255, 255, 0.32);
  --shadow: rgba(0, 0, 0, 0.65);
  --font: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none; /* Safari needs the prefix */
  -webkit-touch-callout: none;
  touch-action: manipulation; /* no double-tap zoom on buttons (iOS/Android) */
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { -webkit-user-drag: none; }
svg { fill: currentColor; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }

/* ---------- ambient background (neutral, gives the glass something to blur) ---------- */
#bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .35; }
.g1 { width: 56vw; height: 56vw; left: -16vw; top: -22vw; background: rgba(165, 175, 195, 0.14); }
.g2 { width: 48vw; height: 48vw; right: -14vw; bottom: -18vw; background: rgba(150, 160, 180, 0.10); }
.g3 { width: 34vw; height: 34vw; right: 8vw; top: -10vw; background: rgba(180, 188, 205, 0.08); }

/* ---------- 3D stage ---------- */
#stage {
  position: fixed; inset: 0; z-index: 1;
  cursor: grab; touch-action: none; /* opacity animated by GSAP only */
}
#stage.grabbing { cursor: grabbing; }
#stage.dimmed { opacity: .55; }
.gl-layer, .css3d-layer { position: absolute !important; inset: 0; }
.gl-layer { pointer-events: none; }
.css3d-layer { pointer-events: none; }

/* ---------- beat cards (CSS3D) ----------
   backdrop-filter is unreliable inside preserve-3d, so card glass is emulated:
   milky translucent fill + hairline stroke + top specular line. */
.card-wrap {
  width: 264px; height: 352px;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.beat-card {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid var(--stroke);
  box-shadow: 0 24px 60px -30px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform .38s cubic-bezier(.2,.9,.25,1.2), box-shadow .38s ease, border-color .38s ease, background .38s ease;
}
.beat-card.hover {
  transform: scale(1.07);
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--stroke-strong);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 34px 90px -32px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cover { position: relative; height: 172px; flex: none; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.beat-card.hover .cover img { transform: scale(1.07); }
.cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,12,0) 62%, rgba(7,8,12,.6)); /* photo legibility fade, not chrome */
}

.tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.genre-tag { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(10, 12, 16, 0.62); border: 1px solid rgba(255, 255, 255, 0.24); color: #e7ebf2; }
.excl-tag { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(22, 18, 8, 0.7); border: 1px solid rgba(232, 198, 106, 0.55); color: var(--gold); }
.beat-card .excl-tag { right: auto; left: 10px; top: 38px; }

/* real-data badges */
.coll-tag { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(10, 12, 16, 0.66); border: 1px solid rgba(255, 255, 255, 0.28); color: #eef1f6; }
.fmt-tag { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(10, 12, 16, 0.6); border: 1px solid rgba(255, 255, 255, 0.18); color: var(--muted); letter-spacing: .1em; }
.price s { color: var(--muted); font-weight: 500; font-size: .78em; margin-left: 6px; }
.m-tags .coll-tag { position: static; }

/* buffering spinner on a card while its (large WAV) preview loads */
.play-btn .spinner { display: none; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(10,12,18,.35); border-top-color: var(--accent-ink); animation: spin .7s linear infinite; }
.beat-card.loading .play-btn svg { opacity: 0; }
.beat-card.loading .play-btn .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* modal license + note */
.m-license { margin-top: 4px; }
.m-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.t-price s { color: var(--muted); font-weight: 500; font-size: .72em; margin-left: 6px; }

.play-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  box-shadow: 0 10px 26px -10px var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.play-btn:hover { transform: scale(1.12); box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.8); }
.play-btn svg { width: 20px; height: 20px; fill: var(--accent-ink); }
.i-pause { display: none; }
.playing .play-btn .i-play, .m-play.playing .i-play { display: none; }
.playing .play-btn .i-pause, .m-play.playing .i-pause { display: block; }
.playing .play-btn { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4), 0 10px 26px -10px var(--shadow); }
  50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0), 0 10px 26px -10px var(--shadow); }
}

.meta { display: flex; flex-direction: column; gap: 7px; padding: 14px 15px 15px; flex: 1; }
.row-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-title h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 700; font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.producer { font-size: 12.5px; color: var(--muted); }
.row-specs { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.spec { font-variant-numeric: tabular-nums; color: #c9cfda; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.3); }
.mood { margin-left: auto; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); font-size: 10.5px; }
.license-btn {
  margin-top: auto;
  padding: 9px 12px; border-radius: 11px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--stroke);
  opacity: 0; visibility: hidden;   /* revealed only on card hover */
  transition: opacity .25s ease, background .25s ease, border-color .25s ease, color .25s ease;
}
.beat-card.hover .license-btn { opacity: 1; visibility: visible; }
.license-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--stroke-strong);
}

/* ---------- topbar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) calc(26px + env(safe-area-inset-right, 0px)) 0 calc(26px + env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between;
}
#logo { font-size: 17px; font-weight: 700; letter-spacing: .26em; display: flex; align-items: center; gap: 10px; }
#logo i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}
#logo span { color: var(--ink); }
#cart-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
}
#cart-btn svg { width: 20px; height: 20px; fill: var(--ink); }
#cart-count, .p-cart .count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; border-radius: 99px; padding: 0 5px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; font-style: normal;
  background: var(--accent);
  color: var(--accent-ink);
}
#cart-count.zero, .p-cart .count.zero { display: none; }

/* ---------- hero ---------- */
#hero {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  background: radial-gradient(ellipse 62% 56% at 50% 46%, rgba(7, 8, 12, 0.88), rgba(7, 8, 12, 0.42) 62%, rgba(7, 8, 12, 0) 100%); /* scrim for legibility */
}
.hero-badge {
  font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  padding: 7px 16px; border-radius: 99px;
  border: 1px solid var(--stroke); background: rgba(14, 16, 22, 0.5);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  margin-bottom: 26px;
}
.hero-badge b { color: var(--ink); font-weight: 600; }
#hero h1 {
  font-size: clamp(46px, 8.6vw, 96px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
  color: var(--ink);
  margin-bottom: 18px;
}
#hero p { max-width: 600px; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; color: var(--muted); margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.btn {
  padding: 14px 30px; border-radius: 99px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .03em;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 36px -16px var(--shadow);
}
.btn.primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 44px -16px rgba(0, 0, 0, 0.8); }
.btn.ghost {
  border: 1px solid var(--stroke); background: var(--glass); color: var(--ink);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.btn.ghost:hover { border-color: var(--stroke-strong); background: var(--glass-strong); }

.hero-hint { margin-top: 46px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(154, 161, 173, .7); }

/* ---------- filters ---------- */
#filters {
  position: fixed; top: calc(78px + env(safe-area-inset-top, 0px)); left: 0; right: 0; z-index: 31;
  display: flex; gap: 9px; justify-content: center; flex-wrap: wrap;
  padding: 0 calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
  visibility: hidden;
}
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 15px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600;
  background: rgba(16, 18, 24, 0.5);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.pill[hidden] { display: none; }
.pill:hover { border-color: var(--stroke-strong); }
.pill.active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
}
.pill .p-val { color: var(--ink); font-weight: 700; }
.pill .chev { width: 15px; height: 15px; opacity: .6; }
.pill.clear-all { color: var(--muted); }
.pill.clear-all:hover { color: var(--ink); }

#filter-drop {
  position: fixed; z-index: 65;
  width: 210px; max-height: 280px; overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(17, 19, 26, 0.78);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.9);
}
#filter-drop .opt {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 9px;
  font-size: 13px; color: var(--ink);
}
#filter-drop .opt:hover { background: rgba(255, 255, 255, 0.09); }
#filter-drop .opt.on { color: var(--ink); font-weight: 700; background: rgba(255, 255, 255, 0.06); }

#result-chip {
  position: fixed; top: calc(126px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 31; visibility: hidden;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
#result-chip button { color: var(--ink); text-decoration: underline; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal.hidden, .hidden { display: none !important; }
.m-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 6, 9, 0.6);
  backdrop-filter: blur(18px) saturate(120%); -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.m-panel {
  position: relative;
  width: min(940px, 94vw); max-height: 88vh; overflow: auto;
  display: grid; grid-template-columns: 360px 1fr; gap: 30px;
  padding: 30px;
  border-radius: 24px;
  background: rgba(19, 21, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(34px) saturate(150%); -webkit-backdrop-filter: blur(34px) saturate(150%);
  box-shadow: 0 50px 140px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.m-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--stroke);
  transition: background .2s ease, transform .2s ease;
}
.m-close:hover { background: rgba(255, 255, 255, 0.18); transform: rotate(90deg); }

.m-coverbox { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--stroke); box-shadow: 0 26px 70px -24px var(--shadow); }
.m-cover { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.m-coverbox .excl-tag { position: absolute; top: 12px; left: 12px; }

.m-wave { position: relative; height: 64px; margin-top: 16px; border-radius: 10px; overflow: hidden; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.m-bars { position: absolute; inset: 4px; display: flex; align-items: flex-end; gap: 2px; }
.m-bars span { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.34); min-height: 12%; }
.m-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: rgba(255, 255, 255, 0.14);
  border-right: 2px solid var(--accent);
  pointer-events: none;
}
.m-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.m-play {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  box-shadow: 0 12px 30px -12px var(--shadow);
  transition: transform .2s ease;
}
.m-play:hover { transform: scale(1.08); }
.m-play svg { width: 22px; height: 22px; fill: var(--accent-ink); }
.m-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.m-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.m-tags { display: flex; gap: 8px; }
.m-tags .tag { position: static; }
.mood-tag { background: rgba(10, 12, 16, 0.62); border: 1px solid rgba(255, 255, 255, 0.2); color: #cfd5df; }
.m-title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.m-producer { color: var(--muted); font-size: 14.5px; }
.m-producer b { color: var(--ink); }
.m-specs { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke);
}

.m-tiers { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.tier {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.tier:hover:not(.disabled) { border-color: var(--stroke-strong); }
.tier.selected {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.10);
}
.tier.disabled { opacity: .42; cursor: not-allowed; }
.t-radio { width: 17px; height: 17px; flex: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); transition: all .2s ease; }
.tier.selected .t-radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); }
.t-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-info b { font-size: 14.5px; }
.t-info small { font-size: 12px; color: var(--muted); }
.t-price { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink); }

.m-actions { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.m-actions .btn { flex: 1; min-width: 150px; text-align: center; padding: 14px 18px; }

/* ---------- sticky player ---------- */
#player {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 55;
  width: min(880px, 94vw); height: 74px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  border-radius: 18px;
  background: rgba(17, 19, 26, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
#player.offscreen { visibility: hidden; }
.p-cover { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid rgba(255,255,255,.1); }
.p-info { display: flex; flex-direction: column; gap: 2px; width: 150px; min-width: 0; flex: none; }
.p-info b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-info span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-play {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent);
  transition: transform .2s ease;
}
.p-play:hover { transform: scale(1.1); }
.p-play svg { width: 18px; height: 18px; fill: var(--accent-ink); }
#player .i-pause { display: none; }
#player.is-playing .i-pause { display: block; }
#player.is-playing .i-play { display: none; }
.p-progress { position: relative; flex: 1; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); cursor: pointer; }
.p-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  border-radius: 99px;
  background: var(--accent);
}
.p-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.p-vol { display: flex; align-items: center; gap: 8px; flex: none; }
.p-vol svg { width: 18px; height: 18px; fill: var(--muted); }
.p-vol input { width: 88px; accent-color: var(--accent); cursor: pointer; }
.p-cart { position: relative; width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke); }
.p-cart svg { width: 18px; height: 18px; fill: var(--ink); }

/* ---------- cart panel ---------- */
#cart-panel {
  position: fixed; top: calc(70px + env(safe-area-inset-top, 0px)); right: calc(22px + env(safe-area-inset-right, 0px)); z-index: 70;
  width: min(340px, calc(100vw - 32px));
  max-height: 60vh; overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(17, 19, 26, 0.78);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%);
  box-shadow: 0 30px 80px -18px rgba(0, 0, 0, 0.95);
}
#cart-panel h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.cart-empty { font-size: 13.5px; color: var(--muted); padding: 8px 0 4px; }
.cart-item { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.cart-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.cart-item div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item small { font-size: 11px; color: var(--muted); }
.cart-item span { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-item .rm { font-size: 16px; color: var(--muted); padding: 4px; }
.cart-item .rm:hover { color: var(--ink); }
.cart-total { display: flex; justify-content: space-between; padding: 12px 2px; font-size: 14px; }
#cart-panel .checkout { width: 100%; padding: 12px; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: calc(108px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast-msg {
  padding: 11px 20px; border-radius: 99px;
  font-size: 13px; white-space: nowrap;
  color: var(--muted);
  background: rgba(19, 21, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 44px -10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.toast-msg b { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .card-wrap { width: 204px; height: 282px; }
  .cover { height: 122px; }
  .meta { padding: 11px 12px 12px; gap: 5px; }
  .row-title h3 { font-size: 14px; }
  .price { font-size: 13px; }
  .producer { font-size: 11.5px; }
  .row-specs { font-size: 10.5px; gap: 6px; }
  .mood { display: none; }
  .license-btn { padding: 8px 10px; font-size: 11.5px; }
  .play-btn { width: 40px; height: 40px; }
  .play-btn svg { width: 17px; height: 17px; }
  .beat-card .excl-tag { top: 34px; }

  #topbar { padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
  #filters { top: calc(64px + env(safe-area-inset-top, 0px)); justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  #filters::-webkit-scrollbar { display: none; }
  #result-chip { top: calc(112px + env(safe-area-inset-top, 0px)); }

  #modal { padding: 0; align-items: flex-end; }
  .m-panel { grid-template-columns: 1fr; gap: 20px; width: 100vw; max-height: 92dvh; border-radius: 24px 24px 0 0; padding: 22px 20px calc(30px + env(safe-area-inset-bottom, 0px)); }
  .m-coverbox { max-width: 240px; }
  .m-actions .btn { min-width: 120px; padding: 13px 14px; }

  #player { height: 64px; gap: 10px; padding: 0 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .p-info { width: 96px; }
  .p-vol, .p-time { display: none; }
  .p-cover { width: 40px; height: 40px; }
}

/* short viewports (landscape phones) — compact the chrome so cards stay visible */
@media (max-height: 520px) {
  #topbar { height: calc(52px + env(safe-area-inset-top, 0px)); }
  #filters { top: calc(52px + env(safe-area-inset-top, 0px)); justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #filters::-webkit-scrollbar { display: none; }
  #result-chip { display: none; }
  #hero h1 { font-size: clamp(34px, 7vh, 56px); margin-bottom: 10px; }
  #hero p { margin-bottom: 18px; }
  .hero-badge { margin-bottom: 14px; }
  .hero-hint { margin-top: 18px; }
  .btn { padding: 11px 24px; }
  #player { height: 56px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .p-cover { width: 36px; height: 36px; }
  .p-vol { display: none; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .p-info { width: 120px; }
  .p-vol input { width: 64px; }
}
