/* Responsive single-stylesheet layout -- mobile-first, scales up on wider
   viewports. No JS-based layout switching (Requirement 7.1). */

:root {
  --bg: #0f1115;
  --surface: #181b22;
  --text: #f1f3f6;
  --muted: #9aa3b2;
  --accent: #5ec2a7;
  --warn: #d98f4e;
  --error: #e06c6c;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.ticker {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticker-header h1 {
  font-size: 1.25rem;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.current-block,
.state-block,
.recently-played {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}

.current-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}

#current-title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.3;
}

#current-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

#current-link:hover {
  text-decoration: underline;
}

.meta {
  color: var(--muted);
  margin: 8px 0 0 0;
  font-size: 0.95rem;
}

.progress-wrap {
  margin-top: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.8s linear;
}

.progress-time {
  margin: 8px 0 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.state-block p {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
}

.error-block {
  border: 1px solid var(--error);
}

.recently-played h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#recently-played-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#recently-played-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#recently-played-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

#recently-played-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

#recently-played-list a:hover {
  text-decoration: underline;
}

@media (min-width: 720px) {
  .ticker {
    max-width: 760px;
  }

  .ticker-header h1 {
    font-size: 1.6rem;
  }

  #current-title {
    font-size: 1.8rem;
  }
}
