/* Beat Deck: neon theme and responsive song, play, and collection screens. */
/* Theme tokens */
:root,
:root:not([data-theme='light']) {
  --bg: #0c0b16;
  --surface: #181725;
  --surface-2: #232137;
  --ink: #f5f3fc;
  --ink-2: #aaa6bf;
  --accent: #e535ab;
  --accent-soft: #e535ab1c;
  --line: #ffffff16;
  --radius: 18px;
  --font-display: 'Trebuchet MS', system-ui, sans-serif;
  --max: 1100px;
  color-scheme: dark;
}

/* Page shell and typography */
body {
  background: radial-gradient(ellipse at 85% 0, #35122d66, transparent 45%), var(--bg);
}

.app-header {
  padding-inline: 28px;
}

.brand {
  letter-spacing: -0.5px;
}

.app-main {
  padding-top: 28px;
}

.eyebrow {
  font: 700 11px/1.4 var(--font-mono);
  letter-spacing: 2px;
  color: #45e4ed;
  margin-bottom: 16px;
}

/* Compact library summary keeps tracks in view. */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 12px;
}

.hero h1 {
  font-size: 24px;
  letter-spacing: -0.8px;
  margin: 0;
}

.section-title {
  margin-top: 20px;
}

/* Song tiles and difficulty controls */
.song-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 20px 0;
}

.song.card {
  margin: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  display: flex;
  min-height: 176px;
}

.song-art {
  width: 32%;
  min-width: 95px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--song) 35%, #12111e), #11101d);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  color: var(--song);
}

.song-art:after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border: 20px double currentColor;
  border-radius: 50%;
  opacity: 0.15;
  left: 30px;
  top: 45px;
}

.song-art span {
  font: 700 36px var(--font-mono);
  opacity: 0.9;
}

.wave {
  font-size: 22px;
  letter-spacing: 3px;
  white-space: nowrap;
}

.song-body {
  padding: 20px;
  flex: 1;
}

.song small {
  font-size: 11px;
  color: var(--song);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.song h3 {
  font-size: 20px;
  margin: 8px 0;
}

.song .btn {
  min-height: 44px;
  font-size: 13px;
}

.badge {
  color: #d5d0e4;
  background: #ffffff08;
  border: 1px solid var(--line);
}

.difficulty {
  margin-bottom: 12px;
}

.chip {
  min-height: 44px;
}

/* Collection cards and rarity artwork */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.collectible {
  --rarity: #9da5b5;
  border: 1px solid var(--rarity);
  border-radius: 16px;
  overflow: hidden;
  background: #181724;
  position: relative;
}

.collectible.rare {
  --rarity: #65a9ff;
}

.collectible.epic {
  --rarity: #b78aff;
}

.collectible.legendary {
  --rarity: #f6c467;
}

.collectible.legendary:after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #ffeda31a 45%, transparent 60%);
  background-size: 300% 100%;
  animation: foil 5s infinite;
}

.card-art {
  height: 130px;
  position: relative;
  background:
    radial-gradient(
      ellipse at center,
      color-mix(in srgb, var(--rarity) 25%, transparent),
      transparent 70%
    ),
    #10101d;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--rarity);
}

.card-art span {
  font-size: 100px;
  line-height: 1;
  transform: rotate(var(--angle));
  text-shadow: 0 0 30px currentColor;
}

.art-1 span {
  border: 2px solid;
  border-radius: 50%;
  font-size: 66px;
  width: 90px;
  text-align: center;
}

.art-2 span {
  filter: drop-shadow(12px 0 0 currentColor);
}

.art-3 span {
  border: 7px double;
  line-height: 0.7;
}

.art-4 span {
  transform: rotate(var(--angle)) scaleX(1.6);
}

.card-art i {
  position: absolute;
  right: 14px;
  bottom: 8px;
  font: 12px var(--font-mono);
  opacity: 0.6;
}

.card-copy {
  padding: 16px;
}

.card-copy small {
  color: var(--rarity);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-copy h3 {
  margin: 6px 0;
}

.card-copy p {
  font-size: 13px;
  color: var(--ink-2);
  min-height: 39px;
}

.card-copy .btn {
  width: 100%;
  font-size: 13px;
}

.missing .card-art {
  opacity: 0.4;
}

/* Equipped deck slots */
.deck-slots {
  display: flex;
  gap: 10px;
  margin: 24px 0 14px;
}

.deck-slots > div {
  flex: 1;
  border: 1px dashed #e535ab77;
  background: #e535ab08;
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
  font-size: 14px;
}

/* Live play: score, falling notes, and timing feedback */
.hud {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: var(--surface);
  border-radius: 16px;
  margin: 18px 0;
}

.hud div {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.hud small {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-2);
}

.hud strong {
  font: 700 24px var(--font-mono);
}

#lane {
  height: 480px;
  max-height: 60dvh;
  position: relative;
  overflow: hidden;
  border: 1px solid #36e8ec44;
  border-radius: 18px;
  background: linear-gradient(90deg, #1c153100, #1c1531, #1c153100), #0d0e1c;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}

.lane-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 59px, #ffffff06 60px),
    linear-gradient(
      90deg,
      transparent 24.9%,
      #ffffff0a 25%,
      transparent 25.1%,
      transparent 74.9%,
      #ffffff0a 75%,
      transparent 75.1%
    );
}

.hit-line {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 18%;
  height: 3px;
  background: #43eced;
  box-shadow:
    0 0 18px #43eced,
    0 0 50px #43eced55;
  text-align: center;
}

.hit-line span {
  display: block;
  margin-top: 22px;
  font: 11px var(--font-mono);
  letter-spacing: 4px;
  color: #b0a9c9;
}

.note {
  position: absolute;
  left: 25%;
  right: 25%;
  height: 14px;
  border: 1px solid #fface2;
  background: linear-gradient(90deg, #e535ab, #f887d0);
  border-radius: 8px;
  box-shadow: 0 0 20px #e535ab66;
}

#feedback {
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 25px;
  font-weight: 700;
  pointer-events: none;
  color: #aaa6bf;
}

#feedback.perfect {
  color: #43eced;
}

#feedback.great {
  color: #b58cfc;
}

#feedback.good {
  color: #fac56d;
}

#feedback.miss {
  color: #ef7e94;
}

#pause-overlay {
  position: absolute;
  inset: 0;
  background: #0c0b16dc;
  place-content: center;
  text-align: center;
  font-weight: 700;
}

#pause-overlay:not([hidden]) {
  display: grid;
}

/* Results and scoring breakdown */
.result-hero {
  text-align: center;
  padding: 24px;
}

.grade {
  font-size: 100px;
  line-height: 1.2;
  font-weight: 900;
  color: #43eced;
  text-shadow: 0 0 40px #43eced44;
}

.result-hero h1 small {
  font-size: 15px;
  color: var(--ink-2);
}

.split {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.actions {
  margin-top: 24px;
  justify-content: center;
}

/* Reward pack and reveal */
.pack-header {
  text-align: center;
  max-width: 650px;
  margin: 30px auto;
}

.sealed-pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 230px;
  height: 320px;
  margin: 30px auto;
  border: 2px solid #e535ab;
  border-radius: 20px;
  box-shadow: 0 0 90px #e535ab33;
  background: repeating-linear-gradient(135deg, #22192e 0 15px, #1b1528 15px 30px);
  color: #fff;
  cursor: pointer;
  transform: rotate(-4deg);
}

.sealed-pack span {
  color: #43eced;
  font-size: 65px;
  line-height: 1;
}

.sealed-pack strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: 3px;
}

.sealed-pack small {
  color: #efa3d5;
}

.reveal .collectible {
  animation: reveal 0.6s ease both;
}

.reveal .collectible:nth-child(2) {
  animation-delay: 0.15s;
}

.reveal .collectible:nth-child(3) {
  animation-delay: 0.3s;
}

/* Settings and shared spacing */
.card + .card {
  margin-top: 16px;
}

label select {
  min-width: 150px;
}

#cal-status {
  color: #43eced;
  margin-top: 15px;
}

/* Animation and reduced motion */
@keyframes foil {
  to {
    background-position: 150% 0;
  }

}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(30px) rotateY(90deg);
  }

  to {
    opacity: 1;
    transform: none;
  }

}

.reduce * {
  animation: none !important;
  transition: none !important;
}

/* Phone layout */
@media (max-width: 600px) {
  .app-header {
    padding-inline: 18px;
  }

  .hero {
    min-height: 0;
    padding: 0 0 20px;
  }

  .hero-disc {
    display: none;
  }

  .hero h1 {
    font-size: 2.7rem;
  }

  .hero p {
    font-size: 14px;
  }

  .song-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .song-body {
    padding: 16px;
  }

  .song-art {
    width: 28%;
  }

  .section-title {
    align-items: start;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .section-title > span {
    font-size: 11px;
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-copy {
    padding: 12px;
  }

  .card-copy h3 {
    font-size: 15px;
  }

  .card-copy .btn {
    font-size: 11px;
    padding-inline: 7px;
  }

  .card-art {
    height: 110px;
  }

  .deck-slots {
    gap: 6px;
  }

  .deck-slots > div {
    padding: 14px 5px;
    font-size: 11px;
  }

  .result-hero {
    padding: 15px 0;
  }

  .result-hero .eyebrow {
    font-size: 9px;
  }

  .pack-header h1 {
    font-size: 26px;
  }

  .play-heading h2 {
    font-size: 18px;
  }

  .hud strong {
    font-size: 20px;
  }

}


/* Now-playing preparation: cover on the left, controls on the right. */
.track-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.track-heading svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

.track-heading strong,
.track-heading small {
  display: block;
}

.track-heading small,
.track-best small {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-2);
}

.track-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}

.track-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid var(--song);
  box-shadow: 0 18px 70px color-mix(in srgb, var(--song) 15%, transparent);
}

.track-controls {
  min-width: 0;
}

.track-controls h1 {
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.segments {
  display: flex;
  padding: 4px;
  margin: 22px 0;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
}

.segments button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.segments button[aria-pressed='true'] {
  color: #11101d;
  background: var(--song);
  font-weight: 700;
}

.track-best {
  display: flex;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.track-best strong {
  display: block;
  font: 700 26px var(--font-mono);
  margin-top: 6px;
}

.track-controls .section-title h2 {
  font-size: 16px;
}

.mini-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mini-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  --rarity: #b58cfc;
}

.mini-card .card-art,
.empty-slot {
  height: 66px;
}

.mini-card .card-art span {
  font-size: 48px;
}

.mini-card > span {
  display: block;
  padding: 8px 5px;
  font-size: 11px;
  text-align: center;
}

.empty-slot {
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.round-play {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 22px auto 12px;
  border: 0;
  border-radius: 50%;
  background: var(--song);
  color: #11101d;
  cursor: pointer;
  box-shadow: 0 0 35px color-mix(in srgb, var(--song) 25%, transparent);
}

.round-play svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.track-hint {
  text-align: center;
}

.play-timeline {
  margin-top: 16px;
}

.play-timeline progress {
  display: block;
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
}

.play-timeline > div {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 12px var(--font-mono);
  color: var(--ink-2);
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 24px;
  }

  .track-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .track-cover {
    width: min(100%, 340px);
    margin-inline: auto;
  }

  .track-heading {
    margin-bottom: 18px;
  }
}

.tabbar svg.icon {
  width: 24px;
  height: 24px;
}
