@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* === ЗАГАЛЬНІ СТИЛІ (ПОЛЬСЬКА ТЕМА) === */
body {
    font-family: 'Nunito', sans-serif;
    background-color: #ffebee; /* Світло-червоний фон */
    margin: 0;
    color: #4b4b4b;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.game-container {
    width: 100%;
    max-width: 600px;
    background: #fdfdfd;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    box-sizing: border-box;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* === КНОПКИ МЕНЮ === */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 18px;
    font-weight: 800;
    text-transform: uppercase;
    transition: transform 0.1s;
    border: none;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}
.menu-btn:active { transform: translateY(4px); box-shadow: none !important; }

.btn-start { background-color: #58cc02; color: white; box-shadow: 0 5px 0 #46a302; }
.btn-dict { background-color: #dc143c; color: white; box-shadow: 0 5px 0 #b01030; }
.btn-info { background-color: #885df1; color: white; box-shadow: 0 5px 0 #6e46ce; }
.btn-share { background-color: #fff; color: #4b4b4b; border: 2px solid #e5e5e5; box-shadow: 0 5px 0 #e5e5e5; }

/* === ЕЛЕМЕНТИ ГРИ === */
.card-body {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 0 #e5e5e5;
    border: 2px solid #e5e5e5;
    text-align: center;
    margin-bottom: 20px;
}

.word {
    font-size: 2rem;
    color: #4b4b4b;
    margin: 20px 0;
    font-weight: 800;
}

/* === ПОЛЕ ВВЕДЕННЯ ТЕКСТУ === */
.keyboard-input {
    width: 100%;
    padding: 18px 15px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #4b4b4b;
    text-align: center;
    background: #f7f9fa;
    border: 2px solid #e5e5e5;
    border-radius: 18px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.keyboard-input:focus {
    background: white;
    border-color: #dc143c;
    box-shadow: 0 4px 10px rgba(220, 20, 60, 0.15);
}

/* Стиль для поля, яке тільки для віртуальної клавіатури (readonly) */
.keyboard-input[readonly] {
    background-color: white !important;
    cursor: default;
    opacity: 1;
    color: #4b4b4b;
    border-color: #e5e5e5;
}

.keyboard-input[readonly]:focus {
    border-color: #dc143c;
    box-shadow: 0 4px 10px rgba(220, 20, 60, 0.15);
}

/* === КНОПКИ ДІЙ (ПЕРЕВІРИТИ / ПРОПУСТИТИ) === */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-check {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    background-color: #58cc02;
    border: none;
    border-radius: 18px;
    box-shadow: 0 5px 0 #46a302;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-check:active {
    transform: translateY(5px);
    box-shadow: none;
}

.btn-skip, .btn-skip-full {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 2px solid transparent;
    color: #afafaf;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: 0.2s;
}

.btn-skip:hover, .btn-skip-full:hover {
    background: #f7f9fa;
    color: #4b4b4b;
}

/* === СТИЛІ ДЛЯ ВСІХ РІВНІВ (GAME BUTTONS) === */

/* РІВЕНЬ 1: ТАК / НІ */
.tf-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.tf-btn {
    flex: 1;
    border: none;
    border-radius: 16px;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tf-true { background-color: #58cc02; box-shadow: 0 4px 0 #46a302; }
.tf-true:active { box-shadow: none; transform: translateY(4px); }

.tf-false { background-color: #ff4b4b; box-shadow: 0 4px 0 #d43f3f; }
.tf-false:active { box-shadow: none; transform: translateY(4px); }

/* РІВЕНЬ 2: ВАРІАНТИ ВІДПОВІДІ */
.option-btn {
    background: white;
    border: 2px solid #e5e5e5;
    box-shadow: 0 4px 0 #e5e5e5;
    border-radius: 16px;
    padding: 15px;
    color: #4b4b4b;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    min-height: 60px;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.option-btn:hover {
    background-color: #fff5f5;
    border-color: #ffcdd2;
}

.option-btn:active {
    transform: translateY(4px);
    box-shadow: none;
    border-bottom-width: 2px;
}

/* РІВЕНЬ 6 та 7: СЛОВА-ЧІПИ */
.word-chip {
    background: white;
    border: 2px solid #e5e5e5;
    box-shadow: 0 4px 0 #e5e5e5;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #4b4b4b;
    cursor: pointer;
    transition: all 0.1s;
    margin: 4px;
}

.word-chip:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* КНОПКА "ОЧИСТИТИ" */
button[onclick="resetWords()"] {
    background-color: #ff4b4b !important;
    box-shadow: 0 4px 0 #d43f3f !important;
    color: white !important;
    border-radius: 12px !important;
}
button[onclick="resetWords()"]:active {
    transform: translateY(4px) !important;
    box-shadow: none !important;
}

/* === ВІРТУАЛЬНА КЛАВІАТУРА === */
#keyboard-container {
    background: #ffebee;
    padding: 10px;
    border-radius: 18px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid #ffcdd2;
}

.kb-row {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
    gap: 6px;
}

.kb-key {
    background: white;
    height: 50px;
    min-width: 32px;
    flex: 1;
    max-width: 45px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: #4b4b4b;
    box-shadow: 0 3px 0 #e5e5e5;
    border: 1px solid #eee;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.1s;
}

.kb-key:active { transform: translateY(3px); box-shadow: none; }
.kb-key:hover { background-color: #f9f9f9; }

/* === СПЕЦІАЛЬНІ КЛАВІШІ === */

/* ПРОБІЛ (ВЕЛИКИЙ) */
.kb-key.space {
    flex: 6 !important; /* Розтягується */
    max-width: none !important; /* Без обмежень */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #afafaf;
}

/* Shift */
.kb-key.shift { background-color: #f0f4f8; color: #dc143c; max-width: 55px; font-size: 1.4rem; }
.shift-active { background-color: #dc143c !important; color: white !important; box-shadow: 0 3px 0 #b01030 !important; }

/* Alt */
.kb-key.alt { background-color: #f0f4f8; color: #0057B8; max-width: 55px; font-weight: 900; border-bottom: 3px solid #dbe2e8; }
.alt-active { background-color: #0057B8 !important; color: white !important; box-shadow: 0 3px 0 #003d82 !important; transform: translateY(1px); }

/* Backspace */
.kb-key.wide { background-color: #fff0f0; color: #dc143c; font-size: 1.2rem; max-width: 55px; }
/* --- НИЖНЯ ПАНЕЛЬ НАВІГАЦІЇ --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: white;
    display: flex;
    gap: 15px;
    padding: 15px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    border-top: 2px solid #f0f0f0;
    box-sizing: border-box;
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: transform 0.1s;
    border: none;
    cursor: pointer;
}

.nav-btn:active {
    transform: translateY(3px);
    box-shadow: none !important;
}

/* Кнопка навчання (Зелена) */
.btn-to-study {
    background-color: #58cc02;
    color: white;
    box-shadow: 0 4px 0 #46a302;
}

/* Кнопка профілю (Біла/Червона) */
.btn-to-profile {
    background-color: white;
    color: #dc143c;
    border: 2px solid #e5e5e5;
    box-shadow: 0 4px 0 #e5e5e5;
}