:root { --bg:#12111c; --panel:#1d1b2c; --text:#f3f0fa; --sub:#a9a3c0; --accent:#c9b6ff; --heart:#ff6f91; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; }
body { min-height: 100dvh; background: radial-gradient(120% 70% at 50% 0%, #2a2545 0%, var(--bg) 70%) fixed; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, .carousel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.player { max-width: 480px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.top h1 { font-size: 15px; margin: 0; letter-spacing: .04em; white-space: nowrap; }
.name-chip { min-width: 0; display: flex; gap: 8px; align-items: center; background: var(--panel); border: 0; border-radius: 999px; padding: 7px 13px; font-size: 13px; }
.name-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-chip small { color: var(--sub); flex: none; }

.groups { display: flex; gap: 8px; margin-top: 16px; }
.groups span { font-size: 12px; padding: 4px 16px; border-radius: 999px; color: var(--sub); border: 1px solid #38334f; }
.groups span.on { background: var(--accent); border-color: var(--accent); color: #1b1530; font-weight: 700; }

.carousel { --disc: min(58vw, 250px, 34dvh); position: relative; width: calc(100% + 36px); height: calc(var(--disc) + 44px); margin-top: 8px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.carousel.dragging { cursor: grabbing; }
.disc { position: absolute; left: 50%; top: calc(50% + 10px); width: var(--disc); height: var(--disc); border-radius: 50%; overflow: hidden; background: var(--panel); box-shadow: 0 10px 28px rgba(0,0,0,.5); transition: transform .35s ease, opacity .35s ease; -webkit-touch-callout: none; }
.carousel.dragging .disc { transition: none; }
.disc.current { box-shadow: 0 0 0 3px var(--accent), 0 14px 36px rgba(0,0,0,.6); }
.disc img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.disc.tile { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12%; }
.disc.tile.uta { background: linear-gradient(145deg, #6c5a9e, #2d2650); }
.disc.tile.bgm { background: linear-gradient(145deg, #3f6f86, #1e2d4a); }
.disc.tile span { font-size: calc(var(--disc) * .095); font-weight: 700; line-height: 1.5; word-break: auto-phrase; overflow-wrap: anywhere; }

.info { text-align: center; margin-top: 10px; }
.count { margin: 0; font-size: 12px; color: var(--sub); }
.info h2 { margin: 4px 0 0; font-size: 20px; min-height: 1.4em; line-height: 1.4; }

.progress { width: 100%; height: 4px; background: #332f48; border-radius: 4px; margin-top: 14px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); }
.times { width: 100%; display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); margin-top: 5px; font-variant-numeric: tabular-nums; }

.controls { display: flex; gap: 28px; align-items: center; margin-top: 6px; }
.btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--panel); display: grid; place-items: center; }
.btn.main { width: 74px; height: 74px; background: var(--text); color: #17142a; }
.btn svg { width: 26px; height: 26px; fill: currentColor; }
.btn.main svg { width: 34px; height: 34px; }
.i-pause, .playing .i-play { display: none; }
.playing .i-pause { display: block; }

.heart { margin-top: 14px; width: 64px; height: 52px; background: none; border: 0; display: grid; place-items: center; border-radius: 16px; }
.heart svg { width: 38px; height: 38px; fill: none; stroke: var(--sub); stroke-width: 1.7; transition: transform .15s ease; }
.heart:active svg { transform: scale(.85); }
.heart[aria-pressed="true"] svg { fill: var(--heart); stroke: var(--heart); }

.message { min-height: 1.5em; margin: 8px 0 0; font-size: 12px; color: #ffc2cf; text-align: center; }

.gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(12,11,20,.9); overflow: auto; }
.card { width: 100%; max-width: 340px; background: var(--panel); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.card h2 { margin: 0; font-size: 19px; }
.card p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--sub); }
.card input { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid #494366; background: var(--bg); color: var(--text); }
.primary { border: 0; border-radius: 10px; padding: 12px; background: var(--accent); color: #1b1530; font-weight: 700; }
.link { border: 0; background: none; color: var(--sub); font-size: 13px; }

/* 集計ページ */
.summary { max-width: 560px; margin: 0 auto; padding: 18px; }
.summary h1 { font-size: 18px; }
.summary h2 { font-size: 13px; color: var(--accent); margin: 22px 0 8px; }
.summary ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.summary li { background: var(--panel); border-radius: 12px; padding: 12px 14px; }
.row { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 15px; }
.row .num { flex: none; color: var(--heart); font-variant-numeric: tabular-nums; }
.row .num.zero { color: var(--sub); }
.names { margin: 6px 0 0; font-size: 13px; color: var(--sub); line-height: 1.7; overflow-wrap: anywhere; }
.summary .meta { font-size: 12px; color: var(--sub); }

@media (prefers-reduced-motion: reduce) { .disc, .heart svg { transition: none; } }

@media (max-height: 600px) {
  .groups { margin-top: 10px; }
  .heart { margin-top: 6px; }
  .progress { margin-top: 10px; }
}
