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

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #eee;
    line-height: 1.5;
}

.hero {
    height: 100vh;
    background: url('../images/dduck.jpeg') center center / cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1;
}

.content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

h1 {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 10px #ff0040, 0 0 20px #ff0040;
}

.glitch {
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 100% { text-shadow: 0 0 5px #ff0040, 0 0 10px #ff0040; }
    50% { text-shadow: -2px 0 red, 2px 0 blue; }
}

.tagline {
    font-size: 1.4rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #ddd;
}

.buttons .btn {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn.primary {
    background: #ff0040;
    color: #fff;
    box-shadow: 0 0 10px #ff0040;
}

.btn.primary:hover {
    background: #cc0030;
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff0040;
}

.btn.secondary {
    background: transparent;
    border: 2px solid #ff0040;
    color: #ff0040;
}

.btn.secondary:hover {
    background: #ff0040;
    color: #000;
}

.features {
    padding: 4rem 1rem;
    background: #111;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.card {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 20px;
    width: 280px;
    text-align: center;
    transition: 0.2s;
    border-bottom: 3px solid #ff0040;
}

.card:hover {
    transform: translateY(-10px);
    background: #222;
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.game-section {
    padding: 4rem 1rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    text-align: center;
}

.game-section h2 {
    color: #ff0040;
    text-shadow: 0 0 10px #ff0040;
}

.nes-emulator {
    text-align: center;
    padding: 2rem;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    margin: 2rem 0;
}

#nes-container {
    border: 3px solid #ff0040;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 0, 64, 0.5);
}

.nes-controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.game-info {
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    color: #aaa;
    font-size: 0.9rem;
}

/* Мобильное управление (появляется только после запуска игры) */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-top: 2px solid #ff0040;
    touch-action: manipulation;
}

.control-panel {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Крестовина слева */
.dpad {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(3, 60px);
    gap: 6px;
    background: rgba(20, 20, 40, 0.9);
    padding: 8px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Правая группа (A/B + Start/Select) */
.right-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.action-buttons {
    display: flex;
    gap: 16px;
}

.system-buttons {
    display: flex;
    gap: 16px;
}

.ctrl-btn {
    background: #1e1e2a;
    border: 2px solid #ff0040;
    color: #ff0040;
    font-weight: bold;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    transition: 0.05s linear;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:active {
    background: #ff0040;
    color: #000;
    transform: scale(0.96);
}

/* Размеры кнопок */
.dpad .ctrl-btn {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
}

.up { grid-column: 2 / 3; grid-row: 1 / 2; }
.left { grid-column: 1 / 2; grid-row: 2 / 3; }
.down { grid-column: 2 / 3; grid-row: 3 / 4; }
.right { grid-column: 3 / 4; grid-row: 2 / 3; }

.action-buttons .ctrl-btn {
    width: 75px;
    height: 75px;
    font-size: 2rem;
    background: #2a0a0a;
    border-color: #ff6666;
}

.system-buttons .ctrl-btn {
    width: 85px;
    height: 50px;
    font-size: 0.9rem;
    background: #111;
    letter-spacing: 1px;
}

/* Для очень маленьких экранов (ширина < 480px) */
@media (max-width: 480px) {
    .dpad {
        grid-template-columns: repeat(3, 50px);
        grid-template-rows: repeat(3, 50px);
        gap: 4px;
    }
    .dpad .ctrl-btn {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    .action-buttons .ctrl-btn {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }
    .system-buttons .ctrl-btn {
        width: 70px;
        height: 45px;
        font-size: 0.8rem;
    }
}
