/* Lion Dance Beats — game styles */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&display=swap');

:root {
  --gold: #e3b94e;
  --gold-deep: #b8862a;
  --gold-bright: #f4d98a;
  --cream: #f6ead0;
  --ink: #3a2a14;
  --purple: #4a1d8a;
  --purple-deep: #2a1255;
  --magenta: #d61f9e;
  --teal: #7fd0d8;
  --orange: #e8642a;
  --red: #d23a3a;
  --font: "Baloo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0a0410;
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
  position: fixed;
  width: 100%;
  top: 0; left: 0;
}

/* ── Scaling stage ───────────────────────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  background: #0a0410;
  overflow: hidden;
}
#game {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 720px;
  height: 1280px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 80px rgba(74,29,138,0.5);
}

/* ── Screen base ─────────────────────────────────────────── */
.gscreen {
  position: absolute;
  inset: 0;
  background-color: #2a1255;
  background-image: url('assets/gameplay_racemodedrum_background.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.gscreen.fade-enter { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Image button helper */
.imgbtn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: block;
  transition: transform 0.12s ease, filter 0.12s ease;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
}
.imgbtn:hover { transform: scale(1.05); filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45)) brightness(1.05); }
.imgbtn:active { transform: scale(0.95); }
.imgbtn img { display: block; width: 100%; height: 100%; pointer-events: none; }

/* Pulsing play button */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.pulse { animation: pulse 1.4s ease-in-out infinite; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.floaty { animation: floaty 3s ease-in-out infinite; }

/* HUD chip */
.hud-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(42, 18, 85, 0.7);
  border: 2px solid var(--gold);
  border-radius: 100px;
  padding: 4px 16px 4px 6px;
  color: var(--cream);
  font-weight: 700;
  font-size: 26px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.hud-chip img { width: 38px; height: 38px; object-fit: contain; }

/* Generic text */
.title-shadow { text-shadow: 0 3px 0 rgba(0,0,0,0.25), 0 6px 12px rgba(0,0,0,0.3); }

/* Readable title banner — solid backing for headings over busy art */
.title-banner {
  display: inline-block;
  background: linear-gradient(180deg, rgba(42,18,85,0.92), rgba(20,8,40,0.92));
  border: 3px solid var(--gold);
  border-radius: 100px;
  padding: 8px 28px;
  color: var(--cream);
  box-shadow: 0 5px 16px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.title-banner .sub {
  color: var(--gold-bright);
  font-weight: 700;
}

/* Modal backdrop */
.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 20, 0.66);
  display: grid;
  place-items: center;
  z-index: 50;
}
@keyframes popIn {
  0% { transform: scale(0.85); }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.pop { animation: popIn 0.3s cubic-bezier(.18,.89,.32,1.28); }

/* Falling note */
.note {
  position: absolute;
  will-change: transform, opacity;
  pointer-events: none;
  transform-origin: center center;
}
.note img { display: block; width: 100%; height: 100%; }

/* Impact flash */
@keyframes hitflash {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}
.hitflash { animation: hitflash 0.35s ease-out forwards; }

@keyframes risefade {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1.3); }
}
.judge {
  position: absolute;
  font-weight: 800;
  font-size: 40px;
  pointer-events: none;
  animation: risefade 0.6s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Tap zones */
.tapzone {
  position: absolute;
  bottom: 0;
  height: 540px;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Lane guide glow when pressed */
@keyframes lanepulse {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* Rotate hint — ask players to use PORTRAIT on landscape phones */
#rotate-hint {
  position: fixed;
  inset: 0;
  background: #1a0b33;
  color: var(--cream);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
  text-align: center;
  font-family: var(--font);
  padding: 40px;
}
#rotate-hint .ico { font-size: 70px; animation: rothint 2s ease-in-out infinite; }
@keyframes rothint { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-90deg); } }
@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) {
  #rotate-hint { display: flex; }
}

/* combo bounce */
@keyframes comboPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.combo-pop { animation: comboPop 0.3s ease; }

/* ── Portrait drum (CSS, bottom of gameplay) ─────────────── */
.pdrum {
  position: absolute;
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background:
    linear-gradient(90deg, #6aa0d8 0 50%, #f0c84a 50% 100%);
  border: 14px solid #c23a52;
  box-shadow:
    inset 0 8px 24px rgba(255,255,255,0.25),
    inset 0 -18px 40px rgba(0,0,0,0.35),
    0 12px 30px rgba(0,0,0,0.5);
  overflow: hidden;
}
.pdrum::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 18%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
}
.pdrum-rim {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f4d98a, #b8862a 70%, #8a5a1e);
  box-shadow: 0 3px 6px rgba(0,0,0,0.5);
}
