* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror the video */
    z-index: 1;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

#score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#score {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
}

#score-display .label {
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0.8;
}

#combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b35;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: comboPulse 0.3s ease-out;
}

#combo-display.hidden {
    display: none;
}

#combo {
    font-size: 72px;
    font-weight: bold;
}

#combo-display .label {
    font-size: 24px;
    letter-spacing: 4px;
}

@keyframes comboPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#lives-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 64px;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
    color: #fff;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 64px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    background: linear-gradient(45deg, #ff6b35, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen .subtitle {
    font-size: 24px;
    margin-bottom: 40px;
    opacity: 0.8;
}

#camera-status {
    margin-bottom: 30px;
    font-size: 18px;
}

#camera-status .loading {
    color: #ffd700;
    animation: pulse 1.5s infinite;
}

#camera-status .ready {
    color: #4caf50;
}

#camera-status .error {
    color: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.screen button {
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #ff6b35, #ff8c42);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.screen button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.5);
}

.screen button:active {
    transform: scale(0.98);
}

.screen button.hidden {
    display: none;
}

.instructions {
    margin-top: 40px;
    text-align: center;
    opacity: 0.7;
}

.instructions p {
    margin: 10px 0;
    font-size: 16px;
}

.final-score {
    font-size: 36px;
    margin: 20px 0;
}

.final-score span {
    color: #ffd700;
    font-weight: bold;
}

.best-score {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.7;
}

.best-score span {
    color: #4caf50;
}

/* Slice trail effect */
.slice-trail {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

/* Hover progress indicator for buttons */
.hover-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.hover-progress.active {
    opacity: 1;
}

.hover-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hover-progress circle {
    fill: none;
    stroke-width: 8;
    cx: 50;
    cy: 50;
    r: 45;
}

.hover-progress .bg {
    stroke: rgba(255, 255, 255, 0.3);
}

.hover-progress .progress {
    stroke: #4caf50;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s;
}
