@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@700&display=swap');

:root {
    --bg-color: #1a1a2e;
    --container-bg: #16213e;
    --border-color: #0f3460;
    --accent-color: #e94560;
    --text-main: #4cc9f0;
    --text-sub: #f72585;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: white;
    font-family: 'Roboto Mono', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

h1 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: var(--text-main);
    text-shadow: 0 0 5px var(--text-main);
}

h2 {
    color: var(--text-sub);
    margin-bottom: 20px;
}

/* --- MENU STYLES --- */
.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
}

.menu-btn {
    padding: 12px;
    background: transparent;
    border: 2px solid var(--text-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.menu-btn:hover {
    background: var(--text-main);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--text-main);
}

.cancel-btn {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.cancel-btn:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--accent-color);
}

.credits {
    margin-top: 30px;
    font-size: 12px;
    color: #666;
}

.setting-row {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.menu-select {
    padding: 10px;
    background: var(--container-bg);
    border: 2px solid var(--text-main);
    color: var(--text-main);
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    width: 200px;
    cursor: pointer;
    outline: none;
}

input[type=range] {
    width: 200px;
    cursor: pointer;
}

/* --- GAME UI --- */
#level-display {
    color: var(--text-sub);
    margin-bottom: 10px;
    font-size: 18px;
}

#game-container {
    position: relative;
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--container-bg);
    border: 4px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

/* Кнопка Паузы в игре */
#btn-pause-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-main);
    color: white;
    font-weight: bold;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#btn-pause-icon:hover {
    background: var(--text-main);
    color: black;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-label {
    margin-bottom: 5px;
    font-size: 12px;
    color: #aaa;
    letter-spacing: 1px;
}

canvas {
    background-color: #000;
    image-rendering: pixelated;
    border: 2px solid #222;
    box-shadow: inset 0 0 10px #000;
}

#ui {
    margin-top: 20px;
    text-align: center;
    line-height: 1.6;
    color: #ccc;
}

.key {
    display: inline-block;
    background: var(--accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    margin: 0 3px;
    box-shadow: 0 2px 0 #990000;
}

.legend {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 8px;
}

/* --- INTRO COMIC STYLE --- */
.comic-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    width: 90%;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.intro-visual {
    font-size: 80px;
    margin-bottom: 20px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-sub);
    padding: 20px;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.15);
    border-radius: 8px;
}

.intro-text {
    font-size: 18px;
    line-height: 1.6;
    color: #fff;
    margin-bottom: 30px;
    min-height: 60px;
    text-shadow: 0 2px 4px #000;
}

.skip-btn {
    margin-top: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
}

.skip-btn:hover {
    color: var(--accent-color);
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flicker-text {
    animation: flicker 2s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ЛЕЧЕНИЕ БОЛЬШИХ КАРТИНОК */
.intro-visual img {
    width: 100%;
    /* Растягиваем на всю ширину панели */
    max-width: 600px;
    /* Не шире, чем сама панель */
    height: auto;
    /* Высота подстроится сама (сохранит пропорции) */
    display: block;
    /* Убирает лишние отступы */
    border-radius: 4px;
    /* Скругление углов как у кнопок */
    box-shadow: 0 0 10px #000;
    /* Тень */
}

/* Убираем лишние отступы у родительского блока */
.intro-visual {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 20px;
}

.lang-switch {
    display: flex;
    gap: 10px;
}

.small-btn {
    padding: 5px 15px;
    font-size: 14px;
    width: auto;
    min-width: 50px;
}

/* Подсветка активного языка */
.small-btn.active {
    background: var(--text-main);
    color: var(--bg-color);
}