:root {
    --bg-color: #030308;
    --text-color: #00ff66;
    --accent-pink: #ff0055;
    --accent-cyan: #00f0ff;
    --card-bg: rgba(10, 10, 25, 0.92);
    --font-header: 'Press Start 2P', monospace;
    --font-body: 'Silkscreen', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Сброс для всех ссылок */
a, a:visited, a:hover, a:active {
    color: inherit;
    text-decoration: none;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
}

/* Космический канвас */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
    pointer-events: none;
}

/* CRT-эффект */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.35) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* Главное окно аркады */
.container {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 580px;
    padding: 2rem 1.5rem;
    background: var(--card-bg);
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.15);
    border-radius: 4px;
    text-align: center;
}

h1.glitch-title {
    font-family: var(--font-header);
    font-size: 1.3rem;
    color: #ffffff;
    text-shadow: 2px 2px 0px var(--accent-pink), -2px -2px 0px var(--accent-cyan);
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-bottom: 1.2rem;
}

.pixel-hr {
    border: none;
    height: 3px;
    background: var(--accent-pink);
    box-shadow: 0 0 8px var(--accent-pink);
    margin: 1.5rem 0;
}

/* Меню — СТРОГО вертикальный список */
.arcade-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.9rem;
    margin: 1.5rem 0;
    width: 100%;
}

/* Каждая кнопка меню */
.menu-item {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(0, 240, 255, 0.03);
    border: 2px solid var(--accent-cyan);
    color: var(--text-color) !important;
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-align: left;
    transition: all 0.15s ease-in-out;
}

/* Ховер / Выделение кнопки */
.menu-item:hover, .menu-item:focus {
    background: rgba(255, 0, 85, 0.15);
    border-color: var(--accent-pink);
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
    transform: scale(1.01);
}

.menu-item .prefix {
    color: var(--accent-pink);
    margin-right: 0.5rem;
}

.blink {
    animation: blinker 1.2s infinite;
    color: var(--accent-pink);
    font-size: 0.75rem;
}

@keyframes blinker {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Фикс кнопки в меню для модалки */
button.menu-item {
    cursor: pointer;
    width: 100%;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .container {
        padding: 1.2rem 0.8rem;
    }

    h1.glitch-title {
        font-size: 0.9rem;
    }

    .menu-item {
        font-size: 0.68rem;
        padding: 0.7rem 0.5rem;
    }
} /* <--- Вот эта скобка закрывает мобильный блок! */

/* Стили модального окна (работают везде: и на ПК, и на мобилке) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(3, 3, 8, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--card-bg);
    border: 3px solid var(--accent-pink);
    box-shadow: 0 0 25px rgba(255, 0, 85, 0.4), inset 0 0 12px rgba(255, 0, 85, 0.2);
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
    border-radius: 4px;
    position: relative;
    animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-header);
    font-size: 0.9rem;
    color: #ffff00;
}

.close-btn {
    background: none;
    border: none;
    color: var(--accent-pink);
    font-family: var(--font-header);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.15s;
}

.close-btn:hover {
    color: #ffffff;
    text-shadow: 0 0 8px var(--accent-pink);
}

/* Сетка карточек с иконками */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.2rem 0;
}

.media-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: rgba(0, 240, 255, 0.04);
    border: 2px solid var(--accent-cyan);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.7rem;
    gap: 0.6rem;
    transition: all 0.15s ease-in-out;
}

.media-card:hover {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.5);
    transform: translateY(-3px);
}

.media-card.disabled {
    opacity: 0.4;
    border-color: #555;
    cursor: not-allowed;
}

.media-card.disabled:hover {
    transform: none;
    box-shadow: none;
    background: rgba(0, 240, 255, 0.04);
}

.media-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 4px var(--accent-cyan));
    transition: filter 0.15s;
}

.media-card:hover .media-icon {
    filter: drop-shadow(0 0 8px var(--accent-pink));
}

.modal-footer {
    font-size: 0.65rem;
    color: var(--accent-cyan);
    text-align: center;
    margin-top: 1rem;
}