* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

body {
    background: linear-gradient(135deg, #0c2461, #1e3799);
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow: hidden; /* УБИРАЕМ СКРОЛЛ */
    position: fixed; /* ФИКСИРУЕМ ПОЗИЦИЮ */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
}

/* Контейнер для контента с возможностью скролла */
.main-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto; /* Только здесь можно скроллить */
    overflow-x: hidden;
    padding: 10px;
    flex: 1;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
}

h1 {
    color: #f6b93b;
    text-shadow: 0 0 10px rgba(246, 185, 59, 0.5);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #f6b93b;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f6b93b;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
}

@media (min-width: 900px) {
    .game-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

.game-board {
    position: relative;
    width: 600px;
    height: 400px;
    background: #2c3e50;
    border: 3px solid #f6b93b;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    flex-shrink: 0; /* Чтобы не сжималось */
}

.taxi {
    position: absolute;
    width: 30px;
    height: 50px;
    background: #f6b93b;
    border-radius: 5px;
    transform-origin: center;
    z-index: 10;
    transition: transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000;
    font-weight: bold;
    font-size: 12px;
    border: 2px solid #000;
}

.taxi::after {
    content: "🚕";
    position: absolute;
    font-size: 20px;
}

.passenger {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #4a69bd;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
    cursor: pointer;
    z-index: 5;
}

.passenger::before {
    content: "👤";
    font-size: 14px;
}

.passenger.highlight {
    background: #e55039;
    box-shadow: 0 0 15px #e55039;
    animation: highlightPulse 0.5s infinite;
}

.road {
    position: absolute;
    background: #34495e;
}

.building {
    position: absolute;
    background: #2c3e50;
    border: 1px solid #7f8c8d;
}

.dialog-box {
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #f6b93b;
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 350px;
    min-height: 420px; /* Было 350px, стало 420px */
    height: 420px; /* Фиксируем высоту */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    overflow: hidden; /* Чтобы контент не вылезал */
}

.dialog-content {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
    max-height: 250px; /* Ограничиваем высоту текста */
    min-height: 150px; /* Минимальная высота */
}

.dialog-message {
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 1.1rem;
}

.passenger-name {
    color: #f6b93b;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.dialog-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 180px; /* Ограничиваем высоту кнопок */
    overflow-y: auto;
    padding-right: 5px;
    flex-shrink: 0; /* Чтобы не сжимались */
}

/* Улучшаем скроллбар */
.dialog-options::-webkit-scrollbar {
    width: 6px;
}

.dialog-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.dialog-options::-webkit-scrollbar-thumb {
    background: #f6b93b;
    border-radius: 3px;
}

.dialog-options::-webkit-scrollbar-thumb:hover {
    background: #fa983a;
}

.dialog-content::-webkit-scrollbar {
    width: 6px;
}

.dialog-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb {
    background: #4a69bd;
    border-radius: 3px;
}

.dialog-content::-webkit-scrollbar-thumb:hover {
    background: #6a89cc;
}

.dialog-option {
    background: #34495e;
    border: none;
    color: white;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    text-align: left;
}

.dialog-option:hover {
    background: #4a69bd;
    transform: translateX(5px);
}

.dialog-option.danger {
    background: #e55039;
}

.dialog-option.danger:hover {
    background: #eb2f06;
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: #34495e;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: #f6b93b;
    width: 100%;
    transition: width 1s linear;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 800px;
}

.control-row {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: #34495e;
    border: 2px solid #f6b93b;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
    width: 100px;
    -webkit-user-select: none; /* Предотвращает выделение текста на iOS */
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Убирает синее выделение на мобильных */
    touch-action: manipulation; /* Улучшает поведение на touch-устройствах */
}

/* Отключаем outline при фокусе, но оставляем для доступности */
.control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(246, 185, 59, 0.5);
}

/* Предотвращаем скролл при фокусе на кнопках */
.control-btn:active,
.control-btn:focus {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.control-btn:hover {
    background: #4a69bd;
    transform: scale(1.05);
}

.instructions {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 800px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    flex-direction: column;
    gap: 20px;
}

.game-over.active {
    display: flex;
}

.game-over h2 {
    color: #e55039;
    font-size: 3rem;
    text-shadow: 0 0 10px rgba(229, 80, 57, 0.5);
}

.game-over p {
    font-size: 1.5rem;
    color: white;
}

.restart-btn {
    background: #f6b93b;
    border: none;
    color: #000;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s;
}

.restart-btn:hover {
    background: #fa983a;
    transform: scale(1.1);
}

.destination {
    position: absolute;
    width: 25px;
    height: 25px;
    background: #38ada9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    z-index: 3;
    border: 2px solid white;
}

.destination::before {
    content: "📍";
    font-size: 16px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 5px #e55039; }
    50% { box-shadow: 0 0 20px #e55039; }
    100% { box-shadow: 0 0 5px #e55039; }
}

/* Добавьте в конец style.css */

/* Анимация мигания заголовка */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Анимация появления такси */
@keyframes taxiAppear {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* Анимация монет */
@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Эффект при получении денег */
.coin-effect {
    position: absolute;
    color: gold;
    font-size: 20px;
    font-weight: bold;
    animation: coinFloat 1s ease-out forwards;
}

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

/* Анимации для города */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px #f6b93b; }
    50% { box-shadow: 0 0 20px #f6b93b; }
    100% { box-shadow: 0 0 5px #f6b93b; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Стили для элементов города */
.street-light {
    position: absolute;
    background: #7f8c8d;
    border-radius: 2px;
}

.tree div {
    position: absolute;
}

.trash-can {
    position: absolute;
    background: #2c3e50;
    border: 1px solid #7f8c8d;
    border-radius: 2px;
}

.lawn {
    position: absolute;
    background: rgba(46, 204, 113, 0.1);
    border: 1px dashed rgba(46, 204, 113, 0.3);
}

.sidewalk {
    position: absolute;
    background: #95a5a6;
    opacity: 0.7;
}

.road-marking {
    position: absolute;
    background: #ffffff;
}

.building {
    position: absolute;
    background: #2c3e50;
    border: 1px solid #7f8c8d;
}

/* Подсветка активных элементов */
.passenger:hover {
    animation: glow 1s infinite, float 2s infinite ease-in-out !important;
    z-index: 10 !important;
}

/* Эффект для такси при движении */
.taxi.moving {
    animation: bounce 0.5s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0px); }
    to { transform: translateY(-3px); }
}

/* Стили для диалоговых кнопок */
.dialog-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.dialog-option {
    background: #34495e;
    border: 2px solid #4a69bd;
    color: white;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.dialog-option:hover {
    background: #4a69bd;
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dialog-option:active {
    transform: translateX(10px) scale(0.98);
}

.dialog-option::before {
    content: "➤";
    position: absolute;
    left: -20px;
    transition: left 0.3s ease;
    opacity: 0;
}

.dialog-option:hover::before {
    left: 10px;
    opacity: 1;
}

.dialog-option.danger {
    background: #c0392b;
    border-color: #e74c3c;
}

.dialog-option.danger:hover {
    background: #e74c3c;
}

/* Анимация появления кнопок */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dialog-option {
    animation: slideIn 0.3s ease forwards;
}

.dialog-option:nth-child(1) { animation-delay: 0.1s; }
.dialog-option:nth-child(2) { animation-delay: 0.2s; }
.dialog-option:nth-child(3) { animation-delay: 0.3s; }
.dialog-option:nth-child(4) { animation-delay: 0.4s; }