* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif;
}
body { background-color: #f5f5f5; padding: 10px; min-height: 100vh;
}
.page-wrapper { display: flex; justify-content: center; align-items: flex-start; gap: 20px; max-width: 1400px; margin: 0 auto; position: relative;
}
.container { flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; max-width: 800px;
}
.game-title { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: bold; color: #8B4513; margin-bottom: 15px; text-align: center;
}
.game-wrapper { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; align-items: flex-start; width: 100%; max-width: 100%;
}
.board-container { background-color: #DEB887; border: 2px solid #8B4513; border-radius: 5px; padding: 10px; max-width: 100%; overflow: hidden; display: flex; 
    justify-content: center; align-items: center;
}
#gameCanvas {
    background-color: #DEB887; cursor: crosshair; max-width: 100%; height: auto; touch-action: none;
}
.info-panel { background-color: white; border-radius: 8px; padding: 20px; min-width: 280px; width: 100%; max-width: 400px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    overflow: visible; height: auto; display: block;
}
.info-title { font-size: clamp(1rem, 3vw, 1.25rem); font-weight: bold; color: #333; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #DEB887; 
    display: block;
}
.info-item { margin-bottom: 15px; display: flex; align-items: center; width: 100%; flex-wrap: nowrap;
}
.info-label { font-weight: bold; color: #555; min-width: 90px; margin-right: 10px;
}
.player-indicator { width: 20px; height: 20px; border-radius: 50%; margin-right: 10px; flex-shrink: 0;
}
.player-black { background-color: black;
}
.player-white { background-color: white; border: 1px solid #ccc;
}
.status-text { font-weight: bold; color: #8B4513; margin: 20px 0; padding: 12px; background-color: #f8f0e3; border-radius: 5px; text-align: center; font-size: 
    clamp(0.9rem, 2vw, 1rem); width: 100%; display: block;
}
.rules-title { font-size: clamp(0.9rem, 2vw, 1rem); font-weight: bold; margin: 20px 0 10px 0; color: #333; display: block;
}
.rules-list { padding-left: 20px; color: #666; line-height: 1.8; font-size: clamp(0.8rem, 2vw, 0.9rem); margin-bottom: 20px; width: 100%;
}
.controls { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; width: 100%;
}
.control-btn { background-color: #8B5A2B; color: white; border: none; padding: 10px 18px; border-radius: 5px; cursor: pointer; font-size: clamp(0.8rem, 2vw, 0.9rem); 
    transition: background-color 0.2s; flex: 1; min-width: 110px;
}
.control-btn:hover { background-color: #6b421e;
}
.control-btn:disabled { background-color: #ccc; cursor: not-allowed; opacity: 0.8;
}
.ai-mode { margin: 20px 0; display: flex; align-items: center; font-size: clamp(0.9rem, 2vw, 1rem); width: 100%;
}
.scale-controls { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%;
}
.scale-btn { padding: 8px 12px; font-size: 12px; flex: none; min-width: 70px;
}
#scaleSlider {
    flex: 1; min-width: 120px;
}
.timer { font-family: monospace; font-size: clamp(0.9rem, 2vw, 1rem); color: #8B4513; flex-shrink: 0;
}
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; 
    z-index: 1000; padding: 20px;
}
.modal-content { background-color: white; padding: 30px; border-radius: 10px; text-align: center; width: 100%; max-width: 350px;
}
.modal-title { font-size: clamp(1.2rem, 4vw, 1.5rem); font-weight: bold; margin-bottom: 20px; color: #8B4513;
}
.modal-btn { background-color: #8B5A2B; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-size: clamp(0.9rem, 2vw, 1rem); 
    margin-top: 20px; width: 100%; max-width: 200px;
}
.hidden { display: none;
}
.scoreboard-section { margin-top: 25px; width: 100%; display: block;
}
.scoreboard-title { font-size: clamp(0.9rem, 2vw, 1rem); font-weight: bold; color: #8B4513; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 1px solid 
    #DEB887;
    display: block;
}
.scoreboard-table { width: 100%; border-collapse: collapse; font-size: clamp(0.8rem, 2vw, 0.9rem); margin-bottom: 10px;
}
.scoreboard-table th { background-color: #f8f0e3; color: #8B4513; padding: 10px; text-align: left; border-bottom: 2px solid #DEB887;
}
.scoreboard-table td { padding: 10px; border-bottom: 1px solid #f0e6d2;
}
.scoreboard-table tr:hover { background-color: #faf6ed;
}
.score-rank { font-weight: bold; color: #8B5A2B; width: 40px; text-align: center;
}
.score-value { font-weight: bold; color: #d2691e; text-align: right;
}
.score-date { font-size: 0.8em; color: #888;
}
#usernameModal .modal-content {
    max-width: 320px;
}
#usernameInput {
    width: 100%; padding: 10px; margin: 15px 0; border: 1px solid #DEB887; border-radius: 5px; font-size: 1rem;
}
.score-info { font-size: 1.1em; color: #d2691e; margin: 10px 0; font-weight: bold;
}
/* 响应式适配 */ @media (max-width: 992px) { .page-wrapper { justify-content: center;
    }
}
@media (max-width: 768px) { .game-wrapper { flex-direction: column; align-items: center; gap: 20px; padding: 5px;
    }
    
    .info-panel { width: 100%; max-width: 100%; padding: 20px 15px; margin: 0 auto;
    }
    
    .board-container { padding: 10px; margin: 0 auto;
    }
    
    body { padding: 10px 5px;
    }
    
    .control-btn { min-width: 100px; padding: 10px 15px;
    }
    
    .game-title { font-size: 1.6rem;
    }
    
    .info-item { flex-wrap: wrap; margin-bottom: 12px;
    }
    
    .info-label { min-width: 80px; margin-bottom: 5px;
    }
}
@media (max-width: 480px) { .game-title { font-size: 1.4rem; margin-bottom: 10px;
    }
    
    .info-panel { padding: 15px;
    }
    
    .modal-content { padding: 20px 15px;
    }
    
    .controls { gap: 8px;
    }
    
    .control-btn { min-width: 90px; padding: 8px 12px; font-size: 0.85rem;
    }
    
    .scoreboard-table th, .scoreboard-table td { padding: 8px 5px; font-size: 0.8rem;
    }
}
