/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: #0c0f16;
    font-family: 'Courier New', 'Consolas', monospace;
    color: #E0E0E0;
}

/* Game wrapper - для центрирования и масштабирования */
#game-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Game container - базовый размер с динамическим масштабированием */
#game-container {
    position: relative;
    width: 1200px;
    height: 700px;
    background: #0c0f16;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
}

/* Динамическое масштабирование через JavaScript будет применять transform: scale() */
/* CSS media queries отключены, так как масштабирование полностью управляется через JavaScript */

/* HUD - Верхняя панель */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 15px;
    z-index: 1000;
    flex-wrap: wrap;
}

.hud-item {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: box-shadow 0.3s ease;
}

.hud-item:hover {
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hud-label {
    color: #00ffff;
    font-weight: bold;
}

.hud-value {
    color: #E0E0E0;
    font-weight: bold;
}

@media (max-width: 480px) {
    .hud-item {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Кнопка удаления сохранений */
.delete-save-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff0000;
    border-radius: 8px;
    padding: 8px 16px;
    color: #ff6666;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    white-space: nowrap;
}

.delete-save-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    transform: scale(1.05);
}

.delete-save-btn:active {
    transform: scale(0.95);
    background: rgba(255, 0, 0, 0.4);
}

@media (max-width: 480px) {
    .delete-save-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Игровая комната с drag-to-pan */
#game-room {
    position: absolute;
    top: 0;
    left: 0;
    width: 2000px;
    height: 2000px;
    transform-origin: 0 0;
    will-change: transform;
}

/* Игровые объекты */
.game-object {
    position: absolute;
    cursor: pointer;
}

.game-object.clickable {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.3s;
}

.game-object.clickable:hover {
    filter: brightness(1.2);
}

.game-object.clickable:active {
    transform: scale(0.95);
}

/* PC */
#pc {
    top: 300px;
    left: 200px;
}

.monitor {
    width: 120px;
    height: 100px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #00ffff;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transition: box-shadow 0.3s ease;
}

.monitor:hover {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
}

.monitor-screen {
    width: 100px;
    height: 70px;
    background: #000;
    margin: 10px auto;
    border: 1px solid #00ffff;
    position: relative;
    overflow: hidden;
}

.monitor-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    animation: monitor-glow 2s ease-in-out infinite;
}

@keyframes monitor-glow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.screen-content {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 70px;
    color: #00ffff;
    font-weight: bold;
    text-shadow: 0 0 10px #00ffff;
}

/* Клавиатура */
#keyboard {
    top: 420px;
    left: 200px;
}

.keyboard-visual {
    width: 150px;
    height: 60px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #7d3cff;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 0 20px rgba(125, 60, 255, 0.5);
    transition: box-shadow 0.3s ease;
}

.keyboard-visual:hover {
    box-shadow: 0 0 30px rgba(125, 60, 255, 0.8);
}

.key-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.key {
    width: 20px;
    height: 12px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    border-radius: 2px;
}

/* Индикатор клика */
.click-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ffff;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    font-size: 18px;
    text-shadow: 0 0 10px #00ffff;
}

.click-indicator.show {
    animation: click-popup 0.5s ease-out;
}

@keyframes click-popup {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* Сервер */
#server {
    top: 300px;
    left: 500px;
}

.server-rack {
    width: 150px;
    height: 200px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #7d3cff;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 0 20px rgba(125, 60, 255, 0.5);
}

.rack-unit {
    flex: 1;
    background: #000;
    border: 1px solid #7d3cff;
    border-radius: 4px;
}

/* Область моделей */
#models-area {
    position: absolute;
    top: 300px;
    left: 800px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.model-item {
    width: 100px;
    height: 80px;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #00ffff;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.model-item::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.2) 0%, transparent 70%);
    animation: particle-spark 3s ease-in-out infinite;
}

@keyframes particle-spark {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Консоль с псевдокодом */
#code-console {
    position: absolute;
    bottom: 120px;
    left: 10px;
    right: 10px;
    height: 150px;
    max-height: 25vh;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ffff;
    border-radius: 8px;
    z-index: 800;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transition: height 0.3s ease, max-height 0.3s ease;
}

#code-console.console-collapsed {
    height: 40px;
    max-height: 40px;
}

#code-console.console-collapsed .console-output {
    display: none;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
    min-height: 40px;
}

.console-title {
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
}

.console-controls {
    display: flex;
    gap: 8px;
}

.console-btn {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #E0E0E0;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.console-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.console-collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.console-line {
    color: #00ff88;
    margin-bottom: 2px;
    animation: typewriter 0.3s ease-out;
    word-wrap: break-word;
}

.console-line.comment {
    color: #666;
}

.console-line.function {
    color: #00ffff;
}

.console-line.keyword {
    color: #7d3cff;
}

@keyframes typewriter {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 700px) {
    #code-console {
        height: 100px;
        max-height: 25vh;
        bottom: 100px;
    }
    
    #code-console.console-collapsed {
        height: 35px;
        max-height: 35px;
    }
    
    .console-output {
        font-size: 10px;
    }
    
    .console-header {
        padding: 6px 10px;
        min-height: 35px;
    }
    
    .console-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* Частицы */
#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ffff;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ffff;
    animation: particle-float 2s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0);
    }
}

/* Кнопки действий */
#action-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.action-btn {
    min-width: 150px;
    min-height: 44px;
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(125, 60, 255, 0.2) 100%);
    border: 2px solid #00ffff;
    border-radius: 8px;
    color: #E0E0E0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.action-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3) 0%, rgba(125, 60, 255, 0.3) 100%);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.btn-cost {
    font-size: 12px;
    color: #00ffff;
}

@media (max-width: 480px) {
    #action-buttons {
        flex-direction: column;
        width: 90%;
    }
    
    .action-btn {
        width: 100%;
    }
}

/* Модальные окна */
.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #00ffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 75vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #00ffff;
    flex-shrink: 0;
}

.modal-header h2 {
    color: #00ffff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #E0E0E0;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #00ffff;
}

.modal-body {
    padding: 20px;
    padding-bottom: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    max-height: calc(75vh - 120px);
    -webkit-overflow-scrolling: touch;
}

/* Прокрутка для мобильных и ПК */
@media (max-width: 700px) {
    .modal-body {
        max-height: calc(75vh - 100px);
        padding: 15px;
        padding-bottom: 20px;
    }
}

@media (min-width: 701px) {
    .modal-body {
        max-height: calc(75vh - 120px);
        padding-bottom: 60px;
    }
    
    .upgrades-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
}

/* Модальное окно подтверждения */
.confirm-modal-content {
    max-width: 500px;
}

.confirm-message {
    color: #E0E0E0;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px 0;
    text-align: center;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-btn {
    padding: 12px 30px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', 'Consolas', monospace;
    min-width: 120px;
}

.confirm-delete-btn {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff6666;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.confirm-delete-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    transform: scale(1.05);
}

.confirm-delete-btn:active {
    transform: scale(0.95);
}

.cancel-btn {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.cancel-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.cancel-btn:active {
    transform: scale(0.95);
}

@media (max-width: 700px) {
    .confirm-message {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .confirm-btn {
        padding: 10px 25px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .confirm-buttons {
        gap: 10px;
    }
}

/* Вкладки */
.upgrades-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #00ffff;
    flex-shrink: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #E0E0E0;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #00ffff;
}

.tab-btn.active {
    color: #00ffff;
    border-bottom-color: #00ffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Добавляем отступ снизу для контента вкладок на больших экранах */
@media (min-width: 1024px) {
    .tab-content.active {
        padding-bottom: 40px;
    }
}

/* Апгрейды */
.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid #00ffff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.upgrade-item:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateX(5px);
}

.upgrade-item.purchased {
    opacity: 0.6;
    border-color: #666;
}

.upgrade-info {
    flex: 1;
}

.upgrade-info h3 {
    color: #00ffff;
    margin-bottom: 5px;
    font-size: 16px;
}

.upgrade-info p {
    color: #E0E0E0;
    font-size: 13px;
    margin-bottom: 5px;
}

.upgrade-level {
    color: #7d3cff;
    font-size: 12px;
    margin-top: 5px;
}

.upgrade-buy-btn {
    min-width: 150px;
    min-height: 44px;
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    border-radius: 8px;
    color: #E0E0E0;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-buy-btn:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

.upgrade-buy-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.upgrade-buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-cost {
    color: #00ffff;
}

/* Баннеры рекламы */
.ad-placeholder {
    min-height: 50px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px dashed #00ffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
    margin: 10px 0;
}

#bottom_banner {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 728px;
    z-index: 500;
}

/* Уведомления */
#notifications {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
}

.notification {
    background: rgba(125, 60, 255, 0.9);
    border: 1px solid #7d3cff;
    border-radius: 8px;
    padding: 12px 16px;
    color: #E0E0E0;
    box-shadow: 0 0 20px rgba(125, 60, 255, 0.5);
    animation: notification-slide 0.3s ease-out;
}

@keyframes notification-slide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Обратный отсчет перед рекламой */
.ad-countdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: none;
}

.ad-countdown.hidden {
    display: none;
}

.countdown-text {
    text-align: center;
    color: #00ffff;
}

.countdown-number {
    font-size: 120px;
    font-weight: bold;
    text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff;
    animation: countdown-pulse 0.5s ease-in-out;
    line-height: 1;
    margin-bottom: 20px;
}

.countdown-label {
    font-size: 32px;
    color: #E0E0E0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    font-weight: bold;
}

@keyframes countdown-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 700px) {
    .countdown-number {
        font-size: 80px;
    }
    .countdown-label {
        font-size: 24px;
    }
}

/* Кнопка возврата камеры */
.reset-camera-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    color: #00ffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.reset-camera-btn:not(.hidden) {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: reset-camera-pulse 2s ease-in-out infinite;
}

.reset-camera-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: scale(1.1);
}

.reset-camera-btn:active {
    transform: scale(0.95);
}

.reset-camera-btn svg {
    width: 24px;
    height: 24px;
}

@keyframes reset-camera-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    }
}

@media (max-width: 700px) {
    .reset-camera-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }
    
    .reset-camera-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Кнопка звука */
.sound-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    color: #00ffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.sound-toggle-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: scale(1.1);
}

.sound-toggle-btn:active {
    transform: scale(0.95);
}

.sound-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.sound-toggle-btn .hidden {
    display: none;
}

@media (max-width: 700px) {
    .sound-toggle-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 70px;
    }
    
    .sound-toggle-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Туториал overlay */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    pointer-events: none;
}

.tutorial-overlay.hidden {
    display: none;
}

.tutorial-highlight {
    position: absolute;
    border: 3px solid #00ffff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 30px rgba(0, 255, 255, 0.3);
    pointer-events: none;
    animation: tutorial-pulse 1.5s ease-in-out infinite;
    z-index: 3001;
}

@keyframes tutorial-pulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 30px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 255, 255, 1), inset 0 0 50px rgba(0, 255, 255, 0.5);
    }
}

.tutorial-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 2px solid #00ffff;
    border-radius: 12px;
    padding: 20px;
    max-width: 350px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    pointer-events: auto;
    z-index: 3002;
}

.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tutorial-title {
    color: #00ffff;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tutorial-text {
    color: #E0E0E0;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.tutorial-btn {
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    border-radius: 8px;
    color: #00ffff;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.tutorial-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

.tutorial-btn:active {
    transform: scale(0.95);
}

.tutorial-skip {
    background: rgba(125, 60, 255, 0.2);
    border-color: #7d3cff;
    color: #b894ff;
    box-shadow: 0 0 10px rgba(125, 60, 255, 0.3);
}

.tutorial-skip:hover {
    background: rgba(125, 60, 255, 0.3);
    box-shadow: 0 0 15px rgba(125, 60, 255, 0.5);
}

/* Фоновые сообщения туториала */
.tutorial-background-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}

.tutorial-background-messages.hidden {
    display: none;
}

.background-message {
    position: absolute;
    color: rgba(0, 255, 255, 0.3);
    font-size: 12px;
    font-family: 'Courier New', 'Consolas', monospace;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.2);
}

@media (max-width: 700px) {
    .tutorial-tooltip {
        max-width: 280px;
        padding: 15px;
    }
    
    .tutorial-title {
        font-size: 18px;
    }
    
    .tutorial-text {
        font-size: 13px;
    }
    
    .tutorial-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Эффект перегрева */
.overheat-effect {
    filter: hue-rotate(0deg) brightness(0.5);
    animation: overheat-pulse 0.5s ease-in-out infinite;
}

@keyframes overheat-pulse {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(0.5);
    }
    50% {
        filter: hue-rotate(10deg) brightness(0.6);
    }
}

/* Анимация апгрейда */
.upgrade-glow {
    animation: upgrade-glow 0.5s ease-out;
}

@keyframes upgrade-glow {
    0% {
        box-shadow: 0 0 0 rgba(0, 255, 255, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 255, 255, 0);
    }
}
