@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Fredoka+One&display=swap');

/* ── VARIABILI ────────────────────────────────────────────── */
:root {
    --lyp-bg:      #0f1535;
    --lyp-surface: #1a2555;
    --lyp-card:    #212e6a;
    --lyp-yellow:  #FFD93D;
    --lyp-orange:  #FF6B35;
    --lyp-pink:    #FF6B9D;
    --lyp-teal:    #4ECDC4;
    --lyp-green:   #2ECC71;
    --lyp-red:     #E74C3C;
    --lyp-text:    #F0F4FF;
    --lyp-muted:   #a8b4d8;
    --lyp-label:   #c4ccee;
    --lyp-radius:  14px;
    --lyp-shadow:  0 8px 32px rgba(0,0,0,.45);
    --lyp-font-h:  'Fredoka One', cursive;
    --lyp-font-b:  'Nunito', sans-serif;
}

/* ── UTILITIES ───────────────────────────────────────────── */
.lyp-hidden { display: none !important; pointer-events: none !important; }
@keyframes lyp-fadeIn  { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes lyp-slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes lyp-bounce  { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* ── AUTH WRAP ───────────────────────────────────────────── */
.lyp-auth-wrap {
    font-family: var(--lyp-font-b);
    color: var(--lyp-text);
}
/* Wrapper contenitore gioco + overlay */
.lyp-game-container {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}
/* ── Auth overlay: comportamento altezza ─────────────────────
   Quando l'overlay è VISIBILE (utente non ancora autenticato):
   - L'overlay è in-flow (position:relative) → il container si adatta alla
     sua altezza, non a quella del gioco sottostante
   - Il contenuto del gioco è nascosto → non occupa spazio
   Quando l'overlay è NASCOSTO (.lyp-hidden):
   - Il gioco torna visibile e occupa il suo spazio naturale
   ─────────────────────────────────────────────────────────── */

/* Overlay visibile → in-flow, dimensiona il container */
.lyp-auth-overlay {
    background: var(--lyp-bg);
    border-radius: 24px;
    z-index: 20;
    overflow-y: auto;
}

/* Overlay nascosto (.lyp-hidden) → torna assoluto per non interferire con il gioco */
.lyp-auth-overlay.lyp-hidden {
    position: absolute;
    inset: 0;
}

/* Quando overlay è visibile, nasconde il contenuto del gioco per evitare spazio inutile */
.lyp-game-container:has(> .lyp-auth-overlay:not(.lyp-hidden)) > :not(.lyp-auth-overlay) {
    display: none !important;
}
/* Modalità standalone [lyp_login]: fuori da un game-container,
   torna al flusso normale del documento */
.lyp-auth-overlay.lyp-auth-standalone {
    position: relative;
    inset: auto;
    min-height: auto;
    max-width: 680px;
    margin: 0 auto;
}
/* Su standalone: quando l'overlay è nascosto (lyp-hidden) non occupa spazio */
.lyp-auth-overlay.lyp-auth-standalone.lyp-hidden {
    display: none;
}
/* Materie home: transizione smooth quando viene nascosta */
.lyp-materie-home,
.lyp-games-home {
    transition: opacity .2s ease;
}
.lyp-materie-home.lyp-hidden,
.lyp-games-home.lyp-hidden {
    display: none;
}
/* Wrapper della pagina [lyp_login]: il padding-top viene impostato inline
   dallo shortcode in base all'altezza dell'header fisso del tema.
   Questo evita che il form si sovrapponga all'header quando si espande
   (es. passando da login a registrazione che è più alta). */
.lyp-login-page-wrap {
    max-width: 680px;
    margin: 0 auto;
    /* box-sizing per includere il padding nel calcolo dell'altezza */
    box-sizing: border-box;
}
/* Pagina progressi: override per larghezza maggiore e nessun gap */
.lyp-login-page-wrap.lyp-all-progress-page-wrap {
    max-width: 780px;
    background: var(--lyp-bg);
}
/* Se il tema ha l'header fisso e non si usa header_offset,
   questo fallback CSS evita la sovrapposizione usando una variabile
   impostabile dal tema: :root { --lyp-admin-bar-height: 32px; } */
.lyp-login-page-wrap .lyp-auth-standalone {
    /* Assicura che il form sia sempre visibile sopra altri elementi della pagina */
    position: relative;
    z-index: 1;
}
/* User bar e guest banner: fuori dal container, nel flusso normale */
.lyp-user-bar,
.lyp-guest-banner {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}
.lyp-auth-screen { display:none; padding:32px 28px 36px; animation:lyp-fadeIn .3s ease; }
.lyp-auth-screen.active { display:block; }

.lyp-auth-logo { display:flex; align-items:center; gap:14px; justify-content:center; margin-bottom:20px; }
.lyp-auth-logo span { font-size:44px; animation:lyp-bounce 2.5s infinite ease-in-out; }
.lyp-auth-logo h1 { font-family:var(--lyp-font-h); font-size:30px; margin:0; color:#fff; line-height:1; }
.lyp-auth-logo p  { color:var(--lyp-muted); font-size:13px; margin:4px 0 0; font-weight:600; }
.lyp-auth-title { font-family:var(--lyp-font-h); font-size:24px; color:#fff; margin:0 0 6px; text-align:center; }
.lyp-auth-sub   { color:var(--lyp-muted); font-size:14px; text-align:center; margin:0 0 20px; font-weight:600; }

/* Form */
.lyp-auth-form { max-width:380px; margin:0 auto; }
.lyp-profile-form { max-width:100% !important; }
.lyp-field { margin-bottom:14px; }
.lyp-field label { display:block; font-weight:700; font-size:12px; color:var(--lyp-label); margin-bottom:5px; text-transform:uppercase; letter-spacing:.5px; }
.lyp-required { color:var(--lyp-pink); }
.lyp-field input[type="text"],
.lyp-field input[type="email"],
.lyp-field input[type="password"],
.lyp-field input[type="date"] {
    width:100%; box-sizing:border-box; background:var(--lyp-card);
    border:2px solid rgba(255,255,255,.08); border-radius:var(--lyp-radius);
    color:var(--lyp-text); font-family:var(--lyp-font-b); font-size:15px;
    padding:11px 14px; outline:none; transition:border-color .2s;
}
.lyp-field input:focus { border-color:var(--lyp-teal); }
.lyp-field small { color:var(--lyp-muted); font-size:12px; margin-top:3px; display:block; }
.lyp-field .lyp-select,
.lyp-field select {
    width:100%; box-sizing:border-box; background:var(--lyp-card);
    border:2px solid rgba(255,255,255,.08); border-radius:var(--lyp-radius);
    color:var(--lyp-text); font-family:var(--lyp-font-b); font-size:15px;
    padding:11px 14px; outline:none; cursor:pointer; appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a8b4d8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 14px center; transition:border-color .2s;
}
.lyp-field .lyp-select:focus,.lyp-field select:focus { border-color:var(--lyp-teal); }
.lyp-field .lyp-select option,.lyp-field select option { background:#1a2555; color:#f0f4ff; }
.lyp-field-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.lyp-pw-wrap { position:relative; }
.lyp-pw-wrap input { padding-right:44px; }
.lyp-pw-toggle { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:17px; padding:0; line-height:1; }
.lyp-optional-toggle { text-align:center; margin:2px 0 12px; }

/* Checkbox */
.lyp-check-group { margin-bottom:12px; }
.lyp-check-label { display:flex; align-items:flex-start; gap:10px; cursor:pointer; font-size:13px; color:var(--lyp-label); line-height:1.5; }
.lyp-check-label input[type="checkbox"] { width:17px; height:17px; flex-shrink:0; margin-top:2px; accent-color:var(--lyp-teal); cursor:pointer; }

/* Feedback */
.lyp-auth-error   { background:rgba(231,76,60,.15); border:1px solid var(--lyp-red); border-radius:10px; color:#ff8a80; font-size:13px; font-weight:600; padding:9px 13px; margin-bottom:12px; display:none; }
.lyp-auth-success { background:rgba(46,204,113,.15); border:1px solid var(--lyp-green); border-radius:10px; color:#69f0ae; font-size:13px; font-weight:600; padding:9px 13px; margin-bottom:12px; display:none; }

/* Bottoni */
.lyp-btn-auth { width:100%; background:linear-gradient(135deg,var(--lyp-orange),var(--lyp-pink)); border:none; color:#fff; font-family:var(--lyp-font-h); font-size:18px; padding:13px; border-radius:var(--lyp-radius); cursor:pointer; transition:transform .15s,opacity .15s; box-shadow:0 4px 16px rgba(255,107,53,.35); margin-top:4px; }
.lyp-btn-auth:hover:not(:disabled) { transform:scale(1.03); }
.lyp-btn-auth:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.lyp-btn-secondary { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); color:var(--lyp-text); font-family:var(--lyp-font-h); font-size:16px; padding:11px 22px; border-radius:var(--lyp-radius); cursor:pointer; transition:background .2s; }
.lyp-btn-secondary:hover { background:rgba(255,255,255,.18); }
.lyp-back-btn { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); color:var(--lyp-text); font-family:var(--lyp-font-b); font-weight:700; font-size:13px; padding:6px 13px; border-radius:30px; cursor:pointer; margin-bottom:16px; display:inline-block; transition:background .2s; }
.lyp-back-btn:hover { background:rgba(255,255,255,.2); }
.lyp-auth-links { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:18px; }
.lyp-auth-sep { color:var(--lyp-muted); }
.lyp-link { background:none; border:none; color:#6ee7e0; font-family:var(--lyp-font-b); font-size:13px; font-weight:700; cursor:pointer; padding:0; text-decoration:underline; text-underline-offset:3px; }
.lyp-link:hover { color:var(--lyp-yellow); }

/* ── USER BAR ────────────────────────────────────────────── */
.lyp-user-bar {
    display:flex; justify-content:space-between; align-items:center;
    background:var(--lyp-surface); border-radius:16px 16px 0 0;
    padding:10px 20px;
    font-size:14px; font-weight:600;
    border-bottom:2px solid rgba(255,255,255,.06);
    font-family:var(--lyp-font-b); color:var(--lyp-text);
}
.lyp-user-greeting strong { color:var(--lyp-yellow); }
.lyp-user-bar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lyp-btn-bar { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); color:var(--lyp-text); font-family:var(--lyp-font-b); font-size:12px; font-weight:700; padding:5px 13px; border-radius:20px; cursor:pointer; transition:background .2s,color .2s; }
.lyp-btn-bar:hover { background:rgba(255,255,255,.22); color:var(--lyp-yellow); }
.lyp-btn-logout { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); color:var(--lyp-muted); font-family:var(--lyp-font-b); font-size:12px; font-weight:700; padding:5px 13px; border-radius:20px; cursor:pointer; transition:background .2s,color .2s; }
.lyp-btn-logout:hover { background:rgba(255,255,255,.15); color:var(--lyp-text); }

/* ── PANELS ──────────────────────────────────────────────── */
.lyp-panel-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:9998; backdrop-filter:blur(3px); animation:lyp-fadeIn .2s ease; }
.lyp-panel { position:fixed; top:0; right:0; bottom:0; width:min(500px,100vw); background:var(--lyp-surface); z-index:9999; overflow-y:auto; box-shadow:-8px 0 40px rgba(0,0,0,.6); animation:lyp-slideIn .3s ease; font-family:var(--lyp-font-b); color:var(--lyp-text); }
.lyp-panel-inner { display:flex; flex-direction:column; min-height:100%; }
.lyp-panel-header { display:flex; justify-content:space-between; align-items:center; padding:18px 22px; border-bottom:1px solid rgba(255,255,255,.08); position:sticky; top:0; background:var(--lyp-surface); z-index:1; }
.lyp-panel-header h2 { font-family:var(--lyp-font-h); font-size:20px; margin:0; color:#fff; }
.lyp-panel-close { background:rgba(255,255,255,.1); border:none; color:var(--lyp-text); width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:15px; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.lyp-panel-close:hover { background:rgba(255,255,255,.25); }
.lyp-panel-body { padding:18px 22px 30px; flex:1; }
.lyp-section-title { font-family:var(--lyp-font-h); font-size:16px; margin:0 0 12px; color:var(--lyp-yellow); }
.lyp-hr { border:none; border-top:1px solid rgba(255,255,255,.08); margin:18px 0; }

/* Profilo card */
.lyp-profile-card { display:flex; align-items:center; gap:14px; background:var(--lyp-card); border-radius:14px; padding:14px 18px; margin-bottom:18px; }
.lyp-avatar { width:50px; height:50px; border-radius:50%; background:linear-gradient(135deg,var(--lyp-orange),var(--lyp-pink)); display:flex; align-items:center; justify-content:center; font-family:var(--lyp-font-h); font-size:24px; flex-shrink:0; color:#fff; }
.lyp-profile-nick { font-family:var(--lyp-font-h); font-size:18px; color:var(--lyp-yellow); margin-bottom:3px; }
.lyp-profile-meta { font-size:12px; color:var(--lyp-muted); line-height:1.5; }

/* Danger zone */
.lyp-danger-zone { background:rgba(231,76,60,.08); border:1px solid rgba(231,76,60,.25); border-radius:12px; padding:14px 18px; }
.lyp-danger-title { font-family:var(--lyp-font-h); font-size:16px; color:#ff8a80; margin:0 0 5px; }
.lyp-danger-desc  { color:var(--lyp-muted); font-size:13px; margin:0 0 12px; }
.lyp-btn-danger { background:rgba(231,76,60,.18); border:1px solid rgba(231,76,60,.4); color:#ff8a80; font-family:var(--lyp-font-b); font-size:13px; font-weight:700; padding:7px 14px; border-radius:9px; cursor:pointer; transition:background .2s; }
.lyp-btn-danger:hover { background:rgba(231,76,60,.3); }
.lyp-btn-danger-confirm { background:var(--lyp-red) !important; border:none !important; color:#fff !important; width:100%; font-size:15px !important; }
.lyp-btn-reset-game { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); color:var(--lyp-muted); font-family:var(--lyp-font-b); font-size:12px; font-weight:700; padding:6px 14px; border-radius:20px; cursor:pointer; transition:background .2s,color .2s,border-color .2s; margin:4px 4px 4px 0; }
.lyp-btn-reset-game:hover:not(:disabled) { background:rgba(231,76,60,.18); border-color:rgba(231,76,60,.4); color:#ff8a80; }
.lyp-btn-reset-game:disabled { opacity:.5; cursor:not-allowed; }
.lyp-delete-confirm-box { background:rgba(231,76,60,.06); border:1px solid rgba(231,76,60,.18); border-radius:10px; padding:14px; margin-top:12px; }

/* Storico */
.lyp-history-intro { color:var(--lyp-muted); font-size:13px; margin:0 0 16px; }
.lyp-hist-game-card { background:var(--lyp-card); border-radius:12px; padding:14px 16px; margin-bottom:12px; }
.lyp-hist-game-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.lyp-hist-game-slug { font-family:var(--lyp-font-h); font-size:16px; color:var(--lyp-yellow); }
.lyp-hist-game-date { font-size:11px; color:var(--lyp-muted); }
.lyp-hist-game-data { font-size:11px; color:var(--lyp-muted); background:rgba(0,0,0,.2); padding:10px; border-radius:8px; overflow-x:auto; margin:0; white-space:pre-wrap; word-break:break-all; }

/* ── HISTORY CARD — Tabelline Magiche ───────────────────── */
.lypt-hist-summary { display:flex; gap:16px; font-size:13px; color:var(--lyp-muted); margin:8px 0 12px; flex-wrap:wrap; }
.lypt-mini-bars { display:flex; align-items:flex-end; gap:3px; height:60px; padding:4px 0; }
.lypt-mini-bar-wrap { display:flex; flex-direction:column; align-items:center; gap:2px; flex:1; height:100%; cursor:default; }
.lypt-mini-bar { width:100%; min-height:2px; border-radius:3px 3px 0 0; transition:height .3s; }
.lypt-mini-bar-label { font-size:9px; color:var(--lyp-muted); }
.lypt-speed-summary { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; font-size:12px; color:var(--lyp-muted); align-items:center; }
.lypt-speed-summary span { background:rgba(255,255,255,.06); padding:3px 8px; border-radius:20px; }

/* ── HISTORY CARD — Sfide Veloci tabella dettaglio ───── */
.lypt-speed-section { margin-top:12px; }
.lypt-speed-title { font-size:12px; font-weight:700; color:var(--lyp-yellow); margin-bottom:6px; letter-spacing:.03em; }
.lypt-speed-table { width:100%; border-collapse:collapse; font-size:12px; }
.lypt-speed-th { padding:5px 8px; text-align:center; color:var(--lyp-muted); font-weight:600; border-bottom:1px solid rgba(255,255,255,.08); white-space:nowrap; }
.lypt-speed-th-tab { text-align:left; }
.lypt-speed-td-tab { padding:4px 8px; font-weight:700; color:var(--lyp-label); border-top:1px solid rgba(255,255,255,.05); }
.lypt-speed-td { padding:4px 8px; text-align:center; border-top:1px solid rgba(255,255,255,.05); }
.lypt-speed-td-val { font-weight:700; color:#FFD93D; }
.lypt-speed-td-empty { color:rgba(255,255,255,.2); }
.lypt-speed-pts { font-size:10px; font-weight:400; color:var(--lyp-muted); margin-left:2px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width:600px) {
    .lyp-auth-screen { padding:22px 16px 28px; }
    .lyp-panel { width:100vw; }
    .lyp-field-row { grid-template-columns:1fr; }
    .lyp-user-bar { flex-direction:column; gap:8px; padding:10px 14px; }
    .lyp-user-bar-actions { justify-content:center; }
}

/* ── GUEST BUTTON + DIVIDER ──────────────────────────────── */
.lyp-guest-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0 14px; max-width: 380px; margin-left: auto; margin-right: auto;
}
.lyp-guest-divider::before,
.lyp-guest-divider::after {
    content: ''; flex: 1;
    border-top: 1px solid rgba(255,255,255,.12);
}
.lyp-guest-divider span {
    color: var(--lyp-muted); font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}

.lyp-btn-guest {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 100%; max-width: 380px; margin: 0 auto;
    background: rgba(255,255,255,.06);
    border: 1px dashed rgba(255,255,255,.2);
    border-radius: var(--lyp-radius);
    color: var(--lyp-text); font-family: var(--lyp-font-b);
    font-size: 16px; font-weight: 700;
    padding: 14px; cursor: pointer;
    transition: background .2s, border-color .2s;
}
.lyp-btn-guest:hover {
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.35);
}
.lyp-guest-note {
    font-size: 11px; font-weight: 400;
    color: var(--lyp-muted); text-align: center;
}

/* ── GUEST BANNER ────────────────────────────────────────── */
.lyp-guest-banner {
    background: #1a2555;
    border: 2px solid var(--lyp-orange);
    border-radius: 16px 16px 0px 0px;
    max-width: 680px; margin: 0 auto;
    font-family: var(--lyp-font-b);
    animation: lyp-fadeIn .3s ease;
}
.lyp-guest-banner-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 18px; flex-wrap: wrap;
}
.lyp-guest-banner-text {
    font-size: 14px; color: #ffffff; flex: 1; font-weight: 600; min-width: 0;
}
.lyp-guest-banner-text strong { color: var(--lyp-yellow); }
.lyp-guest-banner-actions {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

@media (max-width: 600px) {
    /* Banner ospite mobile: testo + azioni su due righe separate */
    .lyp-guest-banner-inner {
        flex-direction: row-reverse;
        align-items: stretch;
        gap: 6px;
        padding: 10px 14px;
    }
    .lyp-guest-banner-text {
        font-size: 13px;
    }
    /* Azioni su mobile: riga unica con pulsanti compatti */
    .lyp-guest-banner-actions {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 0;
        background: rgba(0,0,0,.2);
        border-radius: 30px;
        padding: 4px 6px;
        overflow: hidden;
    }
    /* Link nella barra ospite su mobile: compatti e senza underline */
    .lyp-guest-banner-actions .lyp-link {
        font-size: 12px;
        font-weight: 700;
        padding: 5px 8px;
        text-decoration: none;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background .15s;
    }
    .lyp-guest-banner-actions .lyp-link:hover,
    .lyp-guest-banner-actions .lyp-link:active {
        background: rgba(255,255,255,.12);
    }
    /* Separatori più compatti */
    .lyp-guest-banner-actions .lyp-auth-sep {
        font-size: 0px;
        color: rgba(255,255,255,.3);
        padding: 0 1px;
        flex-shrink: 0;
    }
    /* "← Matematica": visibile nella pill ma con stile coerente */
    .lyp-guest-banner-actions .lyp-back-materia-btn {
        color: var(--lyp-yellow);
        font-size: 12px;
        font-weight: 700;
        padding: 5px 8px;
        text-decoration: none;
        border-radius: 20px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .lyp-guest-banner-actions .lyp-goto-materie-sep {
        display: inline;
    }
    .lyp-btn-guest { font-size: 15px; }
}

/* ── CHOICE SCREEN ───────────────────────────────────────── */
.lyp-choice-buttons {
    max-width: 380px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 12px;
}
.lyp-btn-choice {
    display: flex; align-items: center; gap: 16px;
    background: var(--lyp-card);
    border: 2px solid rgba(255,255,255,.08);
    border-radius: var(--lyp-radius);
    color: var(--lyp-text); cursor: pointer;
    padding: 16px 20px; text-align: left;
    font-family: var(--lyp-font-b);
    transition: transform .15s, border-color .2s, background .2s;
    width: 100%;
}
.lyp-btn-choice:hover { transform: translateX(5px); border-color: var(--lyp-teal); background: #1e2f6a; }
.lyp-btn-choice-primary  { border-left: 3px solid var(--lyp-teal); }
.lyp-btn-choice-secondary{ border-left: 3px solid var(--lyp-yellow); }
.lyp-choice-icon { font-size: 32px; flex-shrink: 0; }
.lyp-choice-text { display: flex; flex-direction: column; gap: 2px; }
.lyp-choice-text strong { font-family: var(--lyp-font-h); font-size: 18px; }
.lyp-choice-text span { font-size: 12px; color: var(--lyp-muted); }

/* ── GAMES HOME ──────────────────────────────────────────── */
.lyp-games-home {
    font-family: var(--lyp-font-b);
    background: var(--lyp-bg);
    border-radius: 0 0 24px 24px;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: var(--lyp-shadow);
    color: var(--lyp-text);
    animation: lyp-fadeIn .35s ease;
}
.lyp-games-home-inner {
    padding: 28px 24px 32px;
}
.lyp-games-home-title {
    font-family: var(--lyp-font-h);
    font-size: 26px;
    color: #fff;
    margin: 0 0 22px;
    text-align: center;
}
.lyp-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.lyp-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--lyp-card);
    border: 2px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 24px 16px 20px;
    text-decoration: none;
    color: var(--lyp-text);
    transition: transform .18s, border-color .18s, background .18s;
    cursor: pointer;
    position: relative;
}
.lyp-game-card:hover {
    transform: translateY(-4px);
    border-color: var(--lyp-teal);
    background: #1e2f6a;
    text-decoration: none;
    color: var(--lyp-text);
}
.lyp-game-card-disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.lyp-game-card-icon {
    font-size: 44px;
    line-height: 1;
    animation: lyp-bounce 3s infinite ease-in-out;
}
/* Sfasa l'animazione per ogni carta */
.lyp-game-card:nth-child(2) .lyp-game-card-icon { animation-delay: .4s; }
.lyp-game-card:nth-child(3) .lyp-game-card-icon { animation-delay: .8s; }
.lyp-game-card:nth-child(4) .lyp-game-card-icon { animation-delay: 1.2s; }

.lyp-game-card-label {
    font-family: var(--lyp-font-h);
    font-size: 17px;
    text-align: center;
    color: #fff;
}
.lyp-game-card-arrow {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 16px;
    color: var(--lyp-teal);
    opacity: 0;
    transition: opacity .2s, transform .2s;
}
.lyp-game-card:hover .lyp-game-card-arrow {
    opacity: 1;
    transform: translateX(3px);
}
.lyp-games-empty {
    text-align: center;
    color: var(--lyp-muted);
    padding: 30px 0;
    font-size: 15px;
}

@media (max-width: 600px) {
    .lyp-games-home-inner { padding: 20px 16px 24px; }
    .lyp-games-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .lyp-game-card { padding: 20px 12px 16px; }
    .lyp-game-card-icon { font-size: 36px; }
    .lyp-game-card-label { font-size: 15px; }
}

/* ================================================================
   MATERIE HOME — v3
   ================================================================ */
.lyp-materie-home {
    position: relative;
    z-index: 10;
    padding: 0px 0 32px;
}
.lyp-materie-home-inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 28px 24px 32px;
    background: var(--lyp-surface);
    border-radius: 0px 0px 16px 16px;
    border: 2px solid rgba(255,255,255,.07);
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
.lyp-materie-home-title {
    font-family: var(--lyp-font-h);
    font-size: 24px;
    color: #fff;
    margin: 0 0 22px;
    text-align: center;
}
.lyp-materie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.lyp-materia-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--lyp-mat-color, #4a90d9);
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 18px;
    padding: 24px 14px 20px;
    cursor: pointer;
    color: #fff;
    font-family: var(--lyp-font-h);
    transition: transform .18s, box-shadow .18s, border-color .18s;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.lyp-materia-card:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 28px rgba(0,0,0,.35);
    border-color: rgba(255,255,255,.5);
}
.lyp-materia-card-icon {
    font-size: 44px;
    line-height: 1;
    animation: lyp-bounce 3s infinite ease-in-out;
}
.lyp-materia-card:nth-child(2) .lyp-materia-card-icon { animation-delay: .4s; }
.lyp-materia-card:nth-child(3) .lyp-materia-card-icon { animation-delay: .8s; }
.lyp-materia-card:nth-child(4) .lyp-materia-card-icon { animation-delay: 1.2s; }
.lyp-materia-card:nth-child(5) .lyp-materia-card-icon { animation-delay: 1.6s; }
.lyp-materia-card:nth-child(6) .lyp-materia-card-icon { animation-delay: 2.0s; }
.lyp-materia-card-label {
    font-size: 16px;
    text-align: center;
    color: #fff;
    font-weight: 700;
}
.lyp-materie-empty {
    text-align: center;
    color: var(--lyp-muted);
    padding: 30px 0;
    font-size: 15px;
}

/* Back button inside games-home */
.lyp-back-to-materie {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    padding: 5px 14px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background .15s;
}
.lyp-back-to-materie:hover {
    background: rgba(255,255,255,.20);
}

/* Pulsante Materie nella barra utente e banner ospite */
#lyp-goto-materie-btn,
#lyp-goto-materie-guest-btn {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.25);
}
#lyp-goto-materie-btn:hover,
#lyp-goto-materie-guest-btn:hover {
    background: rgba(255,255,255,.25);
}

@media (max-width: 600px) {
    .lyp-materie-home-inner { padding: 20px 14px 24px; }
    .lyp-materie-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .lyp-materia-card { padding: 20px 10px 16px; }
    .lyp-materia-card-icon { font-size: 36px; }
    .lyp-materia-card-label { font-size: 14px; }
}

/* ── Pulsante Muto (centralizzato nella barra) ── */
.lyp-btn-mute {
    font-size: 18px;
    padding: 4px 8px;
    min-width: 34px;
    letter-spacing: 0;
}
/* Nel banner ospite usa stile link — solo override dimensione */
#lyp-mute-btn-guest.lyp-link {
    font-size: 18px;
    vertical-align: middle;
}

/* ── Link "Guarda tutti i progressi" nella scheda laterale ── */
.lyp-history-all-link {
    text-align: center;
    margin: 16px 0 4px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.lyp-btn-all-progress {
    display: inline-block;
    background: linear-gradient(135deg, rgba(74,144,217,.25), rgba(74,144,217,.1));
    border: 1px solid rgba(74,144,217,.45);
    color: #a8c8f8;
    font-family: var(--lyp-font-b);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 24px;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}
.lyp-btn-all-progress:hover {
    background: linear-gradient(135deg, rgba(74,144,217,.45), rgba(74,144,217,.2));
    border-color: rgba(74,144,217,.8);
    color: #d0e8ff;
}

/* ── Pagina [lyp_all_progress] ── */
.lyp-all-progress-page-wrap {
    min-height: 60vh;
}
.lyp-all-progress-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}
.lyp-all-progress-title {
    font-family: var(--lyp-font-b);
    font-size: 22px;
    font-weight: 800;
    color: var(--lyp-yellow);
    margin: 0 0 24px;
    text-align: center;
    letter-spacing: -.3px;
}
.lyp-all-progress-loading,
.lyp-all-progress-empty {
    color: var(--lyp-muted);
    font-size: 14px;
    text-align: center;
    padding: 40px 0;
}
.lyp-all-progress-loading,
.lyp-all-progress-empty {
    color: var(--lyp-muted);
    text-align: center;
    padding: 40px 0;
    font-size: 15px;
}

/* ── Accordion materie ── */
.lyp-acc-section {
    background: var(--lyp-card);
    border: 1px solid var(--lyp-border);
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
}
.lyp-acc-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: none;
    border: none;
    color: var(--lyp-text);
    font-family: var(--lyp-font-b);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.lyp-acc-header:hover {
    background: rgba(255,255,255,.05);
}
.lyp-acc-icon   { font-size: 20px; flex-shrink: 0; }
.lyp-acc-label  { flex: 1; }
.lyp-acc-count  { font-size: 11px; font-weight: 600; color: var(--lyp-muted); background: rgba(255,255,255,.07); padding: 3px 9px; border-radius: 20px; flex-shrink: 0; }
.lyp-acc-chevron { font-size: 14px; color: var(--lyp-muted); flex-shrink: 0; transition: transform .2s; }
.lyp-acc-body {
    padding: 4px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--lyp-border);
}
/* Card gioco dentro l'accordion — stesso stile del pannello laterale */
.lyp-all-progress-wrap .lyp-hist-game-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 12px 14px;
}

@media (max-width: 600px) {
    .lyp-all-progress-wrap { padding: 20px 10px 40px; }
    .lyp-all-progress-title { font-size: 18px; }
    .lyp-acc-header { padding: 12px 14px; font-size: 14px; }
}
