/* 东方障行阵 - 步步为营 游戏样式 */

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

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

#game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 游戏标题 */
#game-header {
    text-align: center;
    width: 100%;
}

#game-header h1 {
    color: #e94560;
    font-size: 28px;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
    letter-spacing: 4px;
}

#turn-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
}

#current-player {
    font-weight: bold;
    color: #e94560;
}

#walls-count {
    color: #aaa;
}

/* 游戏主区域 */
#game-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 棋盘容器 */
#board-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#game-board {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

/* 点击检测层 - 关键：确保点击事件能正常传递 */
#click-layer {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    /* 不设置pointer-events: none，让它能接收点击 */
    cursor: pointer;
    z-index: 10;
}

/* 控制面板 */
#control-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.control-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: linear-gradient(145deg, #e94560, #c73e54);
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

.control-btn.secondary {
    background: linear-gradient(145deg, #3a3a5a, #2a2a4a);
    font-size: 13px;
}

/* 游戏状态提示 */
#game-status {
    width: 100%;
    min-height: 24px;
    text-align: center;
    color: #ffd700;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#game-status.show {
    opacity: 1;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    /* 确保弹窗关闭后完全不阻挡点击 */
    pointer-events: auto;
}

.modal.hidden {
    display: none;
    /* 双重保险：隐藏时完全不接收事件 */
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #e94560;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content .control-btn {
    padding: 12px 30px;
    font-size: 16px;
}

/* 响应式适配 */
@media (max-width: 400px) {
    #game-container {
        padding: 10px;
    }
    
    #game-header h1 {
        font-size: 24px;
    }
    
    .control-btn {
        padding: 10px 6px;
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}
