body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Rubik', sans-serif;
    background-color: #000000; 
    color: white;
    overflow-x: hidden;
    position: relative;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; 
    position: relative;
}

* {
    box-sizing: border-box; 
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #1a1a1a;
    position: fixed;   
    top: 0;
    left: 0;     
    width: 100%;    
    z-index: 1000;
    box-sizing: border-box;
}

.logo { 
    height: 50px; 
}

.btn-primary, .btn-secondary {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-primary { 
    background: #C60408; 
    color: white; 
}

.btn-secondary { 
    color: white; 
    border: 1px solid #C60408; 
}

.hero {
    text-align: center;
    padding: 5rem 10%;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
}

.hero h1 { 
    font-size: 2.5rem; 
    margin-bottom: 1rem;
    color: #C60408;
    text-transform: uppercase;
    margin-top: 80px;
}

.hero p {
    font-size: 1.1rem;
    color: #bbb;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.store-img {
    height: 45px;
    margin: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.store-img:hover {
    transform: scale(1.05);
}

.gameplay-section {
    padding: 4rem 15px;
    text-align: center;
    border-top: 1px solid #1a1a1a;
    width: 100%;
    box-sizing: border-box; 
    overflow: hidden; 
}

.gameplay-section h2 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.gameplay-section p {
    color: #bbb;
    margin-bottom: 2rem;
}

.game-container {
    max-width: 340px;
    margin: 0 auto;
    background-color: #0a0a0a;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #1a1a1a;
}

.match-row {
    background-color: #1a1a1a;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    border-left: 5px solid #C60408;
    text-align: left;
}

.match-info {
    margin-bottom: 10px;
}

.match-teams {
    font-weight: bold;
    font-size: 1rem;
    color: white;
    display: block;
}

.match-details {
    font-size: 0.75rem;
    color: #888;
}

.bet-grid {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr; 
    gap: 6px;
    align-items: center;
}

.bet-group {
    display: flex;
    gap: 2px;
    background: #333;
    padding: 2px;
    border-radius: 6px;
}

.bet-btn {
    flex: 1;
    background: #444;
    border: none;
    color: white;
    padding: 8px 2px;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Rubik', sans-serif;
    transition: background 0.2s;
}

.bet-btn.selected {
    background-color: #C60408;
    font-weight: bold;
}

.btn-ready {
    display: block;    
    background-color: #C60408;
    color: white;
    width: 200px;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    margin: 25px auto 0 auto;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: filter 0.2s;
}

.btn-ready:hover {
    filter: brightness(1.2);
}

.btn-ready:disabled {
    background-color: #333;
    color: #777;
    cursor: not-allowed;
}

#feedback-demo {
    margin-top: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

#feedback-demo a {
    display: inline-block;
    margin-top: 8px;
    color: #C60408;
    text-decoration: underline;
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-container {
    animation: fadeIn 0.6s ease-out;
}




.game-question {
    font-size: 1rem;
    margin: 1.5rem 0;
    text-transform: uppercase;
    color: #C60408;
    letter-spacing: 1px;
}

.top10-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 2rem;
    align-items: center;
}

.rank-row {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
    transition: all 0.3s;
}

.rank-row .pos {
    font-weight: bold;
    color: #C60408;
    margin-right: 15px;
    width: 15px;
}

.rank-row.correct {
    background-color: #28a745;
    border-color: #fff;
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#autocomplete-container {
    position: relative;
    width: 100%;
    max-width: 300px;
}

input#player-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: white;
    outline: none;
}

#suggestions-box {
    position: absolute;
    bottom: 100%; 
    left: 0;
    width: 100%;
    background-color: #1a1a1a;
    border: 1px solid #C60408;
    border-radius: 8px;
    z-index: 100;
    margin-bottom: 5px;
}

.suggestion-item {
    padding: 12px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    text-align: left;
}

.suggestion-item:hover {
    background-color: #C60408;
}

.suggestions-hidden { display: none; }



.formation-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
}

.field {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 2/3;
    background: #000;
    border: 4px solid #C60408;
    overflow: hidden;
    margin: 0 10px;
}

.goal-area, .semicircle {
    position: absolute;
    border: 4px solid #C60408;
    background: transparent;
}

.goal-area { top: -4px; left: 50%; transform: translateX(-50%); width: 95px; height: 65px; }
.semicircle { bottom: -4px; left: 50%; transform: translateX(-50%); width: 90px; height: 45px; border-bottom: none; border-radius: 45px 45px 0 0; }

.player { position: absolute; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); }
.shirt-container { position: relative; width: 40px; height: 40px; cursor: pointer; }
.shirt-container img { width: 100%; }
.number-inside { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); font-size: 12px; color: black; font-weight: bold; }
.player-name-label { font-size: 10px; margin-top: 4px; color: white; white-space: nowrap; font-weight: bold; }


.player.selected-target .shirt-container {
    outline: 3px solid #fff;
    outline-offset: 5px;
    border-radius: 5px;
    box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.6);
    animation: pulse-select 1.5s infinite;
}

@keyframes pulse-select {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.side-panel {
    width: 100%;
    max-width: 360px;
    background: #F9F2F1; 
    border-radius: 16px;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.underscore-box {
    display: inline-block;
    width: 20px;
    height: 24px;
    margin: 0 2px;
    text-align: center;
    line-height: 24px;
    font-size: 18px;
    color: black;
    border-bottom: 2px solid #333;
}

.underscore-box.cursor {
    border-bottom: 2px solid #C60408;
    animation: blink 1s steps(2, start) infinite;
}

.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.key {
    width: 28px; 
    height: 38px;
    max-width: 32px;
    min-width: 0;
    background: #333; 
    color: white;
    border: none; 
    border-radius: 6px;
    font-size: 14px; 
    font-weight: bold;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.key-wide {
    flex: 2;
    max-width: 80px;
}

/* Per telefoni con larghezza fino a 380px (iPhone SE, piccoli Android) */
@media (max-width: 380px) {
    .key {
        width: 24px;
        height: 34px;
        font-size: 12px;
    }

    .keyboard-row {
        gap: 4px;
    }

    .side-panel, .side-panel-career {
        padding: 20px 8px;
    }
}

@media (max-width: 330px) {
    .key {
        width: 22px;
        gap: 3px;
    }
}

@keyframes blink { to { border-color: transparent; } }




.career-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    align-items: flex-start; 
    gap: 30px;              
    padding: 40px 20px;
    margin: 0 auto;
    max-width: 1200px;
}


.career-container-main, 
.side-panel-career {
    width: 100%;
    max-width: 350px;
    flex-shrink: 1; 
}


.career-box {
    background: #F9F2F1;
    color: black;
    border-radius: 10px;
    padding: 20px;
    margin: 0; 
    width: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.career-row {
    display: grid;
    grid-template-columns: 90px 1fr 85px;
    font-size: 13px;
    padding: 4px 0;
    color: #333;
    border-bottom: 1px solid rgba(0,0,0,0.05); 
}

.career-row:last-child {
    border-bottom: none;
}

.career-row span:last-child {
    text-align: right;
}

.side-panel-career {
    background: #F9F2F1;
    border-radius: 16px;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .career-layout {
        gap: 40px; 
        padding: 20px 10px;
    }

    .career-container-main, 
    .side-panel-career {
        width: 100%; 
        max-width: 380px;
    }
}




#quiz-page {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 50px auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

.quiz-container {
    width: 100%;
    background: #1a1a1a; 
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

#quiz-header {
    margin-bottom: 15px;
    text-align: left;
}

#question-count {
    font-weight: bold;
    font-size: 1.2rem;
    color: #c62828;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #333;
    border-radius: 4px;
    margin-bottom: 30px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #c62828;
    width: 33%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

#question-text {
    font-size: 1.4rem;
    font-weight: bold;
    min-height: 60px;
    margin-bottom: 30px;
}

#answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer {
    padding: 15px;
    background-color: #f8f0f0;
    color: black;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer:hover:not(:disabled) {
    background-color: #e0dada;
}

.answer.correct {
    background-color: #4CAF50 !important;
    color: white;
}

.answer.incorrect {
    background-color: #f44336 !important;
    color: white;
}

.btn-register {
    background-color: #c62828;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    transition: background 0.3s;
}

.btn-register:hover {
    background-color: #a82222;
}

.gameplay-section {
    overflow: hidden;     
    width: 100%;
}

.formation-layout, .career-layout {
    max-width: 100%;
    overflow: hidden;      
}



.landing-footer {
    background-color: #000;
    border-top: 1px solid #1a1a1a;
    padding: 30px 5%;
    width: 100%;
    box-sizing: border-box;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    height: 60px; 
    width: auto;
}

.footer-contact {
    text-align: center;
}

.footer-contact h4 {
    margin: 0 0 5px 0;
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.footer-contact a {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 24px;  
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1); 
    transition: transform 0.2s, opacity 0.2s;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
}