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

body {
    background-color: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    border: 4px solid #4a4a6a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(100, 100, 200, 0.3);
}

#game-canvas {
    display: block;
    background-color: #2d2d44;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#ui-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

#health-display {
    display: flex;
    gap: 5px;
}

.heart {
    width: 24px;
    height: 24px;
    background-color: #ff4757;
    clip-path: path('M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z');
    transform: scale(1.2);
}

.heart.empty {
    background-color: #4a4a6a;
}

.heart.half {
    background: linear-gradient(90deg, #ff4757 50%, #4a4a6a 50%);
}

#score-display {
    color: #ffd700;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
}

#lives-display {
    position: absolute;
    top: 40px;
    left: 10px;
    color: #ffaa00;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
}

.life-icon {
    color: #ffd700;
    margin-right: 2px;
}

#level-display {
    position: absolute;
    top: 40px;
    right: 10px;
    color: #88aaff;
    font-size: 12px;
    text-shadow: 2px 2px 0 #000;
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
}

#game-over h1 {
    font-size: 48px;
    color: #ff4757;
    text-shadow: 4px 4px 0 #000;
    margin-bottom: 20px;
}

#game-over p {
    font-size: 16px;
    color: #ffd700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

#loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffd700;
    font-size: 24px;
    z-index: 200;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1f4e 50%, #1a1a2e 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 150;
    overflow-y: auto;
    padding: 10px 0;
}

.start-content {
    text-align: center;
    color: white;
    padding: 5px 10px;
}

.game-title {
    font-size: 42px;
    color: #ff69b4;
    text-shadow:
        3px 3px 0 #ff1493,
        6px 6px 0 #8b008b,
        0 0 20px #ff69b4,
        0 0 40px #ff1493;
    margin-bottom: 2px;
    letter-spacing: 6px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 4px 4px 0 #ff1493, 8px 8px 0 #8b008b, 0 0 20px #ff69b4, 0 0 40px #ff1493; }
    to { text-shadow: 4px 4px 0 #ff1493, 8px 8px 0 #8b008b, 0 0 30px #ff69b4, 0 0 60px #ff1493, 0 0 80px #ff69b4; }
}

.subtitle {
    font-size: 12px;
    color: #b8b8d0;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.controls-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #4a4a6a;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 12px;
}

.controls-box h2 {
    font-size: 14px;
    color: #ffd700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.controls-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.control-section {
    text-align: left;
}

.control-section h3 {
    font-size: 10px;
    color: #ff69b4;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.control-row.center {
    justify-content: center;
    margin-top: 8px;
}

.key {
    display: inline-block;
    min-width: 28px;
    padding: 4px 8px;
    background: linear-gradient(180deg, #4a4a6a 0%, #2a2a4a 100%);
    border: 2px solid #6a6a8a;
    border-radius: 5px;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 0 #1a1a2a;
}

.key.mouse {
    min-width: 70px;
    background: linear-gradient(180deg, #5a4a7a 0%, #3a2a5a 100%);
    border-color: #7a6a9a;
}

.action {
    color: #d0d0e0;
    font-size: 10px;
}

#start-button {
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 40px;
    font-size: 16px;
    font-family: inherit;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 4px;
    box-shadow:
        0 4px 0 #8b008b,
        0 0 20px rgba(255, 105, 180, 0.5);
    transition: all 0.1s ease;
}

#start-button:hover {
    background: linear-gradient(180deg, #ff85c1 0%, #ff3da5 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 #8b008b,
        0 0 30px rgba(255, 105, 180, 0.7);
}

#start-button:active {
    transform: translateY(4px);
    box-shadow:
        0 2px 0 #8b008b,
        0 0 15px rgba(255, 105, 180, 0.5);
}

.tip {
    margin-top: 10px;
    font-size: 10px;
    color: #8888aa;
    font-style: italic;
}

/* Difficulty Selector */
.difficulty-box {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #4a4a6a;
    border-radius: 10px;
    padding: 10px 20px;
    margin-bottom: 12px;
}

.difficulty-box h2 {
    font-size: 12px;
    color: #ffd700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.difficulty-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.difficulty-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: rgba(74, 74, 106, 0.5);
    border: 2px solid #4a4a6a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-option:hover {
    background: rgba(100, 100, 150, 0.5);
    border-color: #6a6a8a;
}

.difficulty-option input[type="radio"] {
    display: none;
}

.difficulty-option input[type="radio"]:checked + .difficulty-label {
    color: #ff69b4;
}

.difficulty-option:has(input[type="radio"]:checked) {
    background: rgba(255, 105, 180, 0.2);
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

.difficulty-label {
    font-size: 12px;
    color: #ffffff;
    font-weight: bold;
    margin-bottom: 2px;
}

.difficulty-desc {
    font-size: 9px;
    color: #8888aa;
}

.hidden {
    display: none !important;
}
