:root {
  --paper: #F2EEE6;
  --card: #FBF8F2;
  --ink: #1B1A17;
  --muted: #5E5A52;
  --rule: #D6CFC1;
  --track: #DDD6C8;
  --accent: #D9481C;
  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
}

.page {
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

.display {
  font-family: var(--display);
  font-stretch: 62%;
  font-weight: 800;
  text-transform: uppercase;
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
}

header.top .display { font-size: 22px; letter-spacing: 0.02em; }

.onair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onair .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.playing .onair .dot { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: 0.25; } }

.card {
  margin: 4px 20px 0;
  border: 2px solid var(--ink);
  background: var(--card);
}

.card .strip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card .titles { padding: 18px 14px 14px; }

.card h1 {
  margin: 0;
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 900;
  font-size: 44px;
  line-height: 0.92;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.card h1.long { font-size: 34px; }
.card h1.longer { font-size: 28px; }

.card .by { margin-top: 12px; font-size: 14px; }
.card .by strong { font-weight: 500; }

.card .now {
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  min-height: 1.3em;
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 16px;
}

.play {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.play:active { transform: scale(0.96); }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.loading .play { opacity: 0.7; }

.progress { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.bar { height: 6px; background: var(--track); position: relative; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }

.times { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }

.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 20px 8px;
}

.tl-head .display { font-size: 18px; letter-spacing: 0.04em; }
.tl-head small { font-size: 11px; color: var(--muted); }

ol.tracklist {
  list-style: none;
  margin: 0;
  padding: 0 20px;
  flex: 1;
}

ol.tracklist li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.3;
}

ol.tracklist .n { width: 42px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
ol.tracklist .t { flex: 1; min-width: 0; }
ol.tracklist .t em { font-style: normal; color: var(--muted); }
ol.tracklist .flag { flex: none; font-size: 11px; }

ol.tracklist li.section {
  padding: 16px 0 6px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--display);
  font-stretch: 62%;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

ol.tracklist li.section:first-child { padding-top: 0; }

ol.tracklist li.past { color: #6B665C; }
ol.tracklist li.current { color: var(--accent); font-weight: 500; }
ol.tracklist li.current .n { color: var(--accent); }
ol.tracklist li.overlay { padding-left: 16px; font-size: 12px; }
ol.tracklist li.overlay .n { width: 26px; }

.source { padding: 10px 20px 0; font-size: 11px; color: var(--muted); }
.source a { color: var(--muted); }

footer.next {
  margin-top: 16px;
  border-top: 2px solid var(--ink);
  padding: 12px 20px 22px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

footer.next span:first-child { color: var(--muted); flex: none; }
footer.next span:last-child { text-align: right; }

/* Connexion */
.login {
  margin: 0 20px;
  padding: 18px 14px;
  border: 2px solid var(--ink);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }

.login input {
  font: inherit;
  font-size: 16px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 0;
}

.login button {
  font: inherit;
  font-weight: 500;
  padding: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.login .error { color: var(--accent); font-size: 13px; margin: 0; }
