:root {
  --bg: #f7f3ec;
  --ink: #231f1a;
  --muted: #5e564c;
  --accent: #3b5a5f;
  --accent-2: #c6a25a;
  --border: #e3d8c9;
  --paper: #fdf9f3;
  --paper-2: #f6efe6;
  --font-title: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Helvetica", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9), rgba(246, 237, 224, 0.85) 35%, rgba(235, 225, 210, 0.9) 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04) 2px, rgba(0, 0, 0, 0.015) 3px, rgba(0, 0, 0, 0.015) 5px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.player {
  width: min(760px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(252, 248, 242, 0.92)),
    var(--paper);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 30px 60px rgba(45, 35, 25, 0.18);
}

.title h1 {
  margin: 0 0 4px 0;
  font-family: var(--font-title);
  letter-spacing: 0.06em;
  font-size: 42px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.intro {
  margin-top: 24px;
  color: var(--ink);
  line-height: 1.6;
}

.download {
  margin-top: 18px;
}

.composer {
  margin: 0 0 4px 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.status {
  margin-top: 24px;
  padding: 16px;
  border-left: 4px solid var(--accent);
  background: var(--paper-2);
}

.status.is-hidden {
  display: none;
}

.status-line {
  font-size: 20px;
  font-weight: 600;
}

.status-sub {
  margin-top: 6px;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}

.btn {
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:active {
  transform: scale(0.97);
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.is-hidden {
  display: none;
}

.countdown {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed rgba(120, 108, 93, 0.35);
  border-radius: 12px;
}

.countdown-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.countdown-time {
  font-size: 32px;
  margin: 6px 0;
  font-family: var(--font-title);
}

.countdown-sub {
  color: var(--muted);
}

.progress {
  margin-top: 18px;
}

.progress-inline {
  margin-top: 12px;
}

.progress-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.progress-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(59, 90, 95, 0.12);
  border: 1px solid rgba(59, 90, 95, 0.18);
}

.progress-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(198, 162, 90, 0.95);
  box-shadow: 0 0 16px rgba(198, 162, 90, 0.7);
}

.share,
.donate,
.download {
  margin-top: 18px;
}

.donate-text {
  margin: 0 0 10px 0;
  color: var(--ink);
}

.donate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.score {
  margin-top: 28px;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-title);
}

.month-label {
  font-size: 26px;
  letter-spacing: 0.04em;
}

.beat-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-body);
}

.year-strip {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 16px 0;
  font-size: 9px;
  text-transform: none;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.year-strip span {
  padding: 4px 4px;
  border-radius: 8px;
  text-align: center;
  background: rgba(59, 90, 95, 0.08);
  line-height: 1.2;
  word-break: break-word;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  hyphens: manual;
}

.year-strip span.active {
  background: var(--accent);
  color: white;
}

.score-container {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(246, 239, 230, 0.85)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03) 1px, rgba(0, 0, 0, 0) 18px),
    var(--paper);
  overflow: hidden;
  position: relative;
  max-height: 520px;
  overflow-y: auto;
}

.glide-cursor {
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: linear-gradient(180deg, rgba(198, 162, 90, 0.1), rgba(198, 162, 90, 0.9), rgba(198, 162, 90, 0.1));
  box-shadow: 0 0 18px rgba(198, 162, 90, 0.75);
  border-radius: 2px;
  pointer-events: none;
  transition: left 1s linear;
  opacity: 0.85;
}

.glide-cursor::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(198, 162, 90, 0.9);
  box-shadow: 0 0 16px rgba(198, 162, 90, 0.85);
}

.score-fallback {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.osmd-svg {
  width: 100%;
  height: auto;
}

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.footer-line + .footer-line {
  margin-top: 4px;
}

@media (max-width: 540px) {
  .player {
    padding: 22px;
  }

  .title h1 {
    font-size: 32px;
  }

  .status-line {
    font-size: 18px;
  }

  .score-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .score-container {
    max-height: 380px;
  }
}

@media (max-width: 640px) {
  .score {
    display: none;
  }
}
