html, body { margin: 0; background: #070103; }
#app { display: flex; justify-content: center; }
.ph5 {
  width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh;
  border: 0; border-radius: 0; box-shadow: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.buymode { display: flex; gap: 6px; padding: 6px 12px 0; }
.buymode button {
  flex: 1; min-height: 46px; border: 3px solid var(--k); border-radius: 12px; cursor: pointer;
  font: 400 15px "Secular One", Heebo, sans-serif; color: var(--ink); background: var(--paper);
  box-shadow: 3px 3px 0 var(--k);
}
.buymode button[aria-pressed="true"] { background: var(--gold); }
.buymode button:focus-visible { outline: 3px solid #7de3ff; outline-offset: 2px; }
.row5[hidden], .row5.lock[hidden] { display: none; }
.welcome {
  position: fixed; inset: auto 12px 16px 12px; max-width: 456px; margin: 0 auto; z-index: 10;
  padding: 12px 14px; border-radius: 14px; background: var(--paper); color: var(--ink);
  border: 3px solid var(--k); box-shadow: 4px 4px 0 var(--k);
  font: 600 14px Heebo, sans-serif;
}
.welcome button {
  margin-inline-start: 10px; min-height: 40px; padding: 0 14px; border: 3px solid var(--k);
  border-radius: 10px; background: var(--red); color: var(--cream); cursor: pointer;
  font: 400 14px "Secular One", Heebo, sans-serif;
}

.tierbadge { position: absolute; top: -12px; right: -8px; display: none; pointer-events: none; }
.tierbadge svg { display: none; }
.row5[data-tier="1"] .tierbadge, .row5[data-tier="2"] .tierbadge, .row5[data-tier="3"] .tierbadge { display: block; }
.row5[data-tier="1"] .tierbadge .t1 { display: block; }
.row5[data-tier="2"] .tierbadge .t2 { display: block; }
.row5[data-tier="3"] .tierbadge .t3 { display: block; }
.row5[data-tier="1"] .ic { box-shadow: 0 0 0 3px #f2b83a; }
.row5[data-tier="2"] .ic { box-shadow: 0 0 0 3px #ff7a1f, 0 0 14px 2px #ff7a1f; }
.row5[data-tier="3"] .ic { box-shadow: 0 0 0 3px #fff3a0, 0 0 20px 4px #f2b83a; animation: tier3glow 1.8s ease-in-out infinite; }
@keyframes tier3glow { 50% { box-shadow: 0 0 0 3px #fff3a0, 0 0 30px 8px #f2b83a; } }
@media (prefers-reduced-motion: reduce) { .row5[data-tier="3"] .ic { animation: none; } }

/* ---- phone browser adaptation ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
button, a, #stage, .row5 { touch-action: manipulation; }
.ph5 {
  display: flex; flex-direction: column;
  /* clip preserves the artwork bounds without trapping sticky positioning. */
  overflow: clip;
}
.ph5 .top {
  position: sticky; top: 0; z-index: 5;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: #3a0f4a; box-shadow: 0 4px 0 var(--k);
}
.nav5 {
  position: sticky; bottom: 0; z-index: 5; margin-top: auto; flex-shrink: 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.welcome { inset-block-end: calc(84px + env(safe-area-inset-bottom)); }
.welcome button { min-height: 46px; }
/* SVG displacement filters are CPU-heavy on phones: keep the hand-drawn wobble on desktop only. */
@media (pointer: coarse) { #stage g[filter] { filter: none; } }

.nav5 button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 60px; padding: 6px 0; border: 0; background: transparent;
  color: #bfa98f; font: 600 11.5px Heebo, sans-serif;
}
.nav5 .coming-soon { cursor: default; opacity: .7; }
.nav5 .coming-soon small { font-size: 10px; line-height: 1; }
.nav5 a:focus-visible, #stage:focus-visible {
  outline: 3px solid #7de3ff; outline-offset: -4px;
}
