:root {
  color-scheme: dark;
  font-size: 100%;
  --bg: #0b0e13;
  --panel: #171b22;
  --panel-border: #30343c;
  --text: #f7f9fc;
  --muted: #aab2c0;
  --accent: #ff4d67;
  --accent2: #ff855d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, 'Leelawadee UI', sans-serif; }
body { padding: 24px 18px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { opacity: .5; cursor: wait; }
[hidden] { display: none !important; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent2); outline-offset: 5px; }
.shell { width: 100%; max-width: 920px; margin: 0 auto; }
.hero { padding: 50px 0 28px; }
.brand { font-size: .75rem; letter-spacing: 3px; font-weight: bold; color: #ff9b84; }
h1 { margin: 10px 0 8px; font-size: 3.25rem; line-height: 1.35; overflow-wrap: anywhere; }
.subtitle { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.8; }
.player-card { display: grid; grid-template-columns: 180px minmax(0, 1fr) 150px; align-items: center; gap: 24px; width: 100%; padding: 24px; border: 1px solid var(--panel-border); border-radius: 20px; background: var(--panel); }
.station-art { width: 180px; max-width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 20px; background: var(--accent); font-size: 2.5rem; overflow: hidden; }
.station-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.station-copy { min-width: 0; }
.station-copy .eyebrow { margin: 0 0 7px; color: #ff9b84; font-size: .75rem; font-weight: bold; letter-spacing: 2px; }
.station-copy h2 { margin: 0 0 6px; font-size: 1.75rem; line-height: 1.25; overflow-wrap: anywhere; }
.station-copy p { margin: 0; color: var(--muted); line-height: 1.6; }
.station-copy .status { margin-top: 9px; font-size: .875rem; }
.radio-panel[data-state=playing] .status { color: #78e2a0; }
.radio-panel[data-state=error] .status { color: #ff8f9f; }
.radio-panel[data-state=reconnecting] .status, .radio-panel[data-state=buffering] .status { color: #ffb399; }
.controls { min-width: 0; text-align: center; }
.play-button { width: 76px; height: 76px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #12151b; }
.play-button:hover:not(:disabled) { background: #ffe5df; }
.play-button svg { width: 30px; height: 30px; fill: currentColor; }
.play-icon { transform: translateX(-2px); }
.pause-icon { display: none; }
.radio-panel[data-active=true] .play-icon { display: none; }
.radio-panel[data-active=true] .pause-icon { display: block; }
.volume-wrap { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.icon-button { display: grid; place-items: center; padding: 10px; width: 44px; min-width: 44px; height: 44px; border: 0; background: transparent; color: #fff; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.muted-icon { display: none; }
.icon-button[aria-pressed=true] .volume-icon { display: none; }
.icon-button[aria-pressed=true] .muted-icon { display: block; }
#volume { width: 90px; min-width: 50px; height: 32px; margin: 0; accent-color: var(--accent2); cursor: pointer; }
.volume-note { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.station-list-wrap { margin-top: 28px; }
.chat-card { margin-top: 24px; padding: 24px; border: 1px solid var(--panel-border); border-radius: 20px; background: var(--panel); }
.chat-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; flex-wrap: wrap; }
.chat-heading h2 { margin: 0; font-size: 1.4rem; }
.chat-heading p, .chat-caption { color: var(--muted); font-size: .875rem; margin: 6px 0 14px; }
#chat-status { color: #ffb399; font-size: .8125rem; }
.chat-join { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 18px; }
.chat-presence { margin: 4px 0 18px; padding: 0 14px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--bg); }
.chat-presence summary { min-height: 48px; padding: 12px 0; cursor: pointer; font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.chat-presence summary:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; border-radius: 4px; }
.online-dot { display: inline-block; width: 8px; height: 8px; margin: 0 8px; background: var(--muted); border-radius: 50%; }
.is-online .online-dot { background: #78e2a0; }
.online-hint { color: var(--muted); margin-left: 12px; font-size: .8125rem; }
#online-names { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; }
#online-names li { padding: 6px 10px; border: 1px solid var(--panel-border); border-radius: 8px; color: #ffb399; font-size: .875rem; overflow-wrap: anywhere; max-width: 100%; }
#online-guests, .online-note { color: var(--muted); font-size: .8125rem; line-height: 1.6; margin: 0 0 12px; }
.chat-card input, .chat-card textarea { min-width: 0; max-width: 100%; color: var(--text); background: var(--bg); border: 1px solid #687181; border-radius: 10px; padding: 12px; font: inherit; }
.chat-card input { flex: 1; }
.chat-card button { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; color: #1b1012; background: linear-gradient(120deg,#ff7d8e,#ffac86); font-weight: bold; }
.chat-card button:disabled { cursor: default; }
.chat-card textarea:focus-visible, .chat-feed:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }
.chat-feed { height: 300px; overflow-y: auto; padding: 4px 16px; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 12px; overflow-wrap: anywhere; }
#chat-empty { color: var(--muted); text-align: center; margin-top: 110px; }
.chat-message { padding: 14px 0; border-bottom: 1px solid var(--panel-border); }
.chat-message>div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.chat-message strong { color: #ffb399; }
.chat-message time { color: var(--muted); font-size: .75rem; }
.chat-message p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.6; }
.chat-caption { margin-top: 8px; }
.chat-input-row { display: flex; align-items: stretch; gap: 10px; margin-top: 8px; }
.chat-input-row textarea { flex: 1; resize: vertical; }
.chat-notice { color: var(--muted); min-height: 1.5em; font-size: .875rem; line-height: 1.6; margin-bottom: 0; overflow-wrap: anywhere; }
.emoji-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.emoji-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-card .emoji-button { width: 44px; height: 44px; padding: 4px; font-size: 1.5rem; font-family: 'Apple Color Emoji','Segoe UI Emoji',sans-serif; font-weight: normal; color: var(--text); background: var(--bg); border: 1px solid var(--panel-border); }
.chat-card .emoji-button:hover { background: #30202a; border-color: var(--accent2); }
.chat-card #emoji-toggle { background: transparent; color: #ffb399; border: 1px solid var(--panel-border); font-size: .875rem; }
.chat-card #emoji-toggle[aria-expanded=true] { border-color: var(--accent2); }
.emoji-panel { margin-top: 12px; padding: 14px; background: var(--bg); border: 1px solid var(--panel-border); border-radius: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.emoji-group h3 { font-size: .875rem; color: var(--muted); margin: 0 0 8px; }
.emoji-notice { color: #ffb399; font-size: .875rem; line-height: 1.6; margin: 8px 0 0; }
.emoji-notice:empty { display: none; }
@media(max-width:520px) { .emoji-panel { grid-template-columns: minmax(0,1fr); } }
@media(max-width:520px) {
  .chat-card { padding: 18px; }
  .chat-join label { width: 100%; }
  .chat-join input { width: 100%; flex-basis: 100%; }
  .chat-input-row { flex-direction: column; }
}
h3 { font-size: 1.125rem; margin: 0; }
.station-list { margin-top: 12px; }
.station-row { width: 100%; margin-bottom: 10px; padding: 15px 16px; border: 1px solid var(--panel-border); border-radius: 12px; background: #151920; color: #fff; text-align: left; }
.station-row.active { border-color: var(--accent2); background: #261a18; }
.station-row strong { display: block; overflow-wrap: anywhere; line-height: 1.5; }
.station-row span { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.ios-note { margin: 24px 4px 0; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.config-retry { margin-top: 12px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--accent2); border-radius: 8px; background: transparent; color: #ffb399; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 18px; padding: 12px; background: #fff; color: #12151b; z-index: 2; }
.skip-link:focus { top: 12px; }
@media (max-width: 720px) {
  h1 { font-size: 2.5rem; }
  .player-card { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .station-art { width: 200px; margin: 0 auto 18px; }
  .controls { margin-top: 22px; text-align: left; }
  .volume-wrap { justify-content: flex-start; }
}
@media (max-width: 360px) {
  .hero { padding-top: 32px; }
  h1 { font-size: 2.125rem; }
  .player-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
