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

body {
    background-color: #2c3e50;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    background-color: #34495e;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.opponent-area,
.player-area {
    height: 25%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
}

.battlefield {
    height: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    position: relative;
}

.battle-area {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 200px;
}

.opponent-card-slot,
.player-card-slot {
    width: 110px;
    height: 150px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.opponent-field,
.player-field {
    height: 45%;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    padding: 10px;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.opponent-hand,
.player-hand {
    height: 25%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    padding: 10px;
    gap: 10px;
    justify-content: center;
}

.player-stats,
.opponent-stats {
    height: 30%;
    color: white;
    padding: 10px;
    font-size: 1.2em;
}

.card {
    width: 120px;
    height: 160px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

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

.card-content {
    width: 100%;
    height: 100%;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 25px;
    height: 25px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    margin-bottom: 5px;
}

.card-name {
    font-size: 0.8em;
    font-weight: bold;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-type {
    padding: 2px 6px;
    color: white;
    border-radius: 4px;
    font-size: 0.7em;
}

.card-image {
    height: 80px;
    margin: 5px;
    overflow: hidden;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.card-battle-values {
    margin-top: auto;
    padding: 5px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.value-row {
    display: flex;
    justify-content: center;
    margin: 3px 0;
    width: 95%;
    gap: 3px;
}

.value-row span {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    border-radius: 3px;
    background-color: #95a5a6;
    color: white;
}

.battle-stats {
    width: 95%;
    display: flex;
    justify-content: center;
    gap: 3px;
}

.battle-stats span {
    background-color: #34495e;
}

.numbers span,
.battle-stats span {
    width: 20px;
    height: 20px;
}

.card-attack, .card-defense {
    width: 25px;
    height: 25px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.card-defense {
    background-color: #2ecc71;
}

.card-back {
    background: linear-gradient(45deg, #2c3e50, #3498db);
    border: 2px solid #fff;
}

.opponent-hand .card {
    background: linear-gradient(45deg, #2c3e50, #3498db);
    border: 2px solid #fff;
}

.opponent-hand .card-content {
    display: none;
}

.card.selected {
    transform: translateY(-20px);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}

.play-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    font-size: 1.2em;
}

.play-button:hover {
    background-color: #2ecc71;
}

/* 修改战场上卡牌的特殊样式 */
.opponent-card-slot .card,
.player-card-slot .card {
    transform: none !important;  /* 防止hover效果和位移 */
    transition: none !important; /* 移除过渡效果 */
    margin-top: 0 !important;   /* 确保没有上边距 */
}

/* 移除战场上卡牌的hover效果 */
.opponent-card-slot .card:hover,
.player-card-slot .card:hover {
    transform: none !important;
}

/* 调整战场区域的卡牌大小 */
.battlefield .card {
    width: 110px;      /* 稍微小一点 */
    height: 150px;     /* 稍微小一点 */
}

/* 确保战场上的卡牌不会重叠 */
.battlefield .card:not(:first-child) {
    margin-left: 10px;
}

/* 骰子按钮样式 */
.dice-button {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    display: none;
}

.dice-button:hover {
    background-color: #c0392b;
}

/* 修改骰子结果显示样式 */
.dice-result {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 1em;
    pointer-events: none;
    text-align: center;
    width: 140px;  /* 固定宽度 */
    left: 50%;    /* 水平居中 */
    transform: translateX(-50%);  /* 水平居中调整 */
}

/* 添加玩家和对手的骰子结果位置样式 */
.dice-result.player {
    bottom: -30px;  /* 在卡牌下方显示 */
}

.dice-result.opponent {
    top: -30px;    /* 在卡牌上方显示 */
}

/* 修改按钮容器位置 */
.button-container {
    position: absolute;
    left: 50%;          /* 居中对齐 */
    top: 50%;          /* 垂直居中 */
    transform: translate(-50%, -50%);  /* 居中调整 */
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.play-button, .dice-button {
    position: static;
    transform: none;
    width: 100px;
    padding: 8px 0;    /* 调整按钮高度 */
    font-size: 1em;    /* 调整字体大小 */
}

.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.start-button {
    padding: 20px 40px;
    font-size: 1.5em;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.start-button:hover {
    transform: scale(1.1);
    background-color: #2ecc71;
}

.volume-control {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    z-index: 1001;
}

.volume-control label {
    font-size: 0.9em;
}

.volume-control input[type="range"] {
    width: 100px;
    cursor: pointer;
}

.volume-value {
    min-width: 40px;
    font-size: 0.9em;
}

.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 30px;  /* 增加内边距 */
    border-radius: 8px;
    z-index: 1000;
    text-align: center;
    white-space: pre-line;
    min-width: 300px;
}

.game-message .close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.game-message .close-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 游戏结束提示的特殊样式 */
.game-message.game-over {
    position: absolute;
    top: 12.5%;  /* 对手手牌区域的中间 */
    transform: translateX(-50%);
}

.game-message.fade-out {
    animation: fadeOut 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
} 