/* Reset si baza */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Buton Fullscreen (ca la YouTube) */
.fullscreen-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    color: white;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn svg {
    width: 28px;
    height: 28px;
}

/* Hide fullscreen button when in fullscreen on mobile */
@media (max-width: 768px) {
    .fullscreen-btn {
        width: 45px;
        height: 45px;
    }

    .fullscreen-btn svg {
        width: 24px;
        height: 24px;
    }
}

:root {
    --color-primary: #FF6B6B;
    --color-secondary: #4ECDC4;
    --color-success: #95E1D3;
    --color-warning: #FFE66D;
    --color-purple: #A78BFA;
    --color-orange: #FFA94D;
    --color-pink: #FF6AC1;
    --color-blue: #5DADE2;
    --color-green: #6BCF7F;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* FARA SCROLL */
    position: fixed;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

#app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Ecrane - LANDSCAPE OPTIMIZAT */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    padding: 0.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== MENIU ===== */
header h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #FFE66D, #A78BFA);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s ease infinite;
    text-align: center;
    margin: 0;
}

@keyframes rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.5rem;
    color: white;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin: 0;
}

/* Butoane */
button {
    font-family: inherit;
    font-size: 1.3rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 200px;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

.btn-large {
    font-size: 1.8rem;
    padding: 1.2rem 3rem;
    min-width: 250px;
}

.btn-start {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255,107,107,0.5);
}

.btn-continue {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
}

.btn-next {
    background: linear-gradient(135deg, #A78BFA 0%, #8B5CF6 100%);
    color: white;
}

.btn-replay {
    background: linear-gradient(135deg, #FFE66D 0%, #FFAB4C 100%);
    color: #333;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    font-size: 1.1rem;
    min-width: 150px;
    padding: 0.8rem 1.5rem;
}

.btn-back {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
    font-size: 1.2rem;
    min-width: 150px;
}

button:active {
    transform: scale(0.95);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* ===== ECRAN JOC - LANDSCAPE ===== */
#game-screen {
    padding: 0.5rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    gap: 1rem;
}

.level-badge, .score-badge {
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.level-badge {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
}

.score-badge {
    background: linear-gradient(135deg, #FFE66D 0%, #FFAB4C 100%);
    color: #333;
}

/* Afisare cuvant tinta - COMPACT */
.word-display {
    background: white;
    padding: 1rem 2rem;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    margin: 0;
    border: 4px solid #FFE66D;
}

.word-label {
    font-size: 1.2rem;
    color: #666;
    margin: 0 0 0.3rem 0;
}

.target-word {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5rem;
    margin: 0;
}

/* Sloturi litere - COMPACT */
.letter-slots {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0.5rem 0;
    min-height: auto;
}

.letter-slot {
    width: 60px;
    height: 70px;
    background: white;
    border: 4px dashed #ccc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Arial Black', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.letter-slot.empty {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #ccc;
    border-color: #ccc;
}

.letter-slot.filled {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
    border-color: #4CAF50;
}

.letter-slot.correct {
    background: linear-gradient(135deg, #6BCF7F 0%, #4CAF50 100%);
    border-color: #2E7D32;
    color: white;
    border-style: solid;
    animation: popIn 0.5s ease;
}

.letter-slot.incorrect {
    background: linear-gradient(135deg, #FF6B6B 0%, #E74C3C 100%);
    border-color: #C0392B;
    color: white;
    animation: shake 0.4s ease;
}

@keyframes popIn {
    0% { transform: scale(0.7); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Feedback - COMPACT */
.feedback {
    font-size: 1.3rem;
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.3rem 0;
    background: white;
    color: #333;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 3px solid #4ECDC4;
}

.feedback.success {
    background: linear-gradient(135deg, #6BCF7F 0%, #4CAF50 100%);
    border-color: #2E7D32;
    color: white;
}

.feedback.error {
    background: linear-gradient(135deg, #FF6B6B 0%, #E74C3C 100%);
    border-color: #C0392B;
    color: white;
}

.feedback.info {
    background: linear-gradient(135deg, #5DADE2 0%, #3498DB 100%);
    border-color: #2980B9;
    color: white;
}

.feedback.warning {
    background: linear-gradient(135deg, #FFE66D 0%, #FFAB4C 100%);
    border-color: #F39C12;
    color: #333;
}

/* Timer - COMPACT */
.timer-container {
    width: 100%;
    max-width: 400px;
    margin: 0.5rem auto;
}

.timer-bar {
    width: 100%;
    height: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 2px solid #FFE66D;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #6BCF7F 0%, #FFE66D 50%, #FF6B6B 100%);
    transition: width 1s linear;
    width: 100%;
}

.timer-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-top: 0.3rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Game controls - COMPACT */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
}

/* Ecran celebrare - COMPACT */
.celebration {
    background: white;
    padding: 2rem 3rem;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 5px solid #FFE66D;
}

.celebration-title {
    font-size: 3.5rem;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #FFE66D, #A78BFA);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 2s ease infinite;
    margin: 0 0 1rem 0;
}

.celebration-message {
    font-size: 2rem;
    color: #333;
    margin: 0 0 1rem 0;
}

.celebration-score {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #FFE66D 0%, #FFAB4C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Teme de culoare */
body.theme-verde {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

body.theme-rosu {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

body.theme-albastru {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.theme-galben {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Responsive - Portrait fallback */
@media (orientation: portrait) {
    .target-word {
        font-size: 2.5rem;
    }

    .letter-slot {
        width: 50px;
        height: 60px;
        font-size: 2rem;
    }

    .feedback {
        font-size: 1.1rem;
    }
}

/* Large screens */
@media (min-width: 1024px) and (orientation: landscape) {
    .target-word {
        font-size: 4rem;
    }

    .letter-slot {
        width: 80px;
        height: 95px;
        font-size: 3.5rem;
    }

    .feedback {
        font-size: 1.6rem;
    }
}
