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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 游戏容器 */
.game-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    position: relative;
}

/* 屏幕切换 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* 开始界面 */
#startScreen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#startScreen h1 {
    font-size: 5rem;
    color: #fff;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn.secondary {
    background: #fff;
    color: #333;
}

.btn.info {
    background: #4CAF50;
    color: white;
}

/* 游戏主界面 */
#gameScreen {
    flex-direction: column;
    padding: 1rem;
}

/* 玩家信息区 */
.player-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.player {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    color: white;
    min-width: 150px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
}

.player .name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.player .score {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.player .role {
    font-size: 0.8rem;
    color: #ffd700;
    font-weight: bold;
}

/* 游戏区域 */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 底牌区域 */
.landlord-cards {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 100px;
}

/* 出牌区域 */
.play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.table-cards {
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
}

.player-cards {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
    min-height: 80px;
}

/* 玩家手牌 */
.my-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: -20px;
    min-height: 120px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

/* 牌的样式 */
.card {
    width: 60px;
    height: 90px;
    background: white;
    border: 2px solid #333;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.card.selected {
    transform: translateY(-15px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: #4CAF50;
}

.card.slot {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: default;
}

.card.slot:hover {
    transform: none;
}

.card .rank {
    font-size: 1.8rem;
    line-height: 1;
}

.card .suit {
    font-size: 1.5rem;
    line-height: 1;
}

.card.red {
    color: #e74c3c;
}

.card.black {
    color: #2c3e50;
}

.card.joker {
    font-size: 1rem;
    text-align: center;
    padding: 0.2rem;
}

.card.back {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: transparent;
}

/* 控制按钮 */
.controls, .bid-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.bid-controls {
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 0.5rem;
}

.bid-controls h3 {
    color: white;
    margin-bottom: 1rem;
}

/* 游戏结束界面 */
#gameOverScreen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#gameOverScreen h2 {
    font-size: 3rem;
    color: white;
    margin-bottom: 2rem;
}

.stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    color: white;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-item label {
    font-weight: bold;
}

.setting-item select,
.setting-item input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.3rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* 帮助内容 */
.help-content {
    color: #333;
    line-height: 1.6;
}

.help-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.help-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.help-content li {
    margin-bottom: 0.3rem;
}

/* 动画效果 */
@keyframes dealCard {
    from {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.card.dealing {
    animation: dealCard 0.3s ease-out;
}

@keyframes playCard {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.card.playing {
    animation: playCard 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #startScreen h1 {
        font-size: 3rem;
    }

    .player {
        min-width: 100px;
        padding: 0.5rem;
    }

    .avatar {
        width: 40px;
        height: 40px;
    }

    .card {
        width: 45px;
        height: 65px;
        font-size: 1.2rem;
    }

    .card .rank {
        font-size: 1.4rem;
    }

    .card .suit {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        min-width: 150px;
    }

    .modal-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .player-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .player {
        min-width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }

    .avatar {
        margin: 0;
    }

    .card {
        width: 40px;
        height: 55px;
        font-size: 1rem;
    }

    .my-cards {
        gap: -30px;
    }
}