:root {
    --bg-dark: #232527;
    --bg-card: #2d2f33;
    --bg-card-hover: #383b40;
    --accent-blue: #00A2FF;
    --accent-green: #00B06F;
    --accent-yellow: #F5CD30;
    --accent-red: #FF4D4D;
    --text-primary: #ffffff;
    --text-muted: #b8bcc4;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 162, 255, 0.12), transparent 40%),
        radial-gradient(circle at 80% 10%, rgba(0, 176, 111, 0.1), transparent 35%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(35, 37, 39, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
}

.brand-icon {
    font-size: 1.5rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
    background: rgba(0, 162, 255, 0.18);
    color: var(--text-primary);
}

.site-nav a.legacy-link {
    font-size: 0.85rem;
    opacity: 0.7;
}

.nav-toggle {
    display: none;
    background: var(--bg-card);
    border: none;
    color: white;
    font-size: 1.4rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.site-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.page-game .site-main {
    max-width: none;
    padding: 12px 12px 24px;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 40px;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-content h1 span {
    color: var(--accent-blue);
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 20px;
    max-width: 520px;
}

.badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-blue), #0077cc);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 162, 255, 0.35);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(180deg, #00b4ff, #0088dd);
    color: white;
    box-shadow: 0 6px 0 #005fa3, 0 10px 24px rgba(0, 162, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #005fa3;
}

.btn-secondary {
    background: var(--bg-card);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.hero-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-card img {
    width: 100%;
    max-width: 220px;
    display: block;
    margin: 0 auto 16px;
    border-radius: 12px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 36px;
}

.birthday-section {
    background: linear-gradient(135deg, rgba(0, 162, 255, 0.15), rgba(245, 205, 48, 0.12));
    border: 2px solid rgba(245, 205, 48, 0.35);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 36px;
    text-align: center;
}

.countdown-line {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .countdown-line {
        font-size: 0.95rem;
        white-space: normal;
    }
}

.countdown-done {
    font-size: 1.4rem;
    color: var(--accent-yellow);
    font-weight: 700;
}

.stat-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-box strong {
    display: block;
    font-size: 2rem;
    color: var(--accent-yellow);
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 18px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.interest-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: default;
}

a.interest-card {
    cursor: pointer;
}

.interest-card.sound-card {
    cursor: pointer;
}

.interest-card.sound-card:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

.interest-card.mario.sound-card:hover {
    border-color: rgba(255, 77, 77, 0.65);
}

a.interest-card:hover {
    color: inherit;
}

.interest-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 162, 255, 0.4);
}

.interest-card .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.interest-card h3 {
    margin-bottom: 6px;
}

.interest-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.interest-card.mario { border-color: rgba(255, 77, 77, 0.35); }
.interest-card.sonic { border-color: rgba(0, 162, 255, 0.35); }
.interest-card.roblox { border-color: rgba(0, 176, 111, 0.35); }
.interest-card.discord { border-color: rgba(88, 101, 242, 0.45); }

.leaderboard {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 36px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-list {
    list-style: none;
}

.leaderboard-list li {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-list li:last-child {
    border-bottom: none;
}

.leaderboard-list .rank {
    font-weight: 700;
    color: var(--accent-yellow);
}

.leaderboard-list .coins {
    color: var(--accent-green);
    font-weight: 600;
}

.leaderboard-empty {
    color: var(--text-muted);
    padding: 16px 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.photo-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-muted);
    max-width: 560px;
}

.photo-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.photo-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    color: var(--text-muted);
    transition: transform 0.15s, border-color 0.15s, color 0.15s;
}

.photo-nav-link:hover,
.photo-nav-link.active {
    color: var(--text-primary);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.photo-nav-icon {
    font-size: 1.1rem;
}

.gallery-count {
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

/* --- Carousel foto con cornice --- */
.photo-carousel {
    position: relative;
    max-width: 820px;
    margin: 0 auto 40px;
    outline: none;
}

.carousel-frame {
    padding: 14px;
    background: linear-gradient(145deg, #5c4033 0%, #3d2817 35%, #6b4c35 70%, #4a3220 100%);
    border-radius: 8px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.carousel-frame-inner {
    padding: 10px;
    background: linear-gradient(180deg, #f8f4ec 0%, #ebe4d6 100%);
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px rgba(92, 64, 51, 0.35);
}

.carousel-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #1a1c1e;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
    display: flex;
    flex-direction: column;
}

.carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.carousel-photo-mat {
    flex: 1;
    padding: 12px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.carousel-photo-mat img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}

.carousel-caption {
    padding: 10px 12px 4px;
    text-align: center;
    font-size: 0.85rem;
    color: #5c4033;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    pointer-events: none;
    z-index: 5;
}

.carousel-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(35, 37, 39, 0.75);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.carousel-btn:hover {
    background: var(--accent-blue);
    transform: scale(1.08);
}

.carousel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.carousel-counter {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 4rem;
}

.carousel-current {
    color: var(--accent-yellow);
}

.carousel-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 420px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: scale(1.15);
}

.carousel-toggle {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-toggle:hover {
    border-color: var(--accent-blue);
}

.gallery-empty {
    color: var(--text-muted);
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-dark);
        padding: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .site-nav.open {
        display: flex;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .countdown-unit {
        min-width: 64px;
        padding: 10px 8px;
    }

    .countdown-unit strong {
        font-size: 1.6rem;
    }

    .leaderboard-list li {
        grid-template-columns: 32px 1fr auto;
        font-size: 0.9rem;
    }

    .leaderboard-list .coins {
        display: none;
    }
}

/* ——— Astrologia / tema natale ——— */
.page-astro .card-panel {
    padding: 24px;
    border-radius: var(--radius);
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.page-astro .section-title {
    color: #0f172a;
    margin-bottom: 16px;
}

.page-astro .astro-reading.card-panel {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.page-astro .astro-reading .section-title {
    color: #ffffff;
}

.page-astro .astro-reading .astro-reading-hint {
    color: var(--text-muted);
}

.astro-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px 24px;
    margin: 0 0 12px;
}

.astro-facts div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.astro-facts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
}

.astro-facts dd {
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
}

.astro-note,
.astro-reading-hint {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0 0 16px;
}

.astro-chart-figure {
    margin: 0;
    text-align: center;
}

.astro-chart-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.astro-chart-figure figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
}

.astro-frame-wrap {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.astro-reading-body {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 36px;
    font-size: 1.12rem;
    line-height: 1.85;
    color: #ffffff;
    max-width: none;
}

.astro-reading-body p {
    margin: 0 0 1.15em;
    text-align: justify;
    color: #f1f5f9;
}

.astro-reading-body span {
    font-size: inherit !important;
    color: #f1f5f9 !important;
    font-family: inherit !important;
    line-height: inherit !important;
}

.astro-reading-body h5 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff !important;
    margin: 1.5em 0 0.65em;
    line-height: 1.45;
}

.astro-reading-empty {
    color: var(--text-muted);
    font-style: italic;
}

.astro-frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #fff;
}

@media (max-width: 768px) {
    .astro-reading-body {
        padding: 22px 18px;
        font-size: 1.05rem;
    }

    .astro-frame {
        min-height: 520px;
    }
}
