* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px 0;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 20px;
}

.video-container {
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    padding-top: 56.25%; /* 16:9 宽高比 */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.items-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.item-slot {
    aspect-ratio: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: grab;
    touch-action: none;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

/* 锁定状态样式 */
.item-slot.locked {
    cursor: default;
    pointer-events: none;
}

.item-slot.locked:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.item-slot.locked .item {
    opacity: 0.95;
}

.item-slot:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.item-slot.dragging {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
    z-index: 1000;
}

.item-slot.highlight {
    background-color: #f8f9fa;
    box-shadow: 0 0 0 3px #4a90e2;
}

.item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 10px;
}

.item-content {
    font-size: 48px;
    margin-bottom: 12px;
    transform: translateZ(0);
}

.item-label {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    transform: translateZ(0);
}

.instructions {
    text-align: center;
    color: #666;
    font-size: 15px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.step-control {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-button {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    transform: translateZ(0);
    position: relative;
    z-index: 10;
}

.step-button:hover:not(:disabled) {
    background-color: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.step-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.step-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    opacity: 0.7;
}

.step-description {
    color: #444;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

@keyframes swapLeft {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(-5px, 0, 0) scale(1.03);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes swapRight {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(5px, 0, 0) scale(1.03);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.swapping-left {
    animation: swapLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.swapping-right {
    animation: swapRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

/* 完成后的杯子高亮效果 */
.cup-highlight {
    animation: cupGlow 2s ease-in-out infinite;
}

@keyframes cupGlow {
    0% {
        box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.6);
    }
    100% {
        box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    }
}

/* 干杯文字动画 */
.cheers-text {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #4a90e2;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.cheers-animation {
    animation: showCheers 2s ease-out forwards;
}

@keyframes showCheers {
    0% {
        opacity: 0;
        transform: translate(-50%, 0);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -20px);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -20px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -40px);
    }
}

/* 杯子弹跳动画 */
.cup-bounce {
    animation: cupBounce 0.5s cubic-bezier(0.36, 0, 0.66, -0.56) 3;
}

@keyframes cupBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 移动端优化 */
@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }

    .container {
        padding: 15px;
        gap: 20px;
    }
    
    .video-container {
        border-radius: 12px;
    }

    .game-container {
        gap: 15px;
    }
    
    .items-container {
        gap: 12px;
    }
    
    .item-content {
        font-size: 36px;
    }
    
    .item-label {
        font-size: 14px;
    }

    .step-button {
        padding: 12px 24px;
        font-size: 16px;
    }

    .step-description {
        font-size: 14px;
    }
}

/* 桌面端优化 */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
        gap: 40px;
        padding: 30px;
    }

    .video-container {
        max-width: 800px;
        margin: 0 auto;
    }

    .game-container {
        max-width: 800px;
        margin: 0 auto;
        gap: 25px;
    }

    .items-container {
        gap: 30px;
    }

    .item-slot {
        border-radius: 20px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .item-slot:not(.locked):hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .item {
        padding: 15px;
    }

    .item-content {
        font-size: 56px;
        margin-bottom: 15px;
        transition: transform 0.3s ease;
    }

    .item-slot:not(.locked):hover .item-content {
        transform: scale(1.1);
    }

    .item-label {
        font-size: 18px;
    }

    .instructions {
        font-size: 16px;
        padding: 20px;
        border-radius: 15px;
        max-width: 600px;
        margin: 0 auto;
    }

    .step-control {
        padding: 25px;
        border-radius: 15px;
        max-width: 600px;
        margin: 0 auto;
    }

    .step-button {
        padding: 18px 36px;
        font-size: 20px;
        border-radius: 12px;
        max-width: 300px;
        margin: 0 auto;
    }

    .step-button:not(:disabled):hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
    }

    .step-description {
        font-size: 16px;
    }

    /* 高亮效果优化 */
    .item-slot.highlight {
        box-shadow: 0 0 0 3px #4a90e2, 0 8px 25px rgba(74, 144, 226, 0.2);
        background-color: #f8f9fa;
    }

    /* 拖动效果优化 */
    .item-slot.dragging {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    }

    /* 完成效果优化 */
    .cup-highlight {
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.4);
    }

    /* 动画效果优化 */
    .swapping-left, .swapping-right {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* 干杯文字效果优化 */
    .cheers-text {
        font-size: 16px;
        padding: 10px 20px;
        border-radius: 25px;
    }
} 