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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#canvas {
    border: 3px solid #e94560;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

#ui-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    width: 900px;
    height: 700px;
}

#header {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 600px;
}

#title {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(45deg, #00d4ff, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    letter-spacing: 4px;
}

#score-section, #level-section {
    text-align: center;
}

.label {
    font-size: 14px;
    color: #888;
    margin-bottom: 5px;
}

.value {
    font-size: 32px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#lives-container {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
}

#side-panel {
    position: absolute;
    right: -280px;
    top: 0;
    width: 250px;
    pointer-events: all;
}

.panel-section {
    background: rgba(22, 33, 62, 0.8);
    border: 2px solid #e94560;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.panel-section h3 {
    color: #00d4ff;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
}

#next-canvas, #hold-canvas {
    display: block;
    margin: 0 auto;
    background: #0f0f1e;
    border-radius: 5px;
}

.mine-meter .meter-container {
    position: relative;
    background: #0f0f1e;
    border-radius: 10px;
    height: 30px;
    overflow: hidden;
}

#mine-meter-fill {
    background: linear-gradient(90deg, #00d4ff, #e94560);
    height: 100%;
    transition: width 0.3s;
}

#mine-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 0 5px #000;
}

.stats .stat-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    font-size: 14px;
}

.stats .stat-row span:last-child {
    color: #00d4ff;
    font-weight: bold;
}

.controls-guide {
    font-size: 12px;
}

.control-item {
    margin: 5px 0;
    color: #aaa;
}

#controls {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    pointer-events: all;
}

button {
    background: linear-gradient(135deg, #e94560, #ff6b6b);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
    font-family: 'Courier New', monospace;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(233, 69, 96, 0.5);
}

button:active {
    transform: translateY(0);
}

#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#game-over-screen.hidden {
    display: none;
}

.game-over-content {
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 50px;
    border-radius: 20px;
    border: 3px solid #e94560;
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.5);
}

.game-over-content h1 {
    font-size: 64px;
    color: #e94560;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.8);
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 24px;
    margin: 15px 0;
    color: #00d4ff;
}

footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 14px;
    color: #888;
    z-index: 100;
}

footer a {
    color: #e94560;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #00d4ff;
}

@media (max-width: 900px) {
    #ui-overlay {
        width: 100%;
        height: 100%;
    }
    
    #side-panel {
        right: 10px;
        width: 200px;
        font-size: 12px;
    }
    
    #title {
        font-size: 32px;
    }
    
    #header {
        width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    #canvas {
        transform: translate(-50%, -50%) scale(0.7);
    }
    
    #side-panel {
        display: none;
    }
    
    #controls {
        flex-direction: column;
        gap: 10px;
    }
}