/* WaterHero · «Pioggia di Poteri» (sito e playable ad). Caratteri del sito quando ci sono, altrimenti di sistema (negli annunci). */
.whg { --whg-accent: #ffb68a; --whg-head: var(--font-archivo, "Archivo WH", "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif); --whg-body: var(--font-inter, "Inter WH", "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif); --whg-blue: #005bd3; --whg-yellow: #ffd500; --whg-ink: #101820; position: relative; overflow: hidden; width: 100%; height: 100%; min-height: 560px; border-radius: 28px; background: #000; color: #fff; font-family: var(--whg-body); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.whg:focus { outline: none; }
.whg-canvas { position: absolute; inset: 0; display: block; }
.whg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* HUD */
.whg-hud { position: absolute; left: 10px; right: 10px; top: 10px; display: grid; gap: 6px; pointer-events: none; }
.whg-hud[hidden] { display: none; }
.whg-pill { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 16px 12px; border-radius: 22px; background: rgba(4, 10, 22, .58); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-weight: 700; overflow: hidden; }
.whg-pill b { display: inline-block; font-family: var(--whg-head); font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.whg-pill small { margin-left: 4px; color: #b9c0ca; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.whg-lvl { display: grid; min-width: 0; }
.whg-lvl b { font-size: 18px; }
.whg-lvl small { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--whg-accent); letter-spacing: .04em; }
.whg-time { text-align: center; }
.whg-time b { font-size: 26px; }
.whg-score { justify-self: end; text-align: right; }
.whg-score b { transform-origin: right center; }
.whg-fbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .1); }
.whg-fbar span { display: block; height: 100%; background: linear-gradient(90deg, #59bfff, #c9f1ff); transform-origin: left center; transform: scaleX(0); transition: transform .15s linear; }
.whg-hud.is-rush .whg-time b { color: #ff5a6e; animation: whg-beat 1s infinite; }
@keyframes whg-beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.22); } 30% { transform: scale(1); } }
.whg-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
.whg-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.whg-lives { display: flex; gap: 3px; color: #ff6b7d; font-size: 17px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.whg-lives .off, .whg-lives-big .off { color: rgba(255, 255, 255, .25); }
.whg-power { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 7px; border-radius: 999px; background: var(--c, #ffb68a); color: #101820; font-family: var(--whg-head); font-weight: 800; font-size: 12.5px; letter-spacing: .01em; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); white-space: nowrap; }
.whg-power[hidden] { display: none; }
.whg-power svg { width: 15px; height: 15px; }
.whg-power.is-used { opacity: .45; }
.whg-ctrl { display: flex; gap: 6px; pointer-events: auto; }
.whg-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; }
.whg-icon svg, .whg-chip svg { width: 20px; height: 20px; }
.whg svg .off { display: none; }
.whg.is-muted svg .on { display: none; }
.whg.is-muted svg .off { display: inline; }

/* Schermate */
.whg-screen { position: absolute; inset: 0; display: grid; place-items: safe center; padding: 18px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; background: radial-gradient(120% 90% at 50% 20%, rgba(10, 30, 66, .88), rgba(1, 4, 12, .96)); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); user-select: text; -webkit-user-select: text; }
.whg-screen[hidden] { display: none; }
.whg-screen.is-soft { place-items: start center; padding-top: 112px; background: linear-gradient(rgba(1, 4, 12, .9) 0, rgba(1, 4, 12, .78) 62%, rgba(1, 4, 12, .1) 86%); backdrop-filter: none; -webkit-backdrop-filter: none; }
.whg-card { position: relative; z-index: 1; width: min(100%, 460px); display: grid; gap: 12px; justify-items: center; text-align: center; animation: whg-in .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes whg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.whg-top { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; }
.whg-logo { display: block; width: 150px; height: auto; color: #fff; }
.whg-logo-sm { width: 118px; opacity: .92; }
.whg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .06); color: #e6e9ee; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.whg-kicker { margin: 0; color: var(--whg-accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.whg-title { margin: 0; font-family: var(--whg-head); font-weight: 800; font-size: clamp(30px, 7vw, 44px); line-height: .98; letter-spacing: -.03em; outline: none; text-wrap: balance; }
.whg-text { margin: 0; color: #d4d8de; font-size: 15px; line-height: 1.45; }
.whg-text b { color: #fff; }
.whg-path { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: 100%; margin: 0; padding: 0; counter-reset: none; }
.whg-path li { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0 2px; color: #aab4c2; font-size: 10.5px; font-weight: 600; line-height: 1.15; }
.whg-path li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: rgba(255, 255, 255, .16); z-index: -1; }
.whg-path li:first-child::before { display: none; }
.whg-path span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #16233a; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28); color: #fff; font-family: var(--whg-head); font-weight: 800; font-size: 12px; }
.whg-path li.is-gold span { box-shadow: inset 0 0 0 2px #f5c518; color: #ffe28a; }
.whg-path li.is-done { color: #fff; }
.whg-path li.is-done span { background: var(--whg-accent); box-shadow: none; color: #0a0a0a; }
.whg-path li.is-done.is-gold span { background: linear-gradient(135deg, #fff6b8, #f5c518 50%, #c78f00); }
.whg-path li.is-fail span { background: #3a1018; box-shadow: inset 0 0 0 2px #ff6b7d; }
.whg-legend { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; width: 100%; margin: 2px 0 0; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .07); text-align: left; font-size: 13px; line-height: 1.3; }
.whg-legend li { display: flex; align-items: center; gap: 9px; }
.whg-legend b { margin-left: auto; padding-left: 6px; white-space: nowrap; }
.whg-legend .lg { flex: none; width: 14px; height: 22px; border-radius: 3px; background: linear-gradient(#1b2028 0 36%, var(--c, #fff) 36%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.whg-legend .lg.drop, .whg-legend .lg.gold { width: 14px; height: 18px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; clip-path: path("M7 0C9 4 14 8 14 12A7 7 0 0 1 0 12C0 8 5 4 7 0Z"); background: radial-gradient(circle at 35% 55%, #fff, #59bfff 55%, #1767e0); box-shadow: none; }
.whg-legend .lg.gold { background: radial-gradient(circle at 35% 55%, #fffbe3, #ffd96a 45%, #b07400); }
.whg-legend .lg.bad { width: 16px; height: 16px; border-radius: 3px; background: #f4f4f5; box-shadow: inset 0 0 0 3px #e11d48; }
.whg-rules { margin: 0; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(255, 213, 0, .45); background: rgba(255, 213, 0, .08); color: #fff3c4; font-size: 12px; line-height: 1.45; text-align: left; }
.whg-rules strong { color: #ffd500; }
.whg-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 28px; border: 0; border-radius: 999px; background: #fff; color: #000; font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; transition: transform .15s, opacity .2s; }
.whg-btn:hover { transform: scale(1.03); }
.whg-btn:disabled { opacity: .55; cursor: default; transform: none; }
.whg-btn:focus-visible, .whg-link:focus-visible, .whg-chip:focus-visible, .whg-icon:focus-visible, .whg-check input:focus-visible { outline: 3px solid var(--whg-accent); outline-offset: 3px; }
.whg-play, .whg-go { min-width: min(100%, 300px); min-height: 58px; font-size: 17px; background: var(--whg-accent); color: #0a0a0a; }
.whg-play { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); animation: whg-ping 1.8s infinite; }
@keyframes whg-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); } 70% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.whg-gold { min-width: min(100%, 300px); background: linear-gradient(135deg, #fff1a8, #f5c518 55%, #e0a400); color: #1a1200; box-shadow: 0 8px 26px rgba(245, 197, 24, .28); }
.whg-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.whg-tap { position: relative; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; }
.whg-tap::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.whg-link { min-height: 40px; border: 0; background: none; color: #d4d8de; font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.whg-meta { margin: -2px 0 0; color: #aab1bb; font-size: 12.5px; }
.whg-meta b { color: #fff; }
.whg i { display: inline-block; width: 18px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .18); clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); }
.whg i.on { background: linear-gradient(135deg, #fff6b8, #f5c518 50%, #a87400); }
.whg-ingots { display: flex; gap: 8px; }
.whg-ingots i { width: 42px; height: 22px; transition: background .2s; }
.whg-ingots i.pop { animation: whg-coin .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes whg-coin { from { transform: scale(0) rotate(-25deg); filter: brightness(2); } to { transform: none; filter: none; } }
.whg-score-big { margin: 0; color: #d4d8de; font-size: 15px; font-weight: 600; }
.whg-score-big b { display: block; color: #fff; font-family: var(--whg-head); font-size: clamp(44px, 12vw, 62px); font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.whg-record { margin: -4px 0 0; color: #aab1bb; font-size: 13px; font-weight: 600; }
.whg-record.is-new { padding: 4px 12px; border-radius: 999px; background: var(--whg-accent); color: #0a0a0a; font-weight: 800; letter-spacing: .02em; }
.whg-big { margin: 0; font-family: var(--whg-head); font-weight: 800; font-size: 28px; letter-spacing: -.02em; color: #ffd75e; opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.whg-big.show { opacity: 1; transform: none; }
.whg-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 0; color: #c3cad4; font-size: 13px; }
.whg-stats b { color: #fff; font-family: var(--whg-head); font-size: 16px; }
.whg-next { display: grid; gap: 2px; width: 100%; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.whg-next small { color: var(--whg-accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.whg-next strong { font-family: var(--whg-head); font-size: 22px; letter-spacing: -.02em; }
.whg-next span { color: #d4d8de; font-size: 14px; }
.whg-level.is-big .whg-title { color: #ffd75e; }
.whg-lives-big { display: flex; gap: 6px; margin: 0; color: #ff6b7d; font-size: 26px; }
.whg-claim { margin: 4px 0 0; color: #c9d2de; font-size: 13px; letter-spacing: .01em; }
.whg-claim b { color: var(--whg-yellow); font-family: var(--whg-head); font-weight: 800; }
.whg-shop { width: 100%; text-align: left; }
.whg-shop p { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.whg-shop ul { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.whg-shop li { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .07); }
.whg-shop img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, .9); }
.whg-shop span { display: grid; } .whg-shop small { color: #c3c8cf; } .whg-shop small b { color: #ffd500; }
.whg-code { display: grid; gap: 4px; width: 100%; padding: 14px; border-radius: 16px; border: 2px dashed #ffd500; outline: none; user-select: text; -webkit-user-select: text; }
.whg-code:focus-visible { outline: 3px solid var(--whg-accent); outline-offset: 3px; }
.whg-code span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #ffd500; }
.whg-code strong { font-family: var(--whg-head); font-size: 26px; letter-spacing: .04em; }
.whg-code small { color: #d4d8de; font-size: 12px; }
.whg-saved { display: grid; gap: 12px; justify-items: center; width: 100%; }
.whg-save { display: grid; gap: 8px; width: 100%; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 215, 94, .35); text-align: left; font-size: 13px; color: #d4d8de; }
.whg-save > label:first-child { font-weight: 700; color: #fff; font-size: 14px; }
.whg-save input[type="email"], .whg-codeform input { width: 100%; min-width: 0; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 17px; font-weight: 600; user-select: text; -webkit-user-select: text; }
.whg-save input[type="email"]:focus-visible, .whg-codeform input:focus-visible { outline: 2px solid #ffd500; outline-offset: 2px; }
.whg-save input[aria-invalid="true"], .whg-codeform input[aria-invalid="true"] { border-color: #ff8a8a; }
.whg-check { display: flex; align-items: flex-start; gap: 10px; min-height: 32px; color: #e6e9ee; font-size: 13.5px; line-height: 1.35; cursor: pointer; }
.whg-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #f5c518; }
.whg-note { margin: 0; color: #b9c2ce; font-size: 12px; line-height: 1.4; }
.whg-note a { color: #fff; }
.whg-save .whg-btn { justify-self: center; margin-top: 4px; }
.whg-codeform { display: grid; gap: 6px; width: 100%; text-align: left; font-size: 13px; color: #d4d8de; }
.whg-codeform span { display: flex; gap: 8px; }
.whg-codeform input[name="partita"] { font-size: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.whg-codeform .whg-btn { flex: none; min-height: 50px; padding: 0 20px; }
.whg-error, .whg-ok { margin: 0; font-size: 14px; line-height: 1.4; }
.whg-error { color: #ff9a9a; }
.whg-ok { color: #b9f0c4; }
.whg-error:empty, .whg-ok:empty { display: none; }
[data-resend-slot] { width: 100%; display: grid; justify-items: center; }

/* Coriandoli */
.whg-confetti { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.whg-confetti i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; clip-path: none; background: var(--c); animation: whg-fall var(--t) var(--d) cubic-bezier(.3, .6, .6, 1) forwards; opacity: 0; }
@keyframes whg-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(110vh) rotate(var(--r)); } }

/* Schermi bassi (playable 320x480, telefoni in orizzontale) */
@media (max-height: 640px) {
  .whg-text { font-size: 13.5px; }
  .whg-intro > .whg-text, .whg-intro .whg-legend { display: none; }
  .whg-card { gap: 9px; }
  .whg-title { font-size: clamp(25px, 7vw, 34px); }
  .whg-rules { padding: 8px 12px; font-size: 11.5px; }
  .whg-score-big b { display: inline; margin-right: 4px; font-size: 40px; }
  .whg-result .whg-kicker { display: none; }
  .whg-big { font-size: 24px; }
  .whg-code { padding: 9px 12px; gap: 2px; }
  .whg-code strong { font-size: 22px; }
  .whg-code small { font-size: 11px; }
  .whg-next { padding: 9px 12px; }
  .whg-next strong { font-size: 19px; }
  .whg-logo { width: 124px; }
  .whg-result .whg-path, .whg-result .whg-score-big + .whg-record:not(.is-new) { display: none; }
  .whg-logo-sm { width: 100px; }
}
@media (max-width: 480px) {
  .whg-screen { padding: 14px 12px; }
  .whg-card { gap: 10px; }
  .whg-title { font-size: 29px; }
  .whg-text { font-size: 14px; }
  .whg-legend { grid-template-columns: 1fr; font-size: 13px; padding: 10px 12px; gap: 6px; }
  .whg-btn { min-height: 50px; }
  .whg-keys { display: none; }
  .whg-pill { padding: 7px 12px 11px; }
  .whg-pill b { font-size: 20px; }
  .whg-time b { font-size: 24px; }
  .whg-lvl b { font-size: 16px; }
}
@media (max-width: 360px), (max-height: 520px) {
  .whg-title { font-size: 25px; }
  .whg-pill small { font-size: 10px; }
  .whg-score small { display: none; }
  .whg-path li { font-size: 9.5px; }
  .whg-ingots i { width: 36px; height: 19px; }
  .whg-chip { min-height: 32px; padding: 0 10px; font-size: 12px; }
  .whg-logo { width: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .whg-card, .whg-ingots i.pop, .whg-play, .whg-hud.is-rush .whg-time b { animation: none; }
  .whg-big, .whg-btn, .whg-fbar span { transition: none; }
  .whg-confetti { display: none; }
}
@media (max-height: 640px) { .whg-screen.is-soft { place-items: safe center; padding-top: 18px; background: rgba(1, 4, 12, .9); } }
