/* Animal King — cinematic dark UI layer. Loaded after all legacy styles. */
:root{--ak-radius:10px;--ak-panel:#071923e8;--ak-panel-2:#0b2230e8;--ak-line:rgba(137,211,226,.25);--ak-gold:#d9a526;--ak-green:#1f8b42;--ak-green-2:#0d6531;--ak-danger:#bd2935}
html[data-ak-theme="default"],html[data-ak-theme="premium"]{--ak-bg-image:url('https://images.unsplash.com/photo-1767988048897-2dca103ff620?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="natale"]{--ak-bg-image:url('https://images.unsplash.com/photo-1764976971384-4e5115d0e8e0?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="epifania"]{--ak-bg-image:url('https://images.unsplash.com/photo-1674231262658-9a98bc841270?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="carnevale"]{--ak-bg-image:url('https://images.unsplash.com/photo-1618143511698-c2ebcdabb11d?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="pasqua"]{--ak-bg-image:url('https://images.unsplash.com/photo-1712925371047-13ec04329870?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="primavera"]{--ak-bg-image:url('https://images.unsplash.com/photo-1747418941971-111d7650ed16?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="estate"]{--ak-bg-image:url('https://images.unsplash.com/photo-1737944584732-447ff2091a73?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="autunno"]{--ak-bg-image:url('https://images.unsplash.com/photo-1759691397916-abc3fe1dbb43?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme="halloween"]{--ak-bg-image:url('https://images.unsplash.com/photo-1783712976804-5eb6ca317af5?auto=format&fit=crop&fm=jpg&q=78&w=2400')}
html[data-ak-theme] body{background-image:linear-gradient(120deg,rgba(2,12,18,.78),rgba(4,24,31,.48),rgba(2,12,18,.74)),var(--ak-bg-image)!important;background-size:cover!important;background-position:center!important;background-attachment:fixed!important;color:#f4f8fa!important}
html[data-ak-theme] body:has(.page-shell) .page-shell{width:min(1760px,100%)!important;max-width:none!important;padding:10px!important;margin:0 auto!important}
html[data-ak-theme] .card{border:1px solid var(--ak-line)!important;border-radius:8px!important;background:rgba(3,15,22,.30)!important;box-shadow:0 24px 70px rgba(0,0,0,.34)!important;backdrop-filter:blur(4px);overflow:hidden!important}
html[data-ak-theme] .card::before,html[data-ak-theme] .card::after,html[data-ak-theme] form::before,html[data-ak-theme] form::after,html[data-ak-theme] .payment-panel::before,html[data-ak-theme] .payment-panel::after{display:none!important;content:none!important}
html[data-ak-theme] .page-header{display:grid!important;grid-template-columns:auto minmax(320px,1fr) auto!important;align-items:center!important;gap:18px!important;min-height:78px!important;padding:12px 18px!important;border:0!important;border-bottom:1px solid rgba(218,174,54,.48)!important;border-radius:0!important;background:linear-gradient(100deg,rgba(2,18,27,.98),rgba(5,40,52,.96),rgba(5,25,34,.98))!important;box-shadow:0 12px 30px rgba(0,0,0,.34)!important}
html[data-ak-theme] .logo-wrap img{width:64px!important;height:64px!important;object-fit:contain!important;border-radius:8px!important;background:#fff!important;padding:4px!important;box-shadow:0 8px 20px rgba(0,0,0,.35)!important}
html[data-ak-theme] .header-welcome-title{font-size:clamp(1rem,1.3vw,1.32rem)!important;color:#fff!important;margin:0!important}html[data-ak-theme] .header-welcome-subtitle,html[data-ak-theme] .header-play-hint{color:#dce8eb!important;margin:.25rem 0 0!important}
html[data-ak-theme] .action-bar{display:flex!important;flex-wrap:wrap!important;justify-content:flex-end!important;gap:8px!important}
html[data-ak-theme] .ak-action-btn{min-height:42px!important;padding:8px 12px!important;border-radius:5px!important;border:1px solid rgba(75,201,222,.35)!important;background:linear-gradient(180deg,#073d50,#062a39)!important;color:#fff!important;box-shadow:inset 0 1px rgba(255,255,255,.08),0 8px 18px rgba(0,0,0,.22)!important;font-size:.82rem!important}
html[data-ak-theme] .ak-action-btn:hover{background:linear-gradient(180deg,#0a536a,#073749)!important;border-color:#5dd5e8!important;transform:translateY(-1px)!important}
html[data-ak-theme] .ak-action-logout{background:linear-gradient(180deg,#a52d37,#711b25)!important;border-color:#e0646d!important}.ak-action-icon{display:grid!important;place-items:center!important;width:24px!important;height:24px!important;border-radius:4px!important;background:rgba(255,255,255,.12)!important;font-size:0!important}.ak-action-icon i{font-size:14px!important;color:#54e1dc!important}.ak-action-logout .ak-action-icon i{color:#fff!important}.ak-action-prizes .ak-action-icon i{color:#ffd45b!important}
html[data-ak-theme] .content-area{display:grid!important;grid-template-columns:minmax(330px,.72fr) minmax(620px,1.45fr)!important;gap:18px!important;align-items:start!important;padding:18px!important;background:transparent!important;min-height:calc(100vh - 110px)!important}
html[data-ak-theme] .payment-panel.ak-checkout-card{grid-column:1!important;margin:0!important;width:100%!important;max-width:none!important;padding:18px!important;border:1px solid rgba(218,174,54,.42)!important;border-radius:8px!important;background:linear-gradient(155deg,rgba(4,22,31,.96),rgba(8,37,48,.93))!important;color:#eef6f8!important;box-shadow:0 18px 45px rgba(0,0,0,.36)!important}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(p,h2,h3,h4,label,strong,span){color:inherit!important}html[data-ak-theme] .ak-payment-amount strong{display:inline-block!important;padding:5px 10px!important;border-radius:4px!important;background:#0d7440!important;color:#fff!important}.ak-payment-warning{border-radius:5px!important;background:rgba(201,145,25,.16)!important;border:1px solid rgba(233,180,58,.55)!important;color:#ffd86a!important}
html[data-ak-theme] .ak-checkout-box,html[data-ak-theme] .ak-security-description,html[data-ak-theme] .ak-card-fields-panel{border-radius:6px!important;background:rgba(2,14,20,.58)!important;border:1px solid var(--ak-line)!important;box-shadow:none!important}
html[data-ak-theme] .ak-wallet-option,html[data-ak-theme] .ak-card-inline-button,html[data-ak-theme] .ak-legacy-paypal-button,html[data-ak-theme] .ak-card-pay-button{border-radius:5px!important}
html[data-ak-theme] #ak-number-grid.grid-panel{grid-column:2!important;margin:0!important;padding:12px!important;border-radius:8px!important;border:1px solid rgba(218,174,54,.62)!important;background:linear-gradient(145deg,rgba(3,17,24,.95),rgba(7,31,39,.93))!important;box-shadow:0 0 0 3px rgba(218,174,54,.14),0 22px 52px rgba(0,0,0,.42)!important;backdrop-filter:blur(6px)}
html[data-ak-theme] .table1{background:rgba(2,12,17,.60)!important;border-radius:4px!important;padding:6px!important}html[data-ak-theme] .table1 td{background:rgba(255,255,255,.10)!important;border-radius:4px!important;border:1px solid rgba(255,255,255,.14)!important;padding:5px!important}.table1 .button,.table1 .button2{border-radius:4px!important;box-shadow:inset 0 1px rgba(255,255,255,.25),0 4px 8px rgba(0,0,0,.35)!important}
/* Authentication pages */
html[data-ak-theme] body.ak-login-body,html[data-ak-theme] body:not(:has(.page-header)){background-image:linear-gradient(120deg,rgba(2,12,18,.70),rgba(3,24,31,.38)),var(--ak-bg-image)!important}
html[data-ak-theme] :is(.login-card,.reset-card,.registration-card,.password-card,.auth-card,.wrapper){border-radius:8px!important;border:1px solid rgba(218,174,54,.35)!important;background:rgba(3,18,25,.90)!important;box-shadow:0 28px 70px rgba(0,0,0,.42)!important;backdrop-filter:blur(12px)!important;overflow:hidden!important}
html[data-ak-theme] :is(.brand-panel,.form-panel){border-radius:0!important}html[data-ak-theme] .brand-panel{background:linear-gradient(160deg,rgba(3,20,27,.84),rgba(4,46,48,.80)),var(--ak-bg-image)!important;background-size:cover!important;background-position:center!important}
html[data-ak-theme] .form-panel{background:rgba(4,20,28,.91)!important;color:#f4f8fa!important}html[data-ak-theme] .form-panel :is(h1,h2,h3,p,label,small,span){color:#f4f8fa!important}
html[data-ak-theme] :is(.form-control,input[type=email],input[type=password],input[type=text],input[type=tel],select,textarea){border-radius:5px!important;border:1px solid rgba(138,204,216,.38)!important;background:#f8f3d9!important;color:#172229!important;box-shadow:none!important}html[data-ak-theme] :is(.form-control,input,select,textarea):focus{border-color:#63d8e2!important;box-shadow:0 0 0 3px rgba(64,203,217,.16)!important}
html[data-ak-theme] :is(.btn-login,.btn-register,.btn-submit,.form-panel button[type=submit],.form-panel input[type=submit]){border-radius:5px!important;background:linear-gradient(180deg,#398d24,#246416)!important;border:1px solid #6dbb4c!important;color:#fff!important;box-shadow:0 10px 22px rgba(0,0,0,.28)!important}
html[data-ak-theme] :is(.helper-box,.info-box,.brand-footer,.step-badge,.eyebrow,.badge){border-radius:5px!important}.brand-logo{border-radius:7px!important}
.ak-ui-icon{display:inline-grid;place-items:center;min-width:1.25em;margin-right:.42em;color:#55e1dd}.btn-danger .ak-ui-icon{color:#fff}.btn-warning .ak-ui-icon{color:#ffd15a}
@media(max-width:1050px){html[data-ak-theme] .page-header{grid-template-columns:auto 1fr!important}.action-bar{grid-column:1/-1!important;justify-content:flex-start!important}html[data-ak-theme] .content-area{grid-template-columns:1fr!important}html[data-ak-theme] .payment-panel.ak-checkout-card,html[data-ak-theme] #ak-number-grid.grid-panel{grid-column:1!important}}
@media(max-width:640px){html[data-ak-theme] body:has(.page-shell) .page-shell{padding:0!important}.card{border-radius:0!important}.page-header{padding:10px!important}.content-area{padding:10px!important}.ak-action-btn{flex:1 1 46%!important}.payment-panel.ak-checkout-card,#ak-number-grid.grid-panel{border-radius:6px!important}}

/* v4 — pagamento e finestre azione coerenti con il tema selezionato */
html[data-ak-theme] .payment-panel.ak-checkout-card{
  position:relative!important;
  isolation:isolate!important;
  border:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 55%,transparent)!important;
  border-radius:7px!important;
  background:
    linear-gradient(145deg,rgba(2,15,22,.94),rgba(5,30,39,.91)),
    var(--ak-bg-image)!important;
  background-size:cover!important;
  background-position:center!important;
  color:#eef7f8!important;
}
html[data-ak-theme] .payment-panel.ak-checkout-card::before{
  content:""!important;display:block!important;position:absolute!important;inset:0!important;z-index:-1!important;
  background:linear-gradient(110deg,rgba(1,11,17,.90),rgba(4,30,38,.72),rgba(1,11,17,.91))!important;
  pointer-events:none!important;
}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(.ak-checkout-box,.ak-card-fields-panel,.ak-security-description,.ak-wallet-note,.ak-card-fields-note){
  border-radius:5px!important;
  border:1px solid rgba(124,205,218,.24)!important;
  background:rgba(2,15,22,.76)!important;
  color:#dcebed!important;
  box-shadow:0 14px 30px rgba(0,0,0,.24)!important;
  backdrop-filter:blur(8px)!important;
}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(.ak-checkout-heading h3,.ak-wallet-label,.ak-card-fields-panel label,.ak-card-fields-panel strong){color:#fff!important}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(.ak-checkout-heading p,.ak-wallet-note,.ak-card-fields-note,.ak-security-description){color:#c8dadd!important}
html[data-ak-theme] .payment-panel.ak-checkout-card .ak-payment-icon{border-radius:5px!important;background:linear-gradient(145deg,var(--ak-primary,#17633f),var(--ak-primary-dark,#0e442b))!important;color:#fff!important;border:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 60%,transparent)!important}
html[data-ak-theme] .payment-panel.ak-checkout-card .ak-secure-logo{border-radius:4px!important;box-shadow:none!important}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(.ak-card-inline-button,.ak-card-pay-button,.ak-legacy-paypal-button){
  border-radius:4px!important;transform:none!important;translate:none!important;transition:filter .15s ease,box-shadow .15s ease!important;
}
html[data-ak-theme] .payment-panel.ak-checkout-card :is(.ak-card-inline-button,.ak-card-pay-button,.ak-legacy-paypal-button):hover{
  transform:none!important;translate:none!important;filter:brightness(1.08)!important;
}
html[data-ak-theme] .payment-panel.ak-checkout-card .ak-card-pay-button{background:linear-gradient(180deg,var(--ak-primary,#1f8b42),var(--ak-primary-dark,#0d6531))!important;border:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 45%,transparent)!important}
html[data-ak-theme] .payment-panel.ak-checkout-card .ak-card-field,
html[data-ak-theme] .payment-panel.ak-checkout-card .ak-card-name-input{border-radius:4px!important;background:#f7f2dc!important;border-color:rgba(126,205,219,.48)!important}

/* Pulsante PAGA mobile stabile: nessun salto su hover/focus/touch */
html[data-ak-theme] .ak-mobile-pay-button{
  left:14px!important;right:14px!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;
  width:auto!important;min-width:0!important;max-width:none!important;height:54px!important;
  transform:translate3d(0,18px,0)!important;translate:none!important;
  border-radius:5px!important;border:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 55%,transparent)!important;
  background:linear-gradient(180deg,var(--ak-primary,#17633f),var(--ak-primary-dark,#0e442b))!important;
  box-shadow:0 12px 28px rgba(0,0,0,.42)!important;
  transition:opacity .18s ease,filter .15s ease!important;
  will-change:opacity!important;-webkit-tap-highlight-color:transparent!important;touch-action:manipulation!important;
}
html[data-ak-theme] .ak-mobile-pay-button.is-visible{transform:translate3d(0,0,0)!important}
html[data-ak-theme] .ak-mobile-pay-button:hover,
html[data-ak-theme] .ak-mobile-pay-button:focus,
html[data-ak-theme] .ak-mobile-pay-button:focus-visible,
html[data-ak-theme] .ak-mobile-pay-button:active{transform:translate3d(0,0,0)!important;translate:none!important;filter:brightness(1.07)!important;outline:none!important}

/* Shell comune dei modal, tematizzata e più squadrata */
html[data-ak-theme] .ak-action-modal-overlay{background:rgba(0,8,13,.78)!important;backdrop-filter:blur(8px)!important}
html[data-ak-theme] .ak-action-modal-box{
  border-radius:7px!important;border:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 48%,transparent)!important;
  background:rgba(2,15,22,.97)!important;box-shadow:0 34px 100px rgba(0,0,0,.60)!important;
}
html[data-ak-theme] .ak-action-modal-head{
  background:linear-gradient(100deg,rgba(2,18,27,.99),rgba(5,44,55,.97),rgba(3,20,28,.99))!important;
  border-bottom:1px solid color-mix(in srgb,var(--ak-accent,#d9a526) 40%,transparent)!important;
}
html[data-ak-theme] .ak-action-modal-title{color:#fff!important}
html[data-ak-theme] .ak-action-modal-close{border-radius:4px!important;background:rgba(255,255,255,.10)!important;color:#fff!important;border:1px solid rgba(255,255,255,.16)!important;transform:none!important}
html[data-ak-theme] .ak-action-modal-close:hover{background:rgba(189,41,53,.78)!important;transform:none!important}
html[data-ak-theme] .ak-action-modal-body,
html[data-ak-theme] .ak-action-modal-frame,
html[data-ak-theme] .ak-action-modal-content,
html[data-ak-theme] .ak-password-modal-panel{
  background:
   linear-gradient(135deg,rgba(2,14,21,.91),rgba(4,33,42,.82),rgba(2,14,21,.94)),
   var(--ak-bg-image)!important;
  background-size:cover!important;background-position:center!important;color:#edf6f7!important;
}
html[data-ak-theme] .ak-password-card{max-width:650px!important;border-radius:6px!important;background:rgba(2,16,23,.89)!important;border:1px solid rgba(126,205,219,.28)!important;color:#eef7f8!important;box-shadow:0 20px 55px rgba(0,0,0,.38)!important}
html[data-ak-theme] .ak-password-card :is(h3,p,label,span){color:inherit!important}
html[data-ak-theme] .ak-password-input-wrap,
html[data-ak-theme] .ak-password-input-wrap input{border-radius:4px!important}
html[data-ak-theme] .ak-password-toggle,
html[data-ak-theme] .ak-password-actions .btn{border-radius:4px!important;transform:none!important}
html[data-ak-theme] .ak-password-actions .btn-primary{background:linear-gradient(180deg,var(--ak-primary,#17633f),var(--ak-primary-dark,#0e442b))!important;border-color:color-mix(in srgb,var(--ak-accent,#d9a526) 45%,transparent)!important}
html[data-ak-theme] .ak-password-actions .btn-secondary{background:linear-gradient(180deg,#304552,#1b2e38)!important;border-color:rgba(140,203,216,.30)!important;color:#fff!important}
@media(max-width:700px){html[data-ak-theme] .ak-action-modal-box{border-radius:5px!important}html[data-ak-theme] .ak-action-modal-overlay{padding:7px!important}}

/* V8 — Tabellone senza doppio contenitore: resta solo la cornice oro della griglia */
html[data-ak-theme] #ak-number-grid.grid-panel{
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
html[data-ak-theme] #ak-number-grid #load_posts{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
}
@media(max-width:640px){
  html[data-ak-theme] #ak-number-grid.grid-panel{
    border-radius:0!important;
    padding:0!important;
  }
}
