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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.settings-panel {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}

#modeSelectionPanel {
    display: block;
}

#singleSettingsPanel,
#twoPlayerSettingsPanel,
#gamePanel {
    display: none;
}

.home-btn-container {
    position: fixed;
    top: 20px;
    right: 20px;
}

.home-btn {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    transition: all 0.3s;
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.setting-item {
    margin-bottom: 25px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.setting-item input[type="number"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.setting-item input[type="number"]:focus {
    border-color: #667eea;
}

.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-label span {
    font-size: 16px;
    color: #333;
}

.start-btn {
    width: 100%;
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    margin-top: 10px;
}

.back-btn-container {
    margin-bottom: 20px;
}

.back-btn {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.4);
}

.game-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.game-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.current-player {
    text-align: center;
    margin-bottom: 30px;
    font-size: 20px;
}

.player-label {
    color: #666;
}

.player-name {
    font-weight: bold;
    color: #e74c3c;
    transition: color 0.3s;
}

.player-name.player {
    color: #e74c3c;
}

.player-name.computer {
    color: #3498db;
}

.player-name.player1 {
    color: #e74c3c;
}

.player-name.player2 {
    color: #9b59b6;
}

.buttons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.button-item {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    border: 3px solid #fff;
}

.button-item:hover:not(.pressed) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6);
}

.button-item.pressed {
    background: linear-gradient(145deg, #ccc, #999);
    cursor: not-allowed;
    transform: scale(0.95);
    box-shadow: none;
}

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

.action-btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.action-btn:not(:disabled):hover {
    transform: translateY(-3px);
}

#press1Btn:not(:disabled) {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

#press2Btn:not(:disabled) {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

#press3Btn:not(:disabled) {
    background: linear-gradient(145deg, #e67e22, #d35400);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.action-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

.restart-btn {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    color: white;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.game-status {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    min-height: 50px;
}

.game-status.winner {
    background: linear-gradient(145deg, #f1c40f, #f39c12);
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.history-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.history-panel h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.history-panel ul {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

.history-panel li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #555;
}

.history-panel li:last-child {
    border-bottom: none;
}

.history-panel li span {
    font-weight: bold;
}

.history-panel li .player {
    color: #e74c3c;
}

.history-panel li .computer {
    color: #3498db;
}

.history-panel li .player1 {
    color: #e74c3c;
}

.history-panel li .player2 {
    color: #9b59b6;
}

.hidden {
    display: none;
}