/* K-Radio 웹 플레이어 (외부 글꼴·CDN 없이)
   원칙: 한눈에 보이게 · 크게 누르게 · 부드럽게 움직이게 */
:root {
  --bg: #0b0820;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #171233;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f4f2ff;
  --muted: #a9a3cc;
  --pink: #ff5f8f;
  --violet: #7b61ff;
  --cyan: #3fd8ff;
  --ok: #43e6a8;
  --grad: linear-gradient(135deg, var(--pink), var(--violet));
  --radius: 22px;
  --tap: 52px; /* 손가락으로 누르기 편한 최소 크기 */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px 110px;
  overflow-x: hidden;
}
.ko { color: var(--muted); font-size: 0.86em; font-weight: 500; }
.small { font-size: 0.82em; }
a { color: var(--cyan); }

/* ── 움직이는 배경 ───────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; animation: drift 22s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: #ff4f8b; top: -160px; left: -140px; }
.b2 { width: 600px; height: 600px; background: #6a4dff; bottom: -220px; right: -180px; animation-duration: 28s; }
.b3 { width: 380px; height: 380px; background: #1fc8ff; top: 40%; left: 45%; opacity: 0.25; animation-duration: 34s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.12); } 100% { transform: translate(-40px, 80px) scale(0.95); } }
.hangul span {
  position: absolute; bottom: -60px; color: rgba(255, 255, 255, 0.07); font-weight: 800;
  animation: rise linear infinite; will-change: transform;
}
@keyframes rise { to { transform: translateY(-115vh) rotate(25deg); } }
.grain { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 3, 18, 0.7)); }

/* ── 버튼 (크게, 누르면 살짝 눌림) ─────────── */
button {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; min-height: var(--tap);
  cursor: pointer; transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
  font-weight: 600;
}
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.25); }
button:active:not(:disabled) { transform: scale(0.96); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
button.primary { background: var(--grad); border: 0; box-shadow: 0 10px 30px -8px rgba(255, 95, 143, 0.6); }
button.primary .ko { color: rgba(255, 255, 255, 0.85); }
button.primary:hover { box-shadow: 0 14px 40px -8px rgba(255, 95, 143, 0.8); filter: brightness(1.08); }
button.active { background: var(--grad); border-color: transparent; color: #fff; }
button.active .ko { color: rgba(255, 255, 255, 0.85); }
select {
  font: inherit; background: var(--card-solid); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; min-height: 46px;
}

/* ── 머리 ───────────────────────────────── */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  position: relative; width: 54px; height: 54px; border-radius: 17px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 8px 26px -6px rgba(123, 97, 255, 0.7);
}
.logo span { font-weight: 900; font-size: 1.7rem; color: #fff; font-family: Arial, sans-serif; }
.logo .wave { position: absolute; inset: -6px; border-radius: 22px; border: 2px solid rgba(255, 95, 143, 0.5); animation: ping 2.6s ease-out infinite; }
.logo .w2 { animation-delay: 1.3s; }
@keyframes ping { 0% { transform: scale(0.9); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.02em; }
h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(123, 97, 255, 0.16);
  border: 1px solid rgba(123, 97, 255, 0.5); border-radius: 999px; padding: 8px 14px; font-size: 0.88rem; font-weight: 600;
}
.spark { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1.8s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ── 흐르는 한국어 띠 ─────────────────────── */
.ticker {
  margin: 14px -16px 4px; overflow: hidden; white-space: nowrap; border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: inline-block; padding: 9px 0; animation: marquee 60s linear infinite; }
.ticker-track span { margin: 0 22px; font-size: 0.92rem; }
.ticker-track b { color: #fff; margin-right: 6px; }
.ticker-track i { color: var(--muted); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── 채널 탭 (크게) ──────────────────────── */
.channels { display: flex; gap: 10px; margin: 16px 0; padding: 6px; border-radius: 20px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.channels button { flex: 1 1 0; min-height: 56px; font-size: 1.05rem; border: 0; background: transparent; border-radius: 15px; }
.channels button:hover:not(.active) { background: rgba(255, 255, 255, 0.07); }

/* ── 카드 ───────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card h3 { margin: 0 0 12px; font-size: 1.12rem; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.h-ico { font-size: 1.1rem; }
.label { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── 지금 방송 (가장 크게) ─────────────────── */
.hero { padding: 26px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 95, 143, 0.6), rgba(123, 97, 255, 0.2), rgba(63, 216, 255, 0.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.hero-grid { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; }
.disc-wrap { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.disc {
  width: 190px; height: 190px; border-radius: 50%; position: relative; z-index: 1;
  background:
    radial-gradient(circle, transparent 0 30%, rgba(255,255,255,.05) 31% 32%, transparent 33% 40%, rgba(255,255,255,.05) 41% 42%, transparent 43% 52%, rgba(255,255,255,.05) 53% 54%, transparent 55%),
    conic-gradient(from 0deg, #1c1640, #2b1f5e, #1c1640, #3a1d4f, #1c1640);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), inset 0 0 0 6px rgba(255, 255, 255, 0.04);
  display: grid; place-items: center; animation: spin 6s linear infinite; animation-play-state: paused;
}
.disc-label { width: 74px; height: 74px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; align-content: center; line-height: 1; }
.disc-label b { font-size: 1.7rem; font-family: Arial, sans-serif; }
.disc-label small { font-size: 0.6rem; letter-spacing: 0.2em; font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring { position: absolute; inset: 15px; border-radius: 50%; border: 2px solid rgba(255, 95, 143, 0.0); }
body.playing .disc { animation-play-state: running; }
body.playing .ring { animation: ripple 3s ease-out infinite; }
body.playing .r2 { animation-delay: 1s; }
body.playing .r3 { animation-delay: 2s; }
@keyframes ripple { 0% { transform: scale(0.9); border-color: rgba(255, 95, 143, 0.6); } 100% { transform: scale(1.25); border-color: rgba(123, 97, 255, 0); } }

.onair-head { display: flex; align-items: center; gap: 10px; }
.clock { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: #5c5680; flex: none; }
.live-dot.on { background: var(--pink); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 95, 143, .7); } 70% { box-shadow: 0 0 0 12px rgba(255, 95, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 95, 143, 0); } }
.onair h2 { margin: 10px 0 4px; font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; }
.onair h2 .ko { display: block; font-size: 1rem; margin-top: 4px; }
.hosts { margin: 0 0 10px; color: var(--muted); }

.eq { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin: 8px 0 12px; }
.eq i { flex: 1; max-width: 10px; height: 18%; border-radius: 4px; background: var(--grad); opacity: 0.45; transition: height .3s; }
body.playing .eq i { opacity: 1; animation: bounce 1s ease-in-out infinite alternate; }
.eq i:nth-child(2n) { animation-duration: .7s !important; } .eq i:nth-child(3n) { animation-duration: 1.3s !important; }
.eq i:nth-child(4n) { animation-delay: -.4s; } .eq i:nth-child(5n) { animation-duration: .55s !important; } .eq i:nth-child(7n) { animation-delay: -.8s; }
@keyframes bounce { 0% { height: 12%; } 100% { height: 100%; } }

.progress { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--grad); transition: width 1s linear; border-radius: 4px; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 10px 0 14px; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; }
.controls .big { font-size: 1.15rem; padding: 16px 28px; min-height: 62px; border-radius: 20px; flex: 1 1 260px; }
.controls #btnPause { flex: 0 1 180px; }
.status { color: var(--muted); font-size: 0.88rem; min-height: 1.2em; margin: 10px 0 0; }

/* ── 지금 재생 ──────────────────────────── */
.player audio { width: 100%; margin: 12px 0 8px; height: 48px; border-radius: 14px; }
.player h3 { margin-top: 6px; font-size: 1.25rem; }
#epTopic { margin: 0; }
.corner-now { color: var(--ok); font-weight: 600; min-height: 1.4em; }
.sleep { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sleep-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sleep-btns button { min-height: 46px; padding: 8px 16px; border-radius: 999px; }
.sleep-left { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── 두 칸 ──────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.chapters, .vocab, .replay { list-style: none; padding: 0; margin: 0; }
.chapters li { padding: 12px; border-radius: 14px; display: flex; gap: 12px; cursor: pointer; transition: background .2s; min-height: 48px; align-items: center; }
.chapters li:hover:not(.empty) { background: rgba(255, 255, 255, 0.06); }
.chapters li .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.4em; font-weight: 600; }
.chapters li.current { background: rgba(67, 230, 168, 0.12); color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.chapters li.empty, .vocab li.empty, .replay li.empty { color: var(--muted); cursor: default; }
.vocab li { padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.vocab li:hover { transform: translateX(4px); border-color: rgba(255, 95, 143, 0.5); }
.vocab li.empty { background: none; border: 0; }
.vocab .w { font-size: 1.35rem; font-weight: 800; }
.vocab .r { color: var(--cyan); font-style: italic; margin-left: 8px; }
.vocab .e { display: block; color: var(--muted); }

/* ── 편성표 ─────────────────────────────── */
table.schedule { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.schedule td { padding: 12px 12px; vertical-align: top; background: rgba(255, 255, 255, 0.03); }
.schedule td:first-child { border-radius: 12px 0 0 12px; }
.schedule td:last-child { border-radius: 0 12px 12px 0; }
.schedule td.time { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; width: 1%; font-weight: 700; }
.schedule tr.onair td { background: linear-gradient(90deg, rgba(255, 95, 143, 0.22), rgba(123, 97, 255, 0.12)); color: #fff; }
.schedule tr.onair td.time { color: var(--pink); }
.schedule tr.onair td.time::before { content: "● "; animation: blink 1.4s infinite; }
#tzLabel { color: var(--muted); font-weight: normal; }
.schedule .rerun { font-size: 0.75rem; color: var(--muted); margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }

/* ── 다시 듣기 ──────────────────────────── */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.9rem; flex: 1 1 200px; }
.replay li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.replay li.empty { background: none; border: 0; }
.replay .info { min-width: 0; }
.replay .info b { display: block; overflow: hidden; text-overflow: ellipsis; }
.replay .info span { color: var(--muted); font-size: 0.86rem; }
.replay li button { flex: none; border-radius: 999px; }

/* ── 뉴스·새 소식·앱 ─────────────────────── */
#newsBox { margin-top: 16px; }
ul.news { list-style: none; padding: 0; margin: 6px 0; font-size: 0.92em; }
ul.news li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.news a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
ul.news .src { opacity: 0.7; }
#newsBox .note { font-size: 0.8em; opacity: 0.65; margin: 6px 0 0; }
ul.updates { list-style: none; padding: 0; margin: 6px 0; }
ul.updates li { padding: 12px 0; border-bottom: 1px solid var(--line); }
ul.updates li:last-child { border-bottom: 0; }
ul.updates .when { color: var(--muted); font-size: 0.8rem; margin-right: 6px; font-variant-numeric: tabular-nums; }
ul.updates .tag { display: inline-block; font-size: 0.72rem; padding: 2px 9px; border-radius: 9px; background: rgba(255, 95, 143, 0.18); color: var(--pink); margin-right: 6px; font-weight: 700; }
ul.updates p { margin: 4px 0 0; }
ul.updates p.ko { font-size: 0.86rem; }
ul.updates a { font-weight: 700; }
#updatesMore { margin-top: 6px; }

/* 재방송 안내 */
.replay-banner { background: rgba(123, 97, 255, 0.14); border: 1px solid rgba(123, 97, 255, 0.4); border-radius: 16px; padding: 12px 16px; margin: 18px 0 0; font-size: 0.9rem; }
.replay-banner .ko { font-size: 0.84rem; opacity: 0.9; }

/* 광고 나올 때 누르는 카드 */
.ad-now {
  margin-top: 12px; padding: 14px 16px; border-radius: 16px; font-size: 1rem;
  background: linear-gradient(135deg, rgba(67, 230, 168, 0.18), rgba(63, 216, 255, 0.12)); border: 1px solid rgba(67, 230, 168, 0.5);
  animation: popin .5s cubic-bezier(.2, 1.4, .4, 1);
}
.ad-now .get { display: inline-block; margin: 8px 0 0; padding: 10px 16px; border-radius: 999px; background: var(--ok); color: #062b1c; font-weight: 800; text-decoration: none; }
.ad-now .tag { font-size: 0.72rem; padding: 2px 7px; border-radius: 6px; background: rgba(67, 230, 168, 0.3); color: #dfffee; font-weight: 800; }
@keyframes popin { from { transform: scale(0.9); opacity: 0; } }

footer { text-align: center; color: var(--muted); font-size: 0.86rem; margin-top: 26px; }

/* ── 아래 고정 미니 플레이어 (스크롤 내려도 바로 누르게) ── */
.mini {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%);
  width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  border-radius: 999px; background: rgba(23, 18, 51, 0.88); border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  transition: transform .45s cubic-bezier(.2, 1.2, .4, 1); z-index: 20;
}
.mini.show { transform: translate(-50%, 0); }
.mini-t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.mini-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; background: var(--grad); border: 0; font-size: 1.2rem; flex: none; }
.mini-eq { display: flex; align-items: flex-end; gap: 3px; height: 20px; width: 22px; }
.mini-eq i { flex: 1; height: 30%; background: var(--pink); border-radius: 2px; }
body.playing .mini-eq i { animation: bounce .8s ease-in-out infinite alternate; }
.mini-eq i:nth-child(2) { animation-delay: -.3s !important; } .mini-eq i:nth-child(3) { animation-delay: -.6s !important; }

/* ── 휴대폰 ─────────────────────────────── */
@media (max-width: 760px) {
  body { padding: 10px 12px 110px; font-size: 16px; }
  .hero { padding: 20px 18px; }
  .hero-grid { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .disc-wrap { width: 150px; height: 150px; margin: 0 auto; }
  .disc { width: 130px; height: 130px; }
  .disc-label { width: 52px; height: 52px; }
  .disc-label b { font-size: 1.2rem; }
  .onair h2 { font-size: 1.55rem; }
  .grid { grid-template-columns: 1fr; }
  .controls .big { flex-basis: 100%; }
  .controls #btnPause { flex: 1 1 100%; }
  .ticker { margin: 12px -12px 4px; }
  h1 { font-size: 1.3rem; }
  .ai-badge { font-size: 0.8rem; padding: 6px 12px; }
}

/* 움직임 줄이기 설정을 켠 사람 배려 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 손질: 채널 이름 줄바꿈 깔끔하게 · 재생 전엔 일시정지 버튼 숨김 */
.channels button .ko { display: block; font-size: 0.82rem; }
#btnPause:disabled { display: none; }
