body {
    --red: #631217;
    --yellow: #FFCA59;
    margin: 0;
    background-color: #575756;
    background: url(resources/bg.jpg) fixed 50% 50%; 
    background-repeat: repeat;
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 4fr 1fr;
    justify-content: center;
    align-items: center;
    align-content: space-between;
    overflow: visible;
    
}

.animatie {
    margin-top: 17vh;
    display: flex;
    justify-content: center;
}

.pa {
    height: 20vh;
}

#img1 {
    transform: rotate(-6deg);
    animation: kchow1 3s linear 1s infinite;
    margin-left: 48vw;
    z-index: 5;
}

#img2 {
    opacity: 0;
    animation: kchow2 3s linear 1s infinite;
    transform: translateX(-17vw);
    z-index: 5;
}

#lumina {
    opacity: 0;
    display: inline-block;
    z-index: 10;
    transform: translate(-30vw, 0.75vw) scale(80%);
    animation: kchow3 3s linear 1s infinite;
}

#text {
    display: inline-block;
    z-index: 4;
    opacity: 0;
    transform: translate(-51vw, -5.5vw) rotate(-10deg);
    animation: kchow2 3s linear 1s infinite;
}

@keyframes kchow1 {
    0% { opacity: 0; }
    20% { opacity: 0; }
    21% {opacity: 1;}
}

@keyframes kchow2 {
    0% { opacity: 1;
    }
    20% { opacity: 1; }
    21% { opacity: 0; }
}

@keyframes kchow3 {
    0% { opacity: 90%; }
    20% { opacity: 90%; }
    21% {opacity: 0;}
}


.line {
    background-color: var(--yellow);
    height: 0.5vh;
    margin-top: 1vh;
    margin-bottom: 1vh;
    width: 2vw;
}

.dropdown {
    position: relative;
    /* margin-left: 10vw; */
}

.dropdown-content {
    display: none;
    position: absolute;
}

.dropdown:hover > .dropdown-content {
    display: block;
}

#logo {
    height: 8vh;
    margin-left: 7vw;
}

footer {
    background-color: var(--red);
    margin-top: 60px;
    text-align: left;
    max-width: 100% !important;
    position: absolute;
    left: 0;
    width: 100vw;
}

.meniu {
    position: sticky;
    top: 0;
    height: 10vh;
    width: 100vw;
    background-color: var(--red);
}

.meniu > nav {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    column-gap: 30vw;
    overflow: visible;
}

nav {
    height: 5vh;
    width: 25vw;
    column-gap: 30px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.link {
    font-size: x-large;
}

.filme {
    display: flex;
    flex-direction: row;
    column-gap: 4vw;
    justify-content: center;
}   

h1 {
    letter-spacing: 2px;
    font-size: 50px;
}


.film {
    width: 55vh;
    height: 50vh;
    padding-left: 3px;
    padding-right: 3px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--yellow);
    border-radius: 5%;
    transition: 0.2s;
    overflow: hidden;
}

.title {
    font-size: large;
}

.poza, #doc > a > img {
    padding-top: 10px;
    width: 18vw;
}


#mater > a > img {
    /* height: 20vh; */
    width: 15vw;
}

p, h2, h3 {
    text-align: center;
}

#kachow {
    font-size: x-large;
}


.film:hover, .character:hover {
    box-shadow: 0 0 10px 8px red;
    transform: scale(105%);
}

#sally:hover {
    box-shadow: 0 0 10px 8px rgb(96, 159, 252);
}

#mater:hover {
    box-shadow: 0 0 10px 8px lightgrey;
}

#doc:hover {
    box-shadow: 0 0 10px 8px darkblue;
}

@font-face {
    font-family: bangers;
    src: url("resources/bangers.ttf");
}

@font-face {
    font-family: work-sans;
    src: url("resources/work-sans.ttf");
}


p, h3, h4, a {
    font-family: work-sans;
    color: var(--yellow);
    text-decoration: none;

    /* border: 5px solid red; */
}

h1, h2{
    color: var(--yellow);
    font-family: bangers;
    padding-left: 50px;
}

.link {
    display: block;
    width: 8vw;
    border: 1px solid var(--yellow);
    background-color: var(--red);
    color: var(--yellow);
    padding: 10px 10px;
    font-family: bangers;
}

.link:hover {
    filter: brightness(150%);
}

.poster {
    margin-left: 3.8vw;
    width: 20vw;
    height: 23vh;
    border-radius: 5%;
}

#character-title {
    padding-bottom: 0;
    margin-bottom: 0;
    text-align: center;
}

.personaje {
    display: grid;
    justify-items: center;
    align-items: center;
    row-gap: 10%;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 80% 10%;
    padding-top: 3%;
    padding-bottom: 3%;
    padding-right: 20%;
    grid-template-areas: "a b" "c d";
}

.character {
    height: 50vh;
    width: 30vw;
    border: 2px solid var(--yellow);
    border-radius: 5%;
    transition: 0.2s;
    overflow: scroll;
    padding-left: 5px;
    padding-right: 5px;
}

.character > a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.add-btn {
    font-family: 'bangers', cursive;
    font-size: 1.2rem;
    letter-spacing: 1px;
    
    background-color: var(--yellow); 
    color: var(--red);
    border: 2px solid var(--red);
    
    display: block;
    margin: 15px auto;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
    text-transform: uppercase;
}

.add-btn:hover {
    background-color: white; 
    transform: scale(1.1) rotate(-2deg); 
    box-shadow: 0 0 10px var(--yellow);
}

#theme-toggle {
    font-family: 'bangers', cursive;
    font-size: x-large; 
    
    background-color: var(--red); 
    color: var(--yellow);
    border: 2px solid var(--yellow);
    
    padding: 5px 15px;
    margin-left: 2vw; 
    cursor: pointer;
    transition: 0.3s;
}

#theme-toggle:hover {
    filter: brightness(150%);
    box-shadow: 0 0 15px var(--yellow);
}
#garage-container {
    margin-top: 50px;
    padding: 30px;
    background-color: #2a2a2a; 
    border-top: 5px solid var(--yellow);
    border-bottom: 5px solid var(--yellow);
    color: var(--yellow);
    text-align: center;
    min-height: 200px;
}

#garage-container h2 {
    font-family: 'bangers', cursive;
    color: var(--yellow);
    font-size: 3rem;
    text-shadow: 2px 2px var(--red);
}

.garage-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.garage-item {
    background-color: var(--red);
    border: 2px solid var(--yellow); 
    color: var(--yellow);
    padding: 15px;
    border-radius: 10px;
    width: 180px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.5);
}

.garage-item img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid var(--yellow);
    margin-bottom: 10px;
}

.garage-item h4 {
    font-family: 'work-sans', sans-serif;
    margin: 5px 0;
    font-size: 1.2rem;
}
.delete-btn {
    font-family: 'bangers', cursive;
    background-color: #a00; 
    
    border: 1px solid white;
    padding: 5px 15px;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 3px;
    font-size: 1rem;
}

.delete-btn:hover {
    background-color: red;
    box-shadow: 0 0 5px red;
}
body.neon-mode #garage-container {
    background-color: #050510;
    border-color: #00ffff;
}

body.neon-mode .garage-item {
    background-color: #1a1a40;
    border-color: #ff00de;
    box-shadow: 0 0 10px #ff00de;
}

body.neon-mode .add-btn {
    background-color: #39ff14; 
    color: black;
    border-color: #39ff14;
}

/* =========================================
   STILURI PENTRU PAGINA DE CONTACT
   ========================================= */

#contact-section {
    padding: 50px 20px;
    text-align: center;
    min-height: 80vh;
}

.form-container {
    background-color: rgba(0, 0, 0, 0.6); /* Fundal semi-transparent */
    border: 3px solid var(--yellow);
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    color: white;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    font-family: 'bangers', cursive;
    font-size: 1.5rem;
    color: var(--yellow);
    display: block;
    margin-bottom: 5px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    font-family: 'work-sans', sans-serif;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 5px;
    background-color: #eee;
    box-sizing: border-box; /* Asigură că padding-ul nu strică lățimea */
}

/* Stiluri pentru validare */
.form-group input.invalid,
.form-group textarea.invalid {
    border-color: red;
    background-color: #ffcccc;
}

.form-group input.valid,
.form-group textarea.valid {
    border-color: #39ff14; /* Verde neon */
    background-color: #eaffea;
}

/* Mesajele de eroare - ascunse inițial */
.error-msg {
    color: red;
    font-size: 0.9rem;
    font-weight: bold;
    display: none; /* Ascunse by default */
    margin-top: 5px;
}

/* Afișarea erorii */
.visible {
    display: block;
}

.submit-btn {
    width: 100%;
    font-size: 1.5rem;
}

/* =========================================
   STILURI PENTRU JOCUL DRAG RACE
   ========================================= */

/* Containerul principal al jocului */
#race-game {
    text-align: center;
    margin: 50px 0;
    padding: 40px;
    background: #1a1a1a; /* Gri închis aproape negru */
    color: white;
    border: 4px solid white;
    border-radius: 10px; /* Opțional: colțuri rotunjite */
}

/* Titlul jocului */
#race-game h1 {
    font-family: 'bangers', cursive;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: white;
}

/* Containerul pentru Semafor */
#traffic-light {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px auto; /* auto centrează containerul orizontal */
    background: #333;
    padding: 20px;
    width: fit-content; /* Se mulează pe conținut */
    border-radius: 20px;
    border: 2px solid #555;
}

/* Becurile individuale (Stare stinsă) */
.light {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #222;
    transition: all 0.1s; /* Tranziție rapidă pentru aprindere */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5); /* Efect de adâncime */
}

/* Culorile de bază (stinse) */
#light-red { background-color: #500; }
#light-yellow { background-color: #550; }
#light-green { background-color: #050; }

/* --- CLASE ACTIVE (Adăugate prin JavaScript) --- */

.light.active-red {
    background-color: #ff0000 !important;
    box-shadow: 0 0 30px #ff0000, inset 0 0 10px white !important;
}

.light.active-yellow {
    background-color: #ffcc00 !important;
    box-shadow: 0 0 30px #ffcc00, inset 0 0 10px white !important;
}

.light.active-green {
    background-color: #39ff14 !important; /* Verde neon */
    box-shadow: 0 0 50px #39ff14, inset 0 0 10px white !important;
}

/* --- LOGICA PENTRU TEXT ȘI BUTOANE --- */

/* Container pentru textul de stare (Engine Off / GO) */
.race-status-container {
    min-height: 80px; /* Înălțime minimă ca să nu sară pagina */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Textul efectiv */
#race-status {
    font-family: 'work-sans', sans-serif;
    margin-right: 40px;
    text-align: center; /* Centrare explicită a textului */
    width: 100%;
    word-wrap: break-word; /* Rupe cuvintele lungi dacă e cazul */
}

/* Container pentru buton */
.race-btn-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Stil specific butonului de start */
#start-engine-btn {
    font-size: 1.5rem;
    padding: 15px 40px;
    margin-top: 10px;
    max-width: 90%; /* Să nu iasă din ecran pe telefoane mici */
    cursor: pointer;
}

/* =========================================
   FEATURE: MEMBER AREA (AJAX & LOGIN)
   ========================================= */

#member-area {
    text-align: center;
    margin: 20px 0;
    padding: 30px;
    border: 2px solid var(--red); /* Folosim variabila ta globală */
    background: #2b2b2b; /* Un gri deschis */
    border-radius: 10px;
}

#member-area h2 {
    font-family: 'bangers', cursive;
    color: var(--yellow);
    margin-bottom: 20px;
}

/* Stiluri pentru input-urile de login */
#login-panel input {
    padding: 8px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'work-sans', sans-serif;
}

#login-error {
    color: red;
    display: none; /* Ascuns implicit */
    font-weight: bold;
    margin-top: 10px;
}

/* Panoul Dashboard (ascuns implicit) */
#dashboard-panel {
    display: none; 
}

#dashboard-panel h3 {
    color: green; /* Sau o variabilă dacă ai */
}

/* Butonul de Logout */
#logout-btn {
    background: #333;
    color: white;
    padding: 5px 15px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-family: 'work-sans', sans-serif;
    transition: background 0.2s;
}

#logout-btn:hover {
    background: #555;
}

#member-hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #ccc;
}

/* Butonul Load Secrets */
#load-secrets-btn {
    background-color: var(--yellow);
    color: var(--red);
    border: 2px solid var(--red);
    margin-top: 10px;
}

/* Containerul pentru secrete (Flexbox) */
#secrets-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* CLASĂ NOUĂ: Stilul pentru un cartonaș secret (folosită în JS) */
.secret-card {
    border: 2px dashed var(--red);
    padding: 15px;
    width: 220px;
    background: #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
    text-align: left;
}

.secret-card h4 {
    color: var(--red);
    margin: 0 0 10px 0;
    font-family: 'bangers', cursive;
    letter-spacing: 1px;
}

.secret-card p {
    font-size: 0.9rem;
    color: #333;
    margin: 0;
}


/* --- RESPONSIVE (TELEFON) --- */
@media (max-width: 600px) {
    #race-status {
        font-size: 1.2rem; /* Text mai mic pe mobil */
    }
    
    .light {
        width: 50px !important;  /* Becuri mai mici */
        height: 50px !important;
    }

    #traffic-light {
        gap: 10px;
        padding: 10px;
    }

    #start-engine-btn {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
}

@media (orientation: landscape) and (max-width: 70em) {
    .bonus {
        display: none;
    }
    .character {
        height: 32vh;
        width: 28vw;
    }
    .film {
        height: 35vh;
        width: 25vw;
    }
    .filme {
        padding-left: 5px;
        padding-right: 5px;;
    }
    h1, h2 {
        font-size: xx-large;
    }
    .poster {
        margin-top: 1vh;
        margin-left: 0;
        transform: scale(90%);
    }
    .link, #contact > p {
        font-size: medium
    }
}

@media (orientation: landscape) and (max-width: 40em) {
    .bonus, .title, #kachow {
        display: none;
    }

    .character {
        height: 32vh;
        width: 28vw;
    }
    .film {
        height: 35vh;
        width: 25vw;
    }
    .filme {
        padding-left: 5px;
        padding-right: 5px;;
    }
    h1, h2 {
        font-size: large;
    }
    .poster {
        margin-top: 1vh;
        margin-left: 0;
        transform: scale(90%);
    }
    .link, #contact > p {
        font-size: 3vh;
    }
}

@media (orientation: portrait){
    .meniu > nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .dropdown {
        margin-bottom: 4vh;
        margin-left: 3vh;
    }
    #logo {
        margin-right: 3vw;
        margin-bottom: 4vh;
    }
    .link {
        width: 25vw;
    }
    .line {
        height: 0.6vh;
        width: 10vw;
    }
    .meniu {
        position: static;
        height: 12vh;
    }
    .character {
        height: 32vh;
        width: 28vw;
    }
    .film {
        height: 35vh;
        width: 25vw;
    }
    h1, h2 {
        /* position: static; */
        padding-top: 5vh;
        text-align: center;
        font-size: xx-large;
    }
    #movies > h1, #character-title {
        padding-left: 0;
    }
    .poster {
        margin-left: 10vw;
    }
    #kachow{
        display: none;
    }
    nav {
        padding-top: 2vh;
        align-self: start !important;
        flex-direction: column;    
        row-gap: 0.5vh;
    }
    .personaje, .filme {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        row-gap: 5vh;
        padding-bottom: 5vh;
        padding-top: 5vh;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }
    .film {
        width: 80vw;
        height: 45vh;
    }
    .character {
        width: 80vw;
        height: 40vh;
    }
    .poster, .poza, #mater > a > img {
        width: 60vw;
        height: auto;
        /* height: 20vh; */
    }
    #doc > a > img {
        height: 12vh;
        width: auto;
    }
    #img1 {
        transform: translate(80vw, 0) rotate(-6deg);
    }
    #img2 {
        transform: translate(0, 0);
    }
    #lumina {
        transform: translate(-51vw, 2vh);
    }
    #text {
        transform: translate(-150vw, -11vh) rotate(-10deg);
    }

    

    #race-status {
        font-size: 1.2rem; /* Text mai mic pe telefon */
    }
    
    #start-engine-btn {
        font-size: 1.2rem !important; /* Buton mai mic pe telefon */
        padding: 10px 20px !important;
        width: 80%; /* Butonul să nu fie prea lat */
    }
    
    /* Facem semaforul mai mic pe telefon */
    .light {
        width: 50px !important;
        height: 50px !important;
    }
}
/* 
@media (min-width: 140em) {
    p {
        font-size: 2vh;
    }
    h1, h2, h3, h4, #kachow, .link{
        transform: scale(200%);
    }
    .title {
        transform: scale(250%);

    }

} */

@media (prefers-reduced-data: reduce) {
    #lumina {
        display: none;
    }
}