:root {
  --header-h: 76px;
  --player-h: 104px;
  --chat-w: 390px;
  --page-max: 1280px;
  --bg: #090d16;
  --surface: #111822;
  --text: #f2f9fb;
  --muted: #b0c3ce;
  --line: rgba(168, 202, 214, 0.18);
  --cyan: #48e9e3;
  --magenta: #ed5bc9;
  --sun: #48e9e3;
  --hot: #ed5bc9;
  --mint: #8fe5b2;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  --radius: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body {
  height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: var(--header-h) minmax(0, 1fr) var(--player-h);
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
button:disabled { opacity: 0.55; cursor: wait; }
* { scrollbar-width: thin; scrollbar-color: #398c96 rgba(11, 20, 30, 0.4); }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: rgba(11, 20, 30, 0.4); }
*::-webkit-scrollbar-thumb { background: #398c96; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 60;
  padding: 10px 16px; background: var(--cyan); color: var(--bg); border-radius: 6px;
}
.skip-link:focus { top: 12px; }
.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;
}

.site-header, .player-footer {
  position: relative;
  z-index: 25;
  background: rgba(9, 13, 22, 0.98);
  border-color: var(--line);
}
.site-header { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.header-inner {
  width: min(var(--page-max), calc(100% - 48px)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; font-weight: 800; font-size: 17px; }
.brand-mark {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 0; overflow: visible; border: 0; background: transparent;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.listen-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 214px; height: 48px; flex: 0 0 214px;
  padding: 0 18px; border-radius: 14px; border: 1px solid rgba(143, 229, 178, 0.35);
  background: #224f46; color: #d3ffe5; font-weight: 800; white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.listen-button:hover { background: #286356; border-color: #8fe5b2; }
.listen-button.is-playing { background: #141f2a; border-color: var(--line); color: var(--text); }
.listen-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: currentColor; }
.listen-icon-live, .listen-button.is-playing .listen-icon-play { display: none; }
.listen-button.is-playing .listen-icon-live { display: block; }
.chat-tab {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 18px; border: 1px solid rgba(72, 233, 227, 0.28);
  border-radius: 14px; background: #131e2a; color: var(--text); font-weight: 800;
}
.chat-tab:hover, .chat-tab.is-attached { background: #192b36; border-color: rgba(72, 233, 227, 0.5); }
.chat-tab svg { width: 21px; height: 21px; fill: var(--cyan); }

.app-layout {
  position: relative; isolation: isolate; width: 100%; min-height: 0; overflow: hidden;
  padding: 24px max(24px, calc((100vw - var(--page-max)) / 2));
  background: #090d16;
}
.app-layout::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(9, 13, 22, 0.12) 0%, rgba(9, 13, 22, 0.08) 50%, rgba(9, 13, 22, 0.14) 100%),
    url("../img/batukada-electric-background.webp") center / cover no-repeat;
}
.content-panel {
  width: calc(100% - var(--chat-w) - 40px); height: 100%; min-height: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 20px;
  border: 0; padding: 10px 0 0; background: none;
}
.hero-pattern { display: none; }
.content-copy { align-self: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--cyan);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--magenta); }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 80px; line-height: 1.03; font-weight: 800; }
h1 span { display: block; color: var(--cyan); }
.hero-copy { max-width: 550px; margin: 20px 0 0; font-size: 18px; line-height: 1.6; color: #c6d6df; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card {
  min-width: 0; padding: 18px 16px; border-radius: 8px;
  border: 1px solid rgba(131, 201, 217, 0.2); background: rgba(15, 27, 38, 0.72);
  backdrop-filter: blur(12px);
}
.feature-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; }
.feature-icon img { display: block; width: 27px; height: 27px; }
.feature-card h2 { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 800; }
.feature-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.social-icons { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0; }
.social-icon {
  display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 25, 36, 0.82);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.social-icon:hover { border-color: var(--cyan); background: #1a2b39; }
.social-icon svg { display: block; width: 29px; height: 29px; }

.chat-widget {
  position: fixed; right: max(24px, calc((100vw - var(--page-max)) / 2));
  top: calc(var(--header-h) + 24px); bottom: calc(var(--player-h) + 24px);
  z-index: 20; width: var(--chat-w); min-height: 0; display: none;
}
.chat-widget.is-open { display: block; }
.chat-panel {
  position: relative; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
  padding-top: 58px; border: 1px solid rgba(120, 188, 207, 0.24); border-radius: 16px;
  background: rgba(10, 22, 32, 0.74); backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.settings-toggle {
  position: absolute; top: 10px; right: 16px; z-index: 4;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(25, 42, 54, 0.9); color: var(--cyan);
}
.settings-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.settings-toggle:hover, .settings-toggle[aria-expanded="true"] { border-color: var(--cyan); background: #203744; }
.chat-settings {
  position: absolute; top: 55px; right: 12px; z-index: 5; width: min(310px, calc(100% - 24px));
  display: grid; gap: 14px; padding: 18px; border: 1px solid rgba(72, 233, 227, 0.3);
  border-radius: 8px; background: rgba(12, 25, 36, 0.97); box-shadow: var(--shadow);
  max-height: calc(100% - 70px); overflow: auto;
}
.settings-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; }
.settings-kicker { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.settings-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { border: 0; background: none; padding: 5px 0; color: var(--cyan); font-weight: 800; }
.settings-action {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 6px; background: #172936; color: var(--text); font-weight: 700;
}
.cast-action { justify-content: flex-start; cursor: pointer; }
google-cast-launcher { width: 26px; height: 26px; --connected-color: var(--cyan); --disconnected-color: var(--cyan); }
.cast-action.is-active { border-color: var(--cyan); background: rgba(72, 233, 227, 0.14); }
.settings-check { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.settings-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--cyan); }
.settings-status { min-height: 16px; margin: 0; color: var(--muted); font-size: 12px; }
.chat-header { display: none; }
.icon-button {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #162936; color: var(--text);
}
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 13px; border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; font-weight: 800; white-space: nowrap;
}
.button-primary { background: var(--cyan); color: #062023; border-color: var(--cyan); }
.button-primary:hover { background: #89f4ee; }
.button-secondary { background: #172a37; color: var(--text); border-color: var(--line); }
label { font-weight: 700; }
input, textarea {
  min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid rgba(134, 198, 213, 0.24);
  border-radius: 6px; background: rgba(5, 17, 26, 0.66); color: var(--text);
}
textarea { resize: vertical; }
textarea::placeholder, input::placeholder { color: #8cabb9; opacity: 1; }
input:focus, textarea:focus { border-color: var(--cyan); }
.chat-name-panel { display: grid; gap: 8px; flex-shrink: 0; padding: 0 14px 14px; border-bottom: 1px solid var(--line); }
.chat-name-panel label { font-size: 13px; }
.chat-name-panel.is-hidden { display: none; }
.chat-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chat-name-row input { flex: 1 1 145px; width: auto; }
.pinned-message {
  flex-shrink: 0; margin: 12px 14px 0; padding: 12px 14px;
  border: 1px solid rgba(237, 91, 201, 0.4); border-left: 3px solid var(--magenta);
  border-radius: 6px; background: rgba(87, 28, 78, 0.25); color: #f5e9f1; font-size: 13px;
}
.pinned-message strong { display: block; margin-bottom: 5px; color: #ff9ee4; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.chat-messages {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  overflow: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 14px;
}
.chat-message {
  flex-shrink: 0; align-self: flex-start; max-width: 90%; padding: 10px 12px;
  border: 1px solid rgba(151, 199, 212, 0.12); border-radius: 10px 10px 10px 3px;
  background: rgba(24, 46, 59, 0.84); overflow-wrap: anywhere; font-size: 13px;
}
.chat-message.is-own {
  align-self: flex-end; border-radius: 10px 10px 3px 10px;
  border-color: rgba(72, 233, 227, 0.26); background: rgba(13, 85, 88, 0.69);
}
.chat-message__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; margin-bottom: 4px; }
.chat-message__name { font-size: 12px; font-weight: 800; color: #e1faf9; }
.chat-message__time { font-size: 10px; color: #a9c7d1; }
.chat-message p { margin: 0; color: var(--text); }
.empty-state { padding: 20px 0; color: var(--muted); font-size: 13px; }
.jump-to-latest {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px;
  border: 1px solid rgba(72, 233, 227, 0.5); border-radius: 24px;
  background: #132c37; color: var(--cyan); box-shadow: var(--shadow); font-size: 12px; font-weight: 800;
}
.jump-to-latest svg { width: 19px; height: 19px; fill: currentColor; }
.jump-to-latest span { white-space: nowrap; }
.chat-composer { position: relative; flex-shrink: 0; padding: 12px; border-top: 1px solid var(--line); background: rgba(7, 18, 28, 0.6); }
.composer-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 67px; gap: 7px; align-items: center; }
.composer-row textarea { display: block; height: 42px; min-height: 42px; max-height: 96px; resize: none; font-size: 13px; }
.composer-row .button { height: 42px; padding: 7px; }
.emoji-button { font-size: 19px; line-height: 1; }
.composer-meta { display: flex; justify-content: space-between; gap: 8px; min-height: 16px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.form-status.is-error { color: #ffa7cf; }
.form-status.is-success { color: var(--mint); }
.emoji-picker {
  position: absolute; left: 12px; bottom: calc(100% + 2px); z-index: 5;
  display: grid; grid-template-columns: repeat(4, 36px); gap: 5px; padding: 9px;
  border: 1px solid rgba(72, 233, 227, 0.26); border-radius: 8px; background: #112635; box-shadow: var(--shadow);
}
.emoji-picker button { width: 36px; height: 34px; padding: 0; border: 0; border-radius: 5px; background: #1e3746; font-size: 18px; }
.emoji-picker button:hover { background: #2b4a5b; }

.player-footer {
  display: flex; align-items: flex-start; justify-content: center; min-height: 0; overflow: hidden;
  border-top: 1px solid var(--line); padding: 0.7rem 1rem 0;
}
.player-footer iframe { display: block; width: 100%; flex-shrink: 0; }

@media (max-width: 1200px) and (min-width: 921px) {
  :root { --chat-w: 350px; }
  h1 { font-size: 64px; }
  .hero-copy { font-size: 16px; }
  .content-panel { width: calc(100% - var(--chat-w) - 28px); gap: 16px; }
  .feature-card { padding: 14px 12px; }
  .feature-card h2 { font-size: 13px; }
  .feature-card p { font-size: 12px; }
}
@media (max-width: 920px) {
  :root { --header-h: 66px; --player-h: 89px; }
  .header-inner { width: calc(100% - 32px); gap: 12px; }
  .brand { font-size: 15px; gap: 9px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .listen-button { display: none; }
  .chat-tab { height: 42px; padding: 0 14px; }
  .app-layout { padding: 24px; }
  .app-layout::before { background-position: 60% center; opacity: 0.72; }
  .content-panel { width: 100%; gap: 14px; padding: 0; }
  .content-copy { align-self: start; padding: 12px 0 0; }
  h1 { display: none; }
  .eyebrow { margin-bottom: 12px; }
  .hero-copy { max-width: 500px; margin: 0; font-size: 16px; }
  .info-grid { grid-template-columns: 1fr; gap: 10px; }
  .feature-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding: 14px; }
  .feature-icon { grid-row: span 2; margin: 0; align-self: start; }
  .feature-card h2 { font-size: 14px; }
  .feature-card p { margin-top: 4px; font-size: 13px; }
  .social-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .social-icon svg { width: 26px; height: 26px; }
  .chat-widget {
    left: 0; right: 0; top: var(--header-h); bottom: var(--player-h); width: auto;
    padding: 10px 10px 12px; background: rgba(5, 12, 19, 0.24);
  }
  .chat-panel { background: rgba(10, 22, 32, 0.82); }
  .player-footer { padding: 8px 0.6rem 0; }
}
@media (max-width: 380px) {
  .header-inner { width: calc(100% - 20px); }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .chat-tab { padding: 0 10px; gap: 6px; font-size: 13px; }
  .app-layout { padding: 18px 16px; }
  .hero-copy { font-size: 14px; }
  .feature-card { padding: 12px; }
  .feature-card p { font-size: 12px; }
}
@media (max-height: 700px) {
  .content-panel { gap: 12px; }
  .content-copy { align-self: start; }
  .eyebrow { margin-bottom: 10px; }
  .feature-icon { margin-bottom: 9px; }
  .feature-card { padding-top: 12px; padding-bottom: 12px; }
  h1 { font-size: 60px; }
  .hero-copy { margin-top: 12px; font-size: 15px; }
}
@media (max-width: 920px) and (max-height: 650px) {
  .app-layout { padding-top: 16px; padding-bottom: 14px; }
  .content-panel { grid-template-rows: auto auto auto; align-content: space-between; gap: 12px; }
  .content-copy { padding-top: 0; }
  .hero-copy { margin: 0; font-size: 14px; line-height: 1.45; }
  .feature-card { padding: 10px; column-gap: 9px; }
  .feature-card h2 { font-size: 12px; }
  .feature-card p { font-size: 11px; line-height: 1.45; margin-top: 3px; }
  .feature-icon { margin-bottom: 0; width: 26px; height: 26px; }
  .feature-icon img { width: 24px; height: 24px; }
  .social-icon { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
