/* ==========================================================
   Olympus Ascension — jogo (DOM + CSS + SVG)
   ========================================================== */

.game-shell { display: flex; justify-content: center; }

.game {
  --s: 1;
  --hudh: 96px;
  --g-gold: #ffd23f;
  --g-gold-2: #f0a000;
  --g-navy: #0d2a5c;
  --g-cyan: #5ff0ff;
  position: relative;
  width: min(100%, 400px, calc((100svh - 120px) * 0.5625));
  min-width: 280px;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  font-family: var(--font-ui, system-ui, sans-serif);
  border: 3px solid var(--g-gold);
  box-shadow: 0 0 0 6px rgba(255, 210, 63, .18), 0 24px 60px -12px rgba(13, 42, 92, .45);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  container-type: inline-size;
  background: #6cc0ff;
}
.game[data-screen="play"], .game[data-screen="play"] .g-stage { touch-action: none; }
:where(.game button) { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.game img { -webkit-user-drag: none; }

/* ---------- modo tela cheia no celular ---------- */
html.game-immersive, html.game-immersive body { overflow: hidden; overscroll-behavior: none; }
html.game-immersive .game-shell {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(circle at 50% 30%, #1d4e9e, #071634);
  align-items: center;
}
html.game-immersive .game {
  width: min(100vw, calc(100vh * .75));
  width: min(100vw, calc(100dvh * .75));
  height: 100vh; height: 100dvh;
  aspect-ratio: auto; min-width: 0;
  border: 0; border-radius: 0; box-shadow: none;
}
html.game-immersive .g-hud { padding-top: calc(8px + env(safe-area-inset-top)); }
.g-close {
  position: absolute; z-index: 60; display: none;
  top: calc(8px + env(safe-area-inset-top)); right: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(7, 22, 52, .55);
  font-size: 16px; font-weight: 900; cursor: pointer;
}
html.game-immersive .g-close { display: grid; place-items: center; }
html.game-immersive .game[data-screen="play"] .g-close { display: none; }

/* ---------- cenário ---------- */
.g-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.g-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #4fb0ff 0%, #bfe6ff 55%, #fff1cf 100%); transition: background .6s; }
.g-scenery {
  position: absolute; left: 50%; bottom: -2%; width: 118%; height: 46%;
  transform: translateX(-50%);
  background: url(../assets/svg/gate.svg) center bottom / contain no-repeat;
  opacity: .9; transition: opacity .5s;
}
.g-cloud { position: absolute; width: 46%; opacity: .9; animation: drift linear infinite; }
.g-cloud.c1 { top: 12%; left: -50%; animation-duration: 38s; }
.g-cloud.c2 { top: 34%; left: -50%; width: 34%; animation-duration: 29s; animation-delay: -14s; opacity: .7; }
.g-cloud.c3 { top: 58%; left: -50%; width: 56%; animation-duration: 46s; animation-delay: -30s; opacity: .8; }
@keyframes drift { to { transform: translateX(330%); } }

.game[data-level="menu"] .g-scenery, .game[data-level="gate"] .g-scenery { background-image: url(../assets/svg/gate.svg); }
.game[data-level="gate"] .g-sky { background: linear-gradient(180deg, #58b4ff 0%, #d2eeff 50%, #ffe3a3 100%); }
.game[data-level="clouds"] .g-sky { background: linear-gradient(180deg, #2f93ef 0%, #8fd0ff 55%, #e9f7ff 100%); }
.game[data-level="clouds"] .g-scenery { opacity: 0; }
.game[data-level="clouds"] .g-cloud { animation-duration: 12s; }
.game[data-level="clouds"] .g-cloud.c2 { animation-duration: 9s; }
.game[data-level="clouds"] .g-cloud.c3 { animation-duration: 15s; }
.game[data-level="temple"] .g-sky { background: linear-gradient(180deg, #ffb45e 0%, #ffd79a 45%, #fff3dc 100%); }
.game[data-level="temple"] .g-scenery { background-image: url(../assets/svg/temple.svg); height: 40%; opacity: .55; }
.game[data-level="hall"] .g-sky { background: radial-gradient(circle at 50% 20%, #a58bf0 0%, #5a3fb0 50%, #2b1a66 100%); }
.game[data-level="hall"] .g-scenery { background-image: url(../assets/svg/temple.svg); opacity: .16; height: 70%; bottom: 10%; }
.game[data-level="hall"] .g-cloud { opacity: .15; }
.game[data-level="peak"] .g-sky { background: linear-gradient(180deg, #0b2150 0%, #1f4d99 55%, #6f93c9 100%); }
.game[data-level="peak"] .g-scenery { background-image: url(../assets/svg/mountain.svg); height: 75%; opacity: .45; }
.game[data-level="peak"] .g-cloud { filter: brightness(.55); }
.game[data-level="boss"] .g-sky { background: radial-gradient(ellipse at 50% 30%, #3b1256 0%, #1a0826 45%, #07030d 80%), #07030d; }
.game[data-level="boss"] .g-sky::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 35%; background: linear-gradient(0deg, rgba(255, 70, 20, .45), transparent); animation: embers 3s ease-in-out infinite alternate; }
.game[data-level="boss"] .g-scenery, .game[data-level="boss"] .g-cloud { opacity: 0; }
@keyframes embers { from { opacity: .5; } to { opacity: 1; } }

/* Fúria do Trovão */
.game.is-fury { animation: furyBorder .5s linear infinite; }
.game.is-fury .g-sky::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(95, 240, 255, .28), rgba(255, 210, 63, .18));
  animation: furySky .9s steps(2) infinite;
}
@keyframes furyBorder { 50% { border-color: var(--g-cyan); box-shadow: 0 0 0 6px rgba(95, 240, 255, .35), 0 0 40px rgba(95, 240, 255, .6); } }
@keyframes furySky { 50% { opacity: .35; } }

/* ---------- palco e entidades ---------- */
.g-stage { position: absolute; inset: 0; z-index: 2; overflow: hidden; }
.ent { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.ent img { width: 100%; height: 100%; display: block; pointer-events: none; animation: entIn .22s ease-out; }
.ent-sym { pointer-events: auto; cursor: pointer; z-index: 3; }
.ent-sym::before { content: ""; position: absolute; inset: -16%; border-radius: 50%; }
.ent-sym.sigil img { animation: entIn .22s ease-out, spin 5s linear infinite; }
.ent-sym.bolt img { animation: entIn .22s ease-out, wiggle .3s ease-in-out infinite; filter: drop-shadow(0 0 8px #ffe066); }
.ent-sym.curse img { animation: entIn .22s ease-out, throb .7s ease-in-out infinite; }
.timed::after {
  content: ""; position: absolute; inset: -10%; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .95);
  box-shadow: 0 0 8px rgba(255, 255, 255, .6);
  animation: lifeRing var(--life, 1.5s) linear forwards;
}
.timed.curse::after { border-color: #c084fc; box-shadow: 0 0 8px #7c3aed; }
.timed.bolt::after { border-color: #ffe066; }
@keyframes lifeRing { from { transform: scale(1.25); opacity: 1; } to { transform: scale(.55); opacity: .2; } }

.ent-hazard img { filter: drop-shadow(0 0 6px rgba(160, 90, 255, .7)); }
.ent-hazard.ent-hazard img[src*="flame"] { filter: drop-shadow(0 0 8px rgba(255, 110, 20, .9)); }
.is-fury .ent-hazard img { filter: sepia(1) saturate(5) hue-rotate(5deg) brightness(1.25) drop-shadow(0 0 10px #ffe066) !important; }
.ent-pickup img { filter: drop-shadow(0 0 8px rgba(255, 225, 110, .95)); animation: entIn .22s ease-out, bob .9s ease-in-out infinite; }
.ent-pickup img[src*="lightning"] { filter: drop-shadow(0 0 10px #5ff0ff) drop-shadow(0 0 4px #fff); }

.out-pop img { animation: outPop .3s ease-out forwards !important; }
.out-pop::after, .out-fade::after { display: none; }
.out-fade { opacity: 0; transition: opacity .25s; }

@keyframes entIn { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes outPop { to { transform: scale(1.7); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wiggle { 50% { transform: rotate(8deg) scale(1.06); } }
@keyframes throb { 50% { transform: scale(1.08); } }
@keyframes bob { 50% { transform: translateY(-4px) scale(1.05); } }

/* Zeus */
.player { position: absolute; left: 0; top: 0; z-index: 5; will-change: transform; pointer-events: none; }
.player img { position: relative; width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 0 8px rgba(95, 240, 255, .75)) drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.player-aura { position: absolute; left: 30%; right: 0; top: 0; bottom: -8%; border-radius: 50%; background: radial-gradient(circle, rgba(95, 240, 255, .35), transparent 65%); animation: aura 1.6s ease-in-out infinite; }
.player.blink img { animation: blink .14s steps(2) infinite; }
.player.charging img { animation: charge .35s ease-in-out infinite; }
.is-fury .player img { filter: drop-shadow(0 0 12px #ffe066) drop-shadow(0 0 26px #5ff0ff) brightness(1.15); }
.is-fury .player-aura { background: radial-gradient(circle, rgba(255, 230, 102, .6), transparent 65%); animation-duration: .5s; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes charge { 50% { filter: drop-shadow(0 0 22px #5ff0ff) brightness(1.3); transform: translateY(-3px); } }

/* ---------- inimigos (Titã e Hades) ---------- */
.foe { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; }
.foe > img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.foe.hit > img { animation: foeHit .32s ease-out; }
.titan-wrap > img { filter: drop-shadow(0 12px 20px rgba(80, 40, 0, .35)); animation: breathe 2.4s ease-in-out infinite; }
.titan-wrap.dead > img { animation: crumble 1.3s ease-in forwards; }
@keyframes breathe { 50% { transform: translateY(-3px) scale(1.01); } }
@keyframes foeHit { 0% { filter: brightness(3) saturate(0); transform: translateX(0); } 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } 100% { filter: none; transform: none; } }
@keyframes crumble { to { transform: translateY(40px) scale(.85) rotate(4deg); opacity: 0; filter: grayscale(1) blur(2px); } }

.hades-wrap > img {
  position: relative;
  filter: drop-shadow(0 0 18px rgba(120, 90, 255, .45));
  animation: hover 3s ease-in-out infinite;
}
.hades-aura { position: absolute; inset: 5% 0; z-index: 0; border-radius: 50%; background: radial-gradient(circle, rgba(80, 120, 255, .35), transparent 70%); animation: aura 2s ease-in-out infinite; }
.hades-wrap.enraged .hades-aura { background: radial-gradient(circle, rgba(255, 40, 60, .5), transparent 70%); animation-duration: .8s; }
.hades-wrap.enraged > img { filter: saturate(1.35) drop-shadow(0 0 16px rgba(255, 40, 40, .8)); }
.hades-wrap.vulnerable .hades-aura { background: radial-gradient(circle, rgba(255, 220, 90, .35), transparent 70%); }
.hades-wrap.staggered > img { animation: stagger .12s linear infinite; }
.hades-wrap.dead > img { animation: vanish 2s ease-in forwards; }
@keyframes hover { 50% { transform: translateY(-6px); } }
@keyframes aura { 50% { transform: scale(1.12); opacity: .7; } }
@keyframes stagger { 25% { transform: translate(-3px, 1px); } 75% { transform: translate(3px, -1px); } }
@keyframes vanish { 30% { filter: brightness(4); } to { transform: scale(.4) translateY(-60px); opacity: 0; filter: brightness(4) blur(6px); } }

.zone {
  position: absolute; width: calc(58px * var(--s)); height: calc(58px * var(--s));
  transform: translate(-50%, -50%); border-radius: 50%;
  opacity: 0; pointer-events: none; z-index: 3; cursor: pointer;
}
.zone::before { content: ""; position: absolute; inset: -22%; border-radius: 50%; }
.zone.active { opacity: 1; pointer-events: auto; animation: zoneIn .2s ease-out; }
.zone .core {
  position: absolute; inset: 14%; border-radius: 50%;
  display: grid; place-items: center; font-size: calc(18px * var(--s));
  background: radial-gradient(circle at 40% 35%, #fff9d6, #ffd23f 45%, #e08a00);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .8), 0 0 18px 4px rgba(255, 210, 63, .8);
}
.zone .ring {
  position: absolute; left: 50%; top: 50%; width: 100%; height: 100%;
  border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, .8), inset 0 0 10px rgba(95, 240, 255, .6);
  transform: translate(-50%, -50%) scale(2.9);
}
.zone.ready .core { background: radial-gradient(circle at 40% 35%, #fff, #a5f6ff 50%, #22c3e6); box-shadow: 0 0 0 3px #fff, 0 0 26px 8px rgba(95, 240, 255, .95); }
.zone.ready .ring { border-color: var(--g-cyan); }
@keyframes zoneIn { from { transform: translate(-50%, -50%) scale(.3); } }

.callout {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6;
  padding: 7px 16px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: rgba(13, 42, 92, .7); border: 1px solid rgba(255, 255, 255, .3);
  font-weight: 900; letter-spacing: .08em; font-size: calc(13px * var(--s));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.callout:empty { display: none; }
.callout.hot { background: linear-gradient(135deg, #fff1a8, #ffc629); color: var(--g-navy); border-color: #fff; animation: pulse .7s ease-in-out infinite; }
.callout.perfect { background: linear-gradient(135deg, #bff8ff, #3ad5f5); color: var(--g-navy); }
.callout.miss { background: #e11d48; }
.callout.dim { opacity: .75; }
.callout.hint { animation: pulse 1s ease-in-out infinite; }
.game[data-level="clouds"] .callout, .game[data-level="peak"] .callout, .game[data-level="boss"] .callout { bottom: calc(112px * var(--s)); }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.06); } }

/* Salão dos Deuses (memória) */
.hall { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--hudh) 18px 22px; z-index: 2; }
.hall-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.hall-msg { font-family: var(--font-display, serif); font-weight: 900; font-size: calc(22px * var(--s)); letter-spacing: .06em; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.hall.your-turn .hall-msg { color: var(--g-gold); animation: blink2 1s ease-in-out infinite; }
@keyframes blink2 { 50% { opacity: .6; } }
.hall-slots { display: flex; gap: 8px; }
.hall-slots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6); transition: .15s; }
.hall-slots i.show { background: var(--g-gold); border-color: #fff; transform: scale(1.3); }
.hall-slots i.ok { background: #4ade80; border-color: #fff; }
.hall-pads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pad {
  aspect-ratio: 1 / .92; border-radius: 22px; cursor: pointer; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(232, 222, 250, .9));
  border: 3px solid var(--c); color: var(--g-navy);
  box-shadow: 0 6px 0 var(--c), 0 10px 20px rgba(0, 0, 0, .25);
  transition: transform .08s, box-shadow .08s, background .1s;
}
.pad img { width: 50%; height: auto; pointer-events: none; }
.pad span { font-weight: 900; font-size: calc(12px * var(--s)); letter-spacing: .12em; pointer-events: none; }
.pad-0 { --c: #e7a400; } .pad-1 { --c: #f0521a; } .pad-2 { --c: #0f8fd6; } .pad-3 { --c: #2e9e44; }
.pad.lit { background: var(--c); color: #fff; transform: translateY(3px) scale(1.04); box-shadow: 0 3px 0 var(--c), 0 0 30px 6px var(--c); }
.pad.lit img { filter: brightness(0) invert(1) drop-shadow(0 0 6px #fff); }
.pad.wrong { background: #e11d48; animation: shakeX .35s; }
.hall:not(.your-turn) .pad { cursor: default; }

/* Golpe final */
.final-strike {
  position: absolute; left: 50%; bottom: 17%; transform: translateX(-50%); z-index: 8;
  width: calc(128px * var(--s)); text-align: center; cursor: pointer; pointer-events: auto;
}
.final-strike img { width: 100%; display: block; pointer-events: none; animation: throb .5s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(95, 240, 255, .9)); }
.final-strike.press img { animation: press .12s ease-out; }
.final-strike b { display: block; margin-top: 4px; font-size: calc(22px * var(--s)); font-weight: 900; pointer-events: none; }
.final-strike small { display: block; font-weight: 900; letter-spacing: .1em; font-size: calc(11px * var(--s)); color: var(--g-gold); pointer-events: none; animation: blink2 .6s infinite; }
.final-bar { height: 8px; margin: 6px 0; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; pointer-events: none; }
.final-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff4d4d, #ffd23f); }
@keyframes press { 50% { transform: scale(.88); } }

/* ---------- efeitos ---------- */
.g-fx { position: absolute; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; z-index: 30;
  font-weight: 900; font-size: calc(18px * var(--s)); color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 12px rgba(0, 0, 0, .35);
  animation: popUp .95s ease-out forwards;
}
.pop.pts { color: #ffe27a; }
.pop.pts.fury { color: #fff6b0; }
.pop.sm { font-size: calc(13px * var(--s)); }
.pop.big { font-family: var(--font-display, serif); font-size: calc(24px * var(--s)); letter-spacing: .03em; }
.pop.huge { font-family: var(--font-display, serif); font-size: calc(28px * var(--s)); animation: popHuge 1.4s ease-out forwards; text-shadow: 0 3px 0 #b36b00, 0 0 20px rgba(255, 210, 63, .8); color: #fff7cf; }
.pop.miss { color: #ff7b8f; }
.pop.perfect { color: #fff27a; text-shadow: 0 2px 0 #9a5b00, 0 0 16px #5ff0ff; }
.pop.good { color: #b8f5ff; }
.pop.combo { color: #7ff0ff; text-shadow: 0 2px 0 #0b4a6b, 0 0 16px #5ff0ff; }
.pop.fury { color: #fff; text-shadow: 0 0 10px #5ff0ff, 0 0 30px #5ff0ff, 0 3px 0 #0b4a6b; }
.pop.boss { color: #ffb4d8; text-shadow: 0 2px 0 #4a0d2e, 0 0 14px #ff2d6f; font-size: calc(19px * var(--s)); }
.pop.count { font-family: var(--font-display, serif); font-size: calc(76px * var(--s)); color: #fff7cf; text-shadow: 0 4px 0 #b36b00, 0 0 30px rgba(255, 210, 63, .9); animation: countAnim .55s ease-out forwards; }
.pop.count.go { color: #bff8ff; text-shadow: 0 4px 0 #0b4a6b, 0 0 30px #5ff0ff; }
@keyframes popUp { 0% { transform: translate(-50%, -30%) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -140%) scale(1); opacity: 0; } }
@keyframes popHuge { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1.05); opacity: 0; } }
@keyframes countAnim { 0% { transform: translate(-50%, -50%) scale(2); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }

.spark { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; animation: spark .6s ease-out forwards; }
.spark.gold { background: #ffe066; box-shadow: 0 0 8px #ffd23f; }
.spark.cyan { background: #bff8ff; box-shadow: 0 0 8px #5ff0ff; }
.spark.dark { background: #a855f7; box-shadow: 0 0 8px #7c3aed; }
.spark.fire { background: #ff8a1a; box-shadow: 0 0 8px #ff4d12; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.1); opacity: 0; } }

.strike-bolt { position: absolute; top: 0; width: calc(46px * var(--s)); transform: translateX(-50%); z-index: 11; animation: strikeAnim .4s ease-out forwards; }
.strike-bolt img { width: 100%; height: 100%; object-fit: fill; display: block; filter: drop-shadow(0 0 10px #5ff0ff) drop-shadow(0 0 3px #fff); }
@keyframes strikeAnim { 0% { opacity: 0; transform: translateX(-50%) scaleY(.2); transform-origin: top; } 20% { opacity: 1; transform: translateX(-50%) scaleY(1); } 50% { opacity: .4; } 65% { opacity: 1; } 100% { opacity: 0; } }

.g-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; opacity: 0; }
.g-flash.on.white { background: #fff; animation: flash .4s ease-out; }
.g-flash.on.red { background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 0, 50, .6)); animation: flash .5s ease-out; }
.g-flash.on.bolt { background: radial-gradient(ellipse at 50% 0%, rgba(210, 250, 255, .85), rgba(95, 240, 255, .25) 70%); animation: flashBolt .5s linear; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes flashBolt { 0% { opacity: .9; } 20% { opacity: .1; } 35% { opacity: .8; } 100% { opacity: 0; } }

.game.shake .g-stage, .game.shake .g-bg { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
@keyframes shakeX { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- HUD ---------- */
.g-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 15; padding: 10px 10px 0; pointer-events: none; display: none; }
.game[data-screen="play"] .g-hud, .game[data-screen="pause"] .g-hud { display: block; }
.hud-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr auto; gap: 6px; align-items: stretch; }
.hud-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 6px 3px; border-radius: 12px; line-height: 1.05;
  background: rgba(7, 22, 52, .55); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hud-stat span { font-size: 9px; font-weight: 800; letter-spacing: .14em; opacity: .8; }
.hud-stat b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-stat b.bump { animation: bump .25s ease-out; }
.hud-stat.warn b { color: #ff8b9c; animation: blink2 .5s infinite; }
@keyframes bump { 40% { transform: scale(1.25); color: #ffe27a; } }
.hud-btn {
  pointer-events: auto; width: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(7, 22, 52, .55); border: 1px solid rgba(255, 255, 255, .3);
  font-weight: 900; font-size: 15px; letter-spacing: -1px;
}
.hud-row2 { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.hud-lives { display: flex; gap: 3px; }
.hud-lives img { width: 21px; height: 19px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); transition: .2s; }
.hud-lives img.lost { filter: grayscale(1) brightness(.6); opacity: .45; transform: scale(.85); }
.hud-level { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 10px; border-radius: 99px; background: rgba(7, 22, 52, .55); }
.hud-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 8px; border-radius: 10px; background: rgba(7, 22, 52, .55); }
.hud-bar[hidden] { display: none; }
.hud-bar .lbl { font-size: 9px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.hud-bar .bar { flex: 1; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.hud-bar .bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s; }
.hud-bar b { font-size: 11px; min-width: 32px; text-align: right; }
.hud-fury .bar i { background: linear-gradient(90deg, #5ff0ff, #ffd23f); box-shadow: 0 0 8px #5ff0ff; }
.is-fury .hud-fury { background: rgba(95, 240, 255, .35); }
.is-fury .hud-fury b { color: #fff27a; }
.hud-boss .bar i { background: linear-gradient(90deg, #7c3aed, #ff2d6f); transition: width .3s; }
.hud-boss .lbl { color: #ffb4d8; }
.hud-boss.hit .bar { animation: shakeX .25s; }

/* ---------- telas ---------- */
.g-screen {
  position: absolute; inset: 0; z-index: 40; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 20px; text-align: center;
}
.g-screen.on { display: flex; animation: screenIn .35s ease-out; }
.g-screen.g-menu.on { animation: none; }
@keyframes screenIn { from { opacity: 0; transform: scale(.97); } }
.g-screen.dim { background: rgba(7, 22, 52, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }

.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 210px; padding: 13px 26px; border-radius: 999px; cursor: pointer;
  font-weight: 900; letter-spacing: .08em; font-size: 15px; border: 0;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.g-btn.primary { background: linear-gradient(180deg, #fff1a8 0%, #ffc629 45%, #f09a00 100%); color: #5a2d00; box-shadow: 0 5px 0 #b36b00, 0 10px 24px rgba(240, 160, 0, .45); }
.g-btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #b36b00, 0 4px 10px rgba(240, 160, 0, .45); }
.g-btn.big { font-size: 20px; padding: 16px 40px; min-width: 230px; animation: ctaPulse 1.8s ease-in-out infinite; }
.g-btn.ghost { background: rgba(255, 255, 255, .88); color: var(--g-navy); box-shadow: 0 4px 0 rgba(13, 42, 92, .25); }
.g-btn.ghost:active { transform: translateY(3px); box-shadow: none; }
.g-btn:focus-visible, .icon-btn:focus-visible, .map-node:focus-visible, .pad:focus-visible { outline: 3px solid #5ff0ff; outline-offset: 3px; }
@media (hover: hover) { .g-btn:hover { filter: brightness(1.06); } }
@keyframes ctaPulse { 50% { transform: scale(1.04); } }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 18px; background: rgba(255, 255, 255, .85); border: 0; box-shadow: 0 3px 0 rgba(13, 42, 92, .25); }

/* Menu: Zeus contra Hades */
.game[data-level="menu"] .g-sky {
  background:
    radial-gradient(ellipse 60% 40% at 20% 55%, rgba(120, 170, 255, .55), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 55%, rgba(255, 80, 40, .5), transparent 70%),
    linear-gradient(105deg, #1a2a8a 0%, #3b2fa0 46%, #7a1830 54%, #240610 100%);
}
.game[data-level="menu"] .g-scenery { opacity: 0; }
.game[data-level="menu"] .g-cloud { opacity: .18; }
.g-menu { justify-content: flex-start; padding: 5% 16px 16px; gap: 7px; }
.g-menu .icon-btn { position: absolute; top: 12px; left: 12px; z-index: 3; }
html.game-immersive .g-menu .icon-btn { top: calc(8px + env(safe-area-inset-top)); }
html.game-immersive .g-menu { padding-top: calc(5% + env(safe-area-inset-top)); }
.menu-logo { position: relative; z-index: 2; width: 88%; height: auto; margin-bottom: -7%; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .5)); }
.menu-vs { position: relative; width: calc(100% + 32px); flex: 1 1 auto; min-height: 120px; margin: 0 -16px; }
.menu-vs img { position: absolute; bottom: 0; height: auto; max-height: 100%; object-fit: contain; object-position: bottom; }
.vs-zeus { left: -9%; width: 64%; object-position: left bottom; filter: drop-shadow(0 0 16px rgba(95, 170, 255, .7)); animation: float 3.2s ease-in-out infinite; z-index: 1; }
.vs-hades { right: -5%; width: 54%; object-position: right bottom; filter: drop-shadow(0 0 16px rgba(255, 60, 40, .6)); animation: float 3.2s ease-in-out -1.6s infinite; }
.vs-badge {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 2;
  font-family: var(--font-display, serif); font-weight: 900; font-size: 13cqw; line-height: 1;
  color: #fff3b0; text-shadow: 0 3px 0 #9a5b00, 0 0 18px #5ff0ff, 0 0 30px rgba(255, 80, 40, .8);
  animation: vsPulse 1.4s ease-in-out infinite;
}
@keyframes vsPulse { 50% { transform: translate(-50%, -50%) scale(1.12); } }
@keyframes float { 50% { transform: translateY(-8px); } }
.menu-sub { margin: 0 0 4px; font-weight: 800; color: #fff; font-size: 14px; max-width: 290px; line-height: 1.35; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.g-menu .g-btn.big { padding: 14px 40px; }
.menu-best { margin-top: 4px; font-size: 11px; font-weight: 900; letter-spacing: .14em; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .2); padding: 6px 14px; border-radius: 99px; }
.menu-best b { color: #ffd23f; font-size: 14px; margin-left: 6px; }
.menu-legal { font-size: 10.5px; color: #fff; opacity: .85; margin: 0; font-weight: 800; letter-spacing: .04em; }

/* Zeus em cena nos níveis de toque */
.cameo { position: absolute; pointer-events: none; z-index: 1; height: auto; filter: drop-shadow(0 0 12px rgba(95, 240, 255, .55)) drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); animation: float 3s ease-in-out infinite; }
.cameo-gate { left: -6%; bottom: 0; width: 64%; opacity: .95; }
.cameo-temple { left: -8%; bottom: 0; width: 50%; z-index: 3; }
.cameo-hall { position: static; width: 58%; max-height: 32%; object-fit: contain; }

/* Mapa */
.g-map { background: linear-gradient(180deg, #4fb0ff, #cfe9ff 60%, #fff1cf); justify-content: flex-start; padding: 16px; }
.g-map::before { content: ""; position: absolute; inset: 0; background: url(../assets/svg/mountain.svg) center bottom / cover no-repeat; opacity: .75; }
.map-head { position: relative; z-index: 2; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html.game-immersive .map-head { padding-top: env(safe-area-inset-top); padding-right: 40px; }
.map-head h3 { margin: 0; font-family: var(--font-display, serif); font-size: 19px; color: #fff; text-shadow: 0 2px 0 #b36b00; }
.map-head .icon-btn { width: 36px; height: 36px; font-size: 16px; color: var(--g-navy); font-weight: 900; }
.map-best { position: relative; z-index: 2; font-size: 11px; font-weight: 900; color: var(--g-navy); letter-spacing: .1em; }
.map-best b { color: #b36b00; }
#map-nodes { position: absolute; inset: 70px 8px 10px; z-index: 1; }
.map-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-path polyline { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: 1.4; stroke-dasharray: 2.5 2; vector-effect: non-scaling-stroke; stroke-width: 4px; }
.map-node {
  position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .95); border: 2px solid #fff; color: var(--g-navy);
  box-shadow: 0 4px 0 rgba(13, 42, 92, .2), 0 8px 18px rgba(13, 42, 92, .2);
}
.map-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: radial-gradient(circle at 40% 35%, #fff9d6, #ffd23f); border: 2px solid #e0a100; }
.map-ico img { width: 72%; height: 72%; object-fit: contain; }
.map-txt { display: flex; flex-direction: column; font-size: 12px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.map-txt b { font-size: 9px; letter-spacing: .12em; color: #b36b00; }
.map-txt .stars { font-size: 11px; letter-spacing: 1px; }
.map-state { font-size: 13px; font-weight: 900; }
.map-node.done .map-state { color: #16a34a; }
.map-node.open { border-color: #ffd23f; animation: nodePulse 1.4s ease-in-out infinite; }
.map-node.open .map-state { color: #f09a00; }
.map-node.locked { opacity: .72; cursor: not-allowed; filter: grayscale(.8); }
.map-node.boss .map-ico { background: radial-gradient(circle at 40% 35%, #c4b5fd, #6d28d9); border-color: #3b0764; }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 63, .45), 0 8px 18px rgba(13, 42, 92, .2); } }

/* Painéis (intro, pausa, resultado) */
.panel {
  width: 100%; max-width: 330px; padding: 20px 18px; border-radius: 22px;
  background: linear-gradient(180deg, #fffdf6, #f5ecd8); color: var(--g-navy);
  border: 3px solid #ffd23f; box-shadow: 0 16px 40px rgba(7, 22, 52, .4);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.panel .kicker { font-size: 11px; font-weight: 900; letter-spacing: .18em; color: #b36b00; }
.panel h3 { margin: 0; font-family: var(--font-display, serif); font-weight: 900; font-size: 22px; line-height: 1.15; }
.panel p { margin: 0; font-size: 14px; line-height: 1.45; color: #34466b; font-weight: 600; }
.panel .tag { font-size: 11px; font-weight: 900; letter-spacing: .12em; padding: 4px 10px; border-radius: 99px; background: #0d2a5c; color: #ffe27a; }
.panel .goal { font-size: 13px; font-weight: 900; padding: 8px 12px; border-radius: 12px; background: #fff3c4; border: 1px dashed #e0a100; width: 100%; }
.panel .g-btn { width: 100%; min-width: 0; }
.panel .row { display: flex; gap: 8px; width: 100%; }
.intro-icon { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(13, 42, 92, .25)); }
.intro-icon.boss { width: 170px; height: 150px; object-fit: contain; object-position: bottom; border-radius: 16px; background: radial-gradient(ellipse at 50% 70%, #6d28d9, #1a0826 75%); border: 3px solid #6d28d9; box-shadow: 0 0 24px rgba(109, 40, 217, .6); }
.game[data-level="boss"] .panel { border-color: #a855f7; }

.stars { color: #d6d3cb; letter-spacing: 2px; }
.stars .on { color: #ffc629; text-shadow: 0 1px 0 #b36b00; }
.res-stars { font-size: 34px; line-height: 1; }
.stats { width: 100%; display: grid; gap: 4px; margin: 4px 0; font-size: 13px; font-weight: 800; }
.stats div { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 10px; background: rgba(13, 42, 92, .06); }
.stats .total { background: #0d2a5c; color: #ffe27a; font-size: 15px; }

.g-victory { background: radial-gradient(circle at 50% 30%, rgba(255, 241, 168, .95), rgba(79, 176, 255, .95) 70%); }
.vic-zeus { width: 72%; max-height: 26%; object-fit: contain; animation: float 2s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255, 255, 255, .9)); }
.def-hades { width: 58%; max-height: 24%; object-fit: contain; margin-bottom: -18px; filter: drop-shadow(0 0 18px rgba(255, 40, 40, .7)); animation: float 2.6s ease-in-out infinite; }
.g-victory { gap: 6px; }
.vic-title { margin: 0; font-family: var(--font-display, serif); font-weight: 900; font-size: 9cqw; line-height: 1; color: #fff; text-shadow: 0 3px 0 #b36b00, 0 0 24px rgba(255, 255, 255, .7); }
.vic-score { font-family: var(--font-display, serif); font-size: 13cqw; font-weight: 900; color: #0d2a5c; line-height: 1; margin: 2px 0; }
.vic-record { font-size: 11px; font-weight: 900; letter-spacing: .14em; background: #e11d48; color: #fff; padding: 4px 10px; border-radius: 99px; animation: pulse2 .8s infinite; }
@keyframes pulse2 { 50% { transform: scale(1.08); } }
.g-victory .stats { max-width: 300px; }
.g-victory .stats div { background: rgba(255, 255, 255, .75); color: var(--g-navy); }
.g-defeat h3 { color: #b91c1c; }

@media (prefers-reduced-motion: reduce) {
  .g-cloud, .menu-vs img, .vs-badge, .cameo, .g-btn.big, .titan-wrap > img, .hades-wrap > img, .map-node.open { animation: none !important; }
}

/* tela cheia: o jogo fica acima de tudo */
html.game-immersive .site-header { display: none; }
html.game-immersive .hero-grid { z-index: auto; }
.game[data-level="gate"][data-screen="play"] .g-scenery { opacity: .4; height: 38%; }
