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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    max-width: 700px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: #e94560;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.subtitle {
    color: #a0a0a0;
    font-size: 0.9em;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-name {
    color: #fff;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.sp-display {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sp-label {
    color: #ffd700;
    font-size: 0.9em;
}

.sp-value {
    color: #ffd700;
    font-size: 1.3em;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.sp-value.animating {
    animation: spBounce 0.3s ease-out;
}

@keyframes spBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); color: #ff6b6b; }
}

.turn-indicator {
    color: #4ecca3;
    font-size: 1.2em;
    font-weight: bold;
    padding: 8px 20px;
    background: rgba(78, 204, 163, 0.2);
    border-radius: 20px;
    border: 2px solid #4ecca3;
}

.turn-indicator.computer {
    color: #e94560;
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
}

.timer-container {
    position: relative;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    display: none;
}

.timer-container.active {
    display: block;
}

.timer-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ecca3, #45b7d1);
    width: 100%;
    transition: width 1s linear;
    border-radius: 15px;
}

.timer-bar.warning {
    background: linear-gradient(90deg, #ff6b6b, #e94560);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
}

.timer-text.warning {
    color: #ff6b6b;
    animation: timerTextPulse 0.5s ease-in-out infinite;
}

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

.board-container {
    position: relative;
    margin: 0 auto 20px;
    width: fit-content;
}

#game-board {
    display: block;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: crosshair;
}

#game-board.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.animation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.skills-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.skill-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #4ecca3;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.skill-btn:hover:not(.disabled):not(.used) {
    background: rgba(78, 204, 163, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 204, 163, 0.3);
}

.skill-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.skill-btn.used {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #333;
    position: relative;
}

.skill-btn.used::after {
    content: '已用';
    position: absolute;
    color: #ff6b6b;
    font-size: 0.7em;
    bottom: 2px;
}

.skill-name {
    color: #fff;
    font-size: 0.85em;
    margin-bottom: 3px;
}

.skill-cost {
    color: #ffd700;
    font-size: 0.75em;
}

.skill-once {
    color: #ff6b6b;
    font-size: 0.65em;
}

.control-panel {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #4ecca3, #45b7d1);
    border: none;
    border-radius: 25px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 204, 163, 0.4);
}

.message-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    border: 2px solid #4ecca3;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.message-box.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.message-content {
    font-size: 1.1em;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px 40px;
    border-radius: 15px;
    border: 2px solid #4ecca3;
    text-align: center;
    min-width: 300px;
}

.modal-content h2 {
    color: #4ecca3;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #fff;
}

.setting-item select {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #4ecca3;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
}

.setting-item select option {
    background: #1a1a2e;
    color: #fff;
}

.about-text {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.about-author {
    color: #a0a0a0;
    margin-bottom: 20px;
}

.modal-close-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #4ecca3, #45b7d1);
    border: none;
    border-radius: 20px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    transform: scale(1.05);
}

#victory-title {
    font-size: 1.8em;
}

#victory-message {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* Animation elements */
.wind-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #a0a0a0;
    border-radius: 50%;
    pointer-events: none;
}

.water-ripple {
    position: absolute;
    border: 2px solid #4ecca3;
    border-radius: 50%;
    animation: ripple 1s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.falling-stone {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    pointer-events: none;
    animation: fallDown 0.8s ease-in forwards;
}

@keyframes fallDown {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(500px);
        opacity: 0;
    }
}

.dizzy-man {
    position: absolute;
    font-size: 60px;
    animation: dizzy 0.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dizzy {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.rewind-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    animation: rewindFade 1s ease-out forwards;
}

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

.sp-popup {
    position: absolute;
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2em;
    pointer-events: none;
    animation: spPopup 0.8s ease-out forwards;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

@keyframes spPopup {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.hand-slap {
    position: absolute;
    font-size: 80px;
    animation: slap 0.5s ease-out;
    pointer-events: none;
}

@keyframes slap {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(0) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(20px) scale(1);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 650px) {
    #game-board {
        width: 350px !important;
        height: 350px !important;
    }

    .skills-panel {
        gap: 5px;
    }

    .skill-btn {
        padding: 8px 10px;
        min-width: 70px;
    }

    .skill-name {
        font-size: 0.75em;
    }

    .control-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}
