  /* Modern CSS Reset and Base Styles */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.screen.hidden {
    display: none;
}

.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 3em;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
}

.status {
    padding: 10px 20px;
    border-radius: 15px;
    margin: 20px 0;
    font-weight: bold;
}

.status.info {
    background: rgba(52, 152, 219, 0.3);
    border: 2px solid #3498db;
}

.status.success {
    background: rgba(46, 204, 113, 0.3);
    border: 2px solid #2ecc71;
}

.status.error {
    background: rgba(231, 76, 60, 0.3);
    border: 2px solid #e74c3c;
}

.status.warning {
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f1c40f;
}

/* Camera Setup */
.camera-setup {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

#videoCanvas {
    border-radius: 15px;
    border: 3px solid #667eea;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Game Screen */
#gameScreen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 0;
    justify-content: flex-start;
}

.game-hud {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    backdrop-filter: blur(10px);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
}

.hud-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.hud-value {
    font-size: 20px;
    font-weight: bold;
    color: #feca57;
}

.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    /* height: 90vh;  */

    width: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.mouth-avatar {
  position: absolute;
  width: 300px; /* Set width and height suitable to your PNG size */
  height: auto;
  z-index: 100;
  user-select: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease-out;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.mouth-avatar img {
  width: 100%;
  height: 100%;
  display: block;
}


@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.mouth-avatar.eating {
    transform: translate(-50%, -50%);
    animation: none;
}

.food-block {
    position: absolute;
    font-size: 32px;
    line-height: 1;
    z-index: 50;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation-name: rise;
    animation-timing-function: linear;
}

@keyframes rise {
    from {
        bottom: -60px;
        transform: rotate(0deg);
        opacity: 1;
    }
    to {
        bottom: 100%;
        transform: rotate(360deg);
        opacity: 0.7;
    }
}

.food-block.eaten {
    animation: eatEffect 0.5s ease-out forwards;
}

@keyframes eatEffect {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(2) rotate(180deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.score-popup {
    position: absolute;
    font-weight: bold;
    font-size: 24px;
    z-index: 150;
    pointer-events: none;
    animation: scorePopup 1.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-popup.positive {
    color: #2ecc71;
}

.score-popup.negative {
    color: #e74c3c;
}

@keyframes scorePopup {
    0% {
        transform: scale(0.5) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) translateY(-30px);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) translateY(-60px);
        opacity: 0;
    }
}

.calibration-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    backdrop-filter: blur(10px);
}

.face-detected {
    color: #2ecc71;
}

.face-not-detected {
    color: #e74c3c;
}

.calibration-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px dashed rgba(255, 255, 255, 0.5);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-align: center;
    z-index: 200;
}

.instructions-list {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.instructions-list h3 {
    color: #feca57;
    margin-bottom: 15px;
    text-align: center;
}

.instructions-list ul {
    list-style: none;
    padding: 0;
}

.instructions-list li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
}

.instructions-list li::before {
    content: "🎯";
    position: absolute;
    left: 0;
    top: 8px;
}

@media (max-width: 768px) {
    .mouth-avatar {
        font-size: 60px;
    }
    
    .food-block {
        font-size: 24px;
    }
    
    .game-hud {
        padding: 10px 15px;
        flex-wrap: wrap;
    }
    
    .hud-item {
        margin: 5px 10px;
    }
}