/* Reset e font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', serif;
    background-color: #0a0a0a;
    color: #e6d7a8;
    line-height: 1.6;
    position: relative;
    z-index: 0;
    padding-top: 80px; /* Spazio per l'header fisso */
}

/* Video di sfondo */
.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 0;
    z-index: 1000;
}

.header-container {
    max-width: 90%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.logo-link {
    display: block;
}

.logo {
    width: 100%;
    max-width: 180px;
    height: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Dropdown Switcher */
.lang-dropdown {
    position: relative;
    margin-left: 10px;
    z-index: 1001;
}

.lang-selected {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(30, 20, 10, 0.85);
    color: #e6d7a8;
    border: 1px solid #b8860b;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.lang-selected:hover,
.lang-dropdown.open .lang-selected {
    background: rgba(184, 134, 11, 0.25);
    border-color: #d4a017;
    box-shadow: 0 0 10px rgba(184,134,11,0.4);
}

.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.lang-code {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.lang-chevron {
    font-size: 0.55rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.lang-dropdown.open .lang-chevron {
    transform: rotate(180deg);
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 148px;
    background: rgba(18, 12, 6, 0.97);
    border: 1px solid #b8860b;
    border-radius: 8px;
    padding: 4px 0;
    list-style: none;
    box-shadow: 0 8px 28px rgba(0,0,0,0.7), 0 0 12px rgba(184,134,11,0.15);
    backdrop-filter: blur(6px);
    animation: langMenuSlide 0.15s ease;
    z-index: 9999;
}

@keyframes langMenuSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lang-dropdown.open .lang-menu {
    display: block;
}

.lang-option a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    color: #c8b97a;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    transition: background 0.15s, color 0.15s;
    border-radius: 4px;
    margin: 0 4px;
}

.lang-option a:hover {
    background: rgba(184, 134, 11, 0.2);
    color: #f0e0a0;
}

.lang-option-active a {
    background: rgba(184, 134, 11, 0.35);
    color: #f5e6b0;
    font-weight: 700;
    pointer-events: none;
}

.lang-name {
    font-size: 0.8rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 15px;
}

.nav-links li a,
.nav-links li span {
    color: #e6d7a8;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: #d4a017;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #e6d7a8;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Statistics Bar */
.stats-bar {
    background: #f4e8d1;
    border: 2px solid #b8860b;
    border-radius: 8px;
    padding: 10px 20px;
    max-width: 800px;
    margin: 80px auto 0; /* Ridotto da 110px a 80px per avvicinare all'header */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-family: 'MedievalSharp', cursive;
    color: #2c1e0f;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
}

.stat-item i {
    color: #b8860b;
    font-size: 1.2em;
}

.stat-item span {
    font-size: 0.9em;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh; /* Ridotto da 100vh per un layout più compatto */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 20px; /* Ridotto da 120px a 20px per avvicinare alla stats-bar */
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
}

.hero-overlay h1 {
    font-family: 'Cinzel', serif;
    color: #b8860b;
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-overlay .tagline {
    font-family: 'MedievalSharp', cursive;
    color: #f4e8d1;
    font-size: 1.5em;
    margin: 10px 0;
}

.hero-overlay .release-date {
    font-family: 'MedievalSharp', cursive;
    color: #d2b48c;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.hero-overlay .discord-button,
.hero-overlay .action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    margin: 10px;
    border: 2px solid #b8860b;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.hero-overlay .discord-button {
    background: #7289da;
    color: #fff;
}

.hero-overlay .action-button {
    background: #b8860b;
    color: #2c1e0f;
}

.hero-overlay .discord-button:hover,
.hero-overlay .action-button:hover {
    background: #d2b48c;
    transform: scale(1.05);
}

.hero-overlay .action-button i,
.hero-overlay .discord-button i {
    font-size: 1.2rem;
}

/* News Section */
.news-section {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: #f4e8d1;
    border: 3px solid #b8860b;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    font-family: 'MedievalSharp', cursive;
    color: #2c1e0f;
}

.news-section h2 {
    font-family: 'Cinzel', serif;
    color: #b8860b;
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
}

.news-item {
    background: #e6d8b8;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #b8860b;
    border-radius: 5px;
}

.news-item.news {
    border-left: 5px solid #2f4f4f;
}

.news-item.changelog {
    border-left: 5px solid #b8860b;
}

.news-item h3 {
    font-family: 'Cinzel', serif;
    color: #2c1e0f;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.news-meta {
    font-size: 0.9em;
    color: #2f4f4f;
    margin-bottom: 10px;
}

.news-content {
    font-size: 1.1em;
    line-height: 1.6;
}

.news-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.news-actions .action-button {
    padding: 8px 15px;
    font-size: 1em;
}

.news-actions .action-button.liked {
    background: #ffd700;
}

.comment-form {
    margin-top: 10px;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #b8860b;
    border-radius: 5px;
    font-family: 'MedievalSharp', cursive;
    resize: vertical;
}

.comments {
    margin-top: 10px;
}

.comment {
    background: #f4e8d1;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #b8860b;
    border-radius: 5px;
}

.comment p {
    margin: 5px 0;
}

/* Register Section */
.register,
.login,
.ranking {
    padding: 90px 15px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.register-container,
.login-container,
.ranking-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.register h1,
.login h1,
.ranking h1 {
    font-size: 2.5rem;
    font-family: 'MedievalSharp', cursive;
    color: #d4a017;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(212, 160, 23, 0.5);
    animation: glow 2s infinite alternate;
}

.form-content,
.ranking-content {
    background: linear-gradient(to bottom, #f4e8c1, #d4c0a1);
    padding: 30px;
    border: 3px solid #d4a017;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(212, 160, 23, 0.5);
    text-align: left;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 1rem;
    color: #333;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 2px solid #d4a017;
    border-radius: 5px;
    background: #f4e8c1;
    color: #333;
    font-size: 1rem;
}

.g-recaptcha {
    margin: 15px 0;
}

.register-form button,
.login-form button {
    width: 100%;
    padding: 10px;
    background: #d4a017;
    color: #0a0a0a;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    transition: background 0.3s;
}

.register-form button:hover,
.login-form button:hover {
    background: #b89b4e;
}

.login-container p,
.register-container p {
    color: #000;
    text-align: center;
    margin-top: 14px;
    font-size: 0.95rem;
}

.login-container p a,
.register-container p a {
    color: #000;
    font-weight: 700;
    text-decoration: underline;
}

.success {
    color: #2e7d32;
    margin-bottom: 15px;
    text-align: center;
}

.errors {
    list-style: none;
    color: #d32f2f;
    margin-bottom: 15px;
    text-align: center;
}

.errors li {
    margin-bottom: 5px;
}

.form-content a {
    color: #d4a017;
    text-decoration: none;
}

.form-content a:hover {
    text-decoration: underline;
}

/* Ranking Section */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    color: #333;
}

.ranking-table th,
.ranking-table td {
    padding: 10px;
    border: 1px solid #d4a017;
    text-align: center;
}

.ranking-table th {
    background: #d4a017;
    color: #0a0a0a;
    font-family: 'MedievalSharp', cursive;
}

.ranking-table tr:nth-child(even) {
    background: #e6d7a8;
}

.ranking-table tr:hover {
    background: #f4e8c1;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.6);
    padding: 20px 15px;
    color: #b89b4e;
}

.footer-container {
    max-width: 90%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.footer-column h3 {
    font-size: 1.2rem;
    color: #d4a017;
    margin-bottom: 10px;
}

.footer-column p,
.footer-column ul {
    font-size: 0.8rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column ul li a {
    color: #e6d7a8;
    text-decoration: none;
}

.footer-column ul li a:hover {
    color: #d4a017;
}

.footer-copy {
    text-align: center;
    margin-top: 10px;
    font-size: 0.7rem;
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(50px);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(212, 160, 23, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(212, 160, 23, 0.8);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-overlay h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .release-date {
        font-size: 0.9rem;
    }

    .register h1,
    .login h1,
    .ranking h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .hero {
        height: 70vh;
        margin-top: 10px; /* Ridotto da 100px a 10px per mobile */
    }

    .stats-bar {
        padding: 10px;
        margin: 70px auto 0; /* Ridotto da 10px a 70px per mobile */
    }

    .stats-container {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item {
        font-size: 0.9em;
    }

    .stat-item span {
        font-size: 0.8em;
    }

    .news-section {
        margin: 20px auto;
        padding: 15px;
    }

    .hero-overlay h1 {
        font-size: 2em;
    }

    .hero-overlay .tagline {
        font-size: 1.2em;
    }

    .hero-overlay .release-date {
        font-size: 1em;
    }

    .hero-overlay .discord-button,
    .hero-overlay .action-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .register,
    .login,
    .ranking {
        padding: 20px 10px;
    }

    .register h1,
    .login h1,
    .ranking h1 {
        font-size: 1.6rem;
    }

    .logo {
        max-width: 140px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.8);
        padding: 10px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li a,
    .nav-links li span {
        font-size: 0.8rem;
    }

    .hamburger {
        display: block;
    }

    .lang-dropdown {
        margin-left: 0;
        margin-top: 8px;
        position: relative;
        width: 100%;
    }

    .lang-selected {
        width: 100%;
        justify-content: center;
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .lang-menu {
        position: absolute;
        top: calc(100% + 4px);
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        min-width: 140px;
        max-width: 200px;
    }

    .lang-option a {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .lang-code {
        font-size: 0.7rem;
    }

    .lang-name {
        font-size: 0.7rem;
    }

    .header-container,
    .footer-container {
        max-width: 100%;
    }

    .register-container,
    .login-container,
    .ranking-container {
        max-width: 90%;
        padding: 20px;
    }

    .ranking-table th,
    .ranking-table td {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-overlay h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .release-date {
        font-size: 0.7rem;
    }

    .register h1,
    .login h1,
    .ranking h1 {
        font-size: 1.4rem;
    }

    .form-group input,
    .ranking-table th,
    .ranking-table td {
        font-size: 0.8rem;
    }

    .ranking-table {
        font-size: 0.7rem;
    }

    .lang-dropdown {
        margin-top: 6px;
    }

    .lang-selected {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .lang-menu {
        min-width: 120px;
        max-width: 180px;
    }

    .lang-option a {
        padding: 5px 10px;
        font-size: 0.65rem;
    }

    .lang-code {
        font-size: 0.65rem;
    }

    .lang-name {
        font-size: 0.65rem;
    }
}

/* Stile per le icone nel menu di navigazione */
.nav-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    transition: color 0.3s ease, transform 0.2s ease;
}

.nav-links a i {
    font-size: 1.2rem;
    color: #d4af37;
}

.nav-links a:hover i {
    color: #ffd700;
    transform: scale(1.1);
}

.nav-links a.active i {
    color: #ffd700;
}

/* Per il menu responsive (hamburger) */
@media (max-width: 768px) {
    .nav-links a {
        justify-content: center;
    }
}

/* Download Section */
.download-section {
    text-align: center;
    padding: 50px 20px;
    background: rgba(0, 0, 0, 0.5);
    margin: 40px auto 20px;
    max-width: 800px;
    border: 3px solid #b8860b;
    border-radius: 10px;
}

.download-container h2 {
    font-family: 'Cinzel', serif;
    color: #b8860b;
    font-size: 2em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.download-container p {
    font-family: 'MedievalSharp', cursive;
    color: #f4e8d1;
    font-size: 1.2em;
    margin: 15px 0;
}

.download-container .action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: #b8860b;
    color: #2c1e0f;
    border: 2px solid #2f4f4f;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    text-decoration: none;
    transition: background 0.3s, transform 0.2s;
}

.download-container .action-button:hover {
    background: #d2b48c;
    transform: scale(1.05);
}

.download-container .action-button i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .download-section {
        padding: 30px 15px;
        margin-top: 30px;
    }
    .download-container h2 {
        font-size: 1.5em;
    }
    .download-container p {
        font-size: 1em;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    margin-top: 90px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid #b8860b;
    z-index: 1002; /* Sopra l'header */
    display: none; /* Nascosto di default, mostrato via JS */
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    color: #e6d7a8;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    gap: 20px;
}

.cookie-content p {
    font-size: 0.9em;
    margin: 0;
    flex: 1;
}

.cookie-content a {
    color: #d4a017;
    text-decoration: underline;
}

.cookie-content a:hover {
    color: #ffd700;
}

.cookie-button {
    background: #b8860b;
    color: #2c1e0f;
    border: 1px solid #2f4f4f;
    padding: 8px 15px;
    border-radius: 5px;
    font-family: 'Cinzel', serif;
    font-size: 0.9em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.cookie-button:hover {
    background: #d2b48c;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 8px 15px;
    }

    .cookie-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .cookie-content p {
        font-size: 0.8em;
    }

    .cookie-button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}