:root {
  --ink: #111817;
  --cream: #f1dfc2;
  --paper: #ead2ad;
  --rust: #9f4526;
  --rust-dark: #78321f;
  --sage: #657773;
  --line: rgba(18, 25, 24, .18);
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(159,69,38,.23), transparent 35%),
    linear-gradient(160deg, #17201e 0%, #293733 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 680px); min-height: 100vh; margin: auto; padding: 20px 18px 108px; }
.app-header { display: flex; align-items: center; gap: 14px; color: var(--cream); margin-bottom: 18px; }
.brand-logo { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.app-header h1 { margin: 2px 0 0; font-family: Georgia, serif; font-size: clamp(1.5rem, 5vw, 2.1rem); }
.eyebrow, .label { margin: 0; color: var(--rust); font-size: .69rem; font-weight: 900; letter-spacing: .15em; }
.app-header .eyebrow { color: #d79369; }
.install-button { margin-left: auto; border: 1px solid rgba(241,223,194,.5); border-radius: 999px; padding: 9px 12px; color: var(--cream); background: transparent; font-size: .78rem; font-weight: 800; }

.player-card, .next-card, .history { background: var(--cream); border: 1px solid rgba(255,255,255,.25); box-shadow: var(--shadow); }
.player-card { overflow: hidden; border-radius: 28px; }
.live-row { display: flex; align-items: center; gap: 7px; padding: 14px 18px; color: #fff; background: var(--rust-dark); font-size: .73rem; font-weight: 900; letter-spacing: .13em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff714b; box-shadow: 0 0 0 5px rgba(255,113,75,.16); }
.connection { margin-left: auto; max-width: 65%; overflow: hidden; text-overflow: ellipsis; color: #edcfb9; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.now-grid { display: grid; grid-template-columns: minmax(0, 47%) 1fr; gap: 20px; padding: 22px; align-items: center; }
.artwork { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; background: #d8c09d; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.track-copy { min-width: 0; }
.track-copy h2 { margin: 8px 0 3px; font-family: Georgia, serif; font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.05; overflow-wrap: anywhere; }
.artist { margin: 0; color: #4a5652; font-size: 1rem; overflow-wrap: anywhere; }
.program-block { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.program-block strong { display: block; margin-top: 5px; font-size: .94rem; line-height: 1.3; }
.controls { display: flex; align-items: center; gap: 14px; padding: 18px 22px calc(18px + env(safe-area-inset-bottom, 0px)); color: #fff; background: var(--ink); }
.play-button { flex: 0 0 58px; width: 58px; height: 58px; border: 0; border-radius: 50%; color: #fff; background: var(--rust); box-shadow: 0 7px 18px rgba(159,69,38,.45); font-size: 1.35rem; cursor: pointer; }
.controls strong, .controls small { display: block; }
.controls small { margin-top: 3px; color: #b8c3bf; }
.volume { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.volume input { width: 76px; accent-color: var(--rust); }

.next-card { margin-top: 14px; border-radius: 18px; padding: 16px 20px; }
.next-card strong { display: block; margin-top: 5px; }
.history { margin-top: 14px; padding: 22px; border-radius: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.section-heading h2 { margin: 5px 0 0; font-family: Georgia, serif; }
.text-button { border: 0; padding: 8px 0; color: var(--rust); background: transparent; font-size: .75rem; font-weight: 900; }
.history-list { margin: 15px 0 0; padding: 0; list-style: none; }
.history-list li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.history-list img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.history-list strong, .history-list span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list span { margin-top: 3px; color: #56625e; font-size: .83rem; }
.history-list time { color: #66716e; font-size: .75rem; }
.history-list .history-placeholder { display: block; color: #56625e; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 680px); padding: 9px 8px calc(9px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: rgba(15,22,20,.96); border-top: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; color: #aab6b2; text-decoration: none; font-size: .68rem; }
.bottom-nav a span { font-size: 1.1rem; font-weight: 900; }
.bottom-nav a.active { color: #e8996e; }

@media (max-width: 500px) {
  .app-shell { padding-inline: 12px; }
  .app-header { padding-inline: 4px; }
  .brand-logo { width: 58px; height: 58px; }
  .install-button { padding: 8px 9px; }
  .now-grid { grid-template-columns: 1fr; }
  .artwork { width: min(78vw, 330px); justify-self: center; }
  .program-block { margin-top: 16px; }
  .volume { display: none; }
}

@media (display-mode: standalone) { .install-button { display: none !important; } }
