/* ==========================================================================
   Cafe au Drop — Stylesheet
   Built on the CR Coffee Shop design system. Editorial, restrained, warm.
   ========================================================================== */

/* ---- Display face note --------------------------------------------------
   The CR wordmark uses Cafe Brewery (a personal-use display face). For v1
   we fall through to Playfair Display (the design system's documented
   substitute) so the build has no licensed-binary dependency. To upgrade:
   drop cafe-brewery.ttf + cafe-brewery-bold.ttf into /src/assets/fonts/
   and uncomment the @font-face blocks below.

   @font-face {
     font-family: 'Cafe Brewery';
     src: url('/src/assets/fonts/cafe-brewery.ttf') format('truetype');
     font-weight: 400; font-style: normal; font-display: swap;
   }
   @font-face {
     font-family: 'Cafe Brewery';
     src: url('/src/assets/fonts/cafe-brewery-bold.ttf') format('truetype');
     font-weight: 700; font-style: normal; font-display: swap;
   }
*/

:root {
  /* CR raw palette (Million Dollar Red is non-negotiable) */
  --cr-red:                #A52639;
  --cr-red-hover:          #8A1E2F;
  --cr-cream:              #FAF8F5;
  --cr-cream-dark:         #F0EDE8;
  --cr-parchment:          #EFE7D8;
  --cr-charcoal:           #2A2A2A;
  --cr-charcoal-light:     #555555;
  --cr-ink:                #171717;
  --cr-hairline:           rgba(42, 42, 42, 0.12);
  --cr-hairline-dark:      rgba(42, 42, 42, 0.25);

  /* Semantic */
  --bg:                    var(--cr-cream);
  --bg-panel:              var(--cr-cream-dark);
  --fg:                    var(--cr-charcoal);
  --fg-muted:              var(--cr-charcoal-light);
  --fg-strong:             var(--cr-ink);
  --accent:                var(--cr-red);

  /* Type */
  --font-display:          'Cafe Brewery', 'Playfair Display', Georgia, serif;
  --font-serif:            'Playfair Display', 'Hoefler Text', Georgia, serif;
  --font-sans:             'Inter', -apple-system, 'Helvetica Neue', system-ui, sans-serif;
  --font-mono:             'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Sizing — fluid */
  --text-xs:   clamp(0.6875rem, 0.6rem + 0.2vw,  0.75rem);
  --text-sm:   clamp(0.75rem,   0.7rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.25vw, 1.0625rem);
  --text-lg:   clamp(1.0625rem, 1rem + 0.3vw,    1.1875rem);
  --text-xl:   clamp(1.25rem,   1.1rem + 0.5vw,  1.5rem);
  --text-2xl:  clamp(1.5rem,    1.2rem + 1vw,    2rem);
  --text-3xl:  clamp(2rem,      1.5rem + 1.5vw,  2.75rem);
  --text-4xl:  clamp(2.5rem,    1.8rem + 2.5vw,  3.75rem);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Editorial: square corners */
  --radius-0:  0;
  --radius-sm: 2px;

  --transition-base: 200ms ease;
}

/* ---- Reset (light, app-only) ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; height: 100dvh; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img, svg { display: block; max-width: 100%; }
::selection { background: var(--cr-red); color: #fff; }

/* ---- App shell ------------------------------------------------------------- */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 1;
  transition: opacity var(--transition-base);
}
.screen.--leaving { opacity: 0; pointer-events: none; }

/* ---- Typography helpers --------------------------------------------------- */
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--fg-strong);
}
.h-headline {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg-strong);
  text-wrap: balance;
}
.t-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.t-body { font-family: var(--font-sans); color: var(--fg); }
.t-muted { color: var(--fg-muted); }
.t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Hairline divider (the signature CR move) ----------------------------- */
.divider {
  border: 0;
  border-top: 1px solid var(--cr-hairline);
  margin: var(--space-md) 0;
  width: 100%;
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--cr-charcoal);
  background: var(--cr-cream);
  color: var(--cr-charcoal);
  border-radius: var(--radius-0);
  transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
  min-height: 44px;
}
.btn:hover, .btn:focus-visible {
  background: var(--cr-charcoal);
  color: var(--cr-cream);
  outline: none;
}
.btn--primary {
  background: var(--cr-red);
  color: #fff;
  border-color: var(--cr-red);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--cr-red-hover);
  border-color: var(--cr-red-hover);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  border-color: var(--cr-hairline-dark);
  color: var(--fg-muted);
}
.btn--ghost:hover {
  background: transparent;
  color: var(--cr-red);
  border-color: var(--cr-red);
}

/* ==========================================================================
   HOME SCREEN
   ========================================================================== */
.home {
  padding: env(safe-area-inset-top, 0) var(--space-md) env(safe-area-inset-bottom, 0);
  overflow-y: auto;
  align-items: center;
}
.home__inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-lg) 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-lg);
  min-height: 100%;
}
.home__brand {
  text-align: center;
  padding-top: var(--space-md);
}
.home__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-sm);
  display: block;
}
.home__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--space-xs);
}
.home__title {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 3.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cr-red);
  margin: 0;
  line-height: 1;
}
.home__tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--fg-muted);
  margin: var(--space-xs) 0 0;
}

.home__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--cr-hairline);
  border: 1px solid var(--cr-hairline);
}
.home__stat {
  background: var(--cr-cream);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
}
.home__stat-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 0.25rem;
}
.home__stat-value {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--fg-strong);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.home__section-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 var(--space-sm);
  text-align: center;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.shop-card {
  display: block;
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--cr-hairline);
  background: var(--cr-cream);
  text-align: left;
  transition: border-color var(--transition-base);
  cursor: pointer;
}
.shop-card:hover, .shop-card:focus-visible {
  border-color: var(--cr-red);
  outline: none;
}
.shop-card:hover .shop-card__name,
.shop-card:focus-visible .shop-card__name {
  color: var(--cr-red);
}
.shop-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 0.25rem;
}
.shop-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--fg-strong);
  margin: 0 0 0.25rem;
  transition: color var(--transition-base);
}
.shop-card__meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin: 0;
}

.home__footer {
  text-align: center;
  margin-top: auto;
  padding-top: var(--space-md);
}
.home__footer-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--cr-hairline);
  padding-bottom: 2px;
  cursor: pointer;
}
.home__footer-link:hover { color: var(--cr-red); border-color: var(--cr-red); }

/* ==========================================================================
   HOW TO PLAY
   ========================================================================== */
.howto {
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}
.howto__inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.howto__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--fg-strong);
  margin: 0;
}
.howto__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}
.howto__step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
}
.howto__num {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--cr-red);
  width: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.howto__body p {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
}
.howto__ladder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--cr-hairline);
  border-bottom: 1px solid var(--cr-hairline);
}
.howto__ladder img { height: 32px; width: auto; }
.howto__ladder-arrow { color: var(--fg-muted); font-size: var(--text-sm); }

/* ==========================================================================
   GAME SCREEN
   ========================================================================== */
.game {
  display: flex;
  flex-direction: column;
  background: var(--cr-cream);
  position: relative;
  height: 100%;
}
.game__bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.18;
  filter: saturate(0.6);
  z-index: 0;
}
.game__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* HUD: top bar with score + beans + shop label + quit */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0) + var(--space-sm)) var(--space-md) var(--space-sm);
  gap: var(--space-sm);
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cr-hairline);
}
.hud__col { display: flex; flex-direction: column; line-height: 1.1; }
.hud__col--center { text-align: center; }
.hud__col--right { text-align: right; align-items: flex-end; }
.hud__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 2px;
}
.hud__value {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--fg-strong);
  font-variant-numeric: tabular-nums;
}
.hud__quit {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--cr-hairline-dark);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}
.hud__quit:hover { color: var(--cr-red); border-color: var(--cr-red); }

/* Playfield: holds the canvas */
.playfield {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.playfield__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Next-up indicator (floating top-left of canvas) */
.next-up {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 0.4rem 0.6rem;
  background: rgba(250, 248, 245, 0.85);
  border: 1px solid var(--cr-hairline);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.next-up__label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.next-up__img { width: 22px; height: 22px; }

/* Toast (CR voice lines after merges) */
.toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-sm) var(--space-md);
  background: rgba(23, 23, 23, 0.92);
  color: var(--cr-cream);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.toast.--show { opacity: 1; }

/* Power-up bar at the bottom — flex so it adapts if HUD button count changes. */
.powerbar {
  display: flex;
  gap: 1px;
  background: var(--cr-hairline);
  border-top: 1px solid var(--cr-hairline);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.powerbar__btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) 0.25rem;
  background: var(--cr-cream);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
  position: relative;
  min-height: 64px;
}
.powerbar__btn:hover:not(:disabled) { background: var(--cr-cream-dark); }
.powerbar__btn:disabled {
  color: rgba(42, 42, 42, 0.3);
  cursor: not-allowed;
}
.powerbar__icon {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--cr-red);
  margin-bottom: 2px;
  line-height: 1;
}
.powerbar__btn:disabled .powerbar__icon { color: rgba(165, 38, 57, 0.25); }
.powerbar__count {
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   END-OF-GAME SCREEN (modal overlay)
   ========================================================================== */
.endscreen {
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}
.endscreen.--show {
  opacity: 1;
  pointer-events: auto;
}
.endscreen__panel {
  width: 100%;
  max-width: 420px;
  background: var(--cr-cream);
  border: 1px solid var(--cr-charcoal);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.endscreen__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}
.endscreen__line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--cr-red);
  margin: 0;
}
.endscreen__score {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 14vw, 4.5rem);
  font-weight: 700;
  color: var(--fg-strong);
  line-height: 1;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.endscreen__pb {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cr-red);
  margin: -0.5rem 0 0;
}
.endscreen__rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.endscreen__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.625rem 0;
  border-top: 1px solid var(--cr-hairline);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.endscreen__row:last-child { border-bottom: 1px solid var(--cr-hairline); }
.endscreen__row-key { color: var(--fg-muted); font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.15em; text-transform: uppercase; }
.endscreen__row-val { color: var(--fg-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.endscreen__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* ==========================================================================
   Bayou Beast moment overlay
   ========================================================================== */
.beastflash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #C13344 0%, var(--cr-red) 55%, #6E1525 100%);
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-sm);
  box-shadow: inset 0 0 120px rgba(0,0,0,0.35);
}
.beastflash.--play {
  animation: beastflash 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.beastflash__title {
  transform: scale(0.5);
  opacity: 0;
}
.beastflash.--play .beastflash__title {
  animation: beastTitlePop 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.beastflash.--play .beastflash__sub {
  animation: beastSubFade 1.6s ease forwards;
}
@keyframes beastTitlePop {
  0%   { transform: scale(0.4) rotate(-6deg); opacity: 0; }
  18%  { transform: scale(1.18) rotate(2deg); opacity: 1; }
  40%  { transform: scale(1.0) rotate(0); opacity: 1; }
  75%  { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0; }
}
@keyframes beastSubFade {
  0%, 15%  { opacity: 0; }
  35%, 80% { opacity: 0.92; }
  100%     { opacity: 0; }
}
.beastflash__title {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--cr-cream);
  text-align: center;
  margin: 0;
  text-wrap: balance;
}
.beastflash__sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250, 248, 245, 0.8);
  margin: 0;
}
@keyframes beastflash {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  60%  { opacity: 0.92; }
  100% { opacity: 0; }
}

/* ---- Cascade flash (subtle red wash on cascade chains) ----------------- */
.cascade-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(165, 38, 57, 0.22), transparent 65%);
  pointer-events: none;
  opacity: 0;
  z-index: 4;
}
.cascade-flash.--play {
  animation: cascadeFlash 520ms ease;
}
@keyframes cascadeFlash {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ---- Drop button shimmer when used ------------------------------------- */
@keyframes powerUsed {
  0%   { background: var(--cr-cream); color: var(--fg); }
  20%  { background: var(--cr-red); color: #fff; }
  100% { background: var(--cr-cream); color: var(--fg); }
}
.powerbar__btn.--firing {
  animation: powerUsed 380ms ease;
}

/* ---- Mute button ------------------------------------------------------- */
.hud__mute {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--cr-hairline-dark);
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  margin-right: var(--space-xs);
}
.hud__mute:hover { color: var(--cr-red); border-color: var(--cr-red); }
.hud__mute.--muted { color: var(--cr-red); border-color: var(--cr-red); }

.hud__col--leftgroup {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---- Sound splash (first-tap audio unlock prompt) --------------------- */
.soundsplash {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.85);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 1;
  transition: opacity 280ms ease;
  cursor: pointer;
}
.soundsplash.--leaving { opacity: 0; pointer-events: none; }
.soundsplash__panel {
  background: var(--cr-cream);
  border: 1px solid var(--cr-charcoal);
  padding: var(--space-lg);
  text-align: center;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: splashIn 360ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes splashIn {
  0%   { opacity: 0; transform: scale(0.9) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.soundsplash__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0;
}
.soundsplash__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--cr-red);
  margin: 0;
  line-height: 1;
}
.soundsplash__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--fg-muted);
  margin: 0;
}
.soundsplash__btn { margin-top: var(--space-sm); }

/* ---- Chain badge (visible cascade indicator) -------------------------- */
.chain-badge {
  position: absolute;
  top: 64px;
  right: 12px;
  padding: 0.5rem 0.75rem;
  background: var(--cr-red);
  color: #fff;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: var(--text-xl);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5) rotate(-6deg);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 5;
  box-shadow: 0 4px 18px rgba(165, 38, 57, 0.4);
  letter-spacing: -0.02em;
}
.chain-badge.--show {
  opacity: 1;
  transform: scale(1) rotate(-4deg);
}
.chain-badge__count {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-style: normal;
  display: block;
  line-height: 1;
}
.chain-badge__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* ---- Score pulse on points awarded ------------------------------------ */
@keyframes scorePulse {
  0%   { transform: scale(1); color: var(--fg-strong); }
  40%  { transform: scale(1.18); color: var(--cr-red); }
  100% { transform: scale(1); color: var(--fg-strong); }
}
.hud__value.--pulse { animation: scorePulse 240ms ease; display: inline-block; }

/* ==========================================================================
   Danger line indicator (subtle red glow)
   ========================================================================== */
.danger-indicator {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--cr-red), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 2;
}
.danger-indicator.--warn { opacity: 0.55; animation: dangerpulse 900ms ease-in-out infinite; }
@keyframes dangerpulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* ==========================================================================
   Loading screen (initial)
   ========================================================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--cr-cream);
}
.loading__label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ==========================================================================
   Responsive — landscape compress
   ========================================================================== */
@media (orientation: landscape) and (max-height: 520px) {
  .hud { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
  .hud__value { font-size: var(--text-lg); }
  .powerbar__btn { min-height: 52px; padding: 0.4rem 0.25rem; }
}
