* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #120a06;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#wrap {
  position: relative; width: 100%; height: 100%;
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
#game {
  display: block; width: 100%; height: 100%;
  object-fit: contain; background: #1a0f08;
  filter: saturate(1.05);
}
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 10px; align-items: flex-start;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0;
  pointer-events: none; z-index: 5;
}
.score-box {
  background: linear-gradient(145deg, rgba(20,10,8,.62), rgba(65,35,22,.3));
  border: 1px solid rgba(255,220,165,.24);
  border-radius: 14px; padding: 7px 12px; min-width: 66px;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 5px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.score-box .label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; color: rgba(255,220,180,.65);
}
.score-box strong {
  font-size: 22px; font-weight: 800; color: #ffe7c2;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
#muteBtn {
  pointer-events: auto; margin-left: auto;
  background: linear-gradient(145deg, rgba(20,10,8,.62), rgba(65,35,22,.3)); color: #fff;
  width: 40px; height: 40px; border-radius: 12px; font-size: 16px;
  border: 1px solid rgba(255,220,165,.24); cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 5px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,174,72,.11), transparent 42%),
    rgba(10, 5, 8, .57);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  padding: 24px; text-align: center; color: #ffe8c8;
  transition: opacity .24s ease, visibility .24s ease;
}
.overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.title-card {
  position: relative; width: min(100%, 340px);
  padding: 34px 28px 26px;
  border: 1px solid rgba(255,231,195,.24);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.025) 45%),
    rgba(35,18,17,.44);
  box-shadow:
    inset 0 1px rgba(255,255,255,.18),
    inset 0 -1px rgba(255,180,100,.07),
    0 30px 80px rgba(5,2,4,.5);
}
.title-card::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(255,255,255,.045); border-radius: 23px;
}
.logo-wrap {
  position: relative; width: 96px; height: 96px; margin: -2px auto 13px;
}
.logo-wrap::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,185,74,.35), transparent 68%);
  animation: logoGlow 2.8s ease-in-out infinite;
}
#logo {
  position: relative; width: 96px; height: 96px; border-radius: 27px; object-fit: cover;
  border: 2px solid rgba(255,232,194,.45);
  box-shadow: 0 15px 42px rgba(255, 140, 45, .3), inset 0 1px rgba(255,255,255,.3);
}
.overlay h1 {
  font-size: clamp(38px, 11vw, 48px); line-height: 1; font-weight: 900; letter-spacing: -0.055em;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fffaf0 5%, #ffd685 50%, #ff9d3c 100%);
  color: #ffd685; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(117,43,3,.42));
}
.overlay p { color: rgba(255, 235, 211, .78); font-size: 15px; line-height: 1.5; margin-bottom: 21px; }
.overlay .eyebrow {
  margin: 0 0 7px; color: rgba(255,221,167,.66);
  font-size: 9px; font-weight: 800; letter-spacing: .2em;
}
.cta {
  position: relative; isolation: isolate; border: 0; cursor: pointer;
  min-width: 146px;
  background: linear-gradient(180deg, #ffd477 0%, #ffad38 48%, #e97b08 100%);
  color: #2a1400; font-weight: 800; font-size: 18px;
  padding: 14px 36px; border-radius: 999px;
  box-shadow: inset 0 2px rgba(255,255,255,.42), inset 0 -3px rgba(130,55,0,.17),
    0 9px 26px rgba(232, 116, 12, .42);
  touch-action: manipulation;
  animation: ctaPulse 1.9s ease-in-out infinite;
}
.cta::after {
  content: ""; position: absolute; z-index: -1; inset: -5px;
  border: 2px solid rgba(255,192,94,.34); border-radius: inherit;
  animation: ctaRing 1.9s ease-out infinite;
}
.cta span { display: inline-block; transform: translateY(-1px); }
.cta:active { transform: scale(0.96); animation: none; }
.overlay .hint { margin: 17px 0 0; font-size: 10px; opacity: .48; letter-spacing: .035em; }

@keyframes ctaPulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: inset 0 2px rgba(255,255,255,.42), inset 0 -3px rgba(130,55,0,.17), 0 9px 26px rgba(232,116,12,.4); }
  50% { transform: translateY(-2px) scale(1.035); box-shadow: inset 0 2px rgba(255,255,255,.48), inset 0 -3px rgba(130,55,0,.14), 0 14px 34px rgba(255,144,30,.54); }
}
@keyframes ctaRing {
  0%, 35% { opacity: .55; transform: scale(.97); }
  80%, 100% { opacity: 0; transform: scale(1.17); }
}
@keyframes logoGlow {
  0%, 100% { opacity: .65; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1.08); }
}
@media (max-height: 590px) {
  .title-card { padding: 20px 24px 18px; }
  .logo-wrap, #logo { width: 72px; height: 72px; }
  .overlay h1 { font-size: 36px; margin-bottom: 8px; }
  .overlay p { margin-bottom: 13px; }
  .overlay .hint { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .cta, .cta::after, .logo-wrap::before { animation: none; }
}
