/* 斗地主游戏样式 */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
    position: relative;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.favorite-button:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button.favorited {
    background-color: #fff8e1;
    color: #f9a825;
}

.favorite-button.favorited:hover {
    background-color: #ffecb3;
    color: #f57f17;
}

/* 页面标题 */
.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0;
    text-align: center;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.page-title i {
    margin-right: 0;
    color: #2563eb;
    font-size: 26px;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .page-title {
        font-size: 20px;
    }
    
    .page-title i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .back-home-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

/* 游戏内容区域 */
.game-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 600px;
}

/* 房间选择界面 */
.room-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.room-options {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.room-card {
    width: 250px;
    padding: 40px 30px;
    background: #3b82f6;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.room-card:nth-child(2) {
    background: #ec4899;
}

.room-card:nth-child(2):hover {
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.4);
}

.room-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.room-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.room-card p {
    font-size: 14px;
    opacity: 0.9;
}

/* 加入房间表单 */
.join-room-form {
    margin-top: 30px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
}

.join-room-form h3 {
    margin-bottom: 20px;
    color: #1d1d1f;
}

.room-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.room-input {
    padding: 12px 20px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    width: 200px;
    text-align: center;
    letter-spacing: 8px;
}

.room-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-confirm {
    padding: 12px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-cancel {
    padding: 10px 20px;
    background: #e5e7eb;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #d1d5db;
}

/* 游戏房间 */
.game-room {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 房间信息 */
.room-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.room-label {
    font-size: 14px;
    color: #6b7280;
}

.room-id {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 4px;
}

.btn-copy, .btn-leave {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-copy {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-copy:hover {
    background: #bbdefb;
}

.btn-leave {
    margin-left: auto;
    background: #fee2e2;
    color: #dc2626;
}

.btn-leave:hover {
    background: #fecaca;
}

/* 游戏桌面 - 棕色桌布 */
.game-table {
    position: relative;
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.3), 0 4px 15px rgba(0,0,0,0.2);
}

/* 玩家位置 */
.player-position {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
}

.player-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.player-position.active .player-avatar {
    background: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 60px;
}

.player-name {
    font-size: 11px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
    text-align: center;
}

.player-card-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 6px;
    border-radius: 8px;
}

.player-top {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.player-left {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.player-right {
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.player-bottom {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

/* 回合指示器 - 左上角 */
.turn-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(251, 191, 36, 0.95);
    color: #92400e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 游戏状态 - 右上角 */
.game-status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* 倒计时 - 放在桌面中央偏下位置 */
.countdown {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 5;
    display: none;
}

.countdown.warning {
    color: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* 桌面中央 */
.table-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.game-status {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

/* 底牌 */
.bottom-cards {
    margin-bottom: 20px;
}

.bottom-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.bottom-card-list {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* 出牌区域 */
.played-cards {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.played-cards-area {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 操作按钮 */
.game-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-action {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-call {
    background: #fbbf24;
    color: #92400e;
}

.btn-call:hover {
    background: #f59e0b;
}

.btn-pass {
    background: #6b7280;
    color: white;
}

.btn-pass:hover {
    background: #4b5563;
}

.btn-play {
    background: #10b981;
    color: white;
}

.btn-play:hover {
    background: #059669;
}

.btn-skip {
    background: #ef4444;
    color: white;
}

.btn-skip:hover {
    background: #dc2626;
}

/* 我的手牌 */
.my-hand {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    min-height: 120px;
}

.hand-cards {
    display: flex;
    gap: 0;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 20px;
}

/* 扑克牌样式 */
.card {
    width: 60px;
    height: 84px;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    margin-left: -20px;
}

.card:first-child {
    margin-left: 0;
}

.card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.card.selected {
    transform: translateY(-20px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1f2937;
}

.card-value {
    font-size: 18px;
}

.card-suit {
    font-size: 24px;
}

/* 开始游戏区域 */
.start-game-area {
    text-align: center;
    padding: 20px;
}

.btn-start-game {
    padding: 16px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-start-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.start-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 20px;
    color: #1d1d1f;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 20px;
}

.modal-body h4 {
    font-size: 16px;
    color: #1d1d1f;
    margin: 20px 0 10px;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ul {
    list-style: none;
    padding-left: 0;
}

.modal-body li {
    padding: 5px 0;
    color: #4b5563;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-content {
        padding: 20px;
    }
    
    .room-options {
        flex-direction: column;
        gap: 20px;
    }
    
    .room-card {
        width: 100%;
        max-width: 280px;
        padding: 30px 20px;
    }
    
    .game-table {
        height: 350px;
    }
    
    .card {
        width: 50px;
        height: 70px;
    }
    
    .card-value {
        font-size: 14px;
    }
    
    .card-suit {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .game-content {
        padding: 10px;
    }
    
    .top-section {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .page-title {
        font-size: 18px;
        order: -1;
        width: 100%;
        position: static;
        transform: none;
        margin-bottom: 5px;
    }
    
    .back-home-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .room-input-group {
        flex-direction: column;
        width: 100%;
    }
    
    .room-input {
        width: 100%;
        font-size: 16px;
        padding: 10px;
    }
    
    .btn-confirm, .btn-cancel {
        width: 100%;
    }
    
    .join-room-form {
        padding: 20px 15px;
        width: 100%;
    }
    
    .game-table {
        height: 280px;
        padding: 10px;
    }
    
    .player-avatar {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .player-position {
        min-width: 60px;
        gap: 2px;
    }
    
    .player-info {
        padding: 2px 4px;
        min-width: 50px;
    }
    
    .player-name {
        font-size: 9px;
        max-width: 50px;
    }
    
    .player-card-count {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    .player-top {
        top: 8px;
    }
    
    .player-left {
        left: 5px;
    }
    
    .player-right {
        right: 5px;
    }
    
    .player-bottom {
        bottom: 8px;
    }
    
    .game-status {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .turn-indicator {
        top: 8px;
        left: 8px;
        right: auto;
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 12px;
    }
    
    .game-status {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 11px;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.8);
    }
    
    .countdown {
        font-size: 36px;
        top: 60%;
    }
    
    .card {
        width: 36px;
        height: 50px;
        margin-left: -12px;
    }
    
    .card:first-child {
        margin-left: 0;
    }
    
    .card-value {
        font-size: 11px;
    }
    
    .card-suit {
        font-size: 14px;
    }
    
    .hand-cards {
        padding: 5px;
    }
    
    .my-hand {
        padding: 10px 5px;
        min-height: 80px;
    }
    
    .room-info {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    
    .room-id {
        font-size: 18px;
    }
    
    .btn-copy, .btn-leave {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-action {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .btn-start-game {
        padding: 12px 30px;
        font-size: 16px;
    }
}