body {
    overflow: hidden;
    margin: 0;
    font-family: sans-serif;
    color: white;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: url('../assets/jimeng-2025-07-06-4216-一张充满压迫感的游戏背景图。描绘龙王降临前的陈塘关。视角稍远，展现出关隘在狂暴大....jpeg');
    background-size: cover;
    background-position: center;
}

#info-display {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#info-display-top {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    text-align: right;
}

#skill-display p, #difficulty-display p {
    margin: 5px 0;
}

#game-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90%; /* 留出底部给海水 */
}

.word-column {
    position: absolute;
    height: 100%;
    width: 33.33%;
}

.word-column.col-1 { left: 0; }
.word-column.col-2 { left: 33.33%; }
.word-column.col-3 { left: 66.66%; }

.word {
    position: absolute;
    background-image: url('../assets/龙族边框.png');
    background-size: 100% 100%;
    padding: 25px 50px;
    font-size: 36px;
    text-align: center;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
}

.word .letter {
    display: inline-block;
}

.word .letter.correct {
    color: #4caf50; /* 绿色 */
}

#player {
    position: absolute;
    bottom: 1px;
    width: 150px;
    height: 225px;
    background-image: url('../assets/第一形态.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: left 0.2s ease-in-out;
}

#sea-level {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0; /* 初始高度为0 */
    background: linear-gradient(180deg, rgba(64, 164, 223, 0.6) 0%, rgba(30, 144, 255, 0.7) 100%);
    transition: height 0.5s ease-in-out;
    overflow: hidden;
}

/* 海水流动动画效果 - 第一层波浪 */
#sea-level::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    width: 200%;
    height: 50px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 20%, 
        transparent 40%, 
        rgba(255, 255, 255, 0.3) 60%, 
        transparent 80%, 
        rgba(255, 255, 255, 0.4) 100%);
    animation: wave-flow-1 3.5s ease-in-out infinite, wave-vertical-1 2.8s ease-in-out infinite;
    border-radius: 50% 50% 0 0;
}

/* 海水流动动画效果 - 第二层波浪 */
#sea-level::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 150%;
    height: 35px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 15%, 
        transparent 35%, 
        rgba(255, 255, 255, 0.25) 55%, 
        transparent 75%, 
        rgba(255, 255, 255, 0.3) 95%, 
        transparent 100%);
    animation: wave-flow-2 4.2s ease-in-out infinite reverse, wave-vertical-2 3.1s ease-in-out infinite;
    border-radius: 60% 40% 0 0;
}

/* 水平波浪动画 - 第一层 */
@keyframes wave-flow-1 {
    0% {
        transform: translateX(-60%) scaleX(1);
    }
    25% {
        transform: translateX(-45%) scaleX(1.1);
    }
    50% {
        transform: translateX(-30%) scaleX(0.9);
    }
    75% {
        transform: translateX(-15%) scaleX(1.05);
    }
    100% {
        transform: translateX(0%) scaleX(1);
    }
}

/* 水平波浪动画 - 第二层 */
@keyframes wave-flow-2 {
    0% {
        transform: translateX(-40%) scaleX(0.9);
    }
    30% {
        transform: translateX(-25%) scaleX(1.1);
    }
    60% {
        transform: translateX(-10%) scaleX(0.95);
    }
    85% {
        transform: translateX(5%) scaleX(1.05);
    }
    100% {
        transform: translateX(20%) scaleX(0.9);
    }
}

/* 垂直波动动画 - 第一层 */
@keyframes wave-vertical-1 {
    0% {
        top: -25px;
        opacity: 0.8;
    }
    25% {
        top: -30px;
        opacity: 1;
    }
    50% {
        top: -20px;
        opacity: 0.9;
    }
    75% {
        top: -28px;
        opacity: 0.85;
    }
    100% {
        top: -25px;
        opacity: 0.8;
    }
}

/* 垂直波动动画 - 第二层 */
@keyframes wave-vertical-2 {
    0% {
        top: -15px;
        opacity: 0.7;
    }
    20% {
        top: -18px;
        opacity: 0.9;
    }
    45% {
        top: -12px;
        opacity: 0.75;
    }
    70% {
        top: -20px;
        opacity: 0.85;
    }
    100% {
        top: -15px;
        opacity: 0.7;
    }
}

.hidden {
    display: none !important;
}

#failure-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
}

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

#failure-content {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 15px;
    color: white;
    position: relative;
    z-index: 2;
}

#failure-content h1 {
    font-size: 48px;
    color: #ff4d4d;
    margin-bottom: 20px;
}

#failure-content p {
    font-size: 24px;
    margin-bottom: 20px;
}

#player-name-input {
    padding: 10px;
    font-size: 18px;
    border-radius: 5px;
    border: 2px solid #ccc;
    background-color: #333;
    color: white;
    text-align: center;
}

#player-name-input::placeholder {
    color: #888;
}

#submit-score-button {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 20px;
    color: white;
    background-color: #c0392b;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#submit-score-button:hover {
    background-color: #e74c3c;
}

#submit-score-button:disabled {
    background-color: #5a6268;
    cursor: not-allowed;
}

#back-to-home-button {
    margin-top: 15px;
    padding: 12px 25px;
    font-size: 20px;
    color: white;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    width: 100%;
}

#back-to-home-button:hover {
    background-color: #2980b9;
}

.weapon {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 5; /* Ensure weapons are above most elements */
}

.weapon.huojianqiang {
    width: 80px;
    height: 80px;
    background-image: url('../assets/火尖枪.png');
}

.weapon.qingtianjian {
    width: 100px;
    height: 150px;
    background-image: url('../assets/青天剑.png');
}

.weapon.shenyuanzhu {
    width: 80px;
    height: 80px;
    background-image: url('../assets/神元珠.png');
    z-index: 10; /* Ultimate skill should be on top */
} 