/* JOGOS — tela de jogo (HUD, pergunta, treinador) e cenários de cada jogo */

.play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 10px clamp(8px, 2vw, 22px) 10px; gap: 8px; max-width: 1280px; margin: 0 auto; }
.hud { display: flex; align-items: center; gap: 12px; }
.hud-btn { width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; flex: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.hud-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.hud-title { display: grid; line-height: 1.1; min-width: 70px; }
.hud-title b { font-size: 1.15rem; } .hud-title span { font-size: .8rem; opacity: .9; white-space: nowrap; }
.pips { flex: 1; display: flex; gap: 6px; justify-content: center; max-width: 520px; margin: 0 auto; }
.pips i { flex: 1; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .25); max-width: 44px; transition: background .3s, transform .3s; }
.pips i.ok { background: var(--mint); transform: scaleY(1.2); } .pips i.assist { background: var(--sun); } .pips i.miss { background: #ff9fb5; }
.hud-score { display: flex; gap: 8px; font-weight: 700; font-size: 1.1rem; flex: none; }
.hud-score span { background: rgba(255, 255, 255, .22); border-radius: 99px; padding: 6px 14px; }
.combo { background: linear-gradient(90deg, #ff9f43, #ff5e7e) !important; animation: pulse .8s ease-in-out infinite; }

.qbar { display: flex; align-items: center; justify-content: center; gap: 14px; }
.equation { display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); border-radius: 26px; padding: 6px 28px; font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 700; box-shadow: 0 6px 0 rgba(0, 0, 0, .18); min-height: 72px; }
.equation .op, .equation .eq { color: var(--violet); }
.equation .q { color: var(--pink); min-width: 1.1em; text-align: center; animation: pulse 1.4s ease-in-out infinite; }
.equation .q.ok { color: var(--mint-d); animation: starpop .5s both; }
.puz-title { font-size: clamp(1.2rem, 3.4vw, 1.8rem); }
.qtools { display: flex; gap: 8px; }
.no-equation .qtools button[data-act="hint"] { display: none; }
.hintbox { align-self: center; background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 20px; padding: 10px 18px; display: flex; align-items: center; gap: 16px; animation: pop-in .3s; max-width: 100%; }
.hintbox[hidden] { display: none; }
.hintbox p { margin: 0; font-weight: 500; font-size: .95rem; }
.dots { display: flex; gap: 8px; flex: none; }
.frame { display: grid; grid-template-columns: repeat(5, 16px); gap: 3px; padding: 4px; background: #efeaff; border-radius: 8px; }
.frame i { width: 16px; height: 16px; border-radius: 50%; background: #ddd5f5; }
.frame i.da { background: var(--sky); } .frame i.db { background: var(--orange); border-radius: 3px; transform: rotate(45deg) scale(.82); }

.stage { flex: 1; min-height: 0; position: relative; border-radius: 30px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(255, 255, 255, .5); touch-action: none; user-select: none; background: #123; }
.game-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: crosshair; }

.coach { display: flex; align-items: center; gap: 10px; min-height: 58px; }
.coach-mascot { width: 54px; flex: none; }
.coach-text { background: rgba(255, 255, 255, .95); color: var(--ink); padding: 10px 18px; border-radius: 20px 20px 20px 4px; font-weight: 600; font-size: 1.02rem; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.coach.bump .coach-text { animation: pop-in .3s; }

/* ===== 1. BALÕES ===== */
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, #4cc2ff 0%, #a6e6ff 70%, #e5f9ff 100%); overflow: hidden; }
.cloud { position: absolute; background: #fff; border-radius: 99px; height: 44px; width: 130px; opacity: .92; animation: drift 38s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -28px; left: 18px; } .cloud::after { width: 46px; height: 46px; top: -20px; left: 68px; }
.c1 { top: 12%; animation-delay: -4s; } .c2 { top: 36%; animation-delay: -20s; transform: scale(1.3); } .c3 { top: 60%; animation-delay: -30s; transform: scale(.8); }
.hills { position: absolute; left: -5%; right: -5%; bottom: 0; height: 18%; background: radial-gradient(120% 140% at 25% 100%, #4fcf7a 55%, transparent 56%), radial-gradient(120% 140% at 80% 110%, #36b866 55%, transparent 56%); }
.balloon-field { position: absolute; inset: 0; --h: 500px; }
.balloon { position: absolute; left: var(--x); bottom: -190px; margin-left: -62px; width: 124px; animation: rise var(--dur) linear var(--delay) infinite; cursor: pointer; z-index: 2; }
.b-body { display: grid; place-items: center; width: 124px; height: 148px; border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%; background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c1) 60%, #fff) 0%, var(--c1) 45%, var(--c2) 100%); box-shadow: inset -10px -14px 22px rgba(0, 0, 0, .16), 0 10px 18px rgba(0, 0, 0, .12); position: relative; animation: sway var(--sway) ease-in-out infinite alternate; transform-origin: 50% 110%; }
.b-shine { position: absolute; top: 14%; left: 20%; width: 22%; height: 26%; border-radius: 50%; background: rgba(255, 255, 255, .55); transform: rotate(30deg); }
.b-num { font-size: 3rem; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); margin-top: 6px; font-weight: 700; }
.b-shape { position: absolute; top: 12px; right: 18px; color: rgba(255, 255, 255, .9); font-size: 1.1rem; }
.b-knot { display: block; width: 14px; height: 12px; margin: -4px auto 0; background: var(--c2); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.b-string { display: block; width: 2px; height: 42px; margin: 0 auto; background: rgba(60, 40, 120, .45); }
.balloon:hover .b-body { filter: brightness(1.08); }
.balloon.popped { animation-play-state: paused; }
.balloon.popped .b-body, .balloon.popped .b-string, .balloon.popped .b-knot { animation: poof .3s forwards; }
.balloon.wrong .b-body { animation: wobble .4s 2; filter: grayscale(.7); }
.balloon.wrong.gone { opacity: 0; transition: opacity .4s; pointer-events: none; }
.balloon.away { transition: transform 1s, opacity 1s; opacity: 0; }
.balloon.reveal .b-body { box-shadow: 0 0 0 6px #fff, 0 0 40px 12px rgba(255, 255, 255, .9); }

/* ===== 3. QUEBRA-CABEÇA ===== */
.puz { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: linear-gradient(160deg, #35c9a5, #2a6fdb); overflow: auto; }
.puz-board { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(5, 1fr); gap: 6px; border-radius: 22px; padding: 6px; background: rgba(255, 255, 255, .25); }
.puz-row { position: relative; border-radius: 16px; display: flex; align-items: center; gap: 12px; padding: 4px 14px; overflow: hidden; background-size: 100% 500%; background-position: 0 calc(var(--i) * 25%); min-height: 54px; }
.puz-row::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, #5c6bff 0 14px, #4b59e0 14px 28px); transition: opacity .7s, transform .7s; }
.puz-row.solved::before { opacity: 0; transform: scale(1.1); }
.puz-board.pic-sunset .puz-row { background-image: radial-gradient(circle at 78% 52%, #fff6a8 0 6%, #ffd166 7% 11%, transparent 12%), linear-gradient(#ffa07a 0%, #ff6a88 30%, #8a4bd6 62%, #2b2d6e 100%); background-size: 100% 500%; }
.puz-board.pic-ocean .puz-row { background-image: radial-gradient(circle at 20% 22%, #fff 0 4%, transparent 5%), linear-gradient(#aeeaff 0%, #2fb4e6 28%, #1670c4 60%, #0b2f7a 100%); background-size: 100% 500%; }
.puz-board.pic-space .puz-row { background-image: radial-gradient(circle at 70% 60%, #ffb36b 0 9%, #ff6f61 10% 14%, transparent 15%), radial-gradient(circle at 25% 30%, #fff 0 1.2%, transparent 2%), linear-gradient(#0d0a2e, #2b1b6e 55%, #5b2ea6 100%); background-size: 100% 500%; }
.puz-board.pic-forest .puz-row { background-image: radial-gradient(circle at 18% 18%, #fff7b0 0 5%, transparent 6%), linear-gradient(#bff0ff 0%, #8ee08a 35%, #2fae5c 65%, #145a38 100%); background-size: 100% 500%; }
.puz-op { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border-radius: 14px; padding: 4px 16px; font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 700; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.puz-op span { color: var(--violet); }
.puz-slot { position: relative; z-index: 1; width: clamp(70px, 14vw, 110px); height: clamp(44px, 7vh, 62px); border-radius: 14px; border: 4px dashed #fff; background: rgba(255, 255, 255, .28); display: grid; place-items: center; color: #fff; font-size: 1.8rem; font-weight: 700; transition: transform .15s, background .15s; }
.puz-slot.hover { background: rgba(255, 255, 255, .6); transform: scale(1.08); }
.puz-slot.filled { border: 0; background: transparent; }
.puz-slot.filled > :not(.piece) { display: none; }
.puz-slot.nope { animation: shake .4s; border-color: #ff9fb5; }
.puz-tray-wrap { background: rgba(255, 255, 255, .22); border-radius: 22px; padding: 10px; }
.puz-tray { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 64px; }
.piece { position: relative; width: clamp(70px, 14vw, 110px); height: clamp(48px, 7.5vh, 64px); background: #fff; color: var(--ink); border-radius: 14px; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0, 0, 0, .22); cursor: grab; touch-action: none; transition: transform .12s; }
.piece::before { content: ''; position: absolute; left: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: inherit; }
.piece:hover { transform: translateY(-3px); }
.piece.selected { outline: 5px solid var(--sun); transform: translateY(-6px) scale(1.06); }
.piece.dragging { position: fixed; z-index: 70; pointer-events: none; transform: rotate(-4deg) scale(1.1); box-shadow: 0 16px 24px rgba(0, 0, 0, .35); }
.piece.placed { width: 100%; height: 100%; background: var(--mint); color: #fff; cursor: default; animation: snap .35s; box-shadow: 0 3px 0 var(--mint-d); }
.piece.placed::before { display: none; }
.piece.shake { animation: shake .4s; }
.puz-board.complete { animation: pulse .6s 2; }

/* ===== 4. LABIRINTO ===== */
.maze-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0%, #6a4dff, #2b2260); padding: 10px; gap: 10px; }
.maze-board { position: relative; flex: 1; min-height: 0; }
.maze-board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-mark { fill: #ffc933; stroke: #fff; stroke-width: 2; opacity: .85; } .m-mark.done { fill: #1fd1a0; }
.m-trail { stroke: #ff5fa2; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.hero { position: absolute; font-size: clamp(1.6rem, 5vw, 2.6rem); transform: translate(-50%, -58%); transition: left .17s linear, top .17s linear; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .35)); animation: bob 1s ease-in-out infinite; pointer-events: none; }
.doors { display: flex; justify-content: center; gap: clamp(10px, 4vw, 40px); padding-bottom: 4px; }
.door { width: clamp(88px, 22vw, 150px); height: clamp(86px, 17vh, 132px); position: relative; perspective: 500px; }
.door-arch { position: absolute; inset: 0; border-radius: 60px 60px 8px 8px; background: linear-gradient(90deg, #b9743a, #d99556 40%, #b9743a); box-shadow: inset 0 0 0 5px #7a4520, 0 8px 0 #5b3216; display: grid; place-items: center; transform-origin: left center; transition: transform .6s cubic-bezier(.3, 1.2, .4, 1); }
.door-plate { background: #fff7d6; color: var(--ink); border-radius: 12px; padding: 0 14px; font-size: clamp(1.6rem, 4.5vw, 2.6rem); font-weight: 700; margin-top: 18px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.door-knob { position: absolute; right: 12px; top: 58%; width: 12px; height: 12px; border-radius: 50%; background: #ffd34d; }
.door:hover:not(:disabled) .door-arch { filter: brightness(1.1); transform: translateY(-4px); }
.door.open .door-arch { transform: rotateY(-75deg); background: linear-gradient(90deg, #7a4520, #a8672f); }
.door.open { filter: drop-shadow(0 0 16px #ffe08a); }
.door.hint .door-arch { animation: pulse .6s 3; }
.door.locked .door-arch { animation: shake .4s; filter: grayscale(.8) brightness(.7); }
.door.dim { opacity: .35; }

/* ===== 5. ESPAÇO ===== */
.space-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 120%, #4b2fd6 0%, #1a1050 45%, #070425 100%); overflow: hidden; }
.stars { position: absolute; inset: 0; background-repeat: repeat; animation: stars 14s linear infinite; }
.stars.s1 { background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 90px 120px, #cfe6ff, transparent), radial-gradient(2px 2px at 160px 60px, #fff, transparent), radial-gradient(1px 1px at 230px 180px, #ffe9a8, transparent); background-size: 260px 220px; }
.stars.s2 { background-image: radial-gradient(3px 3px at 60px 90px, #fff, transparent), radial-gradient(2px 2px at 190px 200px, #b9a5ff, transparent); background-size: 340px 300px; animation-duration: 7s; opacity: .8; }
.planet { position: absolute; right: -60px; top: 12%; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffb36b, #ff6f61 55%, #8a2b6e); box-shadow: inset -22px -16px 30px rgba(0, 0, 0, .4); opacity: .85; }
.lanes { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); z-index: 3; }
.lane { border-left: 2px dashed rgba(255, 255, 255, .12); cursor: pointer; transition: background .15s; }
.lane:first-child { border-left: 0; }
.lane:hover { background: rgba(255, 255, 255, .06); }
.rocks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.rock { position: absolute; top: 0; width: clamp(80px, 17vw, 120px); transform: translate(-50%, -100px); }
.rock-body { display: grid; place-items: center; aspect-ratio: 1; border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; background: radial-gradient(circle at 30% 30%, hsl(var(--h) 25% 62%), hsl(var(--h) 30% 38%) 70%, hsl(var(--h) 35% 24%)); box-shadow: inset -8px -10px 16px rgba(0, 0, 0, .35), 0 0 0 3px hsl(var(--h) 80% 70% / .5); position: relative; animation: spin 8s linear infinite; }
.rock-body b { font-size: clamp(1.8rem, 5vw, 2.8rem); color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); animation: spin 8s linear infinite reverse; }
.rock-shape { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-size: .95rem; color: rgba(255, 255, 255, .9); }
.rock.crystal .rock-body { background: radial-gradient(circle at 30% 30%, #e9fbff, #7fe0ff 50%, #3d7bff); border-radius: 30%; transform: rotate(45deg); animation: pulse .5s infinite; box-shadow: 0 0 40px 10px #9be7ff; }
.rock.crystal .rock-body b { animation: none; transform: rotate(-45deg); color: #1d3aa8; text-shadow: none; }
.rock.boom { animation: poof .4s forwards; } .rock.fade { opacity: 0; transition: opacity .6s; }
.ship { position: absolute; bottom: 14px; width: clamp(46px, 9vw, 70px); transform: translateX(-50%); transition: left .22s cubic-bezier(.3, 1.4, .5, 1); z-index: 4; pointer-events: none; filter: drop-shadow(0 0 14px rgba(120, 190, 255, .7)); }
.ship svg { width: 100%; display: block; }
.ship .flame { animation: flame .12s infinite alternate; transform-origin: 30px 64px; }
.ship.shake { animation: shake .4s; } .ship.boost { animation: boost .8s ease-in; }

/* ===== 6. PESCARIA (canvas) ===== */
.play[data-game="fishing"] .game-canvas, .play[data-game="archer"] .game-canvas { cursor: crosshair; }

/* ---------- Responsivo dos jogos ---------- */
@media (max-width: 720px) {
  .hud-title span { display: none; } .hud-score .score { padding: 6px 10px; }
  .coach-text { font-size: .9rem; padding: 8px 12px; } .coach-mascot { width: 44px; }
  .equation { padding: 4px 18px; min-height: 60px; gap: 8px; }
  .hintbox { flex-direction: column; gap: 6px; }
  .b-num { font-size: 2.2rem; } .balloon, .b-body { width: 92px; } .balloon { margin-left: -46px; } .b-body { height: 112px; }
  .planet { display: none; }
}
@media (max-height: 560px) {
  .coach { display: none; } .equation { min-height: 52px; font-size: 2rem; }
}
