:root {
  --bg: #16244a; --card: #21335f; --line: #37497a; --text: #f6f4ec; --soft: #b4bfdd;
  --sun: #ffc93c; --ink: #16244a; --coral: #ff8a76;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); font: 17px/1.45 system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body { max-width: 560px; min-height: 100dvh; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 700; }
p { color: var(--soft); text-wrap: pretty; }
a { color: var(--sun); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand img { width: 36px; height: 36px; }
.brand .end { margin-left: auto; }

.btn { min-height: 52px; padding: 12px 20px; border-radius: 16px; background: var(--card); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn.main { background: var(--sun); color: var(--ink); }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: 15px; border-radius: 14px; }
.btn.stop { color: var(--coral); }
.row { display: flex; gap: 10px; }
.row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; padding: 24px 0; }
.center p { max-width: 32ch; }

input { width: 100%; min-height: 54px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: #101b3a; }
input::placeholder { color: #93a1c8; }
input:focus { outline: none; border-color: var(--sun); }
.code-input { text-align: center; text-transform: uppercase; font-size: 28px; font-weight: 700; letter-spacing: .2em; max-width: 280px; }
.code-input::placeholder { letter-spacing: 0; text-transform: none; font-size: 18px; font-weight: 400; }
label { display: block; font-size: 15px; color: var(--soft); }
label input { margin-top: 6px; color: var(--text); font-size: 17px; }

.share { width: 210px; height: 210px; border-radius: 50%; background: var(--sun); color: var(--ink); font-size: 25px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 0 0 14px #ffc93c26, 0 0 0 32px #ffc93c12; margin: 32px; }
.share svg { width: 60px; height: 60px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.player { aspect-ratio: 16/9; min-height: 200px; border-radius: 18px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; display: block; border: 0; }
.now { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 18px; padding: 12px; }
.now img { width: 128px; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; }
.title { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; line-height: 1.3; }
.sub { font-size: 14px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }

ul { list-style: none; padding: 0; }
li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
li:last-child { border: 0; }
li img { width: 80px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
li .title { font-size: 16px; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--soft); flex: none; }
.icon.add { background: var(--sun); color: var(--ink); }

.note { background: var(--card); border-radius: 14px; padding: 12px 16px; color: var(--text); font-size: 15px; }
.qr { background: #fff; border-radius: 18px; padding: 14px; width: 220px; height: 220px; }
.qr svg { width: 100%; height: 100%; stroke: none; fill: #16244a; }
.code { font-size: 32px; font-weight: 800; letter-spacing: .16em; margin-right: -.16em; color: var(--text); }

dialog { margin: auto; width: min(92vw, 400px); border: 0; border-radius: 24px; padding: 24px; background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
dialog::backdrop { background: #080e20cc; }
dialog .stack { align-items: stretch; text-align: center; }
dialog .qr { align-self: center; }

#toast { position: fixed; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); margin: auto; max-width: 480px; padding: 14px 18px; border-radius: 16px; background: var(--text); color: var(--ink); font-weight: 600; text-align: center; opacity: 0; transform: translateY(16px); transition: .2s; pointer-events: none; }
#toast.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } button:active { transform: none; } }
