:root {
    --primary-color: #ff4757;
    --bg-color: #2f3542;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg-color);
    font-family: 'Fredoka One', cursive;
    color: var(--text-color);
    transition: background 0.5s ease;
}

canvas {
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
}

#score-container {
    font-size: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

#chaos-notification {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 4rem;
    color: #ffd32a;
    text-shadow: 4px 4px 0px #ff6348;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    text-align: center;
    white-space: nowrap;
}

#chaos-notification.show {
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 0.5s infinite alternate;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 20;
}

#game-over-screen.visible {
    opacity: 1;
}

#game-over-screen.hidden {
    pointer-events: none;
    display: none; /* simple hide for start */
}

h1 {
    font-size: 5rem;
    margin: 0 0 20px 0;
    color: #ff4757;
    text-transform: uppercase;
}

button {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    padding: 15px 40px;
    background: #2ed573;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 0 #26af61;
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active {
    transform: translateY(5px);
    box-shadow: 0 5px 0 #26af61;
}

@keyframes pulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.1); }
}

/* Chaos Modes CSS Classes */
body.disco {
    animation: discoMode 2s infinite;
}

@keyframes discoMode {
    0% { background: #eb4d4b; }
    25% { background: #f0932b; }
    50% { background: #badc58; }
    75% { background: #22a6b3; }
    100% { background: #eb4d4b; }
}

body.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
