/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #3498db;
    
    /* 文字颜色 */
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-dark: #2c3e50;
    
    /* 背景颜色 */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    
    /* 边框和阴影 */
    --border-color: #533483;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    border: 2px solid var(--border-color);
}

.card-lg {
    max-width: 600px;
}

.card-full {
    max-width: 100%;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #c0392b 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #219a52 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2980b9 100%);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ==================== 标题样式 ==================== */
.page-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ==================== index.html - 玩家登录/注册 ==================== */
.login-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.avatar-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.avatar-option {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.avatar-option img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.avatar-option:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.avatar-option.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.5);
}

.avatar-option.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--success-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* ==================== admin.html - 管理员登录 ==================== */
.admin-login {
    text-align: center;
}

.admin-login .form-group {
    text-align: left;
}

.admin-login .btn-group {
    justify-content: center;
}

/* ==================== game.html - 游戏主界面 ==================== */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.game-header {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
}

.game-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 4px;
}

.game-table {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* 牌桌样式 */
.table-center {
    width: 60%;
    aspect-ratio: 1;
    max-width: 500px;
    min-width: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, #27ae60 0%, #1e8449 100%);
    border: 8px solid var(--border-color);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3), var(--shadow-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.table-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 玩家座位 */
.player-seats {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.player-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

/* 玩家座位位置 - 环绕牌桌 */
.player-seat.top {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.player-seat.top-left {
    top: 15%;
    left: 5%;
}

.player-seat.top-right {
    top: 15%;
    right: 5%;
}

.player-seat.bottom-left {
    bottom: 15%;
    left: 5%;
}

.player-seat.bottom-right {
    bottom: 15%;
    right: 5%;
}

.player-seat.current-turn {
    border-color: var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(231, 76, 60, 0.1);
    }
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    background: var(--bg-secondary);
    margin-bottom: 8px;
    object-fit: cover;
}

.player-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* 破产玩家样式 */
.bankrupt {
    color: #e74c3c !important;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

.player-balance {
    font-size: 12px;
    color: var(--warning-color);
    font-weight: 600;
}

.player-bet {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 2px;
}

/* 游戏底部区域 */
.game-footer {
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    padding: 15px;
}

.player-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.game-card {
    width: 60px;
    height: 90px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card.face-up {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    color: var(--text-dark);
    border-color: var(--accent-color);
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.action-buttons .btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 16px;
    font-size: 14px;
}

/* 聊天区域 */
.chat-area {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid var(--info-color);
}

.chat-sender {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.chat-content {
    font-size: 14px;
    color: var(--text-primary);
}

.chat-input-group {
    display: flex;
    gap: 8px;
}

.chat-input-group .form-input {
    flex: 1;
}

.chat-input-group .btn {
    flex: none;
    min-width: auto;
}

/* ==================== console.html - 管理员控制台 ==================== */
.console-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.console-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.console-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.players-table th,
.players-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.players-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.players-table td {
    color: var(--text-primary);
}

.players-table tr:hover {
    background: rgba(52, 152, 219, 0.1);
}

.balance-input {
    width: 100px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.balance-edit-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.balance-edit-group .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 768px) {
    .card {
        padding: 20px;
        max-width: 100%;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .info-item {
        padding: 6px 10px;
    }
    
    .info-value {
        font-size: 16px;
    }
    
    .avatar-option img {
        height: 60px;
    }
    
    .player-seat {
        padding: 8px;
    }
    
    .player-avatar {
        width: 50px;
        height: 50px;
    }
    
    .action-buttons .btn {
        min-width: 60px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .game-card {
        width: 50px;
        height: 75px;
        font-size: 20px;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .page-container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .page-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 18px;
        font-size: 14px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .avatar-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .avatar-option img {
        height: 50px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-info {
        justify-content: center;
        gap: 8px;
    }
    
    .info-item {
        padding: 4px 8px;
    }
    
    .info-value {
        font-size: 14px;
    }
    
    .table-center {
        width: 80%;
        min-width: 150px;
    }
    
    .table-text {
        font-size: 18px;
        padding: 15px;
    }
    
    .player-seat {
        padding: 6px;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
    }
    
    .player-name {
        font-size: 12px;
    }
    
    .player-balance,
    .player-bet {
        font-size: 10px;
    }
    
    /* 手机端玩家座位位置调整 */
    .player-seat.top {
        top: 2%;
    }
    
    .player-seat.top-left,
    .player-seat.top-right {
        top: 10%;
    }
    
    .player-seat.bottom-left,
    .player-seat.bottom-right {
        bottom: 10%;
    }
    
    .player-seat.bottom-left {
        left: 2%;
    }
    
    .player-seat.bottom-right {
        right: 2%;
    }
    
    .game-card {
        width: 45px;
        height: 68px;
        font-size: 16px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .action-buttons .btn {
        min-width: 50px;
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .chat-area {
        max-height: 100px;
    }
    
    .console-controls {
        grid-template-columns: 1fr;
    }
    
    .players-table th,
    .players-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==================== 辅助类 ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}
