:root {
  color-scheme: dark;
  --bg: #100f14;
  --surface: #181a1d;
  --surface-2: #22262a;
  --text: #f7f1ea;
  --muted: rgba(247, 241, 234, 0.68);
  --line: rgba(255, 255, 255, 0.13);
  --accent: #e9b949;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app {
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(230, 55, 120, 0.24), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(45, 190, 200, 0.22), transparent 35%),
    linear-gradient(145deg, #171018, #0c1114 60%, #100f14);
}

.show-carousel {
  padding: max(10px, env(safe-area-inset-top)) 12px 8px;
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto 8px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.brand p,
.song-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.brand h1 {
  margin: 1px 0 0;
  font-size: 1.18rem;
  line-height: 1.05;
}

.carousel-track {
  position: relative;
  max-width: 980px;
  height: clamp(220px, 45vh, 390px);
  margin: 0 auto;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  perspective: 900px;
}

.show-card {
  position: absolute;
  left: 50%;
  top: 0;
  display: grid;
  align-items: end;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background: #222;
  color: var(--text);
  text-align: left;
  padding: 0;
  cursor: pointer;
  transform-origin: center center;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  will-change: transform, opacity, filter;
}

.show-card.active {
  border-color: rgba(233, 185, 73, 0.95);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.48);
}

.show-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.show-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.10) 64%);
}

.show-card span {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 18px;
}

.show-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.05rem, 5.5vw, 1.45rem);
  line-height: 1.12;
}

.show-card small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
}

.reader {
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(16, 17, 18, 0.93), rgba(16, 17, 18, 0.93)),
    var(--reader-image);
  background-size: cover;
  background-position: center;
  touch-action: pan-y;
}

.song-track {
  height: 100%;
  display: grid;
  grid-template-columns: 100% 100% 100%;
  will-change: transform;
}

.song-slide {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.song-header {
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 21, 0.92);
  backdrop-filter: blur(14px);
}

.song-header h2 {
  margin: 3px 0;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  line-height: 1.17;
}

.song-nav {
  display: flex;
  gap: 8px;
}

.song-nav button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

.lyrics-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.lyrics-panel pre {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px max(18px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  color: #f4eadf;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 4.8vw, 1.34rem);
  line-height: 1.62;
}

@media (min-width: 760px) {
  .show-carousel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .carousel-track {
    height: clamp(280px, 46vh, 390px);
  }

  .song-header {
    padding-left: max(28px, calc((100vw - 760px) / 2));
    padding-right: max(28px, calc((100vw - 760px) / 2));
  }
}
