* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

:root {
  --pink:        #FFB6D9;
  --pink-light:  #FFD6E8;
  --pink-bold:   #FF4FA3;
  --blue:        #A8D8FF;
  --blue-light:  #C9E8FF;
  --purple:      #E8C8FF;
  --purple-bold: #B87CE8;
  --green:       #C8F0CC;
  --yellow:      #FFF0B0;
  --text:        #6b4c6b;
  --text-light:  #a07090;
  --radius:      20px;
  --font-body:   'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display:'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --content-max:  640px;
  --hud-height:   64px;
}

html {
  -webkit-text-size-adjust: 100%;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 42%),
    linear-gradient(180deg, var(--blue-light) 0%, var(--pink-light) 65%, var(--yellow) 100%);
  color: var(--text);
}

/* ── Bubble outline heading style ─────────────────────────────── */
.bubble-text {
  -webkit-text-stroke: 0.11em #fff;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(107,76,107,.14);
}

body {
  line-height: 1.4;
}

h1, h2, .btn, .score-display, .screen-header h2, .modal-card {
  font-family: var(--font-display);
}

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: clamp(16px, 3vw, 28px);
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}
.screen-scroll {
  justify-content: flex-start;
  overflow-y: auto;
  padding: 0;
}

/* ── Menu ───────────────────────────────────────────────────── */
#screen-menu {
  position: relative;
  overflow: hidden;
}

.menu-logo   { font-size: clamp(68px, 14vw, 88px); margin-bottom: 10px; }
.title       { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; color: var(--pink-bold); }
.subtitle    { font-size: clamp(1rem, 2.5vw, 1.15rem); color: var(--text-light); margin-bottom: 12px; }
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}
.menu-footer {
  margin-top: 28px;
  color: var(--text-light);
  font-size: 0.75rem;
  font-style: italic;
  letter-spacing: 0.3px;
  opacity: 0.7;
}

/* Menu stats */
.menu-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.menu-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.7);
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  backdrop-filter: blur(4px);
}
.menu-stat-icon {
  font-size: 1rem;
}

/* Menu floating balloons */
.menu-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.menu-balloon {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0.3;
  animation: menuFloat 5.6s ease-in-out infinite alternate;
}
.menu-balloon-1 {
  width: 60px; height: 75px;
  background: var(--pink);
  top: 12%; left: 8%;
  animation-delay: 0s;
}
.menu-balloon-2 {
  width: 45px; height: 56px;
  background: var(--blue);
  top: 18%; right: 10%;
  animation-delay: -1.8s;
  animation-duration: 6.4s;
}
.menu-balloon-3 {
  width: 52px; height: 65px;
  background: var(--purple);
  bottom: 14%; left: 15%;
  animation-delay: -2.4s;
  animation-duration: 5.9s;
}
.menu-balloon-4 {
  width: 40px; height: 50px;
  background: var(--green);
  top: 34%; left: 4%;
  animation-delay: -1.2s;
  animation-duration: 5.2s;
}
.menu-balloon-5 {
  width: 56px; height: 70px;
  background: var(--yellow);
  bottom: 10%; right: 8%;
  animation-delay: -3.4s;
  animation-duration: 6.1s;
}
.menu-balloon-6 {
  width: 34px; height: 44px;
  background: var(--pink-light);
  top: 56%; right: 20%;
  animation-delay: -0.9s;
  animation-duration: 4.8s;
}
.menu-balloon-7 {
  width: 48px; height: 60px;
  background: var(--blue-light);
  top: 8%; left: 42%;
  animation-delay: -2.8s;
  animation-duration: 5.4s;
}
@keyframes menuFloat {
  0%   { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-26px) rotate(5deg); }
}

/* Settings cog */
.btn-settings-cog {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  background: rgba(255,255,255,.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: transform 0.2s, background 0.2s;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.btn-settings-cog:active {
  transform: scale(0.9) rotate(30deg);
  background: rgba(255,255,255,.85);
}
.btn-settings-cog:focus-visible {
  outline: 3px solid rgba(255,182,217,.85);
  outline-offset: 2px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  min-height: 48px;
  padding: 14px 28px;
  border: none;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  line-height: 1;
}
.btn:active { transform: scale(0.93); }

.btn-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 72px;
  padding: 14px 26px;
  text-align: left;
  line-height: 1.2;
}
.btn-mode-title {
  font-size: 1.05rem;
  font-weight: 800;
}
.btn-mode-desc {
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.9;
}
.btn:focus-visible,
.btn-back:focus-visible,
.setting-row select:focus-visible {
  outline: 3px solid rgba(255,182,217,.85);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), #d98ec8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,182,217,.45);
}
.btn-secondary {
  background: linear-gradient(135deg, var(--purple), #c8a0e8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232,200,255,.45);
}
.btn-ghost {
  background: rgba(255,255,255,.65);
  color: var(--text);
  border: 2px solid rgba(255,182,217,.35);
}
.btn-lives {
  background: linear-gradient(135deg, #FF8FAB, #e0365e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(224,54,94,.35);
}
.btn-back {
  background: rgba(255,255,255,.75);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Game HUD ───────────────────────────────────────────────── */
.game-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  min-height: var(--hud-height);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.5);
  z-index: 20;
}
.score-display {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: 1;
  justify-content: center;
}
#score       { font-size: clamp(1.75rem, 5vw, 2.2rem); font-weight: 800; }
.score-label { font-size: 0.85rem; color: var(--text-light); }
.hud-mode    { font-size: 0.78rem; color: var(--text-light); font-weight: 600; white-space: nowrap; }
.hud-right   { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.lives-display {
  display: flex;
  gap: 1px;
  font-size: 1rem;
  line-height: 1;
}
.lives-display.hidden { display: none; }
.heart-lost { filter: grayscale(1) opacity(0.35); }

@keyframes missFlash {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.miss-flash {
  position: fixed;
  inset: 0;
  background: rgba(220, 38, 70, 0.22);
  pointer-events: none;
  z-index: 99;
  animation: missFlash 0.42s ease-out forwards;
}

.combo-display {
  position: fixed;
  top: calc(var(--hud-height) + 6px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.88);
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.combo-display.active { opacity: 1; }

/* ── Game Area ──────────────────────────────────────────────── */
#game-area {
  position: fixed;
  inset: 0;
  top: calc(var(--hud-height) + env(safe-area-inset-top));
  overflow: hidden;
}
#game-area.paused .balloon {
  animation-play-state: paused;
  pointer-events: none;
}

/* ── Balloons ───────────────────────────────────────────────── */
.balloon {
  position: absolute;
  bottom: -120px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  cursor: pointer;
  animation: floatUp linear forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset -10px -8px 0 rgba(0,0,0,.1),
    0 6px 16px rgba(0,0,0,.14);
}
.balloon:active { transform: scale(0.88) !important; }
.balloon::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 14%;
  width: 42%;
  height: 32%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 72%);
  border-radius: 50%;
  pointer-events: none;
}

.balloon.blind-box {
  animation-name: floatUpGlitter;
  box-shadow:
    0 0 18px rgba(255,182,217,.7),
    inset -8px -5px 0 rgba(0,0,0,.06);
}

.balloon-icon   { font-size: 1.8rem; pointer-events: none; }
.balloon-string {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 18px;
  background: rgba(0,0,0,.2);
  border-radius: 1px;
}

@keyframes floatUp {
  0%   { bottom: -120px; transform: translateX(0)                 rotate(0deg);  }
  20%  {                  transform: translateX(var(--wobble, 12px))  rotate(5deg);  }
  40%  {                  transform: translateX(calc(var(--wobble, 12px) * -0.6))  rotate(-3deg); }
  60%  {                  transform: translateX(var(--wobble, 12px))  rotate(4deg);  }
  80%  {                  transform: translateX(calc(var(--wobble, 12px) * -0.8)) rotate(-5deg); }
  100% { bottom: 110%;   transform: translateX(0)                 rotate(0deg);  }
}
@keyframes floatUpGlitter {
  0%   { bottom: -120px; filter: brightness(1)   drop-shadow(0 0 6px rgba(255,182,217,.5)); }
  25%  {                  filter: brightness(1.2) drop-shadow(0 0 12px rgba(200,240,204,.6)); }
  50%  {                  filter: brightness(1.35) drop-shadow(0 0 16px rgba(232,200,255,.7)); }
  75%  {                  filter: brightness(1.15) drop-shadow(0 0 10px rgba(255,240,176,.6)); }
  100% { bottom: 110%;   filter: brightness(1)   drop-shadow(0 0 6px rgba(255,182,217,.5)); }
}

/* ── Particles ──────────────────────────────────────────────── */
.particle {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  animation: burst 0.6s ease-out forwards;
  z-index: 100;
  transform: translate(-50%, -50%);
}
.particle-star {
  border-radius: 2px;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.particle-heart {
  border-radius: 0;
  clip-path: polygon(50% 85%, 15% 55%, 0% 35%, 0% 18%, 10% 5%, 25% 0%, 40% 5%, 50% 18%, 60% 5%, 75% 0%, 90% 5%, 100% 18%, 100% 35%, 85% 55%);
}
@keyframes burst {
  0%   { transform: translate(-50%,-50%) translate(0,0) scale(1) rotate(0deg);  opacity: 1; }
  50%  { opacity: 0.8; }
  100% { transform: translate(-50%,-50%) translate(var(--dx), var(--dy)) scale(0.3) rotate(180deg); opacity: 0; }
}

/* ── Screen Shake ──────────────────────────────────────────── */
#game-area.shake {
  animation: shakeIt 0.2s ease-out;
}
@keyframes shakeIt {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3px, 2px); }
  50%  { transform: translate(3px, -2px); }
  75%  { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

/* ── Score Bump ────────────────────────────────────────────── */
#score.score-bump {
  animation: scorePop 0.25s ease-out;
}
@keyframes scorePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Milestone Toast ───────────────────────────────────────── */
.milestone-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,214,232,.9));
  border: 3px solid rgba(255,182,217,.6);
  border-radius: 24px;
  padding: 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 300;
  pointer-events: none;
  animation: milestoneIn 2s ease-out forwards;
  box-shadow: 0 8px 32px rgba(255,182,217,.4);
}
.milestone-count {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}
.milestone-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
}
@keyframes milestoneIn {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  25%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  75%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(0.9); opacity: 0; }
}

/* ── NEW! Badge ────────────────────────────────────────────── */
.collect-new-badge {
  background: linear-gradient(135deg, #FF69B4, #FFD700);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 12px;
  letter-spacing: 1px;
  animation: newBadgePulse 0.6s ease-in-out infinite alternate;
}
@keyframes newBadgePulse {
  from { transform: scale(1); box-shadow: 0 2px 8px rgba(255,105,180,.3); }
  to   { transform: scale(1.1); box-shadow: 0 4px 16px rgba(255,105,180,.5); }
}

/* ── Mascot ─────────────────────────────────────────────────── */
#mascot {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  right: calc(18px + env(safe-area-inset-right));
  font-size: clamp(2.2rem, 6vw, 2.8rem);
  z-index: 15;
  transition: transform 0.3s;
  pointer-events: none;
}
#mascot.excited { animation: mascotDance 0.35s ease-in-out infinite alternate; }
@keyframes mascotDance {
  from { transform: scale(1)   rotate(-10deg); }
  to   { transform: scale(1.2) rotate( 10deg); }
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(80,40,80,.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-overlay.hidden { display: none; }

.modal-overlay#collect-reveal {
  background: none;
  backdrop-filter: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: calc(var(--hud-height) + 12px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}

.modal-card {
  background: #fff;
  border-radius: 28px;
  padding: clamp(24px, 5vw, 36px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: popIn 0.38s cubic-bezier(.34,1.56,.64,1);
  max-width: min(360px, calc(100vw - 32px));
  width: 90%;
}
.modal-overlay#collect-reveal .modal-card {
  width: auto;
  max-width: min(280px, calc(100vw - 24px));
  border-radius: 18px;
  padding: 14px 16px;
  gap: 4px;
  box-shadow: 0 10px 24px rgba(107, 76, 107, 0.16);
}
.modal-overlay#collect-reveal .modal-sparkles {
  font-size: 1rem;
  letter-spacing: 2px;
}
.modal-overlay#collect-reveal .collect-emoji {
  font-size: 2.4rem;
}
.modal-overlay#collect-reveal .collect-name {
  font-size: 1.1rem;
}
.modal-overlay#collect-reveal .collect-rarity {
  margin-bottom: 2px;
}
@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-sparkles  { font-size: 1.4rem; letter-spacing: 4px; }
.collect-emoji   { font-size: 4rem; }
.collect-name    { font-size: 1.4rem; font-weight: 800; }
.collect-rarity  { font-size: 0.95rem; color: var(--text-light); margin-bottom: 6px; }
.collect-auto-close {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  background: var(--pink-light);
  border-radius: 999px;
  padding: 6px 12px;
}
.rarity-ultra    { color: #b040b0; font-weight: 700; }

.modal-card h2   { font-size: 1.6rem; font-weight: 800; }
.modal-card p    { color: var(--text-light); font-size: 1rem; }

/* ── Screen headers ─────────────────────────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  width: 100%;
  max-width: var(--content-max);
}
.screen-header h2 { font-size: clamp(1.3rem, 4vw, 1.5rem); font-weight: 800; color: var(--pink-bold); }

/* ── Album ──────────────────────────────────────────────────── */
.album-progress {
  padding: 0 16px 12px;
  width: 100%;
  max-width: var(--content-max);
}
.album-progress-text {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.album-progress-bar {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,.6);
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.album-progress-bar::after {
  content: '⭐';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
.album-progress-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  transition: width 0.4s ease-out;
  min-width: 0;
}
.album-progress-pct {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 4px;
  text-align: right;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 24px;
  width: 100%;
  max-width: var(--content-max);
}
.album-card {
  background: #fff;
  border-radius: 18px;
  padding: 10px 5px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  transition: transform 0.15s;
  border: 2px solid transparent;
}
.album-card:active { transform: scale(0.96); }

/* Rarity card styles */
.album-card.rarity-common {
  border-color: rgba(200,200,200,.3);
}
.album-card.rarity-rare {
  border-color: rgba(168,216,255,.6);
  box-shadow: 0 2px 12px rgba(168,216,255,.3);
}
.album-card.rarity-ultra {
  border-color: rgba(200,140,230,.5);
  box-shadow: 0 2px 16px rgba(200,140,230,.35);
  background: linear-gradient(135deg, #fff, #fdf0ff);
}

/* Locked cards */
.album-card.locked {
  opacity: 1;
  background: linear-gradient(135deg, var(--purple), var(--purple-bold));
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(184,124,232,.3);
}
.album-card.locked .card-emoji {
  filter: none;
}
.card-emoji-locked {
  font-family: var(--font-display);
  font-weight: 800;
  color: rgba(255,255,255,.95);
  text-shadow: 0 2px 0 rgba(107,76,107,.18);
}
.album-card.locked .card-name,
.album-card.locked .card-rarity-hint {
  color: rgba(255,255,255,.9);
}

.card-emoji  { font-size: 1.7rem; margin-bottom: 4px; }
.card-name   { font-size: 0.65rem; font-weight: 700; color: var(--text); }
.card-rarity {
  font-size: 0.55rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 1px;
}
.card-rarity-rare { color: var(--blue); }
.card-rarity-ultra { color: #b060d0; font-weight: 700; }
.card-count  {
  font-size: 0.6rem;
  background: var(--pink-light);
  border-radius: 8px;
  padding: 2px 6px;
  margin-top: 3px;
  display: inline-block;
}

/* Locked card rarity hints */
.card-rarity-hint {
  font-size: 0.55rem;
  margin-top: 2px;
  letter-spacing: 1px;
}

/* ── Settings ───────────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  padding: 0 16px 24px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--pink);
}
.setting-row select {
  background: var(--pink-light);
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

@media (min-width: 768px) {
  :root {
    --hud-height: 68px;
  }

  .menu-buttons {
    max-width: 360px;
  }

  .album-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .screen-header,
  .album-progress,
  .album-grid,
  .settings-list {
    width: min(100%, 720px);
  }
}

@media (max-width: 767px) {
  .screen {
    justify-content: flex-start;
  }

  .screen-scroll {
    align-items: stretch;
  }

  .game-hud {
    gap: 8px;
    padding-inline: 12px;
  }

  .hud-mode {
    font-size: 0.72rem;
  }

  .combo-display {
    max-width: calc(100vw - 24px);
    font-size: 1rem;
  }
}

@media (max-width: 540px) {
  .screen {
    padding: 14px;
  }

  .menu-buttons,
  .settings-list,
  .screen-header,
  .album-progress,
  .album-grid {
    width: 100%;
  }

  .menu-buttons {
    max-width: none;
  }

  .btn {
    width: 100%;
    padding-inline: 22px;
  }

  .game-hud {
    padding-bottom: 10px;
    padding-top: calc(10px + env(safe-area-inset-top));
    min-height: 60px;
  }

  :root {
    --hud-height: 60px;
  }

  .hud-mode {
    display: none;
  }

  .album-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .card-emoji {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #game-area.shake { animation: none; }
  #score.score-bump { animation: none; }
  .balloon { animation-duration: 0.01ms !important; }
  .particle { animation-duration: 0.01ms !important; }
  .milestone-toast { animation-duration: 0.01ms !important; }
  .collect-new-badge { animation: none; }
  #mascot.excited { animation: none; }
  .modal-card { animation: none; }
  .menu-balloon { animation: none; }
  .album-progress-fill { transition: none; }
  .miss-flash { display: none; }
}
