:root {
  --background: #1c120d;
  --background-soft: #261910;
  --panel: #302117;
  --panel-light: #39291d;
  --gold: #c9a45d;
  --gold-light: #ead4a0;
  --text: #f4eadb;
  --muted: #b8a894;
  --border: rgba(201, 164, 93, 0.24);
  --danger: #d38b70;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, #604126 0%, transparent 42%),
    var(--background);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.app-shell {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 100px;
  border-left: 1px solid rgba(201, 164, 93, 0.08);
  border-right: 1px solid rgba(201, 164, 93, 0.08);
  background: rgba(28, 18, 13, 0.88);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  place-items: center;
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 30px;
  font-style: italic;
  box-shadow: inset 0 0 0 4px #c9a45d15;
}

.brand-mark span {
  position: absolute;
  right: 4px;
  top: 1px;
  color: var(--gold);
  font-size: 13px;
}

.brand-text {
  min-width: 0;
}

.brand-text p {
  margin: 0;
  font-size: 15px;
  letter-spacing: 3px;
  font-weight: bold;
}

.brand-text > span {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 1px;
}

.header-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

main {
  padding: 23px 17px 30px;
}

.page {
  display: none;
  animation: appear 0.25s ease-out;
}

.page.active {
  display: block;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome,
.library-heading {
  margin: 7px 0 25px;
}

.overline {
  margin: 0;
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.2px;
}

.welcome h1,
.library-heading h1 {
  margin: 11px 0;
  font-size: clamp(34px, 9vw, 46px);
  font-weight: normal;
  line-height: 1.08;
  letter-spacing: -1.3px;
}

h1 em {
  color: var(--gold-light);
  font-weight: normal;
}

.intro,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.intro {
  margin: 0;
}

.player-card {
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background:
    linear-gradient(155deg, #3b291c, #2a1c13 60%, #24180f);
  box-shadow: 0 15px 40px #00000021;
}

.album-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.25;
  max-height: 245px;
  overflow: hidden;
  border: 1px solid #c9a45d58;
  border-radius: 15px;
  background:
    radial-gradient(circle at center, #694a2b 0%, #38251a 40%, #21150f 78%);
}

.album-art::before,
.album-art::after {
  content: "";
  position: absolute;
  width: 150%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ead4a070, transparent);
  transform: rotate(-28deg);
}

.album-art::after {
  transform: rotate(28deg);
}

.art-ring {
  position: absolute;
  aspect-ratio: 1;
  border: 1px solid #c9a45d60;
  border-radius: 50%;
}

.ring-one {
  width: 65%;
}

.ring-two {
  width: 45%;
  border-color: #ead4a075;
}

.art-center {
  position: relative;
  z-index: 1;
  color: var(--gold-light);
  font-size: 64px;
  font-style: italic;
  text-shadow: 0 4px 20px #00000055;
}

.art-center span {
  position: absolute;
  top: 5px;
  right: -19px;
  font-size: 17px;
  color: var(--gold);
}

.art-caption {
  position: absolute;
  bottom: 17px;
  z-index: 1;
  color: #ead4a0a0;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 4px;
}

.track-information {
  padding: 20px 0 12px;
}

.track-information h2 {
  margin: 5px 0 2px;
  font-size: 22px;
  font-weight: normal;
  overflow-wrap: anywhere;
}

.track-information > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-area {
  padding-top: 9px;
}

#seek-bar {
  display: block;
  width: 100%;
  height: 5px;
  margin: 0;
  appearance: none;
  border-radius: 10px;
  background: #69513b;
  cursor: pointer;
}

#seek-bar::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  appearance: none;
  border: 2px solid var(--background);
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 1px var(--gold);
}

#seek-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid var(--background);
  border-radius: 50%;
  background: var(--gold-light);
}

.time-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px 0 9px;
}

.icon-button,
.play-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: #21160f;
  color: var(--gold-light);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.play-button {
  width: 60px;
  height: 60px;
  border: 1px solid var(--gold-light);
  background: linear-gradient(145deg, #f0d9a1, #b58b46);
  color: #2b1b0e;
  box-shadow: 0 5px 18px #00000028;
}

.play-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.secondary-control {
  width: 39px;
  height: 39px;
}

.player-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.panel {
  margin-top: 17px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(145deg, #302116, #281a12);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #c9a45d50;
  border-radius: 12px;
  color: var(--gold-light);
  font-size: 25px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 19px;
  font-weight: normal;
}

.timer-panel > .muted {
  line-height: 1.6;
}

.timer-display {
  margin: 19px 0;
  color: var(--gold-light);
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: clamp(32px, 9vw, 42px);
  font-weight: 300;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
}

.timer-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.timer-input-row label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 11px;
}

.timer-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #21160f;
  color: var(--text);
}

.gold-button {
  min-height: 45px;
  padding: 10px 14px;
  border: 1px solid var(--gold-light);
  border-radius: 10px;
  background: linear-gradient(135deg, #e8d09a, #b48b47);
  color: #28190e;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
}

.text-button {
  display: block;
  margin: 13px auto 0;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover {
  color: var(--gold-light);
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #24180f;
  cursor: pointer;
}

.option-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #46321f;
  color: var(--gold-light);
  font-size: 22px;
}

.option-copy {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.option-copy strong {
  font-size: 14px;
  font-weight: normal;
}

.option-copy small {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.option-row input {
  accent-color: var(--gold);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.mode-note {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 11px;
}

.library-shortcut {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #352419;
  color: var(--text);
  text-align: left;
}

.shortcut-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid #c9a45d55;
  border-radius: 12px;
  color: var(--gold-light);
  font-size: 23px;
}

.library-shortcut > span:nth-child(2) {
  display: grid;
  gap: 4px;
  flex: 1;
}

.library-shortcut strong {
  font-size: 14px;
  font-weight: normal;
}

.library-shortcut small {
  color: var(--muted);
  font-size: 11px;
}

.shortcut-arrow {
  color: var(--gold);
  font-size: 21px;
}

.library-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 24px 0 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #302116;
}

.library-summary > div:not(.summary-divider) {
  display: grid;
  gap: 3px;
}

.summary-number {
  color: var(--gold-light);
  font-size: 27px;
}

.summary-label {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.summary-divider {
  width: 1px;
  height: 37px;
  background: var(--border);
}

.track-list {
  display: grid;
  gap: 9px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #2b1d14;
  color: var(--text);
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.track-item:hover,
.track-item.is-current {
  border-color: #c9a45d65;
  background: #3a291b;
}

.track-number {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border: 1px solid #c9a45d35;
  border-radius: 10px;
  color: var(--gold-light);
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.track-item.is-current .track-number {
  background: #c9a45d;
  color: #21150f;
}

.track-meta {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.track-meta strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta small {
  overflow: hidden;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-play-indicator {
  color: var(--gold-light);
  font-size: 18px;
}

.library-footnote {
  margin: 22px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.library-footnote code {
  color: var(--gold-light);
}

.bottom-navigation {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 560px);
  padding: 9px 15px calc(9px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--border);
  background: rgba(32, 21, 14, 0.97);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.nav-symbol {
  font-size: 20px;
  line-height: 1.2;
}

.nav-item.active {
  background: #49331f;
  color: var(--gold-light);
}

.hidden {
  display: none !important;
}

@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid var(--border);
    border-radius: 23px;
    overflow: hidden;
  }

  .bottom-navigation {
    bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 0 0 23px 23px;
  }
}

@media (max-width: 370px) {
  main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .player-card,
  .panel {
    padding: 15px;
  }

  .transport-controls {
    gap: 10px;
  }

  .timer-input-row {
    grid-template-columns: 1fr;
  }

  .gold-button {
    width: 100%;
  }
}