
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&display=swap');

/* ============================================
   LITTLE RHYTHM SHOW
   PINK EDITION — V8
   MOBILE FIRST
============================================ */

:root {
  --pink: #F19AB7;
  --pink-soft: #FBE2EB;
  --pink-pale: #FFF0F5;
  --pink-hot: #E55A97;
  --pink-deep: #C9467E;

  --cream: #F7F2E8;
  --paper: #FFFAF5;

  --ink: #252325;
  --red: #C8535F;
  --muted: #866C77;
  --line: #E8C8D3;

  --main-font: 'DM Sans', Arial, sans-serif;
  --display-font: 'Playfair Display', Georgia, serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   RESET
============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;

  background: var(--pink);

  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  width: 100%;
  height: 100%;
  height: 100dvh;

  overflow: hidden;

  background: var(--cream);
  color: var(--ink);

  font-family: var(--main-font);

  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;

  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

button:focus-visible,
input:focus-visible + span {
  outline: 3px solid var(--pink-deep);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* ============================================
   APP
============================================ */

.app {
  position: relative;

  display: flex;
  flex-direction: column;

  width: 100%;
  max-width: 540px;

  height: 100%;
  height: 100dvh;

  margin: 0 auto;

  overflow: hidden;
  isolation: isolate;

  background: var(--cream);
}

@media (min-width: 541px) {
  body {
    background:
      linear-gradient(
        135deg,
        #F8CEDD,
        #EDD1DF 55%,
        #F7E9EC
      );
  }

  .app {
    box-shadow:
      0 0 0 1px rgba(37,35,37,.08),
      0 0 80px rgba(143,43,91,.16);
  }
}

/* ============================================
   HEADER
============================================ */

.masthead {
  position: relative;
  z-index: 5;

  flex: 0 0 auto;

  padding:
    calc(var(--safe-top) + 7px)
    14px
    9px;

  background: var(--pink);

  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 10px;

  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.eyebrow-symbol {
  color: var(--pink-deep);
  font-size: 18px;
  line-height: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;
  margin-top: 4px;
}

.hero-copy {
  min-width: 0;
}

.hero-title {
  font-family: var(--display-font);

  font-size: clamp(29px, 8.5vw, 41px);
  font-weight: 700;
  font-style: italic;

  letter-spacing: -2px;
  line-height: 1.05;
}

.hero-title span {
  color: var(--pink-deep);
}

.artist {
  margin-top: 5px;

  font-size: 8px;
  font-weight: 900;

  letter-spacing: 1px;
  line-height: 1.4;
}

.artist-divider {
  color: var(--pink-deep);
  margin: 0 3px;
}

/* ============================================
   PAUSE BUTTON
============================================ */

.icon-button {
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  width: 40px;
  height: 40px;

  border: 2px solid var(--ink);
  border-radius: 50%;

  background: var(--paper);
  color: var(--ink);

  font-size: 19px;
  font-weight: 900;

  box-shadow: 2px 2px 0 var(--ink);

  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

.icon-button:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: none;
  background: var(--pink-soft);
}

.icon-button:disabled {
  opacity: .42;
  box-shadow: none;
}

/* ============================================
   SCORE / COMBO
============================================ */

.hud {
  position: relative;
  z-index: 5;

  flex: 0 0 auto;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  min-height: 54px;
  gap: 8px;

  padding: 7px 14px;

  background: var(--ink);
  color: var(--paper);
}

.hud-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.8px;
  color: var(--pink);
}

.hud-value {
  font-size: clamp(19px, 5.7vw, 26px);
  font-weight: 900;

  letter-spacing: -.6px;
  line-height: 1.1;

  font-variant-numeric: tabular-nums;
}

.hud-combo {
  align-items: flex-end;
  text-align: right;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hud-symbol {
  color: var(--pink);
  font-size: 18px;
  line-height: 1;
}

.health {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.heart {
  color: var(--pink);
  font-size: 12px;

  transition:
    opacity .2s ease,
    transform .2s ease;
}

.heart.lost {
  opacity: .18;
  transform: scale(.7);
}

/* ============================================
   GAMEPLAY AREA
============================================ */

.stage {
  position: relative;

  flex: 1 1 0;
  min-height: 0;
  width: 100%;

  overflow: hidden;
  isolation: isolate;

  background: var(--cream);

  touch-action: none;
  -ms-touch-action: none;

  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;

  overscroll-behavior: contain;
}

.game-canvas {
  position: absolute;
  inset: 0;

  z-index: 1;

  display: block;
  width: 100%;
  height: 100%;

  pointer-events: none;
  touch-action: none;
}

/* ============================================
   MULTITOUCH LAYER
============================================ */

.touch-layer {
  position: absolute;
  inset: 0;

  z-index: 2;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  width: 100%;
  height: 100%;

  touch-action: none !important;
  -ms-touch-action: none;

  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-lane {
  width: 100%;
  height: 100%;
  min-width: 0;

  background: transparent;

  touch-action: none !important;

  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   HIT JUDGEMENTS
============================================ */

.judgement {
  position: absolute;
  z-index: 4;

  left: 50%;
  top: 65%;

  transform: translate(-50%, -50%);

  pointer-events: none;

  color: var(--pink-deep);

  font-family: var(--display-font);
  font-size: clamp(29px, 8.5vw, 43px);
  font-weight: 700;
  font-style: italic;

  white-space: nowrap;
  text-align: center;

  opacity: 0;

  text-shadow:
    2px 2px 0 var(--paper),
    -2px -2px 0 var(--paper),
    0 4px 13px rgba(37,35,37,.18);
}

.judgement.perfect {
  color: var(--pink-deep);
}

.judgement.good {
  color: var(--pink-hot);
}

.judgement.miss {
  color: var(--ink);
}

.judgement.show {
  animation: judgement-pop .46s cubic-bezier(.2,.8,.2,1) both;
}

/* ============================================
   COMBO CELEBRATIONS
============================================ */

.combo-effect {
  position: absolute;
  z-index: 4;

  top: 29%;
  left: 50%;

  width: min(92%, 330px);

  transform: translate(-50%, -50%);

  text-align: center;
  pointer-events: none;

  color: var(--pink-deep);

  font-family: var(--display-font);
  font-size: clamp(25px, 7.5vw, 40px);
  font-weight: 700;
  font-style: italic;

  line-height: 1.12;

  text-shadow:
    2px 2px var(--paper),
    0 4px 13px rgba(201,70,126,.2);

  opacity: 0;
}

.combo-effect.show {
  animation: combo-pop .85s cubic-bezier(.2,.85,.2,1) both;
}

/* ============================================
   OVERLAY
============================================ */

.overlay {
  position: absolute;
  inset: 0;

  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 15px;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(255,255,255,.95),
      transparent 65%
    ),
    rgba(255,232,241,.97);

  text-align: center;
  overscroll-behavior: contain;

  transition:
    opacity .28s ease,
    visibility .28s ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-inner {
  position: relative;

  width: 100%;
  max-width: 365px;

  margin: auto;

  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 23px 19px;

  background: var(--paper);

  border: 2px solid var(--ink);
  border-radius: 4px;

  box-shadow:
    6px 6px 0 var(--pink),
    9px 9px 0 rgba(201,70,126,.15);
}

.overlay-inner::before,
.overlay-inner::after {
  content: "✳";
  position: absolute;

  color: var(--pink-deep);
  font-size: 20px;
}

.overlay-inner::before {
  top: 10px;
  left: 13px;
}

.overlay-inner::after {
  bottom: 10px;
  right: 13px;
}

.ornament {
  margin-bottom: 13px;

  color: var(--pink-deep);
  font-size: 20px;
  letter-spacing: 7px;
}

.overline {
  color: var(--pink-deep);

  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.9px;
  line-height: 1.5;
}

.overlay-title {
  margin: 14px 0 12px;

  font-family: var(--display-font);
  font-size: clamp(35px, 10.4vw, 52px);
  font-weight: 700;

  line-height: 1.07;
  letter-spacing: -1.7px;

  overflow-wrap: anywhere;
}

.overlay-title em {
  color: var(--pink-deep);
  font-weight: 600;
}

.overlay-copy {
  max-width: 290px;

  margin-bottom: 18px;

  color: #6E5963;

  font-size: 12px;
  line-height: 1.65;
}

/* ============================================
   SONG SELECTION
============================================ */

.song-selector {
  width: 100%;
  min-width: 0;

  margin: 0 0 20px;
  padding: 0;

  border: 0;
}

.song-selector-title {
  display: block;
  width: 100%;

  padding: 0 0 10px;

  color: var(--ink);

  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.7px;
  text-align: center;
}

.song-options {
  display: flex;
  flex-direction: column;
  gap: 8px;

  width: 100%;
}

.song-option {
  position: relative;

  display: flex;
  align-items: center;

  width: 100%;
  min-height: 62px;

  padding: 10px 13px;

  background: var(--pink-pale);

  border: 1.5px solid var(--line);
  border-radius: 3px;

  text-align: left;
  cursor: pointer;

  transition:
    background .18s ease,
    border-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.song-option input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;
}

.song-option:has(input:checked) {
  background: var(--pink-soft);

  border-color: var(--ink);

  box-shadow: 3px 3px 0 var(--ink);
}

.song-option:active {
  transform: scale(.985);
}

.song-option-content {
  display: flex;
  flex-direction: column;
  gap: 5px;

  flex: 1;
  min-width: 0;
}

.song-option-content strong {
  color: var(--ink);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1.3;
}

.song-option-content small {
  color: var(--muted);

  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.song-check {
  display: grid;
  place-items: center;

  flex: 0 0 auto;

  width: 28px;
  height: 28px;

  margin-left: 10px;

  border: 1.5px solid var(--line);
  border-radius: 50%;

  color: var(--muted);
  background: var(--paper);

  font-size: 17px;

  transition:
    background .18s ease,
    color .18s ease,
    transform .18s ease;
}

.song-option:has(input:checked) .song-check {
  background: var(--pink-deep);
  color: white;

  border-color: var(--ink);

  transform: scale(1.05);
}

.song-option input:focus-visible ~ .song-check {
  outline: 3px solid var(--pink-deep);
  outline-offset: 3px;
}

/* ============================================
   HIDDEN LEGACY DIFFICULTY
============================================ */

.difficulty-selector {
  display: none !important;
}

/* ============================================
   PLAY BUTTON
============================================ */

.play {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  width: min(100%, 265px);
  min-height: 58px;

  padding: 0 19px;

  border: 2px solid var(--ink);
  border-radius: 3px;

  background: var(--pink);
  color: var(--ink);

  font-size: 13px;
  font-weight: 900;

  letter-spacing: 1.7px;

  box-shadow: 5px 5px 0 var(--ink);

  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.play:active {
  transform: translate(5px, 5px);
  box-shadow: none;
  background: var(--pink-hot);
}

.play:disabled {
  opacity: .55;
  cursor: wait;
}

.play-arrow {
  font-size: 25px;
  font-weight: 500;
}

.secondary-action {
  margin-top: 17px;
  padding: 9px 12px;

  background: transparent;
  color: var(--pink-deep);

  border: 0;
  border-bottom: 1px solid var(--pink-deep);

  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.overlay-hint {
  margin-top: 19px;

  color: var(--muted);

  font-size: 9px;
  font-weight: 800;
  letter-spacing: .7px;
  line-height: 1.6;
}

/* ============================================
   FOOTER
============================================ */

.footer {
  position: relative;
  z-index: 5;

  flex: 0 0 auto;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 10px;

  min-height: 48px;

  padding: 6px 13px;

  background: var(--pink);

  border-top: 2px solid var(--ink);
}

.playing {
  display: flex;
  align-items: center;
  gap: 9px;

  min-width: 0;
}

.playing-dot {
  flex: 0 0 auto;

  width: 10px;
  height: 10px;

  border-radius: 50%;
  border: 1px solid var(--ink);

  background: var(--pink-deep);
}

.playing-dot.active {
  animation: playing-pulse 1.35s ease-in-out infinite;
}

.track-info {
  display: flex;
  flex-direction: column;

  gap: 3px;
  min-width: 0;
}

.track-name {
  display: block;

  max-width: 220px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 10px;
  font-weight: 900;
  letter-spacing: .7px;
}

.track-artist {
  color: #634850;

  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.clock {
  flex: 0 0 auto;

  font-size: 10px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   PROGRESS BAR
============================================ */

.timeline {
  position: relative;
  z-index: 5;

  flex: 0 0 auto;

  width: 100%;
  height: 6px;

  margin-bottom: var(--safe-bottom);

  background: #F6CEDB;
  overflow: hidden;
}

.progress {
  width: 0%;
  height: 100%;

  background:
    linear-gradient(
      90deg,
      var(--pink-hot),
      var(--pink-deep)
    );

  transition: width .08s linear;
}

/* ============================================
   VICTORY CONFETTI
============================================ */

.confetti {
  position: absolute;
  inset: 0;

  z-index: 20;

  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -45px;

  display: block;

  width: 11px;
  height: 15px;

  opacity: 0;

  background: var(--pink-hot);
  border-radius: 2px;

  animation:
    confetti-fall var(--duration, 3s)
    linear var(--delay, 0s) forwards;
}

.confetti-piece.heart-piece {
  width: auto;
  height: auto;

  background: transparent;
  color: var(--pink-deep);

  font-size: 20px;
  font-weight: 800;
}

.confetti-piece.star-piece {
  width: auto;
  height: auto;

  background: transparent;
  color: var(--red);

  font-size: 17px;
}

/* ============================================
   ANIMATIONS
============================================ */

@keyframes judgement-pop {
  0% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      scale(.55);
  }

  22% {
    opacity: 1;
    transform:
      translate(-50%, -50%)
      scale(1.15);
  }

  55% {
    opacity: 1;
    transform:
      translate(-50%, -50%)
      scale(1);
  }

  100% {
    opacity: 0;
    transform:
      translate(-50%, -75%)
      scale(.94);
  }
}

@keyframes combo-pop {
  0% {
    opacity: 0;
    transform:
      translate(-50%, -30%)
      scale(.6)
      rotate(-5deg);
  }

  25% {
    opacity: 1;
    transform:
      translate(-50%, -50%)
      scale(1.12)
      rotate(2deg);
  }

  55% {
    opacity: 1;
    transform:
      translate(-50%, -50%)
      scale(1);
  }

  100% {
    opacity: 0;
    transform:
      translate(-50%, -95%)
      scale(.9);
  }
}

@keyframes playing-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .55;
    transform: scale(.7);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform:
      translate3d(0, -20px, 0)
      rotate(0deg);
  }

  8% {
    opacity: 1;
  }

  85% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate3d(
        var(--drift, 40px),
        110dvh,
        0
      )
      rotate(var(--rotation, 540deg));
  }
}

/* ============================================
   SMALL PHONES
============================================ */

@media (max-width: 380px) {
  .masthead {
    padding:
      calc(var(--safe-top) + 5px)
      11px
      7px;
  }

  .hero-title {
    font-size: 30px;
  }

  .artist {
    font-size: 7px;
  }

  .hud {
    min-height: 48px;
    padding: 5px 11px;
  }

  .hud-value {
    font-size: 19px;
  }

  .footer {
    min-height: 43px;
    padding: 5px 10px;
  }

  .track-name {
    max-width: 175px;
  }

  .overlay {
    padding: 12px;
  }

  .overlay-inner {
    padding: 17px 14px;
  }

  .overlay-title {
    font-size: 37px;
  }

  .song-option {
    min-height: 55px;
  }
}

/* ============================================
   SHORT SCREENS
============================================ */

@media (max-height: 730px) {
  .masthead {
    padding-top: calc(var(--safe-top) + 5px);
    padding-bottom: 6px;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 35px);
  }

  .hud {
    min-height: 45px;
  }

  .hud-symbol {
    font-size: 14px;
  }

  .footer {
    min-height: 40px;
  }

  .overlay-inner {
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .ornament {
    margin-bottom: 7px;
  }

  .overlay-title {
    margin: 8px 0;
    font-size: clamp(32px, 9vw, 43px);
  }

  .overlay-copy {
    margin-bottom: 11px;
    line-height: 1.45;
  }

  .song-selector {
    margin-bottom: 12px;
  }

  .song-selector-title {
    padding-bottom: 6px;
  }

  .song-option {
    min-height: 48px;
    padding: 7px 10px;
  }

  .song-options {
    gap: 6px;
  }

  .play {
    min-height: 48px;
  }

  .overlay-hint {
    margin-top: 10px;
  }
}

/* ============================================
   VERY SHORT PHONES
============================================ */

@media (max-height: 590px) {
  .eyebrow,
  .ornament,
  .overlay-hint {
    display: none;
  }

  .hero {
    margin-top: 0;
  }

  .hud {
    min-height: 39px;
  }

  .overlay-title {
    font-size: 32px;
    margin: 5px 0;
  }

  .overlay-copy {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .song-option {
    min-height: 42px;
  }

  .song-option-content strong {
    font-size: 10px;
  }

  .play {
    min-height: 42px;
  }
}

/* ============================================
   LANDSCAPE FALLBACK
============================================ */

@media (orientation: landscape) and (max-height: 500px) {
  .masthead {
    padding: 4px 12px;
  }

  .eyebrow,
  .artist {
    display: none;
  }

  .hero {
    margin: 0;
  }

  .hero-title {
    font-size: 24px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .hud {
    min-height: 33px;
    padding: 3px 12px;
  }

  .hud-value {
    font-size: 16px;
  }

  .hud-label {
    font-size: 7px;
  }

  .hud-symbol {
    display: none;
  }

  .footer {
    min-height: 32px;
    padding: 4px 12px;
  }

  .overlay {
    padding: 7px;
  }

  .overlay-inner {
    max-width: 450px;
    padding: 8px 14px;
  }

  .ornament,
  .overlay-hint {
    display: none;
  }

  .overlay-title {
    font-size: 27px;
    margin: 3px 0;
  }

  .overlay-copy {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .song-selector {
    margin-bottom: 7px;
  }

  .song-option {
    min-height: 35px;
    padding: 4px 8px;
  }

  .song-options {
    gap: 4px;
  }

  .play {
    min-height: 35px;
  }
}

/* ============================================
   REDUCED MOTION
============================================ */

@media (prefers-reduced-motion: reduce) {
  .judgement.show,
  .combo-effect.show,
  .playing-dot.active,
  .confetti-piece {
    animation: none;
  }

  .icon-button,
  .play,
  .song-option,
  .song-check,
  .overlay,
  .progress {
    transition: none;
  }
}
 