body {
    background: #000;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

main, #leaderboard-container, #reason-container, #gameCanvas {
    position: relative;
}

h1 {
    margin-top: 24px;
    font-size: 2.2em;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px #000a;
}

#gameCanvas {
    background: linear-gradient(to bottom, #222 60%, #4e9cff 100%);
    display: block;
    margin: 24px auto 0 auto;
    border: 4px solid #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px #0008;
    width: 800px;
    height: 480px;
    max-width: 98vw;
    max-height: 80vh;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30,60,114,0.98);
    padding: 2em 3em;
    border-radius: 20px;
    box-shadow: 0 4px 24px #000b;
}

#reason-container {
    position: static;
    margin: 32px auto 0 auto;
    width: 90%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.35em;
    padding: 22px 18px;
    border-radius: 18px;
    box-shadow: 0 2px 12px #0004;
    text-align: center;
    min-height: 120px;
    max-width: 700px;
    transition: opacity 0.7s;
    opacity: 1;
    font-weight: 500;
}

#reason-text {
    transition: opacity 0.7s;
    opacity: 1;
    line-height: 1.5em;
    word-break: break-word;
}

button {
    background: #ffde59;
    color: #222;
    border: none;
    padding: 0.7em 2em;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 1em;
    box-shadow: 0 2px 8px #0004;
    transition: background 0.2s;
}
button:hover {
    background: #ffd000;
}

#leaderboard-container {
    position: absolute;
    left: 10px;
    top: 30px;
    width: 300px;
    min-height: 340px;
    max-width: 340px;
    background: linear-gradient(135deg, #ff00cc 0%, #3333ff 100%);
    color: #fff;
    font-size: 1.15em;
    padding: 24px 18px 18px 18px;
    border-radius: 22px;
    box-shadow: 0 0 32px 10px #00ffe0cc, 0 0 64px 0 #ff00cc66, 0 2px 24px #0008;
    text-align: left;
    border: 5px solid #fff;
    outline: 4px solid #00ffe0;
    outline-offset: 0px;
    filter: drop-shadow(0 0 18px #fff7);
    animation: leaderboard-glow 2.5s infinite alternate;
}
@keyframes leaderboard-glow {
    0% { box-shadow: 0 0 32px 10px #00ffe0cc, 0 0 64px 0 #ff00cc66, 0 2px 24px #0008; }
    100% { box-shadow: 0 0 48px 18px #ff00ccbb, 0 0 100px 0 #00ffe077, 0 2px 36px #000a; }
}
#leaderboard-container h2 {
    margin: 0 0 16px 0;
    font-size: 1.5em;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #fff, 0 0 18px #ff00cc, 0 2px 8px #00ffe0;
    color: #fff;
    font-family: 'Orbitron', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(90deg, #fff 40%, #ff00cc 60%, #00ffe0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
#leaderboard-list {
    margin: 0 0 16px 22px;
    padding: 0;
    font-size: 1.2em;
}
#leaderboard-list li {
    margin-bottom: 4px;
    font-family: 'Orbitron', 'Segoe UI', Arial, sans-serif;
    padding: 2px 0;
    border-radius: 6px;
    background: linear-gradient(90deg, #fff2 60%, #ff00cc44 100%);
    text-shadow: 0 0 7px #fff, 0 0 12px #00ffe0;
    color: #fff;
    box-shadow: 0 1px 8px #00ffe033;
    border-left: 4px solid #ff00cc;
}
#leaderboard-list li:first-child {
    background: linear-gradient(90deg, #ffe066 60%, #ff00cc 100%);
    color: #222;
    border-left: 6px solid #ffe066;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 12px #fff, 0 0 20px #ffe066;
}
#name-form {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 18px;
    justify-content: center;
}
#player-name {
    flex: 1 1 100px;
    padding: 6px 10px;
    border-radius: 9px;
    border: 2px solid #ff00cc;
    font-size: 1.1em;
    background: #fff8;
    color: #222;
}
#name-form button {
    background: linear-gradient(90deg, #ff00cc 60%, #00ffe0 100%);
    color: #fff;
    border: none;
    padding: 6px 18px;
    font-size: 1.1em;
    border-radius: 9px;
    cursor: pointer;
    box-shadow: 0 2px 12px #ff00cc66;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: 'Orbitron', 'Segoe UI', Arial, sans-serif;
}
#name-form button:hover {
    background: linear-gradient(90deg, #00ffe0 60%, #ff00cc 100%);
    box-shadow: 0 2px 18px #00ffe099;
}

#face-anim-container {
    position: absolute;
    right: 30px;
    top: 80px;
    width: 510px;
    height: 660px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
#face-anim-img {
    width: 480px;
    height: auto;
    filter: drop-shadow(0 0 18px #fff7);
    transition: transform 0.3s cubic-bezier(.36,.07,.19,.97);
    will-change: transform;
}
/* Animations */
@keyframes shake {
    0% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(-10px, 0) rotate(-5deg); }
    40% { transform: translate(10px, 0) rotate(5deg); }
    60% { transform: translate(-10px, 0) rotate(-5deg); }
    80% { transform: translate(10px, 0) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0); }
}
@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
@keyframes flipspin {
    0% { transform: rotateY(0) rotate(0); }
    50% { transform: rotateY(180deg) rotate(180deg); }
    100% { transform: rotateY(360deg) rotate(360deg); }
}
.shake {
    animation: shake 1.7s cubic-bezier(.36,.07,.19,.97);
}
.spin {
    animation: spin 2.2s linear;
}
.pulse {
    animation: pulse 1.6s cubic-bezier(.36,.07,.19,.97);
}
.flipspin {
    animation: flipspin 2.2s cubic-bezier(.36,.07,.19,.97);
}
