* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a2e1a;
    font-family: 'JetBrains Mono', monospace;
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 10;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#overlay.active {
    pointer-events: all;
    background: rgba(10, 20, 10, 0.85);
    backdrop-filter: blur(4px);
}

.hud-item {
    background: rgba(10, 20, 10, 0.8);
    border: 1px solid rgba(100, 200, 100, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    color: #e0ffe0;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(100, 255, 100, 0.3);
}

.hud-timer {
    font-family: 'Bungee', cursive;
    font-size: 22px;
    letter-spacing: 2px;
}

.hud-timer.urgent {
    color: #ff4444;
    animation: pulse-urgent 0.5s infinite alternate;
}

@keyframes pulse-urgent {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(1.05); }
}

.overlay-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(28px, 8vw, 56px);
    color: #4eff4e;
    text-shadow: 0 0 20px rgba(78, 255, 78, 0.5);
    margin-bottom: 8px;
    text-align: center;
}

.overlay-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(12px, 3vw, 16px);
    color: #a0ffa0;
    margin-bottom: 32px;
    text-align: center;
}

.overlay-btn {
    font-family: 'Bungee', cursive;
    font-size: clamp(16px, 4vw, 24px);
    padding: 16px 40px;
    border: 2px solid #4eff4e;
    border-radius: 12px;
    background: rgba(78, 255, 78, 0.1);
    color: #4eff4e;
    cursor: pointer;
    animation: btn-pulse 1.5s infinite alternate;
    transition: all 0.2s;
    margin: 8px;
}

.overlay-btn:hover, .overlay-btn:active {
    background: rgba(78, 255, 78, 0.3);
    transform: scale(1.05);
}

@keyframes btn-pulse {
    from { box-shadow: 0 0 10px rgba(78, 255, 78, 0.3); }
    to { box-shadow: 0 0 25px rgba(78, 255, 78, 0.6); }
}

.overlay-score {
    font-family: 'Bungee', cursive;
    font-size: clamp(36px, 10vw, 64px);
    color: #ffdd44;
    text-shadow: 0 0 20px rgba(255, 221, 68, 0.5);
    margin: 16px 0;
}

.overlay-stats {
    font-size: 14px;
    color: #c0ffc0;
    line-height: 2;
    text-align: center;
    margin-bottom: 16px;
}

.overlay-highscore {
    font-size: 12px;
    color: #88cc88;
    margin-top: 12px;
}

.overlay-stars {
    font-size: 32px;
    margin: 8px 0;
}

.hint-text {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 10, 0.85);
    border: 1px solid rgba(100, 200, 100, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    color: #a0ffa0;
    font-size: 11px;
    text-align: center;
    z-index: 10;
    transition: opacity 1s;
    pointer-events: none;
}

.minimap {
    position: fixed;
    top: 52px;
    right: 10px;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(100, 200, 100, 0.4);
    border-radius: 8px;
    background: rgba(10, 20, 10, 0.7);
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.footer-link {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    z-index: 200;
    font-size: 10px;
    opacity: 0.5;
    text-align: center;
}

.footer-link a {
    color: #88cc88;
    text-decoration: none;
}

.new-highscore {
    animation: rainbow 1s infinite;
}

@keyframes rainbow {
    0% { color: #ff4444; }
    25% { color: #ffdd44; }
    50% { color: #44ff44; }
    75% { color: #44ddff; }
    100% { color: #ff44ff; }
}