body {
  font-family: Arial, sans-serif;
  background-color: #f0f4f8;
  margin: 0; /* Убираем отступы у body */
  padding-top: 60px; /* Добавляем отступ под фиксированный хэдер */
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  overflow: auto;
}

html{
  height: 100%;
  overflow: auto;
}

header {
  position: fixed; /* Прикрепляет хэдер к верхней части экрана */
  top: 0; /* Хэдер всегда будет у самого верха */
  left: 0; /* Начало от левого края экрана */
  width: 100%; /* Растягивает хэдер на всю ширину экрана */
  background-color: #007bff; /* Цвет фона (синий) */
  color: white; /* Цвет текста */
  padding: 10px 20px; /* Внутренние отступы */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Тень под хэдером */
  z-index: 1000; /* Убедимся, что хэдер будет поверх всего остального */
}

/* Стиль для навигационных ссылок */
header nav a {
  color: white; /* Белый текст */
  text-decoration: none; /* Убирает подчеркивание */
  margin-right: 15px; /* Отступ между ссылками */
  font-size: 16px; /* Размер шрифта */
}

header nav a:hover {
  text-decoration: underline; /* Подчеркивание при наведении */
}


.container {
  max-width: 2000px;
  width: 100%;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 90vh; /* Ограничиваем высоту контейнера */
  overflow-y: auto; /* Добавляем вертикальный скролл */
}

h1 {
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

label {
  font-size: 14px;
  color: #555;
}

input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

button {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

.error {
  color: red;
  font-size: 14px;
  text-align: center;
}

a {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

a:hover {
  text-decoration: underline;
}

p {
  /* text-align: center; */
  font-size: 14px;
}

.training-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.training-content {
  display: flex;
  width: 100%;
  height: calc(100vh - 160px);
}

.word-list {
  width: 30%;
  max-height: 100%;
  overflow-y: auto;
    align-items: center;
    justify-content: center;
/*     text-align: center; */
  padding: 10px;
  border-right: 2px solid #ddd;
}

.game-field {
  width: 50%;
  padding: 20px;
}

.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
}

#maskedWord {
    font-size: 4 rem;
    font-weight: bold;
    letter-spacing: 8px; /* Отступы между буквами */
    text-align: center;
    display: inline-block;
    margin-bottom: 20px;
}

.letter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.letter-button {
    font-size: 1.5rem;
    padding: 10px 15px;
    border: 2px solid #007bff;
    background-color: white;
    color: #007bff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.letter-button:hover {
    background-color: #007bff;
    color: white;
}

.letter-button:active {
    transform: scale(0.9);
}

.progress-container {
    width: 100%;
    background-color: #ddd;
    height: 20px;
    position: relative;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #007bff;
    transition: width 0.3s ease-in-out;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin: 0 0 10px;
    color: #007bff;
}

.modal-content button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.modal-content button:hover {
    background-color: #0056b3;
}

@keyframes blink {
    0% { background-color: transparent; }
    50% { background-color: yellow; }
    100% { background-color: transparent; }
}

.missing-letter {
    padding: 5px;
    border-radius: 5px;
}

.highlight {
    animation: blink 1s infinite;
}

.correct-letter {
    color: green;
    font-weight: bold;
}

.wrong-letter {
    color: red;
    font-weight: bold;
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#resultsTable th, #resultsTable td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.result-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.result-buttons button {
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
}

.cta {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 40px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.cta h3 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.cta p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 15px;
}

footer {
    text-align: center;
    padding: 10px;
    background: #2c3e50;
    color: white;
    margin-top: 20px;
}

#profile-btn {
    background: #ffcc00; /* Ярко-жёлтый контрастный цвет */
    color: #2c3e50;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-left: 20px; /* Отступ от меню */
}

#profile-btn:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#profile-btn:active {
    background: #e69500;
    transform: translateY(1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* === Основной контейнер === */
main {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* === Общие стили для секций === */
section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    text-align: center; /* Центрируем контент */
}

/* === Кнопки === */
.btn {
    display: inline-block;
    color: white;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.btn:hover {
    transform: scale(1.05);
}

/* === Блок "Соревнования" (Центрируем контент) === */
.competitions {
    background: #f5f5f5;
    border: 1px solid #bbb;
    text-align: center;
}

/* === Блок "Тренировка и статистика" === */
.training-zone {
    background: #ecf8ec; /* Светло-зелёный */
    border: 1px solid #78c278;
    text-align: center;
}

.training-buttons {
    display: flex;
    justify-content: center;
    gap: 20px; /* Больше пространства */
    margin-top: 15px;
}

/* === Кнопки в "Тренировка и статистика" теперь зелёные === */
.training-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 16px;
    font-size: 17px;
    background: #78c278; /* Под цвет блока */
}

.training-buttons .btn:hover {
    background: #66a066;
}

/* === Блок "Зона управления" (светло-оранжевый) === */
.management-zone {
    text-align: center;
    background: #fff3e0; /* Светлый фон */
    border: 1px solid #ffa366;
    padding: 20px;
}

/* === Контейнер для кнопок в "Зоне управления" === */
.management-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

/* === Кнопки в "Зоне управления" === */
.management-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 16px;
    font-size: 17px;
    font-weight: bold;
    background: #ff7f50; /* Оранжевый фон */
    color: white !important; /* Увеличиваем контраст */
    border: none;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.management-buttons .btn:hover {
    background: #e65100; /* Темно-оранжевый при наведении */
    transform: scale(1.05);
}

.competition-section {
    background-color: #fffae6;
    border: 1px solid #ffcc80;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.competition-section h2 {
    color: #d68c00;
    text-align: center;
}

.competition-section ul {
    list-style: none;
    padding: 0;
}

.competition-section li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ffcc80;
}

.competition-section li:last-child {
    border-bottom: none;
}

.competition-section .btn {
    background-color: #ff9900;
    color: white;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 5px;
}

.competition-section .btn:hover {
    background-color: #e68a00;
}

.profile-table {
    width: 60%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.profile-table th, .profile-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.profile-table th {
    background-color: #007bff;
    color: white;
}

.profile-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.profile-table tr:hover {
    background-color: #ddd;
}

/* Стили модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 60%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

/* Стили кнопки закрытия */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Стили таблиц */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #007acc;
    color: white;
}

tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

tbody tr:hover {
    background-color: #ddd;
}