:root {
  --bg: #0b0a10;
  --bg2: #15131d;
  --card: #1c1a26;
  --line: #2c2938;
  --fg: #f4f2f8;
  --mute: #a39fb3;
  --dim: #6f6a80;
  --pink: #ff5c9a;
  --violet: #8b7bff;
  --gold: #ffc94d;
  --ok: #4fd1a5;
  --grad: linear-gradient(135deg, #ff5c9a 0%, #8b7bff 100%);
  --col: 480px;
  --top: 52px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================ feed */
body.feed-page { overflow: hidden; height: 100dvh; overscroll-behavior: none; }
.feed-wrap { position: relative; height: 100dvh; max-width: var(--col); margin: 0 auto; background: var(--bg); }
@media (min-width: 560px) {
  body.feed-page { background: radial-gradient(1200px 600px at 50% -10%, #2a1630 0%, var(--bg) 60%); }
  .feed-wrap { box-shadow: 0 0 0 1px var(--line), 0 30px 80px #0008; }
}
.feed { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }

.topbar {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0; height: var(--top);
  display: flex; align-items: center; gap: 8px; padding: 0 10px 0 14px;
  background: linear-gradient(#0b0a10ee, #0b0a1000);
}
.logo { font-weight: 800; letter-spacing: .02em; text-decoration: none; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.logo i { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 2px; margin-left: auto; background: #ffffff12; border-radius: 99px; padding: 3px; }
.tabs button { font-size: 13px; padding: 5px 11px; border-radius: 99px; color: var(--mute); font-weight: 600; }
.tabs button.on { background: var(--fg); color: var(--bg); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #ffffff12; }
.icon-btn svg { width: 18px; height: 18px; }
.filters-bar {
  position: absolute; z-index: 19; top: var(--top); left: 0; right: 0; display: flex; gap: 6px; padding: 0 14px;
  overflow-x: auto; scrollbar-width: none;
}
.filters-bar:empty { display: none; }
.pill { flex: none; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: #ffffff1c; backdrop-filter: blur(8px); display: inline-flex; gap: 6px; align-items: center; }
.pill b { font-weight: 600; }

.slide {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: center; padding: calc(var(--top) + 26px) 64px 22px 16px; overflow: hidden;
}
.slide::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, var(--tint, #2a1630) 0%, transparent 70%);
  opacity: .9;
}
.slide > * { position: relative; z-index: 1; }
.art { position: relative; border-radius: 14px; overflow: hidden; background: var(--card); aspect-ratio: 4 / 3; box-shadow: 0 18px 50px #0009; cursor: pointer; }
.art img { width: 100%; height: 100%; object-fit: contain; }
.art .pp {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%;
  background: #000a; display: grid; place-items: center; transition: opacity .2s, transform .2s; backdrop-filter: blur(4px);
}
.art .pp svg { width: 30px; height: 30px; }
.slide.playing .art .pp { opacity: 0; transform: scale(.85); }
.eq { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 3px; align-items: flex-end; height: 18px; padding: 4px 6px; border-radius: 6px; background: #000a; opacity: 0; transition: opacity .2s; }
.eq span { width: 3px; background: var(--pink); border-radius: 2px; height: 30%; }
.slide.playing .eq { opacity: 1; }
.slide.playing .eq span { animation: eq 0.9s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: -.3s !important; background: #d26cd0; }
.eq span:nth-child(3) { animation-delay: -.6s !important; background: var(--violet); }
.eq span:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #ffffff1a; color: var(--mute); }
.badge.r18 { background: #ff5c9a26; color: var(--pink); }
.badge.sale { background: var(--pink); color: #fff; }
.badge.new { background: #4fd1a526; color: var(--ok); }
.badge.rank { background: #ffc94d26; color: var(--gold); }
.title { font-size: 16px; line-height: 1.4; margin: 0 0 4px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title a { text-decoration: none; }
.sub { margin: 0; font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub button { color: var(--fg); text-decoration: underline; text-decoration-color: #fff4; text-underline-offset: 2px; }
.intro { margin: 6px 0 0; font-size: 12.5px; color: var(--mute); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tags::-webkit-scrollbar { display: none; }
.tags button, .tags a { flex: none; font-size: 12px; color: #c9b8ff; text-decoration: none; }

.player { margin-top: 12px; }
.trackline { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--mute); margin-bottom: 6px; }
.trackline .tname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.trackline .time { flex: none; font-variant-numeric: tabular-nums; }
.progress { position: relative; height: 18px; cursor: pointer; touch-action: none; }
.progress::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 3px; border-radius: 3px; background: #ffffff26; }
.progress .fill { position: absolute; left: 0; top: 8px; height: 3px; width: 0; border-radius: 3px; background: var(--grad); }
.progress .knob { position: absolute; top: 4px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: #fff; left: 0; opacity: 0; }
.slide.on .progress .knob { opacity: 1; }
.tracks { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.tracks::-webkit-scrollbar { display: none; }
.tracks button { flex: none; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: #ffffff14; color: var(--mute); font-variant-numeric: tabular-nums; }
.tracks button.on { background: #ff5c9a33; color: #fff; box-shadow: inset 0 0 0 1px var(--pink); }

.cta {
  margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: 12px; background: var(--grad); color: #fff; text-decoration: none; font-weight: 800; font-size: 15px;
  box-shadow: 0 10px 30px #ff5c9a40;
}
.cta s { font-weight: 500; opacity: .75; font-size: 12px; }
.cta .pr { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #0003; }
.saleend { text-align: center; font-size: 11px; color: var(--pink); margin-top: 5px; }

.rail { position: absolute; right: 8px; bottom: 120px; z-index: 2; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.rail button, .rail a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--mute); text-decoration: none; }
.rail .ic { width: 42px; height: 42px; border-radius: 50%; background: #ffffff14; display: grid; place-items: center; }
.rail .ic svg { width: 21px; height: 21px; }
.rail .saved .ic { background: #ff5c9a33; color: var(--pink); }
.rail .stat { color: var(--fg); font-weight: 700; font-size: 11px; }

.end { height: 60dvh; display: grid; place-items: center; text-align: center; color: var(--mute); scroll-snap-align: start; padding: 20px; }
.end a, .end button { color: var(--pink); }

/* ============================================================ overlays */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #0b0a10f2; padding: 24px; }
.gate-box { max-width: 360px; width: 100%; text-align: center; }
.gate-logo { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.gate-logo i { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-box p { color: var(--mute); font-size: 13.5px; line-height: 1.7; }
.gate-box .big { width: 100%; min-height: 54px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 800; font-size: 16px; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.gate-box .big svg { width: 20px; height: 20px; }
.gate-box .sub-btn { width: 100%; min-height: 44px; border-radius: 12px; background: #ffffff12; color: var(--mute); font-size: 13.5px; margin-top: 10px; }
.gate-box small { display: block; color: var(--dim); font-size: 11px; margin-top: 16px; line-height: 1.6; }
.gate-box small a { color: var(--mute); }

.sheet-back { position: fixed; inset: 0; z-index: 90; background: #0008; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-back.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 91; left: 50%; bottom: 0; width: min(100%, var(--col)); max-height: 82dvh; overflow-y: auto;
  transform: translate(-50%, 100%); transition: transform .25s ease; background: var(--bg2); border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px #0008;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: #ffffff30; margin: 0 auto 12px; }
.sheet h3 { font-size: 13px; color: var(--mute); margin: 18px 0 8px; font-weight: 600; }
.sheet h3:first-of-type { margin-top: 4px; }
.search { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); padding: 0 12px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-size: 12.5px; padding: 6px 11px; border-radius: 99px; background: #ffffff10; color: var(--fg); }
.chips button small { color: var(--dim); margin-left: 3px; }
.chips button.on { background: var(--fg); color: var(--bg); }
.chips button.on small { color: #0008; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toggle small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: #ffffff24; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--pink); }
.switch.on::after { transform: translateX(18px); }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet-actions button { flex: 1; min-height: 44px; border-radius: 12px; background: #ffffff12; font-weight: 700; }
.sheet-actions button.primary { background: var(--grad); color: #fff; }
.saved-list { display: flex; flex-direction: column; gap: 10px; }
.saved-item { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.saved-item img { width: 72px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--card); flex: none; }
.saved-item div { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; font-size: 12px; color: var(--dim); }
.sheet-links a { color: var(--mute); }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 40px; transform: translateX(-50%); background: #fff; color: #000; font-size: 13px; padding: 8px 14px; border-radius: 99px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.dev-link { position: fixed; z-index: 150; left: 8px; bottom: 8px; font-size: 11px; background: #ffc94d; color: #000; padding: 4px 8px; border-radius: 6px; text-decoration: none; font-weight: 700; }

/* ============================================================ static pages */
.page { max-width: 880px; margin: 0 auto; padding: 0 16px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; height: 58px; border-bottom: 1px solid var(--line); margin-bottom: 18px; position: sticky; top: 0; background: #0b0a10ee; backdrop-filter: blur(10px); z-index: 10; }
.page-head nav { margin-left: auto; display: flex; gap: 14px; font-size: 13px; }
.page-head nav a { text-decoration: none; color: var(--mute); }
.page-head nav a.swipe { color: #fff; background: var(--grad); padding: 6px 12px; border-radius: 99px; font-weight: 700; }
.crumbs { font-size: 12px; color: var(--dim); margin-bottom: 14px; }
.crumbs a { color: var(--mute); text-decoration: none; }
h1 { font-size: 21px; line-height: 1.45; margin: 0 0 10px; }
h2 { font-size: 16px; margin: 30px 0 12px; }
.lead { color: var(--mute); font-size: 14px; line-height: 1.7; }
.detail { display: grid; gap: 22px; }
@media (min-width: 760px) { .detail { grid-template-columns: 1fr 1fr; align-items: start; } }
.detail .cover { border-radius: 14px; overflow: hidden; background: var(--card); aspect-ratio: 4/3; }
.detail .cover img { width: 100%; height: 100%; object-fit: contain; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 12px 0; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.kv a { color: #c9b8ff; }
.price { font-size: 22px; font-weight: 800; }
.price s { font-size: 13px; color: var(--dim); font-weight: 500; margin-left: 6px; }
.price .off { font-size: 12px; background: var(--pink); color: #fff; padding: 2px 7px; border-radius: 5px; margin-left: 6px; vertical-align: 3px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .cta { flex: 1 1 220px; margin-top: 10px; }
.btn-ghost { flex: 1 1 160px; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: 12px; background: #ffffff12; text-decoration: none; font-weight: 700; font-size: 14px; }
.tracklist { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tracklist li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.tracklist li:first-child { border-top: 0; }
.tracklist li:hover { background: #ffffff08; }
.tracklist li .tp { width: 32px; height: 32px; border-radius: 50%; background: #ffffff14; display: grid; place-items: center; flex: none; }
.tracklist li .tp svg { width: 14px; height: 14px; }
.tracklist li.on { background: #ff5c9a14; }
.tracklist li.on .tp { background: var(--pink); }
.tracklist li .tt { flex: 1; min-width: 0; }
.tracklist li .tt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracklist li .tt .progress { height: 10px; margin-top: 2px; display: none; }
.tracklist li .tt .progress::before, .tracklist li .tt .progress .fill { top: 4px; }
.tracklist li .tt .progress .knob { display: none; }
.tracklist li.on .tt .progress { display: block; }
.tracklist li .dur { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.chiplinks { display: flex; flex-wrap: wrap; gap: 6px; }
.chiplinks a { font-size: 12.5px; padding: 5px 10px; border-radius: 99px; background: #ffffff10; text-decoration: none; }
.chiplinks a small { color: var(--dim); margin-left: 3px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { text-decoration: none; display: block; }
.card .im { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--card); }
.card .im img { width: 100%; height: 100%; object-fit: cover; }
.card .t { font-size: 12.5px; line-height: 1.45; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { font-size: 11.5px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m b { color: var(--pink); font-weight: 700; }
.note { font-size: 12px; color: var(--dim); line-height: 1.7; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 14px; }
.foot { font-size: 12px; color: var(--dim); display: flex; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; }
.foot a { color: var(--mute); }
.prose { font-size: 14px; line-height: 1.85; color: #ddd9e8; }
.prose h2 { font-size: 16px; }
.prose a { color: #c9b8ff; }

@media (max-width: 370px) {
  .tabs button { padding: 5px 8px; font-size: 12px; }
  .logo { font-size: 15px; }
  .topbar { gap: 6px; padding-left: 10px; }
}
