html, body { margin:0; padding:0; width:100%; background-color:#000; }

main {
    margin: 0;
    padding: 20px;
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content:center;
    align-items: center;
    box-sizing: border-box;
    overflow:hidden;
}

.game-container {
    background: #111;
    border: 3px solid #444;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,255,255,0.3);
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #222;
    border-radius: 5px;
    border: 1px solid #555;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: bold;
}

.diamond-icon {
    color: #00ffff;
    font-size: 18px;
}

.life-icon {
    color: #ff4444;
    font-size: 18px;
}

.level-display {
    color: #ffff00;
}

#gameCanvas {
    border: 2px solid #666;
    background: #000;
    display: block;
}

.controls {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #aaa;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #ff4444;
    box-shadow:0 0 20px #000;
    text-align: center;
    font-size: 24px;
    z-index: 1000;
    display: none;
}

.restart-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.restart-btn:hover {
    background: #45a049;
}

.victory {
    border-color: #00ff00 !important;
    box-shadow: 0 0 20px #000;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(51, 51, 51, 0.95);
    padding: 15px;
    box-sizing: border-box;
    border-top: 2px solid #555;
    z-index: 100;
}

 .controls-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.dpad {
    display: grid;
    grid-template-columns: 60px 60px 60px;
    grid-template-rows: 60px 60px;
    gap: 5px;
}

.control-btn {
    background-color: #555;
    border: 2px solid #777;
    color: white;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.control-btn:active {
    background-color: #777;
    transform: scale(0.95);
}

.control-btn.pressed {
    background-color: #888;
    border-color: #aaa;
}

.arrow-up { grid-column: 2; grid-row: 1; }
.arrow-left { grid-column: 1; grid-row: 2; }
.arrow-down { grid-column: 2; grid-row: 2; }
.arrow-right { grid-column: 3; grid-row: 2; }

.bomb-btn {
    /*background-color: #c44;
    border: 2px solid #e66;*/
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 30px;
}

.bomb-btn:active {
    background-color: #e66;
}

.bomb-btn.active {
    background-color: #f88;
    border-color: #faa;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.bomb-status {
    color: white;
    text-align: center;
    font-size: 12px;
    margin-top: 5px;
}

@media only screen and (max-width: 1024px) {
    main { justify-content:left; }
    
    .mobile-controls { display:block; }
            
    .controls { display:none; }
    
    .game-container { 
        position:relative; padding-bottom: 140px; /* Make room for controls */
        
        .hud { position:fixed; top:0; left:0; width:100vw; box-sizing:border-box; }
    }
}