html {
    padding: 0;
    margin: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #111;
    color: white;
    flex-direction: column;
    width: 100%;
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.buttons {
    margin-top: 20px;
}

button {
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: small;
    margin: 5px;
    padding: 10px 15px;
    border: none;
    background-color: white;
    color: #000;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

button:hover:enabled {
    background-color: #007777;
    color: #fff;
    cursor: pointer;
}

button:disabled {
    background-color: grey;
    color: #111;
}

a {
    text-decoration: none;
    font-size: small;
    margin: 5px;
    padding: 10px 15px;
    border: none;
    background-color: white;
    color: #000;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

a:hover {
    background-color: #007777;
    color: #fff;
    cursor: pointer;
}

.robot-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.robot-face {
    position: relative;
    width: 200px;
    height: 200px;
    border: 5px solid #333;
    background-color: #1e1e1e;
    border-radius: 50%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.7);
    transition: box-shadow 0.5s ease;
}

/* Expressions */
.robot-face.happy .pupil {
    transform: translate(-50%, -60%) scale(1.2);
}

.robot-face.sad .pupil {
    transform: translate(-50%, 0%);
}

.robot-face.surprised .pupil {
    transform: translate(-50%, -50%) scale(1.5);
}

.robot-face.angry .pupil {
    transform: translate(-40%, -50%) scale(2);
}

.robot-face.angry .eye {
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.5);
}

.robot-face.sleepy .pupil {
    transform: translate(-50%, -50%) scaleY(0.3);
    background-color: #111;
    opacity: 0.6;
}

/* Glow effect for expressions */
.robot-face.happy {
    box-shadow: 0 0 30px rgba(0, 255, 100, 0.7);
}

.robot-face.surprised {
    box-shadow: 0 0 40px rgba(255, 255, 100, 0.7);
}

.robot-face.angry {
    box-shadow: 0 0 40px rgba(255, 50, 50, 0.8);
}

.robot-face.sleepy {
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.6);
}

/* Confused: Eyes move slightly diagonally and apart */
.robot-face.confused .left-eye .pupil {
    transform: translate(-70%, -40%);
}
.robot-face.confused .right-eye .pupil {
    transform: translate(-30%, -30%);
}

/* Excited: Pupils enlarge and glow brightly */
.robot-face.excited .pupil {
    transform: translate(-50%, -50%) scale(1.8);
    background-color: rgba(0, 255, 127, 1);
}
.robot-face.excited {
    box-shadow: 0 0 50px rgba(0, 255, 127, 0.8);
}

/* Scared: Pupils shrink and glow dimly */
.robot-face.scared .pupil {
    transform: translate(-50%, -50%) scale(0.6);
    background-color: #ff0000;
}
.robot-face.scared {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* Scared mouth: Slower animation */
.robot-face.scared .mouth::before,
.robot-face.scared .mouth::after {
    animation: mouth-animation 6s infinite alternate ease-out;
}

/* Focus: Pupils narrow (vertically) */
.robot-face.focus .pupil {
    transform: translate(-50%, -100%) scaleY(0.6) scaleX(0.8);
    background-color: #ffa500;
}
.robot-face.focus {
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.7);
}

/* Sleepy mouth: Slower animation */
.robot-face.focus .mouth::before,
.robot-face.focus .mouth::after {
    animation: mouth-animation 2.5s infinite alternate ease-out;
}

.robot-face {
    position: relative;
    width: 200px;
    height: 200px;
    background: #333;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.eye {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: white;
    border-radius: 10%;
    top: 40px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.left-eye {
    left: 30px;
}
.right-eye {
    right: 30px;
}

.pupil {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #002;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease-in-out;
}

/* Barcode-style mouth */
.mouth {
    position: absolute;
    bottom: 20px;
    width: 120px;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mouth::before,
.mouth::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to right,
        white 0,
        white 5px,
        transparent 5px,
        transparent 10px
    );
    animation: mouth-animation 1s infinite alternate;
}

@keyframes mouth-animation {
    0% {
        transform: scaleY(0.6);
        opacity: 0.6;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
    100% {
        transform: scaleY(0.8);
        opacity: 0.8;
    }
}

/* Happy mouth: Bars grow taller */
.robot-face.happy .mouth::before,
.robot-face.happy .mouth::after {
    animation: mouth-animation 0.2s infinite alternate ease-in-out;
    transform: scaleY(1.2);
}

/* Sad mouth: Bars shrink */
.robot-face.sad .mouth::before,
.robot-face.sad .mouth::after {
    animation: mouth-animation 3s infinite alternate ease-in-out;
    transform: scale(0.5);
    opacity: 0.8;
}

/* Angry mouth: Faster movement */
.robot-face.angry .mouth::before,
.robot-face.angry .mouth::after {
    animation: mouth-animation 0.2s infinite alternate ease-in;
    transform: scaleY(1.5);
}

/* Sleepy mouth: Slower animation */
.robot-face.sleepy .mouth::before,
.robot-face.sleepy .mouth::after {
    animation: mouth-animation 5s infinite alternate ease-out;
    opacity: 0.5;
}

/* Thinking expression */
.robot-face.thinking .left-eye {
    transform: scaleY(0.5); /* Squint one eye */
}

.robot-face.thinking .right-eye .pupil {
    transform: translate(-30%, -70%); /* Look upward */
}

.robot-face.thinking .mouth::before,
.robot-face.thinking .mouth::after {
    animation: mouth-thinking 4s infinite alternate ease-in-out;
    opacity: 0.6; /* Subtle movement */
}

@keyframes mouth-thinking {
    0% {
        transform: scaleY(0.3);
    }
    100% {
        transform: scaleY(0.5);
    }
}

/* Excited Emotion Sparkles */
.robot-face.excited::before {
    content: "✨";
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 40px;
    animation: sparkle 0.5s linear infinite;
}

.robot-face.excited::after {
    content: "✨";
    position: absolute;
    top: 40px;
    right: 20px;
    font-size: 40px;
    animation: sparkle 0.5s linear infinite;
}

.robot-face.excited .mouth::before,
.robot-face.excited .mouth::after {
    animation: mouth-animation 0.5s infinite alternate ease-out;
}

@keyframes sparkle {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

/* Heartbeat for Love Emotion */
.robot-face.love {
    animation: heartbeat 1.5s infinite ease-in-out;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1); /* Pulse effect */
    }
    100% {
        transform: scale(1);
    }
}

/* Glitch Effect for Angry Emotion */
.robot-face.angry {
    animation: glitch 0.2s linear infinite;
}

@keyframes glitch {
    0% {
        transform: translateX(2px);
    }
    25% {
        transform: translateX(-2px);
    }
    50% {
        transform: translateX(2px);
    }
    75% {
        transform: translateX(-2px);
    }
    100% {
        transform: translateX(0);
    }
}

.stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    border: 1px solid white;
    border-radius: 0.25rem;
    padding: 0.5rem;
    gap: 0.25rem;
}

.stats div {
    display: flex;
    justify-content: space-between;
    font-size: 1.5em;
    width: 100%;
}

.mulish-200 {
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
}

.mulish-400 {
    font-family: "Mulish", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline;
}
.htmx-request.htmx-indicator {
    display: inline;
}

header {
    height: 2rem;
}

.message {
    border: 1px solid white;
    border-radius: 0.25rem;
    font-size: small;
    padding: 0.5rem;
    overflow: scroll;
    margin: 0 auto;
}

.full-width {
    display: flex;
    justify-content: center;
    width: 100vw;
    margin: 0 auto;
}

.game {
    padding: 2rem;
}

h2 {
    margin: 0;
    padding: 0;
}

.pb-10 {
    padding-bottom: 1rem;
}

@media only screen and (max-width: 600px) {
    .game {
        margin-top: 200px;
    }

    .message {
        margin-left: 2rem;
        margin-right: 2rem;
    }
}
