/* 德州扑克游戏样式 */

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a5f3f 0%, #2d4a22 50%, #1a3d2e 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 游戏头部 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-header h1 {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-header h1 i {
    color: #ffd700;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 30px;
}

.pot-size {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #ffd700;
}

.new-game-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* 旧的游戏桌面样式 - 已废弃 */
.poker-table-old {
    flex: 1;
    display: grid;
    grid-template-areas: 
        "opponents opponents opponents"
        "community community community"
        "player player player";
    grid-template-rows: 1fr auto 1fr;
    gap: 30px;
    padding: 20px;
    background: 
        radial-gradient(ellipse 800px 400px at center, rgba(34, 139, 34, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-radius: 20px;
    border: 3px solid #2d5530;
    position: relative;
    min-height: 600px;
}

.poker-table::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
}

/* 对手区域 */
.opponents-area {
    grid-area: opponents;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 20px;
}

.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.opponent.active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.player-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.player-chips {
    color: #4CAF50;
    font-weight: 500;
}

.player-status {
    font-size: 0.9rem;
    color: #ffd700;
    font-weight: 500;
    min-height: 20px;
}

.player-status.folded {
    color: #f44336;
}

.player-status.active {
    color: #ffd700;
    animation: pulse 1.5s infinite;
}

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

.player-cards {
    display: flex;
    gap: 10px;
}

.player-bet {
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #ffd700;
    color: #ffd700;
    font-weight: 600;
}

/* 公共牌区域 */
.community-cards {
    grid-area: community;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.community-cards h3 {
    font-size: 1.3rem;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cards-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 扑克牌样式 */
.card {
    width: 70px;
    height: 100px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card.red {
    color: #d32f2f;
}

.card.black {
    color: #333;
}

.card-back {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: white;
    border-color: #1a237e;
}

.card-back::after {
    content: '🂠';
    font-size: 2rem;
}

.card-placeholder {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    color: transparent;
}

/* 玩家区域 */
.player-area {
    grid-area: player;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.hand-rank {
    color: #4CAF50;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    min-height: 25px;
}

/* 操作区域 */
.action-section {
    text-align: center;
    margin-top: 20px;
}

.action-title {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.action-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.fold-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

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

.check-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

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

.call-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

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

.raise-btn {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

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

/* 加注输入 */
.raise-input {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
}

.raise-input input {
    padding: 10px 15px;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    width: 150px;
}

.raise-input input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.raise-input button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.raise-input button:first-of-type {
    background: #4CAF50;
    color: white;
}

.raise-input button:last-of-type {
    background: #f44336;
    color: white;
}

.raise-input button:hover {
    transform: translateY(-2px);
}

/* 游戏状态 */
.game-status {
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.game-status p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ffd700;
    margin-bottom: 10px;
}

.game-tips {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-tips small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* 游戏结果弹窗 */
.game-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, #2d4a22, #1a3d2e);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    border: 2px solid #ffd700;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #ffd700;
    font-size: 2rem;
    margin-bottom: 20px;
}

.modal-content div {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: white;
}

.modal-content button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .opponents-area {
        flex-direction: column;
        align-items: center;
    }
    
    .opponent {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .poker-table {
        grid-template-areas: 
            "opponents"
            "community"
            "player";
        grid-template-rows: auto auto auto;
        gap: 20px;
        padding: 15px;
        min-height: auto;
    }
    
    .opponents-area {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .opponent {
        min-width: 120px;
        padding: 15px;
    }
    
    .cards-container {
        gap: 10px;
    }
    
    .card {
        width: 60px;
        height: 85px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        min-width: 200px;
    }
    
    .raise-input {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* 房间信息显示 */
.room-info {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #4CAF50;
    backdrop-filter: blur(10px);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.room-header h3 {
    color: #4CAF50;
    font-size: 1.3rem;
    margin: 0;
}

.room-players {
    color: #ffd700;
    font-weight: 600;
}

.room-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.room-start-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.room-start-btn:disabled {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.leave-room-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.leave-room-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.room-players-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.room-player {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.room-player.human {
    border-color: #4CAF50;
}

.room-player.ai {
    border-color: #FF9800;
}

.room-player.empty {
    border-color: rgba(255, 255, 255, 0.3);
    border-style: dashed;
}

.room-player-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.room-player.human .room-player-name {
    color: #4CAF50;
}

.room-player.ai .room-player-name {
    color: #FF9800;
}

.room-player.empty .room-player-name {
    color: rgba(255, 255, 255, 0.5);
}

/* 当前玩家高亮 */
.room-player.current-player {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.room-player.current-player .room-player-name::after {
    content: " ✨";
}

/* 离线玩家样式 */
.room-player.offline {
    opacity: 0.6;
    border-color: #666 !important;
    background: rgba(100, 100, 100, 0.1) !important;
}

.room-player.offline .room-player-name {
    color: #888 !important;
}

.room-player-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 游戏状态在房间模式下的样式调整 */
.room-mode .poker-table {
    grid-template-areas: 
        "opp1 opp2 opp3"
        "community community community"
        "opp4 player opp5";
    grid-template-columns: 1fr 2fr 1fr;
}

.room-mode .opponents-area {
    display: contents;
}

.room-mode .opponent {
    min-width: 150px;
    padding: 15px;
}

.room-mode .opponent:nth-child(1) { grid-area: opp1; }
.room-mode .opponent:nth-child(2) { grid-area: opp2; }
.room-mode .opponent:nth-child(3) { grid-area: opp3; }
.room-mode .opponent:nth-child(4) { grid-area: opp4; }
.room-mode .opponent:nth-child(5) { grid-area: opp5; }

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.2rem;
    }
    
    .opponents-area {
        flex-direction: column;
    }
    
    .card {
        width: 50px;
        height: 70px;
        font-size: 0.8rem;
    }
    
    .action-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 150px;
    }
    
    .action-title {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        padding: 15px;
        gap: 10px;
    }
    
    .room-header {
        flex-direction: column;
        text-align: center;
    }
    
    .room-players-list {
        grid-template-columns: 1fr;
    }
    
    .room-mode .poker-table {
        grid-template-areas: 
            "opp1"
            "opp2"
            "opp3"
            "community"
            "opp4"
            "opp5"
            "player";
        grid-template-columns: 1fr;
    }
}