/* ===== Variables ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-blue: #60a5fa;
    --accent-purple: #a78bfa;
    --accent-pink: #f472b6;
    --border-blue: #3b82f6;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --card-color: #ec4899; /* ורוד למשחק מי אני */
}

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

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-blue);
    flex-shrink: 0;
}

.home-link, .trophy-link {
    text-decoration: none;
    font-size: 1.5rem;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
}

.home-link:hover, .trophy-link:hover {
    background: rgba(255,255,255,0.2);
}

header h1 {
    font-size: 1.4rem;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#score-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ===== Game Area ===== */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

/* ===== Welcome Screen ===== */
#welcome-screen {
    max-width: 800px;
    text-align: center;
    animation: fadeIn 0.5s;
}

#welcome-screen h2 {
    font-size: 2rem;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.difficulty-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.diff-btn {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.diff-btn:hover {
    transform: translateY(-5px);
    border-color: var(--card-color);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.btn-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.btn-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.instructions {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 25px;
    text-align: right;
}

.instructions h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent-blue);
    display: none; /* הסתרת כיתוב רמת הטשטוש */
}

.instructions ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.instructions li {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Game Screen ===== */
#game-screen {
    max-width: 600px;
    width: 100%;
    animation: fadeIn 0.5s;
}

#image-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 30px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    background: var(--bg-secondary);
}

#character-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    transition: filter 0.5s ease;
}

/* Pixelation levels */
.pixelated-5 { filter: blur(0px); width: 50px; height: 50px; }
.pixelated-4 { filter: blur(0px); width: 67px; height: 67px; }
.pixelated-3 { filter: blur(0px); width: 100px; height: 100px; }
.pixelated-2 { filter: blur(0px); width: 200px; height: 200px; }
.pixelated-1 { filter: blur(0px); width: 400px; height: 400px; }
.pixelated-0 { filter: grayscale(50%); width: 400px; height: 400px; }

#pixelation-level {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--accent-blue);
    display: none; /* הסתרת כיתוב רמת הטשטוש */
}

/* ===== Attempts Bar ===== */
#attempts-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

#attempts-dots {
    display: flex;
    gap: 8px;
}

.dot {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.dot.active {
    color: var(--card-color);
    text-shadow: 0 0 10px var(--card-color);
}

/* ===== Input Area ===== */
#input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#guess-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-tertiary);
    border-radius: 12px;
    color: var(--text-primary);
    transition: border-color 0.3s;
}

#guess-input:focus {
    outline: none;
    border-color: var(--card-color);
}

#guess-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--card-color), #db2777);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

#guess-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(236, 72, 153, 0.4);
}

#guess-btn:active {
    transform: translateY(0);
}

/* ===== Hint Area ===== */
#hint-area {
    text-align: center;
    margin-bottom: 20px;
}

#hint-btn {
    padding: 12px 25px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

#hint-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.4);
}

#hint-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#hint-text {
    margin-top: 15px;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-right: 4px solid var(--accent-blue);
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.6;
    animation: slideDown 0.3s;
}

/* ===== Feedback ===== */
#feedback {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px;
    border-radius: 10px;
    min-height: 50px;
    animation: fadeIn 0.3s;
}

#feedback.success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 2px solid var(--success);
}

#feedback.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 2px solid var(--error);
}

#feedback.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 2px solid var(--warning);
}

/* ===== Overlay ===== */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

#overlay-box {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--border-blue);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    animation: scaleIn 0.3s;
}

#overlay-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

#overlay-title {
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#overlay-msg {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

#fun-fact {
    background: var(--bg-primary);
    border-right: 4px solid var(--accent-pink);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: right;
}

#overlay-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--card-color), #db2777);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

#overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(236, 72, 153, 0.5);
}

/* ===== Score Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--border-blue);
    border-radius: 25px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    animation: scaleIn 0.3s;
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-align: center;
}

#final-score-display {
    font-size: 1.3rem;
    color: var(--accent-blue);
    display: none; /* הסתרת כיתוב רמת הטשטוש */
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--card-color);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn-submit, .btn-skip {
    flex: 1;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.4);
}

.btn-skip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-skip:hover {
    background: var(--bg-secondary);
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.shake {
    animation: shake 0.4s;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #image-container {
        width: 300px;
        height: 300px;
    }
    
    .pixelated-5 { width: 37px; height: 37px; }
    .pixelated-4 { width: 50px; height: 50px; }
    .pixelated-3 { width: 75px; height: 75px; }
    .pixelated-2 { width: 150px; height: 150px; }
    .pixelated-1, .pixelated-0 { width: 300px; height: 300px; }
    
    #welcome-screen h2 {
        font-size: 1.5rem;
    }
    
    .difficulty-selector {
        grid-template-columns: 1fr;
    }
    
    #input-area {
        flex-direction: column;
    }
    
    #guess-btn {
        width: 100%;
    }
}

/* ===== Overlay Buttons Container ===== */
.overlay-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

#info-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

#info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.4);
}

