/* Prism Pop Phase 3 — premium mobile-first */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg1: #e8d5ff;
  --bg2: #c5e8ff;
  --bg3: #ffe5f0;
  --card: rgba(255, 255, 255, 0.86);
  --ink: #2a2140;
  --muted: #6b5f88;
  --accent: #7c5cff;
  --accent2: #ff6b9d;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg1) 0%, var(--bg2) 45%, var(--bg3) 100%);
  background-attachment: fixed;
}

#app {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#screen-play.screen { overflow: hidden; }
.screen.active { display: flex; }
.screen.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(42, 33, 64, 0.72);
  /* Avoid backdrop-filter on iOS Safari — it blurs the play board underneath and can stick */
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}
@supports not (-webkit-touch-callout: none) {
  .screen.overlay {
    background: rgba(42, 33, 64, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

.menu-card {
  margin: auto;
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: 24px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(124, 92, 255, 0.22), inset 0 1px 0 rgba(255,255,255,0.9);
}
.menu-card.compact { padding: 24px 20px; }
.menu-card.wide { max-width: 400px; max-height: 90%; overflow: auto; }

.logo-gem {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(124, 92, 255, 0.35));
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-gem { animation: none; }
}

.title {
  font-size: 2rem;
  letter-spacing: 0.06em;
  background: linear-gradient(120deg, #ff6b9d, #7c5cff, #3ecfcf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-top: 6px;
}
.tagline { color: var(--muted); font-size: 0.95rem; margin: 4px 0 14px; }
.high-score { font-weight: 700; margin-bottom: 18px; color: var(--accent); }
.phase-note { margin-top: 14px; font-size: 0.7rem; color: var(--muted); opacity: 0.9; }
.phase-note a { color: var(--accent); }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 8px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 rgba(42, 33, 64, 0.12);
  cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(42, 33, 64, 0.12); }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, #7c5cff);
  box-shadow: 0 5px 0 #5a3fd4;
}
.btn.primary:active { box-shadow: 0 2px 0 #5a3fd4; }
.btn.ghost { background: rgba(255,255,255,0.55); color: var(--muted); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.chip {
  width: auto;
  flex: 1;
  margin: 4px;
  padding: 10px 8px;
  font-size: 0.85rem;
  border-radius: 999px;
}
.btn.chip.off { opacity: 0.5; text-decoration: line-through; }
.btn.tiny {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn.tiny.off { opacity: 0.45; }
.audio-row { display: flex; gap: 4px; margin-top: 8px; }

.hud {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.hud-block {
  flex: 1 1 0;
  min-width: 0;
  background: var(--card);
  border-radius: 12px;
  padding: 4px 4px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.12);
}
.hud-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hud-value { font-size: 0.95rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hud-actions { display: flex; flex-shrink: 0; flex-wrap: nowrap; gap: 2px; max-width: 48%; }

.energy-row { flex-shrink: 0; margin-bottom: 6px; }
.energy-meter {
  position: relative;
  display: block;
  width: 100%;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  box-shadow: inset 0 1px 3px rgba(42,33,64,0.15);
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  padding: 0;
}
.energy-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b9d, #ffcc33, #3ee0d6, #7c5cff);
  background-size: 200% 100%;
  transition: width 0.25s ease;
}
.energy-meter.charged .energy-fill {
  width: 100% !important;
  animation: shimmer 1.2s linear infinite;
  box-shadow: 0 0 12px rgba(255,200,100,0.8);
}
@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .energy-meter.charged .energy-fill { animation: none; }
}
.energy-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
  pointer-events: none;
}
.energy-meter.charged .energy-label { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }

.play-row {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
}
.board-wrap {
  position: relative;
  flex: 0 1 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
#board {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  touch-action: none;
}

.toast {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  background: rgba(42,33,64,0.88);
  color: #fff;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  max-width: 90%;
  text-align: center;
}
.prism-tip {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.35;
  z-index: 6;
  box-shadow: 0 6px 20px rgba(124,92,255,0.25);
  pointer-events: none;
}
.prism-tip[hidden] { display: none !important; }
.toast[hidden] { display: none !important; }

.side-panel {
  width: 88px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-box {
  background: var(--card);
  border-radius: 14px;
  padding: 8px 6px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.12);
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
#next {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 4px auto 0;
  box-sizing: border-box;
}
.tip {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.4;
  background: rgba(255,255,255,0.45);
  border-radius: 10px;
  padding: 8px;
}
.desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) {
  .desktop-only { display: block; }
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.ctrl {
  height: 56px;
  border: none;
  border-radius: 16px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 4px 0 rgba(42, 33, 64, 0.12);
  touch-action: manipulation;
  cursor: pointer;
}
.ctrl:active, .ctrl.pressed {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(42, 33, 64, 0.12);
  background: #fff;
}
.ctrl.accent {
  color: #fff;
  background: linear-gradient(135deg, #3ecfcf, #7c5cff);
  box-shadow: 0 4px 0 #5a3fd4;
}
.ctrl.accent:active, .ctrl.accent.pressed { box-shadow: 0 2px 0 #5a3fd4; }

.over-score { font-size: 1.25rem; font-weight: 800; margin: 8px 0; }
.over-best { color: var(--accent); font-weight: 600; margin-bottom: 12px; min-height: 1.2em; }

.help-body { text-align: left; font-size: 0.9rem; line-height: 1.45; color: var(--ink); margin-bottom: 12px; }
.help-body p { margin: 0 0 10px; }


@media (min-height: 780px) {
  .ctrl { height: 64px; }
  .title { font-size: 2.25rem; }
}


.vol-row {
  display: flex; flex-direction: column; gap: 4px; align-items: stretch;
  margin: 10px 0 4px; font-size: 0.75rem; color: var(--muted); font-weight: 600;
}
.vol-row input[type=range] { width: 100%; accent-color: var(--accent); }
.world-chip {
  flex-shrink: 0; align-self: center; margin: 0 0 6px;
  padding: 3px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.55); font-size: 0.72rem; font-weight: 700;
  color: var(--ink); box-shadow: 0 2px 8px rgba(124,92,255,0.12);
}
.crystal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px;
}
.crystal-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(240,230,255,0.9));
  border-radius: 16px;
  padding: 12px 10px 10px;
  box-shadow: 0 6px 18px rgba(124,92,255,0.14);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.crystal-card.locked {
  opacity: 1;
  filter: none;
  background: linear-gradient(160deg, rgba(60,45,90,0.55), rgba(40,30,70,0.65));
  color: #e8e0ff;
}
.crystal-card.locked .name { color: #ddd0ff; }
.crystal-card.locked .meta { color: #b0a0d0; }
.crystal-thumb { display: block; border-radius: 12px; }
.crystal-card .name { font-weight: 800; font-size: 0.82rem; }
.crystal-card .meta { font-size: 0.68rem; color: var(--muted); }
.crystal-reveal {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* Solid dimmer — NO backdrop-filter (iOS Safari blurs the board underneath and can stick) */
  background: rgba(30,20,50,0.35);
  border-radius: 12px; gap: 6px;
  /* Overlay must never eat board/swipe input; only the dismiss button is clickable */
  pointer-events: none;
}
.crystal-reveal[hidden] { display: none !important; }
.crystal-reveal .reveal-name { font-weight: 800; font-size: 1.05rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.crystal-reveal .reveal-meta { font-size: 0.75rem; color: rgba(255,255,255,0.85); }
.crystal-reveal #reveal-dismiss {
  pointer-events: auto;
  width: auto;
  min-width: 88px;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.credit-note { font-size: 0.7rem; color: var(--muted); margin-top: 8px; }
.audio-row { flex-wrap: wrap; }


/* Narrow phones (iPhone SE / 12/13 logical 375–390) */
@media (max-width: 400px) {
  #app { padding-left: max(6px, var(--safe-l)); padding-right: max(6px, var(--safe-r)); }
  .hud { gap: 3px; }
  .hud-block { padding: 3px 2px; border-radius: 10px; }
  .hud-label { font-size: 0.55rem; letter-spacing: 0.04em; }
  .hud-value { font-size: 0.82rem; }
  .btn.tiny { width: 28px; height: 28px; min-width: 28px; font-size: 0.68rem; border-radius: 8px; }
  .hud-actions { gap: 1px; max-width: 46%; }
  .side-panel { width: 92px; }
  .world-chip { font-size: 0.7rem; padding: 4px 8px; }
  .play-ui { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 380px) {
  .btn.tiny { width: 26px; height: 26px; min-width: 26px; font-size: 0.62rem; }
  .hud-value { font-size: 0.78rem; }
  .hud-actions { max-width: 44%; }
  .side-panel { width: 86px; }
}

/* --- v8/v9 scenery + high-score celebration --- */
#screen-play.screen {
  position: relative;
  padding: 0;
}
.scenery-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.play-ui {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 12px 14px;
  padding-bottom: calc(12px + var(--safe-b));
}
.board-wrap {
  background: transparent;
  box-shadow: none;
}
.hud, .world-chip, .energy-row, .side-panel, .touch-controls {
  /* Keep chrome readable over rich scenery */
  text-shadow: 0 1px 2px rgba(255,255,255,0.35);
}
.hud-block, .world-chip, .next-box {
  background: rgba(255,255,255,0.88);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(20, 10, 40, 0.18);
}
.energy-meter {
  background: rgba(255,255,255,0.78);
}
.ctrl {
  background: rgba(255,255,255,0.92);
}
.world-chip {
  padding: 4px 10px;
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 4px 0;
}

.high-score-badge {
  display: inline-block;
  margin: 0 auto 10px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(120deg, #ff6b9d, #7c5cff, #4dabf7);
  background-size: 200% 200%;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.45);
  animation: badgePulse 1.6s ease-in-out infinite, badgeShine 3s linear infinite;
}
.high-score-badge[hidden] { display: none !important; }
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes badgeShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .high-score-badge { animation: none; }
}
.celebrate-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 21;
  pointer-events: none;
}
#screen-over #over-card { position: relative; z-index: 22; }
#screen-over.celebrate {
  background: rgba(42, 33, 64, 0.55);
}

/* --- v10 magical main menu (Crystal Garden full-bleed) --- */
.menu-screen {
  position: relative;
  padding: 0 !important;
  overflow: hidden;
  justify-content: flex-start;
}
.menu-scenery {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.menu-hero {
  position: relative;
  z-index: 1;
  margin: auto;
  width: 100%;
  max-width: 340px;
  padding: 18px 18px 20px;
  padding-top: max(18px, calc(8px + var(--safe-t)));
  padding-bottom: max(18px, calc(12px + var(--safe-b)));
  text-align: center;
  /* v14: no gray panel — Crystal Garden shows fully around buttons */
  background: transparent;
  border-radius: 28px;
  border: none;
  box-shadow: none;
}
.menu-diamond {
  display: block;
  width: 132px;
  height: 132px;
  margin: 0 auto 2px;
  filter: drop-shadow(0 10px 18px rgba(124, 92, 255, 0.45));
}
.title-glow {
  font-size: 2.05rem;
  letter-spacing: 0.08em;
  margin-top: 2px;
  /* White + dark outline (stroke works with gradient clip text) */
  -webkit-text-stroke: 1.15px rgba(255, 255, 255, 0.95);
  paint-order: stroke fill;
  /* Soft dark glow — filter follows glyph alpha even when color is transparent */
  filter:
    drop-shadow(0 0 1px rgba(20, 10, 40, 0.95))
    drop-shadow(0 2px 4px rgba(20, 10, 40, 0.85))
    drop-shadow(0 0 14px rgba(40, 20, 80, 0.65));
}
.tagline-light {
  color: #fff;
  font-weight: 700;
  text-shadow:
    0 1px 2px rgba(20,10,40,0.9),
    0 2px 8px rgba(20,10,40,0.75),
    0 0 12px rgba(0,0,0,0.35);
}
.high-score-light {
  color: #fff;
  font-weight: 800;
  text-shadow:
    0 1px 2px rgba(20,10,40,0.95),
    0 2px 6px rgba(20,10,40,0.7);
  background: rgba(40, 20, 70, 0.28);
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 14px rgba(20,10,40,0.25);
}
.jewel-btn {
  color: #fff !important;
  /* Rainbow fill ~82–85% opaque so garden peeks through slightly */
  background: linear-gradient(
    135deg,
    rgba(255,107,157,0.84) 0%,
    rgba(255,154,90,0.84) 28%,
    rgba(255,209,102,0.84) 50%,
    rgba(124,92,255,0.84) 78%,
    rgba(62,207,207,0.84) 100%
  ) !important;
  background-size: 200% 200% !important;
  box-shadow: 0 6px 0 rgba(90,63,212,0.85), 0 10px 24px rgba(124,92,255,0.35) !important;
  border: 1px solid rgba(255,255,255,0.55);
  text-shadow: 0 1px 2px rgba(20,10,40,0.75), 0 2px 6px rgba(20,10,40,0.45);
  animation: jewelShift 6s ease-in-out infinite;
}
@keyframes jewelShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.frost-btn {
  color: #fff !important;
  /* Clear frosted glass ~22% white — no heavy blur (greys the art on iOS) */
  background: rgba(255,255,255,0.22) !important;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow:
    0 4px 12px rgba(20,10,40,0.12),
    inset 0 1px 0 rgba(255,255,255,0.55) !important;
  text-shadow:
    0 1px 2px rgba(10,5,30,0.95),
    0 2px 6px rgba(10,5,30,0.7);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.frost-btn:active {
  background: rgba(255,255,255,0.30) !important;
}
.soon-btn {
  color: rgba(255,255,255,0.92) !important;
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid rgba(255,255,255,0.40);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22) !important;
  text-shadow:
    0 1px 2px rgba(10,5,30,0.95),
    0 2px 6px rgba(10,5,30,0.75);
  font-size: 0.92rem;
  padding: 10px 14px;
  opacity: 0.78;
  cursor: not-allowed;
}
/* Override base .btn:disabled opacity so soon items stay readable */
.menu-hero .soon-btn:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}
.audio-icons {
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.icon-frost {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.25rem !important;
  color: #fff !important;
  background: rgba(255,255,255,0.22) !important;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 4px 12px rgba(20,10,40,0.15), inset 0 1px 0 rgba(255,255,255,0.5) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  text-shadow: 0 1px 3px rgba(10,5,30,0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.icon-frost.off {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.vol-row-light {
  color: #fff;
  font-weight: 600;
  text-shadow:
    0 1px 2px rgba(10,5,30,0.95),
    0 2px 6px rgba(10,5,30,0.7);
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(40, 20, 70, 0.20);
  border: 1px solid rgba(255,255,255,0.28);
}
.vol-row-light input[type=range] {
  accent-color: #ff9ad5;
}
.phase-note-light {
  color: #fff !important;
  font-weight: 600;
  text-shadow:
    0 1px 2px rgba(10,5,30,0.95),
    0 2px 6px rgba(10,5,30,0.7);
  opacity: 1;
}
.phase-note-light a {
  color: #ffe0ff !important;
  text-shadow: 0 1px 3px rgba(10,5,30,0.9);
}

@media (max-width: 390px) {
  .menu-diamond { width: 112px; height: 112px; }
  .title-glow { font-size: 1.75rem; }
  .menu-hero { padding-left: 14px; padding-right: 14px; max-width: 100%; }
  .btn { padding: 12px 14px; font-size: 1rem; }
}
@media (max-width: 375px) {
  .menu-diamond { width: 100px; height: 100px; }
  .title-glow { font-size: 1.6rem; letter-spacing: 0.05em; }
  .icon-frost { width: 44px !important; height: 44px !important; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .jewel-btn { animation: none; }
}


/* build-badge removed for release */


/* --- Release landscape letterbox: portrait game centered, Nova scenery side fill (no blur) --- */
html, body {
  background-color: #1a1030;
  background-image: url("../assets/worlds/crystal-garden.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
#app {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 40px rgba(20, 10, 40, 0.55);
  background: linear-gradient(165deg, var(--bg1) 0%, var(--bg2) 45%, var(--bg3) 100%);
}
@media (min-width: 560px) and (orientation: landscape) {
  #app {
    height: 100%;
    width: min(480px, 42vh * 9 / 16 + 40px, 100vw);
    max-width: 480px;
  }
}
@media (min-width: 900px) {
  #app {
    width: min(420px, 100%);
  }
}
