body {
    margin: 0;
    background: #1a1a1a;
    color: #f0f0f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    user-select: none;
}
h1 { margin: 0 0 10px 0; letter-spacing: 1px; }
#game-container {
    position: relative;
    width: 800px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    background: #87CEEB;
}
canvas { display: block; cursor: grab; touch-action: none; }
canvas.dragging { cursor: grabbing; }
#hud {
    position: absolute;
    top: 8px; left: 10px; right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    font-weight: 900;
}
#stage-label {
    background: rgba(0,0,0,0.55);
    color: #ffd21f;
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 15px;
    text-shadow: 1px 1px 0 #000;
}
#money-text {
    color: #ffd21f;
    font-size: 26px;
    text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
}
#bottom-bar {
    position: relative;
    height: 96px;
    background: #8a5a33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
}
#bottom-bar::before {
    content: "";
    position: absolute;
    top: -8px; left: 0; right: 0;
    height: 8px;
    background:
        linear-gradient(45deg, #8a5a33 50%, transparent 50%) 0 0/16px 8px repeat-x,
        linear-gradient(-45deg, #8a5a33 50%, transparent 50%) 8px 0/16px 8px repeat-x;
}
.circle-btn {
    width: 74px; height: 74px;
    border-radius: 50%;
    border: 3px solid #000;
    background: radial-gradient(circle at 35% 30%, #fff, #d8d8d8);
    color: #222;
    font-weight: 900;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
    flex-shrink: 0;
}
.circle-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.circle-btn .lvl {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    padding: 0 6px;
    font-size: 11px;
    white-space: nowrap;
}
#slots { display: flex; gap: 10px; }
.slot {
    position: relative;
    width: 64px; height: 64px;
    background: #fff;
    border: 3px solid #000;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #222;
    padding: 0;
}
.slot:disabled { cursor: not-allowed; }
.slot .swatch { width: 20px; height: 20px; border: 2px solid #000; margin-bottom: 3px; }
.slot .cost {
    position: absolute;
    bottom: 1px; right: 3px;
    font-size: 11px;
    color: #b8860b;
    font-weight: 900;
    text-shadow: 1px 1px 0 #fff;
}
.cooldown-overlay {
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 0%;
    background: rgba(0,0,0,0.45);
    pointer-events: none;
}
#hint { margin-top: 8px; font-size: 13px; opacity: 0.75; }
#game-over-screen {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
#game-over-text { font-size: 52px; margin: 0; font-weight: 900; text-shadow: 3px 3px 0 #000; }
#restart-btn {
    margin-top: 18px;
    font-size: 20px;
    padding: 10px 26px;
    background: #4CAF50;
    border: 3px solid #000;
    border-radius: 10px;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}
#boot-error {
    position: absolute;
    inset: 0;
    background: rgba(15,15,15,0.94);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9;
    text-align: center;
    padding: 20px;
}
#boot-error h2 { color: #ff6b6b; margin-top: 0; }
#boot-error p { max-width: 560px; line-height: 1.5; }