* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #000;
    font-family: 'Microsoft YaHei', sans-serif;
}

#container {
    width: 100vw;
    height: 100vh;
}

#input_video {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 10px;
    border: 2px solid rgba(100, 180, 255, 0.5);
    opacity: 0.7;
    transform: scaleX(-1);
    z-index: 100;
}

/* 全屏闪光 */
#flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(100,200,255,0.8) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.1s;
}

#flash.active {
    opacity: 1;
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* 冲击波 */
#shockwave {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 3px solid rgba(255, 100, 50, 0.8);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    z-index: 51;
}

#shockwave.explode {
    animation: shockwave-explode 0.8s ease-out;
}

#shockwave.converge {
    animation: shockwave-converge 0.6s ease-out;
}

@keyframes shockwave-explode {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; border-color: rgba(255, 150, 50, 1); }
    100% { transform: translate(-50%, -50%) scale(100); opacity: 0; border-color: rgba(255, 50, 0, 0); }
}

@keyframes shockwave-converge {
    0% { transform: translate(-50%, -50%) scale(100); opacity: 0; border-color: rgba(50, 150, 255, 0); }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; border-color: rgba(100, 200, 255, 1); }
}

/* UI */
#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: #8cf;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 3px solid rgba(100, 180, 255, 0.2);
    border-top-color: #4af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading p {
    font-size: 20px;
    color: #4af;
    text-shadow: 0 0 20px #08f;
}

/* 手势指示器 */
#gesture-indicator {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

#gesture-indicator.show {
    opacity: 1;
}

#gesture-icon {
    font-size: 48px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#gesture-text {
    margin-top: 10px;
    font-size: 18px;
    text-shadow: 0 0 10px currentColor;
}

/* 能量环 */
#power-container {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 80px;
    height: 80px;
    opacity: 0;
    transition: opacity 0.3s;
}

#power-container.show {
    opacity: 1;
}

#power-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

#power-ring .bg {
    fill: none;
    stroke: rgba(100, 180, 255, 0.2);
    stroke-width: 6;
}

#power-ring .progress {
    fill: none;
    stroke: url(#powerGradient);
    stroke: #4af;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    filter: drop-shadow(0 0 5px #08f);
    transition: stroke-dashoffset 0.1s;
}

#power-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    text-shadow: 0 0 10px #08f;
}

/* 连击计数器 */
#combo-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: bold;
    color: transparent;
    text-shadow: none;
    pointer-events: none;
}

#combo-counter.show {
    animation: combo-pop 0.5s ease-out;
}

@keyframes combo-pop {
    0% { 
        transform: translate(-50%, -50%) scale(0.5); 
        opacity: 1;
        color: #fff;
        text-shadow: 0 0 30px #f80, 0 0 60px #f40;
    }
    100% { 
        transform: translate(-50%, -50%) scale(2); 
        opacity: 0;
        color: #f80;
    }
}

/* 屏幕震动 */
body.shake {
    animation: shake 0.3s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px) rotate(-1deg); }
    40% { transform: translateX(10px) rotate(1deg); }
    60% { transform: translateX(-5px) rotate(-0.5deg); }
    80% { transform: translateX(5px) rotate(0.5deg); }
}

body.shake-strong {
    animation: shake-strong 0.5s ease-out;
}

@keyframes shake-strong {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-15px, -10px) rotate(-2deg); }
    20% { transform: translate(15px, 10px) rotate(2deg); }
    30% { transform: translate(-10px, 5px) rotate(-1deg); }
    40% { transform: translate(10px, -5px) rotate(1deg); }
    50% { transform: translate(-5px, 10px) rotate(-0.5deg); }
    60% { transform: translate(5px, -10px) rotate(0.5deg); }
}

/* 操作说明 */
#instructions {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid rgba(100, 180, 255, 0.3);
    border-radius: 15px;
    padding: 20px 25px;
    backdrop-filter: blur(10px);
    max-width: 320px;
    box-shadow: 0 0 30px rgba(0, 100, 200, 0.2);
}

#instructions h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #8cf;
    text-shadow: 0 0 10px #08f;
    border-bottom: 1px solid rgba(100, 180, 255, 0.3);
    padding-bottom: 10px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.instruction-item .icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.instruction-item .text strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 2px;
}

.instruction-item .text p {
    margin: 0;
    font-size: 12px;
    color: #8ab;
    line-height: 1.4;
}

#instructions .tip {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(100, 180, 255, 0.2);
    font-size: 11px;
    color: #6a8;
}

/* 响应式 - 小屏幕隐藏说明 */
@media (max-width: 768px) {
    #instructions {
        display: none;
    }
    
    #input_video {
        width: 100px;
        height: 75px;
    }
}