* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #FFF4E0; color: #3a1414;
  font-family: "Baloo 2", system-ui, sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
}
canvas { position: fixed; inset: 0; display: block; }

.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2vh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.screen.show { opacity: 1; pointer-events: auto; }

/* ---------- Tela inicial ---------- */
#title { justify-content: space-between; }
.title-box {
  text-align: center; margin-top: 3vh; padding: 10px 22px 14px;
  background: #fff; border: 5px solid #3a1414; border-radius: 26px;
  box-shadow: 0 6px 0 #3a1414, 0 0 0 10px rgba(255,255,255,.6);
  transform: rotate(-2deg);
}
.kicker {
  margin: 0; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #E63946; font-size: clamp(15px, 4vw, 21px);
}
h1 {
  margin: 0; font-family: "Luckiest Guy", "Baloo 2", sans-serif; font-weight: 400;
  font-size: clamp(48px, 15vw, 96px); line-height: 1; letter-spacing: .02em;
  color: #FFD23F; -webkit-text-stroke: 3px #3a1414;
  text-shadow: 0 5px 0 #3a1414, 0 8px 0 #E63946;
}
.sub { margin: .4em 0 0; font-size: clamp(13px, 3.6vw, 17px); font-weight: 700; color: #3a1414; }
.t-rec {
  margin: auto 0 0; font-weight: 800; font-size: 18px; color: #3a1414;
  background: #FFD23F; border: 3px solid #3a1414; border-radius: 99px; padding: 2px 16px;
}
.play {
  width: clamp(92px, 24vw, 130px); height: clamp(92px, 24vw, 130px); border-radius: 50%;
  border: 6px solid #3a1414; background: radial-gradient(circle at 35% 30%, #ff8a8f, #E63946);
  color: #fff; font-size: clamp(42px, 11vw, 60px); padding-left: .18em;
  box-shadow: 0 8px 0 #3a1414, 0 0 0 8px #fff;
  animation: pulse 1.2s ease-in-out infinite; cursor: pointer; margin-bottom: 3vh;
}
@keyframes pulse { 50% { transform: scale(1.08); } }
/* modo imagem de prévia (?og): título à esquerda, cabeça (no canvas) à direita */
body.og #title { align-items: flex-start; justify-content: center; padding-left: 4vw; }
body.og .title-box { margin: 0; width: 50vw; padding: 8px 14px 12px; }
body.og .sub { font-size: 14px; line-height: 1.25; }
body.og .play, body.og .t-rec, body.og .mute, body.og .corner { display: none !important; }

/* ---------- Game over ---------- */
#over { background: rgba(58, 20, 20, .55); overflow-y: auto; justify-content: safe center; touch-action: pan-y; }
.over-box {
  width: min(380px, 100%); text-align: center; position: relative; margin: auto 0;
  background: #FFF4E0; border: 5px solid #3a1414; border-radius: 26px; padding: 14px 18px 18px;
  box-shadow: 0 8px 0 #3a1414, 0 18px 50px rgba(0,0,0,.4);
  transform: scale(.7) rotate(-3deg); transition: transform .5s cubic-bezier(.2,1.6,.4,1);
}
#over.show .over-box { transform: none; }
.o-fotos { position: relative; height: 150px; }
#o-foto { height: 150px; filter: drop-shadow(0 0 0 #fff) drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 4px 4px rgba(0,0,0,.35)); }
.o-rec {
  position: absolute; right: -6px; top: 0; display: flex; flex-direction: column; align-items: center;
  transform: rotate(10deg); animation: pulse 1s ease-in-out infinite;
}
.o-rec img { height: 70px; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff); }
.o-rec span {
  font: 400 15px "Luckiest Guy", sans-serif; color: #3a1414; background: #FFD23F;
  border: 2px solid #3a1414; border-radius: 8px; padding: 2px 6px 0; margin-top: -8px;
}
.o-frase { margin: 6px 0 8px; font-family: "Luckiest Guy", "Baloo 2", sans-serif; font-size: clamp(22px, 6.5vw, 30px); line-height: 1.05; color: #E63946; }
.o-stats { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.o-stats li { background: #fff; border: 3px solid #3a1414; border-radius: 14px; padding: 4px 2px 2px; display: flex; flex-direction: column; }
.o-stats b { font: 400 22px "Luckiest Guy", sans-serif; color: #3a1414; }
.o-stats span { font-size: 12px; font-weight: 700; color: #7a4a3a; }
.o-conq { margin: 0 0 8px; font-weight: 800; color: #7a4a3a; font-size: 14px; }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 52px; padding: 6px 8px; margin-top: 8px; border-radius: 16px; border: 3px solid #3a1414; cursor: pointer;
  font: 800 17px/1.1 "Baloo 2", sans-serif; text-decoration: none; color: #fff;
  box-shadow: 0 5px 0 #3a1414;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #3a1414; }
.again { background: #E63946; font: 400 30px/1 "Luckiest Guy", sans-serif; min-height: 64px; padding-top: 10px; }
.zap { background: #25a244; }

/* paisagem / telas baixas */
@media (max-height: 500px) {
  .title-box { margin-top: 0; padding: 4px 18px 8px; }
  h1 { font-size: clamp(40px, 12vh, 64px); }
  .play { width: 84px; height: 84px; font-size: 40px; margin-bottom: 0; }
  .o-fotos, #o-foto { height: 84px; }
  .o-rec img { height: 44px; }
  .o-frase { font-size: 22px; margin: 2px 0 6px; }
  .btn { min-height: 44px; margin-top: 6px; }
  .again { min-height: 50px; font-size: 26px; }
}
body.og h1 { font-size: 64px; white-space: nowrap; } /* game.js encolhe se o nome não couber */

.mute {
  position: fixed; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(58,20,20,.5);
  background: rgba(255,255,255,.75); font-size: 20px; cursor: pointer; display: none;
}
.mute.show { display: block; }

/* ---------- ⓘ / ✕ no canto + pop-up "quer o seu?" ---------- */
.corner {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; z-index: 6;
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(58,20,20,.5); background: rgba(255,255,255,.75); color: #3a1414;
  display: flex; align-items: center; justify-content: center;
}
.ibtn { font: italic 700 19px/1 Georgia, "Times New Roman", serif; }
.exit { font: 700 18px/1 system-ui, sans-serif; width: 44px; height: 44px; display: none; }
body.playing .exit { display: flex; }
body.playing .corner.ibtn { display: none; }
.about {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.about.show { opacity: 1; pointer-events: auto; }
.about-box {
  position: relative; width: min(320px, 100%); text-align: center; color: #E63946;
  background: #fff; border-radius: 22px; padding: 26px 20px 22px;
  border: 4px solid #3a1414; box-shadow: 0 0 0 4px #FFD23F, 0 14px 40px rgba(0,0,0,.5);
  transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.6,.4,1);
}
.about.show .about-box { transform: none; }
.about-q { margin: 0 0 10px; font-family: "Luckiest Guy", "Baloo 2", sans-serif; font-size: 30px; }
.about-mail { font: 800 18px "Baloo 2", sans-serif; color: #E63946; text-decoration: underline; word-break: break-all; }
.about-close {
  position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: none; background: none;
  font: 700 18px system-ui, sans-serif; color: #3a1414; opacity: .7; cursor: pointer;
}
