* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body {
    position: relative;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/systemimg/pattern.svg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: -1;
}
.hidden {
    display: none !important;
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    gap: 20px;
}

.team-input {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.team-input input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    user-select: text;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #C7DDFF;
    color: #2371E7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2371E7;
    color: #fff;
}

#adminBtn {
    background-color: #f44336;
    color: #fff;
}

#adminBtn:hover {
    background-color: #d32f2f;
}

.game-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.team-panel {
    width: 200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.team-panel.active {
    background-color: #e0f7fa;
    box-shadow: 0 0 15px rgba(0, 150, 136, 0.5);
}

.left-panel {
    border-right: 1px solid #ddd;
}

.right-panel {
    border-left: 1px solid #ddd;
}

.score {
    font-size: 36px;
    font-weight: bold;
    margin-top: 20px;
    color: #4CAF50;
}

.map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #e9e9e9;
}

.current-turn {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: 15px;
    background-color: #fff;
}

.map-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.points-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.point {
    position: absolute;
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s;
}

.point:hover {
    transform: scale(1.2);
}

.point.answered {
    cursor: default;
    pointer-events: none;
}

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

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.answer-option {
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.answer-option:hover {
    background-color: #e0e0e0;
}

.answer-option.selected {
    background-color: #bbdefb;
    border-color: #2196F3;
}

#textAnswer {
    width: 100%;
    padding: 10px;
    margin: 20px 0;
    font-size: 16px;
    user-select: text;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #f44336;
    margin: 10px 0;
}

#answerResult {
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}

.results-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    gap: 30px;
}

.results-container {
    display: flex;
    gap: 50px;
}

.result-team {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.final-score {
    font-size: 48px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 10px;
}

.team-input {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.team-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-input-group label {
    min-width: 80px;
}

.remove-team {
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.remove-team:hover {
    background-color: #d32f2f;
}

#addTeam {
    padding: 10px 10px;
    background-color: transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    color: #2371E7;
}

#addTeam:hover {
    transform: translateY(-1px);
    color: #163d78; /* Белый текст при наведении */
}

/* --------------------------------- */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transition: opacity 1s;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#mapOverlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Стили для кнопки "Назад" */
.current-turn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.back-button {
    padding: 8px 16px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #d32f2f;
}

/* Стили для модального окна подтверждения */
.confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.confirm-button {
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.confirm-button:hover {
    background-color: #d32f2f;
}

.cancel-button {
    padding: 10px 20px;
    background-color: #757575;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cancel-button:hover {
    background-color: #616161;
}

.teams-panel {
    width: 200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.back-button {
    padding: 12px 24px;
    background-color: #C7DDFF;
    color: rgb(37, 71, 130);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: auto;
    width: 90%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.back-button:hover {
    background-color: #2371E7;
    color: #fff;
}

.current-turn-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

/* Анимация появления очков */
.score-popup {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    animation: scoreFloat 2s ease-out forwards;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes scoreFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1.5);
    }
}

.header-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    gap: 20px;
    padding: 20px;
}

.header-image {
    max-width: 80%;
    max-height: 150px;
    object-fit: contain;
    margin-bottom: 20px;
}

.corner-image {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 150px;
    height: 150px;
    object-fit: contain;
    z-index: 1000;
    pointer-events: none;
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    gap: 20px;
    padding: 20px;
}

.game-container, .results-screen {
    position: relative;
    z-index: 1;
}


/* Стили для ссылок вверху экрана результатов */
.results-links-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    flex-wrap: wrap; /* Перенос на новую строку если не помещаются */
}

.results-links-container .result-link {
    padding: 12px 24px;
    background-color: #C7DDFF;
    color: #2371E7;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0; /* Запрещаем сжатие ссылок */
}

.results-links-container .result-link:hover {
    background-color: #2371E7;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .results-links-container {
        gap: 10px;
        padding: 0 10px;
    }
    
    .results-links-container .result-link {
        padding: 10px 16px;
        font-size: 14px;
    }
}