html, body { 
    margin: 0; padding: 0; width: 100%; height: 100%; 
    overflow: hidden; font-family: 'Segoe UI', Tahoma, sans-serif; background: #1a202c; 
}
body { display: flex; justify-content: center; align-items: center; }

/* Модальне вікно вибору мови */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); display: flex; justify-content: center; align-items: center; z-index: 100;
}
.modal {
    background: #2d3748; padding: 25px; border-radius: 30px; width: 85%; max-width: 360px; text-align: center; color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.lang-grid { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; 
}

.lang-btn {
    background: #4a5568; color: white; text-decoration: none; padding: 12px 8px; border-radius: 15px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    transition: all 0.2s ease; border: 2px solid transparent;
}

.lang-btn:hover, .lang-btn:active {
    background: #2b6cb0; border-color: #63b3ed; transform: scale(1.05);
}

.flag-icon { font-size: 30px; line-height: 1; }
.lang-text { font-size: 14px; font-weight: bold; }

@media (max-height: 600px) {
    .modal { padding: 15px; }
    .flag-icon { font-size: 24px; }
    .lang-text { font-size: 12px; }
}

/* Контейнер гри */
.game-container {
    background: white; width: 95%; max-width: 420px; height: 96vh; 
    padding: 15px; border-radius: 35px; display: flex; flex-direction: column; box-sizing: border-box;
}
.header-row { display: flex; justify-content: space-between; align-items: center; }
.header-row h1 { font-size: clamp(18px, 4vh, 22px); margin: 0; color: #2d3748; }

.card {
    flex-grow: 1; background: #f7fafc; border: 4px dashed #bee3f8; border-radius: 25px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 10px 0;
}

/* Баки */
/* Баки: Нова сітка 2x3 */
.bins-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin-top: auto; 
}

.bin-button {
    border: none; 
    border-radius: 20px; 
    padding: 12px 5px; 
    color: white; 
    font-weight: bold;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    font-size: 13px;
    transition: transform 0.1s;
    cursor: pointer;
}

.bin-button:active { transform: scale(0.95); }

/* Кольори баків за польським стандартом */
.bin-pm      { background: #ecc94b; box-shadow: 0 5px 0 #b7791f; color: #5F370E; } /* Жовтий: Метал/Пластик */
.bin-paper   { background: #4299e1; box-shadow: 0 5px 0 #2b6cb0; }                /* Синій: Папір */
.bin-glass   { background: #48bb78; box-shadow: 0 5px 0 #2f855a; }                /* Зелений: Скло */
.bin-organic { background: #975a16; box-shadow: 0 5px 0 #5f370e; }                /* Коричневий: Біо */
.bin-mixed   { background: #2d3748; box-shadow: 0 5px 0 #1a202c; }                /* Чорний: Змішані */
.bin-hazard  { background: #e53e3e; box-shadow: 0 5px 0 #9b2c2c; }                /* Червоний: Небезпечні */

.bin-icon { font-size: 24px; margin-bottom: 4px; }

/* Повідомлення */
.message { padding: 10px; border-radius: 15px; text-align: center; font-size: 14px; margin-bottom: 5px; font-weight: bold; }
.correct { background: #c6f6d5; color: #22543d; }
.wrong { background: #fed7d7; color: #822727; }

/* НОВЕ: Стиль для хімічних фактів під балами */
.message small {
    display: block; font-size: 12px; margin-top: 5px; font-weight: normal; line-height: 1.3;
}

.btn-reset-top { background: #edf2f7; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }

.score-board {
    display: flex; justify-content: space-between; align-items: center; background: #edf2f7;
    padding: 10px 15px; border-radius: 20px; margin: 10px 0; border: 1px solid #e2e8f0; font-weight: bold; color: #2b6cb0;
}

.rank-display {
    background: #ffffff; padding: 5px 12px; border-radius: 12px; font-size: 0.85rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); color: #2f855a; font-weight: bold; border: 1px solid #cbd5e0;
}

.emoji-display {
    font-size: clamp(50px, 12vh, 80px); transition: transform 0.3s ease;
}

/* Головне меню */
.menu-modal { max-width: 400px; background: #2d3748; border: 3px solid #4a5568; }
.menu-title { color: #63b3ed; font-size: clamp(24px, 5vh, 32px); text-shadow: 2px 2px 0px #2c5282; margin-bottom: 25px; }

.rank-card {
    background: #1a202c; border-radius: 20px; padding: 20px; margin-bottom: 25px; border: 1px solid #4a5568;
    /* НОВЕ: Дозволяє скролити довгий текст знань */
    max-height: 50vh; overflow-y: auto; 
}

.rank-badge { font-size: 24px; font-weight: bold; color: #48bb78; margin-bottom: 10px; }
.rank-score { font-size: 18px; color: #edf2f7; margin: 5px 0; }
.rank-desc { font-size: 14px; color: #a0aec0; font-style: italic; }

.menu-buttons { display: flex; flex-direction: column; gap: 15px; width: 100%; }

.btn-play {
    background: #48bb78; color: white; border: none; padding: 18px 40px; font-size: 20px; font-weight: bold;
    border-radius: 50px; cursor: pointer; box-shadow: 0 6px 0 #2f855a; transition: all 0.1s; width: 100%;
}
.btn-play:active { transform: translateY(4px); box-shadow: 0 2px 0 #2f855a; }

.btn-secondary {
    background: #4a5568; color: white; border: none; padding: 15px 30px; font-size: 18px; font-weight: bold;
    border-radius: 50px; cursor: pointer; box-shadow: 0 5px 0 #2d3748; transition: all 0.1s; width: 100%;
}
.btn-secondary:active { transform: translateY(3px); box-shadow: 0 2px 0 #2d3748; }

.btn-lang-switch {
    background: #2d3748; color: #edf2f7; border: 2px solid #4a5568; padding: 12px; font-size: 16px;
    font-weight: bold; border-radius: 50px; cursor: pointer; margin-top: 5px; display: flex;
    align-items: center; justify-content: center; gap: 10px; transition: all 0.2s; width: 100%;
}
.btn-lang-switch:hover { background: #4a5568; border-color: #63b3ed; }

.btn-danger-text {
    margin-top: 15px; background: none; border: none; color: #718096; cursor: pointer;
    text-decoration: underline; font-size: 12px;
}
/* --- СТИЛІ ДЛЯ ВІКНА РОЗРОБНИКА (DEVELOPER INFO) --- */
.dev-card {
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 20px;
    padding: 20px;
    color: #f1f5f9;
    text-align: left;
    margin-bottom: 10px;
}

.dev-info-label {
    color: #718096;
    font-size: 10px;
    text-transform: uppercase;
    margin-top: 15px;
    letter-spacing: 1px;
}

.dev-info-value {
    color: #63b3ed;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.dev-link {
    color: #63b3ed;
    text-decoration: none;
    border-bottom: 1px dashed #63b3ed;
}

@keyframes popIn {
    0% { transform: scale(0.6); opacity: 0; }
    80% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}