body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
}

/* Animated gradient background */
#animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background: linear-gradient(45deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #4facfe 75%, 
        #667eea 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
    filter: blur(0px);
    transition: filter 0.3s ease, animation-duration 0.3s ease;
}

#animated-background.combo-active {
    filter: blur(20px);
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Floating blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.blob:nth-child(1) {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.8), transparent);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.blob:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.6), transparent);
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.blob:nth-child(3) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.5), transparent);
    bottom: 10%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }
    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Header with title and links */
#game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

#game-title {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    margin: 0;
}

#header-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.header-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Camera container - centered */
#camera-container {
    position: relative;
    width: 80vw;
    max-width: 1200px;
    height: 70vh;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#camera-container.combo-glow {
    animation: cameraGlow 0.5s ease-out;
}

a {
    color: #00ffff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

a:hover {
    color: #ff00ff;
}

a:visited {
    color: #00ffff;
}

#game-canvas {
    display: none;
}

#background {
    display: none;
}

@keyframes cameraGlow {
    0% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }
    50% {
        border-color: var(--combo-color, #00ffff);
        box-shadow: 0 0 40px var(--combo-color, #00ffff), 0 20px 60px rgba(0, 0, 0, 0.5);
    }
    100% {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }
}

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

#hand-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#fruits-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.fruit {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    transition: transform 0.1s ease;
}

.fruit img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.fruit.sliced {
    animation: fruitSlice 0.5s ease-out forwards;
}

@keyframes fruitSlice {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.3) rotate(360deg);
        opacity: 0;
    }
}

#info-container {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 3px solid #39ff14;
    border-radius: 20px;
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    gap: 30px;
    z-index: 3;
}

#score-container, #lives-container {
    z-index: 3;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}

#combo-container {
    z-index: 3;
    animation: comboPulse 0.5s ease-in-out infinite;
}

.combo-meter {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 15px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

#combo-text {
    font-size: 24px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#score-container span, #lives-container span {
    color: #39ff14;
    font-size: 28px;
    text-shadow: 0 0 10px #39ff14;
}

#score-container.score-bump {
    animation: scoreBump 0.3s ease-out;
}

@keyframes scoreBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes borderPulse {
    0% { 
        transform: scale(1);
        border-width: 3px;
    }
    50% { 
        transform: scale(1.05);
        border-width: 5px;
    }
    100% { 
        transform: scale(1);
        border-width: 3px;
    }
}

/* Modern start screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(20px);
    z-index: 4;
    color: #fff;
    padding: 20px;
    box-sizing: border-box;
}

.title-container {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

#start-screen h1 {
    font-size: 4rem;
    font-weight: 900;
    margin: 0 0 15px 0;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #ff00ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite, pulse 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.subtitle {
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instructions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.instruction-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.instruction-item .icon {
    font-size: 2rem;
}

.instruction-item p {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#start-button {
    margin-top: 20px;
    padding: 18px 50px;
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 0, 255, 0.4);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

#start-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 0, 255, 0.6);
}

/* Modern game over screen */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(118, 75, 162, 0.95) 0%, rgba(102, 126, 234, 0.95) 100%);
    backdrop-filter: blur(20px);
    z-index: 4;
    color: #fff;
    padding: 20px;
    box-sizing: border-box;
}

#game-over h1 {
    font-size: 4rem;
    font-weight: 900;
    margin: 0 0 30px 0;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    animation: shake 0.5s ease-in-out;
}

.score-display {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px 60px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    text-align: center;
}

.score-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 10px 0;
}

.score-value {
    font-size: 4rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(45deg, #ffff00, #ff00ff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 0, 0.5);
}

#restart-button {
    padding: 18px 50px;
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff0080, #ff8000);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 0, 128, 0.4);
    margin-bottom: 20px;
}

#restart-button:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 0, 128, 0.6);
}

.connect-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 10px 0 0 0;
}

#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 5;
    color: #fff;
}

.loading-content {
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0 0 15px 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#loading p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.blade-trail {
    position: absolute;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
    height: 6px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 3;
    opacity: 1;
    filter: blur(1px);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-5px, -5px) rotate(-2deg); }
    20% { transform: translate(5px, 5px) rotate(2deg); }
    30% { transform: translate(-5px, 5px) rotate(-2deg); }
    40% { transform: translate(5px, -5px) rotate(2deg); }
    50% { transform: translate(-5px, -5px) rotate(-2deg); }
    60% { transform: translate(5px, 5px) rotate(2deg); }
    70% { transform: translate(-5px, 5px) rotate(-2deg); }
    80% { transform: translate(5px, -5px) rotate(2deg); }
    90% { transform: translate(-5px, -5px) rotate(-2deg); }
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Screen shake animation */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 2px); }
    20% { transform: translate(5px, -2px); }
    30% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    50% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
    70% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    90% { transform: translate(-1px, 0px); }
}

/* Camera shake for video */
@keyframes cameraShake {
    0%, 100% { transform: scaleX(-1) translate(0, 0); }
    10% { transform: scaleX(-1) translate(-3px, 2px); }
    20% { transform: scaleX(-1) translate(3px, -2px); }
    30% { transform: scaleX(-1) translate(-2px, 2px); }
    40% { transform: scaleX(-1) translate(2px, -2px); }
    50% { transform: scaleX(-1) translate(-1px, 1px); }
    60% { transform: scaleX(-1) translate(1px, -1px); }
    70% { transform: scaleX(-1) translate(-1px, 0px); }
    80% { transform: scaleX(-1) translate(1px, 0px); }
    90% { transform: scaleX(-1) translate(0px, 1px); }
}

/* Medium shake for 5+ combo */
@keyframes screenShakeMedium {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-8px, 4px) rotate(-1deg); }
    20% { transform: translate(8px, -4px) rotate(1deg); }
    30% { transform: translate(-6px, 6px) rotate(-1deg); }
    40% { transform: translate(6px, -6px) rotate(1deg); }
    50% { transform: translate(-4px, 4px) rotate(-0.5deg); }
    60% { transform: translate(4px, -4px) rotate(0.5deg); }
    70% { transform: translate(-2px, 2px) rotate(-0.5deg); }
    80% { transform: translate(2px, -2px) rotate(0.5deg); }
}

@keyframes cameraShakeMedium {
    0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(0deg); }
    10% { transform: scaleX(-1) translate(-6px, 3px) rotate(-1deg); }
    20% { transform: scaleX(-1) translate(6px, -3px) rotate(1deg); }
    30% { transform: scaleX(-1) translate(-4px, 4px) rotate(-0.5deg); }
    40% { transform: scaleX(-1) translate(4px, -4px) rotate(0.5deg); }
    50% { transform: scaleX(-1) translate(-3px, 3px) rotate(-0.5deg); }
    60% { transform: scaleX(-1) translate(3px, -3px) rotate(0.5deg); }
    70% { transform: scaleX(-1) translate(-2px, 2px) rotate(0deg); }
    80% { transform: scaleX(-1) translate(2px, -2px) rotate(0deg); }
}

/* Heavy shake for 7+ combo */
@keyframes screenShakeHeavy {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    5% { transform: translate(-12px, 8px) rotate(-2deg); }
    10% { transform: translate(12px, -8px) rotate(2deg); }
    15% { transform: translate(-10px, 10px) rotate(-2deg); }
    20% { transform: translate(10px, -10px) rotate(2deg); }
    25% { transform: translate(-8px, 8px) rotate(-1deg); }
    30% { transform: translate(8px, -8px) rotate(1deg); }
    35% { transform: translate(-6px, 6px) rotate(-1deg); }
    40% { transform: translate(6px, -6px) rotate(1deg); }
    50% { transform: translate(-4px, 4px) rotate(-0.5deg); }
    60% { transform: translate(4px, -4px) rotate(0.5deg); }
    70% { transform: translate(-2px, 2px) rotate(0deg); }
    80% { transform: translate(2px, -2px) rotate(0deg); }
}

@keyframes cameraShakeHeavy {
    0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(0deg); }
    5% { transform: scaleX(-1) translate(-10px, 6px) rotate(-2deg); }
    10% { transform: scaleX(-1) translate(10px, -6px) rotate(2deg); }
    15% { transform: scaleX(-1) translate(-8px, 8px) rotate(-1.5deg); }
    20% { transform: scaleX(-1) translate(8px, -8px) rotate(1.5deg); }
    25% { transform: scaleX(-1) translate(-6px, 6px) rotate(-1deg); }
    30% { transform: scaleX(-1) translate(6px, -6px) rotate(1deg); }
    40% { transform: scaleX(-1) translate(-4px, 4px) rotate(-0.5deg); }
    50% { transform: scaleX(-1) translate(4px, -4px) rotate(0.5deg); }
    60% { transform: scaleX(-1) translate(-3px, 3px) rotate(0deg); }
    70% { transform: scaleX(-1) translate(3px, -3px) rotate(0deg); }
}

/* Intense shake for 10+ combo */
@keyframes screenShakeIntense {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    5% { transform: translate(-15px, 12px) rotate(-3deg) scale(1.02); }
    10% { transform: translate(15px, -12px) rotate(3deg) scale(0.98); }
    15% { transform: translate(-12px, 15px) rotate(-3deg) scale(1.02); }
    20% { transform: translate(12px, -15px) rotate(3deg) scale(0.98); }
    25% { transform: translate(-10px, 10px) rotate(-2deg) scale(1.01); }
    30% { transform: translate(10px, -10px) rotate(2deg) scale(0.99); }
    35% { transform: translate(-8px, 8px) rotate(-2deg) scale(1.01); }
    40% { transform: translate(8px, -8px) rotate(2deg) scale(0.99); }
    45% { transform: translate(-6px, 6px) rotate(-1deg) scale(1); }
    50% { transform: translate(6px, -6px) rotate(1deg) scale(1); }
    60% { transform: translate(-4px, 4px) rotate(-0.5deg) scale(1); }
    70% { transform: translate(4px, -4px) rotate(0.5deg) scale(1); }
    80% { transform: translate(-2px, 2px) rotate(0deg) scale(1); }
    90% { transform: translate(2px, -2px) rotate(0deg) scale(1); }
}

@keyframes cameraShakeIntense {
    0%, 100% { transform: scaleX(-1) translate(0, 0) rotate(0deg) scale(1); }
    5% { transform: scaleX(-1) translate(-12px, 10px) rotate(-3deg) scale(1.03); }
    10% { transform: scaleX(-1) translate(12px, -10px) rotate(3deg) scale(0.97); }
    15% { transform: scaleX(-1) translate(-10px, 12px) rotate(-2.5deg) scale(1.02); }
    20% { transform: scaleX(-1) translate(10px, -12px) rotate(2.5deg) scale(0.98); }
    25% { transform: scaleX(-1) translate(-8px, 8px) rotate(-2deg) scale(1.01); }
    30% { transform: scaleX(-1) translate(8px, -8px) rotate(2deg) scale(0.99); }
    40% { transform: scaleX(-1) translate(-6px, 6px) rotate(-1deg) scale(1); }
    50% { transform: scaleX(-1) translate(6px, -6px) rotate(1deg) scale(1); }
    60% { transform: scaleX(-1) translate(-4px, 4px) rotate(-0.5deg) scale(1); }
    70% { transform: scaleX(-1) translate(4px, -4px) rotate(0.5deg) scale(1); }
    80% { transform: scaleX(-1) translate(-2px, 2px) rotate(0deg) scale(1); }
}

/* Screen border flash */
.screen-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: 10px solid;
    pointer-events: none;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    animation: borderPulseScreen 0.5s ease-out;
}

@keyframes borderPulseScreen {
    0% { border-width: 0px; }
    50% { border-width: 15px; }
    100% { border-width: 10px; }
}

/* Combo particles */
.combo-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: particleFloat 1.5s ease-out forwards;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translateY(-50px) scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0.5) rotate(720deg);
        opacity: 0;
    }
}

/* Slice effect */
.slice-effect {
    position: fixed;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 20%, 
        rgba(0, 255, 255, 1) 50%, 
        rgba(255, 255, 255, 0.8) 80%, 
        transparent 100%);
    pointer-events: none;
    z-index: 9997;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
    animation: sliceExpand 0.6s ease-out forwards;
}

@keyframes sliceExpand {
    0% {
        width: 0px;
        opacity: 1;
    }
    50% {
        width: 150px;
        opacity: 1;
    }
    100% {
        width: 200px;
        opacity: 0;
    }
}
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 2px); }
    20% { transform: translate(5px, -2px); }
    30% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    50% { transform: translate(-2px, 2px); }
    60% { transform: translate(2px, -2px); }
    70% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    90% { transform: translate(-1px, 0px); }
}

/* Flash effect */
.flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    opacity: 0.4;
    transition: opacity 0.3s ease-out;
    mix-blend-mode: screen;
}

/* Combo text animation */
.combo-text {
    position: fixed;
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #00ffff,
        0 0 30px #ffff00,
        0 0 40px #ff00ff,
        3px 3px 0 #000;
    z-index: 11;
    pointer-events: none;
    animation: comboFloat 1s ease-out forwards;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
}

@keyframes comboFloat {
    0% {
        transform: scale(0.3) translateY(0) rotate(-10deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.3) translateY(-20px) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-100px) rotate(0deg);
        opacity: 0;
    }
}

/* Responsive styling */
@media screen and (max-width: 768px) {
    #start-screen h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .instruction-item {
        padding: 12px 20px;
    }
    
    .instruction-item p {
        font-size: 1rem;
    }
    
    #start-button, #restart-button {
        font-size: 1.4rem;
        padding: 15px 40px;
    }
    
    #game-over h1 {
        font-size: 2.5rem;
    }
    
    .score-value {
        font-size: 3rem;
    }
    
    .combo-text {
        font-size: 2rem;
    }
    
    #info-container {
        gap: 15px;
        padding: 10px 20px;
    }
    
    #score-container, #lives-container {
        font-size: 16px;
    }
    
    #score-container span, #lives-container span {
        font-size: 22px;
    }
}

@media screen and (max-width: 480px) {
    #start-screen h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .instruction-item {
        padding: 10px 15px;
    }
    
    .instruction-item .icon {
        font-size: 1.5rem;
    }
    
    .instruction-item p {
        font-size: 0.9rem;
    }
    
    #start-button, #restart-button {
        font-size: 1.2rem;
        padding: 12px 30px;
    }
    
    #game-over h1 {
        font-size: 2rem;
    }
    
    .score-display {
        padding: 20px 40px;
    }
    
    .score-value {
        font-size: 2.5rem;
    }
    
    #info-container {
        gap: 10px;
        padding: 8px 15px;
        top: 10px;
        right: 10px;
    }
    
    #score-container, #lives-container {
        font-size: 14px;
    }
    
    #score-container span, #lives-container span {
        font-size: 20px;
    }
    
    .combo-text {
        font-size: 1.5rem;
    }
    
    #feedback-para {
        font-size: 12px;
        padding: 8px 12px;
        bottom: 10px;
        left: 10px;
    }
}


/* About Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: white;
    float: right;
    font-size: 35px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-modal:hover {
    transform: scale(1.2) rotate(90deg);
}

.about-container {
    padding: 20px 30px 30px;
    color: white;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.about-info h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    background: linear-gradient(45deg, #ffff00, #ff00ff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    margin: 0;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.about-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.about-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    color: #ffff00;
}

.about-section p {
    margin: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.about-section ul {
    margin: 10px 0;
    padding-left: 20px;
    line-height: 1.8;
}

.about-section li {
    color: rgba(255, 255, 255, 0.9);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.social-link.linkedin:hover {
    background: #0077b5;
    border-color: white;
}

.social-link.github:hover {
    background: #333;
    border-color: white;
}

.social-link span {
    font-size: 1.3rem;
}

/* Responsive modal */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .about-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-photo {
        width: 100px;
        height: 100px;
    }
    
    .about-info h2 {
        font-size: 1.5rem;
    }
    
    .about-container {
        padding: 15px 20px 20px;
    }
    
    .about-section {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .profile-photo {
        width: 80px;
        height: 80px;
    }
    
    .about-info h2 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .about-section h3 {
        font-size: 1.1rem;
    }
    
    .social-links {
        flex-direction: column;
    }
    
    .social-link {
        justify-content: center;
    }
}


/* Responsive header */
@media screen and (max-width: 768px) {
    #game-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    #game-title {
        font-size: 1.5rem;
    }
    
    #header-links {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-link {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    #camera-container {
        width: 95vw;
        height: 60vh;
        border-radius: 20px;
    }
    
    #info-container {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        gap: 15px;
    }
}

@media screen and (max-width: 480px) {
    #game-title {
        font-size: 1.2rem;
    }
    
    .header-link {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    #camera-container {
        width: 98vw;
        height: 55vh;
        border-radius: 15px;
    }
}
