* { box-sizing: border-box; }
html, body { height: 100dvh; overflow: hidden; margin: 0; font-family: system-ui, -apple-system, sans-serif; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
body { display: flex; flex-direction: column; }
.sapp-header { display: flex; align-items: center; padding: 12px 16px; flex-shrink: 0; position: relative; z-index: 10; }
.sapp-header a { text-decoration: none; font-size: 24px; z-index: 2; }
.sapp-header img { position: absolute; left: 50%; transform: translateX(-50%); height: 40px; max-width: 50vw; object-fit: contain; z-index: 1; }
#btn-som { margin-left: auto; background: none; border: none; font-size: 24px; cursor: pointer; z-index: 2; display: flex; align-items: center; padding: 0; }
#game-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.hud { display: flex; justify-content: space-around; width: 100%; max-width: 480px; flex-shrink: 0; }
.hud > div { text-align: center; flex: 1; }
.hud span { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.hud strong { display: block; font-size: 22px; font-weight: 900; line-height: 1.2; }
.field { flex: 1; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 8px; width: 100%; max-width: min(480px, 100%); aspect-ratio: 3 / 4; max-height: 100%; margin: 0 auto; }
.hole { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.hole-inner { width: 100%; height: 100%; aspect-ratio: 1; max-width: 100%; max-height: 100%; position: relative; cursor: pointer; }
.mole { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; }
.hole.active .mole { display: flex; animation: at-pop 0.14s ease-out; }
@keyframes at-pop { from { transform: scale(0.4) translateY(20%); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
#martelo { position: fixed; pointer-events: none; z-index: 100; display: none; transform-origin: bottom left; transition: transform 0.06s; }
#martelo.click { transform: scale(1.15) rotate(-25deg); }
.actions { width: 100%; max-width: 480px; display: flex; justify-content: center; flex-shrink: 0; }
.actions button { border: none; padding: 14px 40px; border-radius: 32px; font-size: 18px; font-weight: 700; cursor: pointer; transition: transform 0.1s; }
.actions button:active { transform: scale(0.96); }
.actions button.hidden { display: none; }
.hint { width: 100%; max-width: 480px; font-size: 12px; text-align: center; margin: 0; padding: 0 8px; flex-shrink: 0; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.overlay.hidden { display: none; }
.overlay .card { border-radius: 20px; padding: 28px 24px; max-width: 340px; width: 100%; text-align: center; }
.overlay .card h2 { margin: 0 0 12px; font-size: 26px; }
.overlay .card p { font-size: 15px; line-height: 1.6; margin: 0 0 20px; }
.overlay .card button { border: none; padding: 12px 28px; border-radius: 24px; font-size: 16px; font-weight: 700; cursor: pointer; }
.at-float { position: fixed; font-weight: 900; font-size: 22px; pointer-events: none; z-index: 150; text-shadow: 0 2px 6px rgba(0,0,0,0.4); transform: translate(-50%, -50%); animation: at-float 0.9s ease-out forwards; }
@keyframes at-float { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -70%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -180%) scale(1.25); } }

/* ACERTE A TOUPEIRA — VISUAL 3D */
html, body { background:#183d20; }
body { background: radial-gradient(ellipse at 50% 5%, #8bdc61 0%, #3e9b3d 48%, #174a2a 100%); }
.sapp-header { background:linear-gradient(180deg,#fff8e8,#f2d7a5); border-bottom:3px solid #9b5b22; box-shadow:0 3px 10px #172b1855; }
.sapp-header a, #btn-som { color:#a84b0a; }
.wrap { position:relative; gap:10px; padding:12px 10px; background:radial-gradient(ellipse at 50% 40%,#a4e86a 0%,#60b94d 62%,#28763a 100%); }
.hud { max-width:520px; border:3px solid #8a4a1d; border-radius:17px; background:linear-gradient(180deg,#b87535,#713913); box-shadow:inset 0 2px 0 #ffd18b, inset 0 -4px 0 #4b250e, 0 5px 9px #102b1c88; padding:8px 4px; }
.hud span { color:#ffe3b4; text-shadow:0 1px 2px #3b1d08; }
.hud strong { color:#ffdf43; font-size:clamp(19px,5vw,25px); text-shadow:0 2px 0 #713300,0 0 8px #ff9d00; }
.field { max-width:520px; gap:5px 7px; padding:7px; border:3px solid #70401b; border-radius:22px; background:linear-gradient(145deg,#6dba43,#32833a); box-shadow:inset 0 2px 9px #e2ff8a77,0 7px 15px #16351d99; }
.hole { overflow:visible; }
.hole-inner { overflow:visible; border-radius:0; background:url('assets/buraco-3d.png') center/100% 100% no-repeat; box-shadow:none; }
.mole { overflow:visible; }
.mole img {
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center top !important;
  /* Puxa a toupeira 30% para cima */
  transform: scale(1.3) translateY(-30%) !important; filter:drop-shadow(0 5px 3px #1b2a1766); }
.mole.gold img { filter:drop-shadow(0 0 7px #ffe34a) drop-shadow(0 5px 3px #1b2a1766); }
.mole.bomb img { filter:drop-shadow(0 0 7px #ff3d27) drop-shadow(0 5px 3px #1b2a1766); }
.actions button { border:3px solid #ffd66b; background:linear-gradient(180deg,#ffb02c,#f05a00); box-shadow:inset 0 3px 0 #ffe9a1,0 5px 0 #963800,0 8px 13px #44230b77; text-shadow:0 2px 2px #9c3900; }
.hint { color:#fff7d7; font-weight:700; text-shadow:0 1px 3px #17421c; }
.hint strong { color:#ffe34d; }
#martelo { font-size:0; width:86px; height:86px; background:url('assets/martelo-3d.png') center/contain no-repeat; filter:drop-shadow(0 5px 5px #14220f88); }
#martelo.click { transform:scale(1.12) rotate(-25deg); }
.overlay { background:#102615aa; }
.overlay .card { background:linear-gradient(180deg,#fff4d5,#e9b66e); border:4px solid #9b541e; box-shadow:0 12px 30px #142b1c99; }
.overlay .card h2 { color:#b34d08; }
.overlay .card button { background:linear-gradient(180deg,#ffb32e,#ef5a00); }
@media (max-height:720px) { .wrap { gap:7px; padding:7px; } .hud { padding:5px 3px; } .hud strong { font-size:19px; } .field { gap:3px 5px; padding:4px; } .actions button { padding:10px 32px; } .hint { font-size:10px; } }








/* ─── LAYOUT 3D DEFINITIVO ─── */
.hole {
  position: relative !important;
  width: 100%;
  height: 100%;
  display: block !important; /* Remove flex */
  overflow: visible !important; /* Permite a toupeira extrapolar um pouquinho */
}

.hole-inner {
  position: absolute !important;
  inset: 0 !important;
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  z-index: 1;
}

.mole {
  position: absolute !important;
  inset: 0 !important;
  display: none;
  z-index: 2;
  pointer-events: none;
}

.hole.active .mole { 
  display: block !important; 
}

.mole img {
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center top !important;
  /* Puxa a toupeira 30% para cima */
  transform: scale(1.3) translateY(-30%) !important; 
}

/* Ajuste do Grid para não encostar em nada */
.grid {
  gap: 4px !important;
}
