* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0312;
  color: #fff;
  font-family: "Luckiest Guy", Impact, system-ui, sans-serif;
  letter-spacing: .5px;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
  cursor: pointer;
}

#mute {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ff7a00;
  background: rgba(20, 4, 34, .7);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(180, 0, 255, .6);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 2, 20, .35), rgba(10, 2, 20, .8));
}
.overlay.show { display: flex; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }

@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.panel {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  padding: 22px 18px 18px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(40, 8, 64, .92), rgba(12, 3, 22, .94));
  box-shadow: 0 0 0 3px #ff7a00, 0 0 0 6px #2a0a40, 0 0 40px 6px rgba(180, 0, 255, .55), inset 0 0 40px rgba(120, 255, 80, .08);
}

.title {
  font-family: "Creepster", "Luckiest Guy", cursive;
  font-weight: 400;
  font-size: clamp(44px, 14vw, 66px);
  line-height: .95;
  color: #ff8a00;
  text-shadow: 0 0 8px #ff4d00, 0 0 22px #b400ff, 3px 3px 0 #2b0040;
  animation: trip 6s linear infinite, wobble 2.4s ease-in-out infinite;
}
.title span { display: block; font-size: .62em; color: #9dff3a; text-shadow: 0 0 10px #39ff14, 2px 2px 0 #2b0040; }

@keyframes trip { to { filter: hue-rotate(360deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.04); } }

.sub { margin-top: 8px; font-size: 17px; color: #e6c8ff; }
.pick { margin-top: 16px; font-size: 20px; color: #9dff3a; text-shadow: 0 0 10px rgba(57, 255, 20, .6); }

.chars { display: flex; gap: 14px; justify-content: center; margin-top: 12px; }
.char {
  flex: 1;
  max-width: 170px;
  padding: 12px 8px 10px;
  border-radius: 18px;
  border: 3px solid #b400ff;
  background: radial-gradient(circle at 50% 30%, #4b1a73, #1a0630);
  color: #fff;
  font-family: inherit;
  font-size: 22px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 0 16px rgba(180, 0, 255, .5);
}
.char:hover, .char:focus-visible { transform: translateY(-4px) rotate(-2deg); border-color: #ff7a00; box-shadow: 0 0 24px rgba(255, 122, 0, .8); outline: none; }
.char:active { transform: scale(.95); }
.char img { display: block; height: clamp(110px, 26vh, 170px); margin: 0 auto 6px; animation: bob 1.2s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(157, 255, 58, .5)); }
.char:nth-child(2) img { animation-delay: -.6s; }
.char span { text-shadow: 2px 2px 0 #2b0040; }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

.hint { margin-top: 14px; font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: #cdb6e6; letter-spacing: 0; }
.hint b { color: #ff9a3a; }

.gameover {
  font-family: "Creepster", "Luckiest Guy", cursive;
  font-weight: 400;
  font-size: clamp(48px, 15vw, 72px);
  color: #ff2a2a;
  text-shadow: 0 0 12px #ff0000, 0 6px 0 #4a0000, 0 0 30px #b400ff;
  animation: shake .5s ease-in-out 2, trip 5s linear infinite;
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }

.bday { margin-top: 6px; font-size: clamp(20px, 6vw, 26px); line-height: 1.2; color: #ffd84a; text-shadow: 2px 2px 0 #2b0040, 0 0 14px rgba(255, 140, 0, .6); }
.bday b { color: #9dff3a; }
.roast { margin-top: 10px; min-height: 1.2em; font-family: system-ui, sans-serif; font-style: italic; font-size: 15px; color: #e6c8ff; letter-spacing: 0; }

.scores { display: flex; justify-content: center; gap: 14px; margin-top: 14px; }
.scores div { min-width: 96px; padding: 8px 12px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 2px solid #4b1a73; }
.scores small { display: block; font-size: 13px; color: #b98ce0; }
.scores b { font-size: 34px; font-weight: 400; color: #fff; }

.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn {
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 21px;
  color: #1a0630;
  background: linear-gradient(180deg, #ffb347, #ff7a00);
  box-shadow: 0 5px 0 #8a3c00, 0 0 18px rgba(255, 122, 0, .6);
  cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a3c00; }
.btn:disabled { opacity: .55; }
.btn.alt { color: #fff; background: linear-gradient(180deg, #7a2bd6, #4b1a73); box-shadow: 0 5px 0 #24063d, 0 0 16px rgba(180, 0, 255, .5); }

.love { margin-top: 16px; font-size: 18px; color: #ff9ad6; text-shadow: 0 0 10px rgba(255, 60, 180, .6); }
.love b { color: #fff; }

/* ---- install / add to home screen */
.btn.install {
  width: 100%;
  margin-top: 14px;
  font-size: 18px;
  color: #10220a;
  background: linear-gradient(180deg, #c6ff7a, #6fd61f);
  box-shadow: 0 5px 0 #2f6b0f, 0 0 18px rgba(157, 255, 58, .55);
}
.btn.install:active { box-shadow: 0 2px 0 #2f6b0f; }
.btn[hidden] { display: none; }

#install { z-index: 15; background: rgba(8, 2, 16, .9); }
.install-title { font-family: "Creepster", "Luckiest Guy", cursive; font-weight: 400; font-size: clamp(34px, 10vw, 46px); color: #9dff3a; text-shadow: 0 0 12px #39ff14, 2px 2px 0 #2b0040; }
.install-icon { display: block; margin: 10px auto 4px; border-radius: 16px; box-shadow: 0 0 20px rgba(255, 122, 0, .6); }
.install-lead { margin-top: 8px; font-family: system-ui, sans-serif; font-size: 15px; line-height: 1.4; color: #e6c8ff; letter-spacing: 0; }
.install-steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: step; text-align: left; font-family: system-ui, sans-serif; font-size: 15px; line-height: 1.4; color: #fff; letter-spacing: 0; }
.install-steps li { position: relative; padding: 10px 10px 10px 46px; margin-top: 8px; border-radius: 12px; background: rgba(0, 0, 0, .35); border: 2px solid #4b1a73; counter-increment: step; }
.install-steps li::before { content: counter(step); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #ff7a00; color: #1a0630; font-family: "Luckiest Guy", Impact, sans-serif; }
.install-steps b { color: #ffd84a; }
.install-steps .note { display: block; margin-top: 4px; font-size: 13px; color: #b98ce0; }
.kbd { display: inline-block; padding: 0 6px; border-radius: 6px; background: #2a0a40; border: 1px solid #7a2bd6; font-size: 14px; }
