body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    font-family: 'Courier New', monospace;
    color: #e94560;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
}

.game-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
    max-width: 900px;
    margin: 0 auto;
}

/* Game Header */
.game-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.header-left {
    display: flex;
    justify-content: flex-start;
}

.header-center {
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

h1 {
    font-size: 1.8em;
    margin: 0;
    text-shadow: 0 0 10px #e94560;
    image-rendering: pixelated;
}

.score, .timer {
    background: rgba(233, 69, 96, 0.1);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #e94560;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Mobile Header Layout */
@media (max-width: 767px) {
    .game-header {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .header-left, .header-right {
        justify-content: center;
    }

    .header-center {
        order: -1; /* Title goes first on mobile */
    }

    h1 {
        font-size: 1.6em;
    }

    .score, .timer {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

canvas {
    border: 2px solid #e94560;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
}

/* Main Game Layout */
.main-game-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 15px 0;
}

/* Game Section */
.game-section {
    display: flex;
    justify-content: center;
}

/* Utility Section */
.utility-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Instruction Panel */
.instruction-panel {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid #e94560;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
}

.instruction-panel h3 {
    margin: 0 0 10px 0;
    color: #e94560;
    font-size: 1.3em;
    text-shadow: 0 0 5px #e94560;
}

.instruction-content {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.keyboard-controls, .touch-controls {
    flex: 1;
}

.keyboard-controls h4, .touch-controls h4 {
    margin: 0 0 8px 0;
    color: #f39c12;
    font-size: 1.1em;
}

.keyboard-controls ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.keyboard-controls li {
    margin: 5px 0;
    color: #fff;
}

.keyboard-controls kbd {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #e94560;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    color: #e94560;
    box-shadow: 0 0 3px rgba(233, 69, 96, 0.3);
}

.touch-controls p {
    margin: 0;
    color: #fff;
    font-size: 0.9em;
}

.game-tips {
    border-top: 1px solid rgba(233, 69, 96, 0.3);
    padding-top: 10px;
    margin-top: 10px;
}

.game-tips p {
    margin: 5px 0;
    color: #f39c12;
    font-size: 0.9em;
}

.game-tips strong {
    color: #e94560;
}

/* Touch Controls Section */
.touch-controls-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.touch-buttons {
    display: flex;
    justify-content: center;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dpad-middle {
    display: flex;
    gap: 5px;
}

/* Responsive Design */
@media (min-width: 768px) {
    .main-game-layout {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .game-section {
        order: 1;
    }

    .utility-section {
        order: 2;
    }
}

@media (min-width: 1024px) {
    .main-game-layout {
        gap: 30px;
    }

    .instruction-panel {
        padding: 20px;
    }

    .touch-controls-section {
        padding: 20px;
    }
}

@media (min-width: 1200px) {
    .game-container {
        max-width: 1200px;
    }
}

.touch-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e94560, #f39c12);
    border: 2px solid #e94560;
    border-radius: 8px;
    color: #000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:hover {
    background: linear-gradient(135deg, #f39c12, #e94560);
    box-shadow: 0 0 12px rgba(233, 69, 96, 0.6);
    transform: scale(1.05);
}

.touch-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 4px rgba(233, 69, 96, 0.8);
}

.controls {
    margin-top: 15px;
    font-size: 1.1em;
    color: #f39c12;
}

.controls p {
    margin: 5px 0;
}

.auto-button {
    background: linear-gradient(135deg, #e94560, #f39c12);
    color: #000;
    border: 2px solid #e94560;
    padding: 10px 20px;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.auto-button:hover {
    background: linear-gradient(135deg, #f39c12, #e94560);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.6);
    transform: scale(1.05);
}

.auto-button:active {
    transform: scale(0.95);
}

.auto-button.auto-active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #27ae60;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.6);
}

/* Retro glow effect */
@keyframes glow {
    0% { box-shadow: 0 0 5px #e94560; }
    50% { box-shadow: 0 0 20px #e94560, 0 0 30px #e94560; }
    100% { box-shadow: 0 0 5px #e94560; }
}

.game-container {
    animation: glow 2s ease-in-out infinite alternate;
}
