/* ============================================
   GIARDINO DI LIBERATE - Main Styles
   Stile coerente con webapp G.U.S.T.O.
   ============================================ */

:root {
    /* === SPACING === */
    --section-padding: 60px;

    /* === BACKGROUNDS === */
    --bg-sito: #f2efea;
    --bg-sito-chiaro: #FDFCF9;
    --bianco-naturale: #FDFBF7;
    --iuta-chiaro: #F5F0E8;
    --iuta-scuro: #E3DCD0;
    --sabbia-calda: #EDE7DD;

    /* === TESTI === */
    --marrone-terra: #3D2E26;
    --marrone-medio: #6B5A4C;
    --marrone-chiaro: #9B8A7A;

    /* === ACCENTI PRIMARI === */
    --terracotta-cotto: #C17557;
    --terracotta-scuro: #A85E41;
    --oro-miele: #D4A574;

    /* === ACCENTO VERDE === */
    --verde-salvia: #7A9B8C;
    --verde-muschio: #5C7560;

    /* === PILASTRI G.U.S.T.O. - Background === */
    --rosa-guida: rgba(246, 225, 230, 0.55);
    --rosa-guida-hover: #EFCED6;
    --verde-udire: rgba(229, 241, 233, 0.55);
    --verde-udire-hover: #D6E7DD;
    --giallo-sperim: rgba(255, 244, 214, 0.55);
    --giallo-sperim-hover: #F3E6BE;
    --viola-tempo: #EEE6F3;
    --viola-tempo-hover: #E1D6EA;
    --azzurro-oss: #E6F1F6;
    --azzurro-oss-hover: #D6E7F0;

    /* === PILASTRI G.U.S.T.O. - Testi === */
    --rosa-guida-text: #8B5A68;
    --verde-udire-text: #5C7560;
    --giallo-sperim-text: #8B7548;
    --viola-tempo-text: #7A6888;
    --azzurro-oss-text: #5C7A88;

    /* === GIARDINO SPECIFICI === */
    --giardino-primary: #7A9E7E;
    --giardino-primary-dark: #6B8F6F;
    --giardino-accent: #D4A574;
    --card-radius: 16px;
    --btn-radius: 25px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-sito);
    color: var(--marrone-medio);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* PWA standalone mode */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    color: var(--marrone-terra);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--verde-muschio);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--terracotta-cotto);
}

/* ============================================
   LAYOUT - Container & Grid
   ============================================ */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 20px 0;
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.header {
    background: var(--verde-salvia);
    padding: 15px 20px;
    min-height: 80px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo img {
    width: 70px;
    height: 70px;
    border-radius: 15px;
}

.header-logo h1 {
    font-size: 1.2rem;
    color: white;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.header-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--iuta-scuro);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: var(--iuta-chiaro);
    border-top: 1px solid var(--iuta-scuro);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--btn-radius);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--giardino-primary) 0%, var(--giardino-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(122, 158, 126, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 158, 126, 0.4);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--giardino-primary);
    border: 2px solid var(--giardino-primary);
}

.btn-secondary:hover {
    background: var(--giardino-primary);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--terracotta-cotto) 0%, var(--terracotta-scuro) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(193, 117, 87, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(193, 117, 87, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.25rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 1.05rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--marrone-terra);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--iuta-scuro);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--marrone-terra);
    background: white;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--giardino-primary);
    box-shadow: 0 0 0 4px rgba(122, 158, 126, 0.15);
}

.form-control::placeholder {
    color: var(--marrone-chiaro);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   STREAK & PROGRESS
   ============================================ */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--iuta-chiaro);
    color: var(--marrone-terra);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    height: 32px;
    box-sizing: border-box;
    cursor: default;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.streak-badge .fire {
    width: 20px;
    height: 20px;
}


.punti-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    height: 44px;
    box-sizing: border-box;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.logout-btn img {
    width: 44px;
    height: 44px;
}

/* G.U.S.T.O. Letters Progress */
.gusto-progress {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.gusto-letters {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

.gusto-letter {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    background: var(--iuta-scuro);
    color: var(--marrone-chiaro);
    transition: all 0.3s ease;
}

.gusto-letter.current {
    background: var(--terracotta-cotto);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(193, 117, 87, 0.4);
}

.gusto-letter.completed {
    background: var(--verde-muschio);
    color: white;
}

/* Set Progress (Figurine Collection) */
.set-progress {
    margin-top: 20px;
}

.set-title {
    font-size: 1.2rem;
    color: var(--marrone-terra);
    margin: 0 0 5px 0;
}

.set-count {
    font-size: 1.05rem;
    color: var(--marrone-medio);
    margin: 0 0 15px 0;
}

.figurine-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.figurina-dot {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--iuta-chiaro);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid var(--iuta-scuro);
}

.figurina-dot img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.figurina-dot.collected {
    border: 3px solid var(--oro-miele);
    box-shadow: 0 2px 10px rgba(212, 165, 116, 0.4);
}

.progress-bar-container {
    background: var(--iuta-scuro);
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--giardino-primary) 0%, var(--verde-muschio) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    color: var(--marrone-chiaro);
    margin-top: 5px;
}

/* ============================================
   ALBUM CARDS (5 Pilastri)
   ============================================ */
.album-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.album-card {
    background: white;
    border-radius: 12px;
    padding: 8px 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.album-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.album-card.album-g { background: var(--rosa-guida); border-color: var(--rosa-guida-hover); }
.album-card.album-u { background: var(--verde-udire); border-color: var(--verde-udire-hover); }
.album-card.album-s { background: var(--giallo-sperim); border-color: var(--giallo-sperim-hover); }
.album-card.album-t { background: var(--viola-tempo); border-color: var(--viola-tempo-hover); }
.album-card.album-o { background: var(--azzurro-oss); border-color: var(--azzurro-oss-hover); }

.album-card .album-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.album-card .album-icon img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.album-card .album-letter {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.album-card.album-g .album-letter { color: var(--rosa-guida-text); }
.album-card.album-u .album-letter { color: var(--verde-udire-text); }
.album-card.album-s .album-letter { color: var(--giallo-sperim-text); }
.album-card.album-t .album-letter { color: var(--viola-tempo-text); }
.album-card.album-o .album-letter { color: var(--azzurro-oss-text); }

.album-card .album-progress {
    font-size: 1.05rem;
    color: var(--marrone-chiaro);
}

.album-card .album-bar {
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.album-card .album-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.album-card.album-g .album-bar-fill { background: var(--rosa-guida-text); }
.album-card.album-u .album-bar-fill { background: var(--verde-udire-text); }
.album-card.album-s .album-bar-fill { background: var(--giallo-sperim-text); }
.album-card.album-t .album-bar-fill { background: var(--viola-tempo-text); }
.album-card.album-o .album-bar-fill { background: var(--azzurro-oss-text); }

/* Mobile: 3 + 2 layout */
@media (max-width: 480px) {
    .album-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .album-card:nth-child(4),
    .album-card:nth-child(5) {
        grid-column: span 1;
    }
}

/* ============================================
   FIGURINE
   ============================================ */
.figurine-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 15px;
}

.figurina {
    aspect-ratio: 1;
    background: var(--iuta-chiaro);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.figurina.collected {
    background: white;
    border-color: var(--giardino-primary);
    box-shadow: 0 2px 10px rgba(122, 158, 126, 0.2);
}

.figurina.locked {
    opacity: 0.5;
}

.figurina .figurina-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.figurina .figurina-name {
    font-size: 1.05rem;
    text-align: center;
    color: var(--marrone-chiaro);
    line-height: 1.2;
}

.figurina.collected .figurina-name {
    color: var(--marrone-terra);
}

/* Rarità */
.figurina.rarity-common { }
.figurina.rarity-uncommon .figurina-icon { filter: drop-shadow(0 0 3px #4ECDC4); }
.figurina.rarity-rare .figurina-icon { filter: drop-shadow(0 0 5px #FFD93D); }
.figurina.rarity-epic .figurina-icon { filter: drop-shadow(0 0 8px #FF6B6B); }

/* ============================================
   MISSION CARD
   ============================================ */
.mission-card {
    background: linear-gradient(135deg, var(--giardino-primary) 0%, var(--verde-muschio) 100%);
    border-radius: var(--card-radius);
    padding: 25px;
    color: white;
    margin-bottom: 20px;
}

.mission-card .mission-label {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mission-card .mission-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: white;
}

.mission-card .mission-text {
    font-size: 1.15rem;
    line-height: 1.7;
    opacity: 0.95;
    margin-bottom: 20px;
}

.mission-card .btn {
    background: white;
    color: var(--giardino-primary);
}

.mission-card .btn:hover {
    background: var(--bianco-naturale);
    transform: translateY(-2px);
}

/* ============================================
   GAMES GRID
   ============================================ */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
}

.game-card {
    background: white;
    border-radius: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--iuta-scuro);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    min-height: 85px;
}

.game-card:hover {
    border-color: var(--giardino-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.game-card:active {
    transform: scale(0.98);
}

.game-card .game-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card .game-icon img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.game-card .game-info {
    flex: 1;
    min-width: 0;
}

.game-card .game-name {
    font-weight: 600;
    color: var(--marrone-terra);
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.game-card .game-desc {
    font-size: 1.05rem;
    color: var(--marrone-chiaro);
}

.game-card.locked {
    opacity: 0.5;
    pointer-events: none;
}

.game-card .game-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    background: var(--giardino-primary);
    color: white;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    flex-shrink: 0;
}

.game-card .game-badge:has(img) {
    background: none;
    padding: 0;
}

.game-card .game-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    padding: 5px 0;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
    z-index: 100;
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    min-width: 44px;
    color: var(--marrone-chiaro);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 10px;
    background: transparent;
}

.nav-item:hover {
    color: var(--giardino-primary);
    background: rgba(122, 158, 126, 0.1);
}

.nav-item.active {
    color: var(--giardino-primary);
    background: rgba(122, 158, 126, 0.15);
}

.nav-item .nav-icon {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item .nav-icon img,
.bottom-nav .nav-item .nav-icon img,
.bottom-nav-content .nav-item .nav-icon img {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.nav-item:hover .nav-icon img,
.nav-item.active .nav-icon img {
    opacity: 1;
}

.nav-item .nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

/* Space for bottom nav */
.main-content {
    padding-bottom: 80px;
}

/* ============================================
   INSTALL BANNER
   ============================================ */
#install-banner {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    z-index: 99;
    animation: slideUp 0.3s ease;
    max-width: 580px;
    margin: 0 auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.install-banner-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

.install-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.install-text strong {
    color: var(--marrone-terra);
    font-size: 1rem;
}

.install-text span {
    color: var(--marrone-chiaro);
    font-size: 1.05rem;
}

.install-btn {
    background: var(--giardino-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-btn:hover {
    background: var(--giardino-primary-dark);
}

.install-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--marrone-chiaro);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

/* ============================================
   NOTIFICATIONS MODAL
   ============================================ */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notification-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.notification-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.notification-modal-content h3 {
    margin-bottom: 10px;
    color: var(--marrone-terra);
}

.notification-modal-content p {
    color: var(--marrone-medio);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.notification-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-allow {
    background: var(--giardino-primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-allow:hover {
    background: var(--giardino-primary-dark);
}

.btn-deny {
    background: none;
    border: none;
    color: var(--marrone-chiaro);
    padding: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden { display: none !important; }
.visible { display: block !important; }

.text-muted { color: var(--marrone-chiaro); }
.text-success { color: var(--verde-muschio); }
.text-warning { color: var(--oro-miele); }
.text-danger { color: var(--terracotta-cotto); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .container {
        padding: 0 15px;
    }

    .card {
        border-radius: 12px;
    }

    .game-card .game-icon,
    .game-card .game-icon img {
        width: 65px;
        height: 65px;
    }

    .game-card {
        padding: 16px 18px;
        min-height: 80px;
    }

    .game-card .game-name {
        font-size: 1rem;
    }

    .game-card .game-desc {
        font-size: 0.95rem;
    }

    /* Bottom nav mobile */
    .nav-item {
        min-width: 40px;
        padding: 3px 4px;
    }

    .nav-item .nav-icon,
    .nav-item .nav-icon img {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
    }

    .nav-item .nav-label {
        font-size: 0.7rem;
    }

    .figurine-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, var(--iuta-chiaro) 25%, var(--iuta-scuro) 50%, var(--iuta-chiaro) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--iuta-scuro);
    border-top-color: var(--giardino-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90%;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast.toast-success {
    border-left: 4px solid var(--verde-muschio);
}

.toast.toast-error {
    border-left: 4px solid var(--terracotta-cotto);
}

.toast.toast-info {
    border-left: 4px solid var(--azzurro-oss-text);
}

.toast-icon {
    font-size: 1.3rem;
}

.toast-message {
    flex: 1;
    color: var(--marrone-terra);
}

/* ============================================
   BLOCCO ORIENTAMENTO LANDSCAPE
   ============================================ */
/* ============================================
   INFO MODAL & LOGOUT DIALOG
   ============================================ */
.info-btn {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    font-weight: 700;
    font-style: italic;
}

.info-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-modal-overlay.active {
    display: flex;
}

.info-modal-card {
    background: white;
    border-radius: 20px;
    padding: 24px 20px 22px;
    max-width: 400px;
    width: calc(100% - 32px);
    text-align: center;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.info-modal-card h3 {
    color: var(--verde-muschio);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 14px;
}

.info-modal-card .info-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.info-modal-card .info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 10px 14px;
    background: var(--iuta-chiaro);
    border-radius: 12px;
}

.info-modal-card .info-item img {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    flex-shrink: 0;
    object-fit: contain;
}

.info-modal-card .info-item .info-text {
    font-size: 0.85rem;
    color: var(--marrone-medio);
    line-height: 1.3;
}

.info-modal-card .info-item .info-text strong {
    color: var(--marrone-terra);
    display: block;
    font-size: 0.88rem;
    margin-bottom: 2px;
}

.info-modal-card .btn-capito {
    padding: 12px 36px;
    border-radius: 25px;
    border: none;
    background: var(--verde-muschio);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.info-modal-card .btn-capito:active {
    transform: scale(0.97);
}

/* Logout Confirmation Dialog */
.logout-dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.logout-dialog-overlay.active {
    display: flex;
}

.logout-dialog-card {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.logout-dialog-card h3 {
    color: var(--marrone-terra);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.logout-dialog-card .logout-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.logout-dialog-card .btn-logout-confirm {
    padding: 14px 20px;
    border-radius: 25px;
    border: none;
    background: var(--terracotta-cotto);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.logout-dialog-card .btn-logout-cancel {
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--iuta-scuro);
    background: transparent;
    color: var(--marrone-medio);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* Motivational Message */
.motivational-msg {
    text-align: center;
    padding: 8px 20px;
    margin: -5px 0 8px;
    font-family: Georgia, 'Merriweather', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.15rem;
    color: #4A6741;
    line-height: 1.4;
}

.motivational-msg p {
    font-family: Georgia, 'Merriweather', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #4A6741;
    background: rgba(253, 251, 247, 0.8);
    padding: 18px 20px;
    border-radius: 16px;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   BLOCCO ORIENTAMENTO LANDSCAPE
   ============================================ */
#landscapeBlocker {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #f2efea;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}
#landscapeBlocker span { font-size: 3rem; display: block; margin-bottom: 15px; }
#landscapeBlocker h3 { color: #3D2E26; margin-bottom: 8px; }
#landscapeBlocker p { color: #6B5A4C; font-size: 0.9rem; }

/* ============================================
   VICTORY POPUP CONDIVISO (tutti i giochi)
   ============================================ */
.victory-overlay-shared {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.victory-overlay-shared.active { display: flex; }
.victory-modal-shared {
    background: white;
    border-radius: 24px;
    padding: 30px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    animation: vpsSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes vpsSlideIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.vps-icon {
    display: block;
    margin: 0 auto 10px;
    width: 100px;
    height: auto;
}
.vps-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--verde-muschio);
    margin: 0 0 6px;
}
.vps-nome {
    font-weight: 800;
    color: var(--verde-muschio);
    font-size: 1.25rem;
}
.vps-detail {
    font-size: 1rem;
    color: var(--marrone-terra);
    margin: 0 0 5px;
    line-height: 1.5;
}
.vps-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--verde-udire-hover);
    color: var(--verde-udire-text);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 8px 0;
}
.vps-punti {
    font-size: 0.95rem;
    color: var(--verde-muschio);
    font-weight: 700;
    margin: 0 0 12px;
}
.vps-figurina {
    font-size: 0.9rem;
    color: var(--viola-tempo-text);
    font-weight: 600;
    margin: 0 0 10px;
}
.vps-edu {
    background: var(--iuta-chiaro);
    border-radius: 12px;
    padding: 12px 15px;
    margin: 10px 0;
    border-left: 3px solid var(--giardino-primary);
}
.vps-edu-text {
    font-size: 0.85rem;
    color: var(--marrone-medio);
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}
.vps-sep {
    border: none;
    border-top: 2px dashed var(--iuta-scuro);
    margin: 12px 0;
}
.vps-classifica-intro {
    font-size: 1rem;
    color: var(--marrone-terra);
    margin: 0 0 10px;
    line-height: 1.5;
}
.vps-classifica { margin: 0 0 12px; }
.vps-classifica-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    background: var(--iuta-chiaro);
}
.vps-classifica-tu {
    background: linear-gradient(135deg, rgba(229,241,233,0.7), rgba(230,241,246,0.7));
    border: 2px solid var(--verde-udire-hover);
}
.vps-classifica-tu .vps-classifica-nome { font-weight: 700; }
.vps-classifica-emoji { margin-right: 10px; flex-shrink: 0; }
.vps-classifica-emoji img { width: 24px; height: 24px; }
.vps-classifica-nome {
    flex: 1;
    font-size: 0.95rem;
    color: var(--marrone-terra);
    font-weight: 600;
    text-align: left;
}
.vps-classifica-punti {
    font-size: 0.85rem;
    color: var(--marrone-medio);
    white-space: nowrap;
    text-align: right;
}
.vps-msg {
    font-size: 0.95rem;
    color: var(--marrone-medio);
    font-style: italic;
    margin: 0 0 16px;
}
.vps-msg img { width: 16px; height: 16px; vertical-align: middle; }
.vps-btn {
    background: var(--verde-muschio);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}
.vps-btn:active { transform: scale(0.97); }
.vps-btn-secondary {
    background: transparent;
    color: var(--verde-muschio);
    border: 2px solid var(--verde-muschio);
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.2s ease;
}
.vps-btn-secondary:active { transform: scale(0.97); }
