/* 基础样式优化 */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #e74c3c;
    --secondary-dark: #c0392b;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --black-color: #000000;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --card-bg: rgba(255, 255, 255, 0.95);
    --transition-speed: 0.3s;
    
    /* 新增渐变背景 */
    --bg-gradient: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    --card-gradient: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.8));
    --game-table: radial-gradient(ellipse at center, #1a8d44 0%, #0d5c2c 100%);
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* 按钮样式优化 */
button {
    cursor: pointer;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0) translate(-50%, -50%);
        opacity: 0.5;
    }
    100% {
        transform: scale(25, 25) translate(-50%, -50%);
        opacity: 0;
    }
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

button:disabled {
    background-color: var(--gray-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.primary-btn {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-dark));
    color: var(--white-color);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, var(--primary-dark), var(--primary-color));
}

.secondary-btn {
    background: linear-gradient(145deg, var(--secondary-color), var(--secondary-dark));
    color: var(--white-color);
}

.secondary-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, var(--secondary-dark), var(--secondary-color));
}

/* 游戏容器优化 */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-areas:
        "header header"
        "game-area chat-area";
    grid-template-columns: 2.5fr 1.5fr;
    grid-gap: 20px;
    min-height: 100vh;
}

.game-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-gradient);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 55%, transparent 60%);
    background-size: 200% 200%;
    animation: shine 3s infinite linear;
    z-index: 1;
    pointer-events: none;
}

@keyframes shine {
    0% { background-position: -100% -100%; }
    100% { background-position: 100% 100%; }
}

.game-header h1 {
    font-size: 2.2rem;
    margin: 0;
    color: var(--dark-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.room-info span {
    font-size: 1.1rem;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    border-radius: 4px;
}

#copy-link-btn {
    background-color: var(--dark-color);
    color: var(--white-color);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#copy-link-btn:hover {
    background-color: #1a2530;
    transform: translateY(-2px);
}

/* 游戏区域优化 */
.game-area {
    grid-area: game-area;
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: slide-up 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slide-up {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
}
}

/* 聊天区域优化 */
.chat-area {
    grid-area: chat-area;
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 150px);
    animation: slide-in-right 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

@keyframes slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(50px);
}
    100% {
        opacity: 1;
        transform: translateX(0);
}
}

.chat-area h3 {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    margin: 0;
    font-size: 1.2rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100% - 110px);
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    background-color: rgba(255,255,255,0.5);
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.chat-input button {
    border-radius: 0 4px 4px 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.7);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 90%;
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    0% { 
        opacity: 0;
        transform: translateY(10px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message .sender {
    font-weight: bold;
    color: var(--primary-color);
}

.chat-message .time {
    font-size: 0.7rem;
    color: #666;
    text-align: right;
    margin-top: 3px;
}

/* 游戏状态信息优化 */
.game-status {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255,255,255,0.5);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
}

#game-message {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--dark-color);
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.8);
    animation: pulse-soft 2s infinite;
}

@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

#current-player {
    font-size: 1.1rem;
    color: #555;
}

#current-player.your-turn {
    color: var(--secondary-color);
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* 对手区域优化 */
.opponents-area {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    position: relative;
    min-height: 100px;
}

.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    min-width: 140px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opponent::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background-color 0.3s ease;
}

.opponent.current {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    animation: breathe 2s infinite;
}

.opponent.current::after {
    background-color: var(--primary-color);
    }

@keyframes breathe {
    0%, 100% { transform: scale(1.05); }
    50% { transform: scale(1.075); }
}

.opponent .name {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.opponent .card-count {
    background-color: var(--primary-dark);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

/* 游戏桌面 */
.play-area {
    margin: 20px 0;
    padding: 30px 20px;
    background: var(--game-table);
    min-height: 200px;
    border-radius: 15px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.play-area::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background: radial-gradient(circle, transparent 20%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0.3;
}

.played-cards {
    position: relative;
    min-height: 140px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.played-cards h3 {
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin-bottom: 15px;
    font-size: 1rem;
}

.played-cards .cards-container {
    justify-content: center;
}

.landlord-cards {
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    transform: scale(0.9);
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(0.9); opacity: 1; }
}

.landlord-cards h3 {
    color: #ffcc00;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* 玩家手牌区域 */
.player-hand {
    padding: 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.8);
    margin-top: auto;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.1);
    position: relative;
    animation: slide-up 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.3s backwards;
}

.player-hand h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

/* 卡牌样式进一步优化 */
.card {
    position: relative;
    width: 80px;
    height: 120px;
    background: white;
    border-radius: 8px;
    margin-right: -30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    user-select: none;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.25s ease,
                margin-bottom 0.25s ease,
                margin-right 0.15s ease;
    transform-origin: bottom center;
    border: 2px solid white;
    background: linear-gradient(to bottom, white 0%, #f8f8f8 100%);
}

.card:hover {
    transform: translateY(-20px) rotate(0deg) !important;
    cursor: pointer;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
    z-index: 5;
    margin-right: -15px;
}

.card.selected {
    transform: translateY(-25px) rotate(0deg) !important;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
    z-index: 10;
    border-color: var(--primary-color);
    margin-right: -5px;
}

.card.selected:hover {
    transform: translateY(-25px) scale(1.05) rotate(0deg) !important;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
}

.card .rank {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 2px;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.card .suit {
    font-size: 2rem;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.8;
}

/* 花色颜色 */
.card.hearts .rank, .card.hearts .suit, 
.card.diamonds .rank, .card.diamonds .suit {
    color: #e74c3c;
}

.card.clubs .rank, .card.clubs .suit, 
.card.spades .rank, .card.spades .suit {
    color: #2c3e50;
}

.card.joker {
    background-color: #f1f1f1;
}

.card.joker .rank {
    font-size: 1.2rem;
    text-align: center;
    margin-top: 40px;
    color: #c0392b;
}

/* 卡牌堆叠效果改进 */
.cards-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    min-height: 140px;
    transition: all 0.3s ease;
    padding: 20px 50px;
    position: relative;
}

.cards-container .card:nth-child(3n+1) {
    transform: rotate(-2deg);
}

.cards-container .card:nth-child(3n+2) {
    transform: rotate(0deg);
}

.cards-container .card:nth-child(3n+3) {
    transform: rotate(2deg);
}

.cards-container .card:last-child {
    margin-right: 0;
}

/* 出牌动画增强 */
.card-play-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
    transition: opacity 0.5s ease;
    perspective: 1000px;
}

.card-play-animation.fade-out {
    opacity: 0;
}

.card-play-animation .animated-card {
    display: inline-block;
    margin: 0 -15px;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

@keyframes move-to-center-from-bottom {
    0% {
        transform: translateY(200px) scale(0.6) rotateY(20deg) rotate(5deg);
        opacity: 0;
    }
    60% {
        transform: translateY(-20px) scale(1.05) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
}

@keyframes move-to-center-from-left {
    0% {
        transform: translateX(-200px) scale(0.6) rotateY(-40deg) rotate(-10deg);
        opacity: 0;
    }
    60% {
        transform: translateX(20px) scale(1.05) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
}

@keyframes move-to-center-from-right {
    0% {
        transform: translateX(200px) scale(0.6) rotateY(40deg) rotate(10deg);
        opacity: 0;
    }
    60% {
        transform: translateX(-20px) scale(1.05) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1) rotateY(0deg) rotate(0deg);
        opacity: 1;
    }
}

.card-play-animation.from-bottom .animated-card {
    animation: move-to-center-from-bottom 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: calc(var(--card-index) * 0.08s);
}

.card-play-animation.from-left .animated-card {
    animation: move-to-center-from-left 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: calc(var(--card-index) * 0.08s);
}

.card-play-animation.from-right .animated-card {
    animation: move-to-center-from-right 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: calc(var(--card-index) * 0.08s);
}

/* 特殊牌型效果增强 */
.special-play {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 90;
    opacity: 0;
}

.special-play.bomb {
    background: radial-gradient(circle, rgba(255,0,0,0.3) 0%, rgba(255,0,0,0) 70%);
    animation: bomb-effect 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.special-play.rocket {
    background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(255,215,0,0) 70%);
    animation: rocket-effect 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bomb-effect {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

@keyframes rocket-effect {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(4);
    }
}

/* 游戏结束区域 */
#game-over {
    text-align: center;
    padding: 40px;
}

#game-result {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--dark-color);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    animation: pop-in 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#final-standings {
    margin: 30px 0;
}

/* 等待区域 */
#waiting-area {
    text-align: center;
}

#waiting-area h2 {
    margin-bottom: 30px;
    color: var(--dark-color);
}

.player-list {
    margin: 20px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin-bottom: 10px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: slide-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation-fill-mode: both;
    animation-delay: calc(var(--player-index, 0) * 0.1s);
}

@keyframes slide-in {
    0% {
        transform: translateX(-50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.player-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.player-item.host {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 4px solid var(--primary-color);
}

.player-item .player-name {
    font-weight: bold;
}

.player-item .kick-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.player-item .kick-btn:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
}

.waiting-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Toast样式优化 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    z-index: 1001;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-width: 80%;
    text-align: center;
    animation: toast-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translate(-50%, 50px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.toast.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 50px);
}

/* 模态框优化 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modal-in 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform: scale(1);
}

@keyframes modal-in {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-modal:hover {
    color: var(--danger-color);
}

#modal-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

#modal-body {
    margin-bottom: 20px;
}

#modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        grid-template-areas:
            "header"
            "game-area"
            "chat-area";
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .room-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .room-info span {
        width: 100%;
        text-align: center;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .bid-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .bid-selector {
        width: 100%;
    }
    
    .bid-selector select {
        width: 100%;
    }
    
    .card {
        width: 60px;
        height: 90px;
        margin-right: -25px;
    }
    
    .card .rank {
        font-size: 1.2rem;
    }
    
    .card .suit {
        font-size: 1.5rem;
    }
    
    .die {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .chat-area {
        max-height: 300px;
    }
}

/* 新增动画和交互效果 */
/* 按钮点击动画 */
.button-clicked {
    animation: button-pulse 0.3s ease;
}

@keyframes button-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* 元素抖动效果 */
.shake-animation {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* 卡牌入场动画 */
.card-entrance {
    opacity: 0;
    transform-origin: bottom center;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.card-entrance.show {
    opacity: 1;
}

/* 卡牌悬停效果 */
.card.hovering {
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.7);
    border-color: rgba(52, 152, 219, 0.7);
}

/* 地主标志 */
.landlord-badge {
    background-color: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: inline-block;
    vertical-align: middle;
}

/* 地主皇冠 */
.landlord-crown {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 20px;
    background: radial-gradient(ellipse at bottom, #ffcc00 0%, #f1c40f 100%);
    clip-path: polygon(50% 0, 65% 30%, 100% 30%, 75% 60%, 85% 100%, 50% 70%, 15% 100%, 25% 60%, 0 30%, 35% 30%);
    box-shadow: 0 3px 10px rgba(241, 196, 15, 0.6);
    animation: crown-glow 2s infinite;
    z-index: 2;
}

@keyframes crown-glow {
    0%, 100% { box-shadow: 0 0 5px 2px rgba(241, 196, 15, 0.6); }
    50% { box-shadow: 0 0 10px 4px rgba(241, 196, 15, 0.8); }
}

/* 地主确定动画 */
.landlord-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255,204,0,0.3) 0%, rgba(255,204,0,0) 70%);
    animation: landlord-effect 2s ease-out;
    z-index: 50;
    pointer-events: none;
}

@keyframes landlord-effect {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* 当前玩家回合高亮 */
.game-area.your-turn {
    animation: your-turn-pulse 1.5s infinite;
}

@keyframes your-turn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4), var(--card-shadow); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0), var(--card-shadow); }
}

/* 出牌按钮准备状态 */
.primary-btn.ready-to-play {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    animation: ready-pulse 1.5s infinite;
}

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

/* 屏幕震动效果 */
.screen-shake {
    animation: screen-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 游戏结束效果 */
.win-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.3) 0%, rgba(46, 204, 113, 0) 70%);
    animation: win-effect 3s ease-out;
    z-index: 50;
    pointer-events: none;
}

.lose-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(231, 76, 60, 0.3) 0%, rgba(231, 76, 60, 0) 70%);
    animation: lose-effect 3s ease-out;
    z-index: 50;
    pointer-events: none;
}

@keyframes win-effect {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

@keyframes lose-effect {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 对手动画 */
.opponent {
    animation: fade-in 0.5s ease-out;
    animation-delay: calc(var(--opponent-index, 0) * 0.2s);
    animation-fill-mode: both;
}

/* 扇形排列改进 */
.player-hand .cards-container {
    perspective: 1000px;
    transform-style: preserve-3d;
    padding-top: 40px;
}

/* 地主牌动画 */
.landlord-card {
    animation: flip-in 0.6s ease-out forwards;
    animation-delay: calc(var(--card-index) * 0.15s);
    transform-origin: center;
    opacity: 0;
}

@keyframes flip-in {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* 改进的Toast样式 */
.toast {
    max-width: 80%;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    padding: 12px 25px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 改进的出牌区域 */
.play-area {
    transition: all 0.3s ease;
    overflow: hidden;
}

.play-area::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 20px;
    bottom: 0;
    left: -10%;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    filter: blur(10px);
    z-index: 1;
}

/* 结束游戏按钮效果 */
#new-game-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

#new-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#new-game-btn:hover::before {
    transform: translateX(0);
}

/* 游戏卡片禁用样式 */
.game-card.disabled {
    opacity: 0.7;
    position: relative;
    cursor: not-allowed;
    filter: grayscale(50%);
    transform: none !important;
}

.game-card.disabled:hover {
    transform: none !important;
    box-shadow: var(--shadow);
}

/* 开发中标记 */
.dev-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    transform: rotate(5deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 优化加入页面 */
.join-container {
    max-width: 500px;
    margin: 50px auto;
    animation: fade-in 0.5s ease-out;
}

.wide-card {
    width: 100%;
    padding: 30px;
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
}

.wide-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 1.5rem;
}

.wide-card input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.wide-card button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.back-link {
    margin-top: 20px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.back-link a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark-color);
}

/* 错误消息样式优化 */
.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 4px;
    font-weight: bold;
    display: none;
    animation: fade-in 0.3s ease-out;
}

/* 游戏选择区域样式优化 */
.game-selection {
    margin: 30px 0;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.game-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.game-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.game-card h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.game-card p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.player-count {
    display: inline-block;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 房间操作区域样式优化 */
.room-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.action-card {
    background: var(--card-gradient);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.action-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 1.5rem;
    text-align: center;
}

.action-card input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.action-card button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
}
