/* ==========================================================
   GRIGLIA E PULSANTI RETTANGOLARI (Classi)
   ================================================---------- */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.btn-rect {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: transform 0.3s ease, filter 0.3s ease;
    z-index: 1;
    font-family: inherit;
    /* prospettiva per l'effetto ologramma (cornice che si inclina,
       personaggio che esce in 3D) */
    perspective: 1200px;
}
/* la card selezionata sta sopra le vicine (l'ologramma sborda) */
.btn-rect.active-class { z-index: 6; }

/* PNG rettangolare originale che definisce i bordi visivi */
.btn-smoke-bg {
    position: absolute;
    top: -16px;
    left: -20px;
    right: -20px;
    bottom: -16px;
    width: calc(100% + 40px);
    height: calc(100% + 32px);
    object-fit: fill;
    pointer-events: none;
    z-index: 1;
    opacity: 0.95;
    mix-blend-mode: screen;
    transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Contenuto testuale interno */
.btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 24px;
    padding-right: 10px;
    width: 100%;
}

.btn-title {
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 200, 255, 0.9);
}

.btn-sub {
    font-size: 0.75rem;
    color: rgba(224, 208, 255, 0.8);
}

/* ==========================================================
   COLORI NEON RICALIBRATI PER IL FILTRO HUE-ROTATE(155DEG)
   ================================================---------- */

/* 1. Juggernaut: Base Ciano -> Output visivo: Rosa/Magenta brillante */
.btn-rect[data-id="juggernaut"]:hover, 
.btn-rect[data-id="juggernaut"].active-class {
    transform: scale(1.05);
}
.btn-rect[data-id="juggernaut"]:hover .btn-smoke-bg, 
.btn-rect[data-id="juggernaut"].active-class .btn-smoke-bg {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(0, 230, 255, 1)) drop-shadow(0 0 15px rgba(0, 230, 255, 1)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

/* 2. Infiltrator: Base Verde -> Output visivo: Viola/Lilla intenso */
.btn-rect[data-id="infiltrator"]:hover, 
.btn-rect[data-id="infiltrator"].active-class {
    transform: scale(1.05);
}
.btn-rect[data-id="infiltrator"]:hover .btn-smoke-bg, 
.btn-rect[data-id="infiltrator"].active-class .btn-smoke-bg {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(0, 255, 130, 1)) drop-shadow(0 0 15px rgba(0, 255, 130, 1)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

/* 3. Bio-Void Mystic: Base Blu Elettrico -> Output visivo: Arancio/Rosso Fuoco */
.btn-rect[data-id="mystic"]:hover, 
.btn-rect[data-id="mystic"].active-class {
    transform: scale(1.05);
}
.btn-rect[data-id="mystic"]:hover .btn-smoke-bg, 
.btn-rect[data-id="mystic"].active-class .btn-smoke-bg {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(0, 60, 255, 1)) drop-shadow(0 0 15px rgba(0, 60, 255, 1)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}

/* 4. Engineer: Base Arancio -> Output visivo: Azzurro/Ciano tecnologico */
.btn-rect[data-id="engineer"]:hover, 
.btn-rect[data-id="engineer"].active-class {
    transform: scale(1.05);
}
.btn-rect[data-id="engineer"]:hover .btn-smoke-bg, 
.btn-rect[data-id="engineer"].active-class .btn-smoke-bg {
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(255, 150, 0, 1)) drop-shadow(0 0 15px rgba(255, 150, 0, 1)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}


/* ==========================================================
   PULSANTE CIRCOLARE CENTRALE (Avvia) 
   ================================================---------- */
.center-action {
    display: flex;
    justify-content: center;
}

.btn-circle {
    position: relative;
    width: 110px;
    height: 110px;
    background: transparent;
    color: #ffffff;
    font-family: inherit; 
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 0.9rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, filter 0.3s ease;
    overflow: visible;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 150, 0, 0.9);
}

/* Tondo.png trasparente */
.btn-circle-bg {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
    mix-blend-mode: screen;
    transition: filter 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.btn-circle .btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 0;
}

/* Il letter-spacing aggiunge 2px "fantasma" dopo l'ultima lettera:
   senza compensazione il testo (AVVIA) appare spostato a sinistra. */
.btn-circle .btn-content > span { margin-right: -2px; }

/* Retroilluminazione dietro l'anello */
.btn-circle::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(112, 56, 248, 0.35) 0%, rgba(0, 200, 255, 0.10) 55%, transparent 75%);
    z-index: 0;
    opacity: 0.75;
    transition: opacity 0.3s ease;
}
.btn-circle:hover::before { opacity: 1; }

/* L'anello ruota lentamente (il testo resta fermo) */
.btn-circle-bg { animation: anelloRuota 48s linear infinite; }
@keyframes anelloRuota { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .btn-circle-bg { animation: none; }
}

/* Effetto Hover e Active con bagliore neon ricalibrato */
.btn-circle:hover, 
.btn-circle:active {
    transform: scale(1.08);
}

.btn-circle:hover .btn-circle-bg, 
.btn-circle:active .btn-circle-bg {
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(255, 150, 0, 1)) drop-shadow(0 0 12px rgba(0, 200, 255, 0.9)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
}
/* ==========================================================
   OLOGRAMMA DI CLASSE (effetto "Mythrill"):
   sul TAP di selezione (.active-class — funziona su Android,
   niente hover-only) la cornice si INCLINA in 3D e il
   personaggio ESCE dalla card come un ologramma.
   L':hover fa da anteprima su desktop.
   ================================================---------- */

/* Cornice che si inclina all'indietro (dal basso, come una carta) */
.btn-rect:hover .btn-smoke-bg,
.btn-rect.active-class .btn-smoke-bg {
    transform: perspective(900px) rotateX(24deg) translateY(-7%);
    transform-origin: 50% 100%;
}

/* Il personaggio: sempre presente ma invisibile, si alza sull'attivazione.
   `contain` + riquadro ristretto = ologramma in scala con la card. */
.btn-rect::after {
    content: "";
    position: absolute;
    inset: 6% 14%;
    background-size: contain;
    background-position: center bottom;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
    transform: translate3d(0, 6%, 0);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
    filter: saturate(1.05) brightness(1.05);
}
.btn-rect:hover::after,
.btn-rect.active-class::after {
    opacity: 1;
    /* si alza ed esce leggermente verso l'osservatore */
    transform: translate3d(0, -18%, 35px);
    filter: saturate(1.1) brightness(1.12)
            drop-shadow(0 16px 14px rgba(0, 0, 0, 0.6));
}

/* Il testo si abbassa leggermente per lasciare la scena all'ologramma */
.btn-rect:hover .btn-content,
.btn-rect.active-class .btn-content {
    transform: translateY(6px);
}
.btn-content { transition: transform 0.5s ease; }

@media (prefers-reduced-motion: reduce) {
    .btn-rect::after, .btn-rect .btn-smoke-bg, .btn-content { transition: none; }
}

/* Assegnazione delle immagini specifiche per ciascuna classe
   (dimensione uniforme via `contain` nella regola base) */
.btn-rect[data-id="juggernaut"]::after {
    background-image: url('../img/classes/juggernaut.png');
}

.btn-rect[data-id="infiltrator"]::after {
    background-image: url('../img/classes/infiltrator.png');
}

.btn-rect[data-id="mystic"]::after {
    background-image: url('../img/classes/bio-void_mystic.png');
}

.btn-rect[data-id="engineer"]::after {
    background-image: url('../img/classes/engineer.png');
}
