body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #2c3e50; /* 深蓝色背景，营造沉浸感 */
    color: #333; /* 默认文字颜色设置为深色 */
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; /* 垂直布局 */
    justify-content: flex-start; /* 从顶部开始 */
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    padding: 20px;
    border-radius: 12px; /* 增大圆角 */
    box-shadow: 0 8px 20px rgba(0,0,0,0.3); /* 更明显的阴影 */
    margin-bottom: 20px; /* 底部留白 */
}

.hidden {
    display: none !important;
}

/* 游戏设置 */
#game-setup h1 {
    text-align: center;
    font-size: 2.5em; /* 增大标题字体 */
    margin-bottom: 30px;
}

#game-setup h3 {
    margin-bottom: 15px;
}

.setup-section label {
    font-size: 1.1em; /* 增大标签字体 */
    margin-bottom: 8px;
    display: block;
}

#player-count {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

#role-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 调整minmax */
    gap: 8px; /* 调整gap */
}

#role-selection label {
    display: flex;
    flex-direction: column; /* 竖向排列 */
    align-items: center; /* 水平居中 */
    justify-content: center; /* 垂直居中 */
    padding: 10px; /* 增加内边距 */
    border: 1px solid #ddd;
    border-radius: 8px; /* 增大圆角 */
    cursor: pointer;
    font-size: 0.9em; /* 调整字体大小 */
    text-align: center; /* 文本居中 */
    transition: all 0.2s ease; /* 添加过渡效果 */
}

#role-selection label:hover {
    border-color: #3498db; /* 悬停时边框颜色 */
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3); /* 悬停时阴影 */
}

#role-selection label.selected {
    border-color: #2ecc71; /* 选中时边框颜色 */
    background-color: #e8f8f5; /* 选中时背景色 */
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4); /* 选中时阴影 */
}

.role-icon {
    width: 90px; /* 设置图片宽度 */
    height: 90px; /* 设置图片高度 */
    margin-bottom: 8px; /* 图片与文字之间的间距 */
    object-fit: contain; /* 确保图片完整显示在框内 */
}

.role-name {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 1.1em; /* 增大角色名称字体 */
}

.role-count {
    color: #7f8c8d; /* 调整颜色 */
    font-size: 1em; /* 增大数量字体 */
}

/* 游戏主界面 */
#game-board h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em; /* 增大字体 */
    padding: 12px 20px; /* 增加内边距 */
    color: #fff; /* 白色文字 */
    border-radius: 10px; /* 更大圆角 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* 阴影 */
    letter-spacing: 1.5px; /* 字母间距 */
    text-transform: uppercase; /* 大写 */
}

/* 游戏阶段背景颜色 */
.day-phase-bg {
    background-color: #87CEEB; /* 天蓝色 */
}

.night-phase-bg {
    background-color: #4682B4; /* 钢蓝色 */
}

#current-prompt {
    text-align: center;
    font-size: 1.3em;
    color: #c0392b; /* 醒目的红色 */
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    background-color: #fdeded;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

#player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 调整minmax */
    gap: 10px; /* 调整gap */
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    #app {
        padding: 15px;
    }

    #role-selection {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    #role-selection label {
        font-size: 0.8em;
    }

    #player-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .player-card {
        padding: 10px;
    }

    .player-card h3 {
    font-size: 1.2em;
}

    .player-card .role {
        font-size: 0.8em;
    }

    .player-card.dead::after {
        font-size: 2.5em;
    }

    .sheriff-badge {
        font-size: 1.2em;
    }

    button {
        padding: 10px;
        font-size: 14px;
    }

    #modal-content {
        padding: 20px;
    }

    #modal-text {
        font-size: 16px;
    }
}


.player-card {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 10px; /* 增大圆角 */
    text-align: center;
    background-color: #fdfdfd;
    transition: all 0.3s ease; /* 更平滑的过渡 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 添加阴影 */
}

.player-card.dead {
    background-color: #f5f5f5;
    opacity: 0.5;
    position: relative;
    box-shadow: none; /* 死亡时移除阴影 */
}

.player-card.dead::after {
    content: 'X';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em; /* 增大X的尺寸 */
    color: #e74c3c; /* 红色X */
    font-weight: bold;
    opacity: 0.8;
    pointer-events: none; /* 确保不影响点击事件 */
}

.player-card.selectable {
    cursor: pointer;
    transition: all 0.2s ease; /* 添加过渡效果 */
}

.player-card.selectable:hover {
    border-color: #3498db;
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
    transform: translateY(-2px); /* 悬停时轻微上浮 */
}

.player-card.selected {
    border-color: #2ecc71;
    background-color: #e8f8f5;
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.4);
    transform: scale(1.03); /* 选中时轻微放大 */
}

.player-card.revealed-idiot {
    border-color: #f39c12; /* 更鲜明的黄色 */
    background-color: #fef9e7; /* 浅黄色背景 */
    box-shadow: 0 6px 12px rgba(243, 156, 18, 0.4); /* 更明显的阴影 */
}

.player-card.sheriff {
    border-color: #f1c40f; /* 更鲜明的金色 */
    box-shadow: 0 6px 12px rgba(241, 196, 15, 0.4); /* 更明显的阴影 */
    position: relative; /* 为警徽定位 */
}

.sheriff-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.5em;
    color: #d4af37;
}

.player-card .role {
    font-size: 0.9em;
    color: #555; /* 设置为深色 */
}

/* 阵营颜色提示 */
.player-card.wolf-alignment {
    background-color: #fbe9e7; /* 狼人 - 浅红色 */
}

.player-card.civilian-alignment {
    background-color: #e8f5e9; /* 平民 - 浅绿色 */
}

.player-card.god-alignment {
    background-color: #e3f2fd; /* 神职 - 浅蓝色 */
}

/* 日志 */
#event-log {
    background-color: #fefefe; /* 浅色背景 */
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    height: 180px; /* 增加高度 */
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* 添加阴影 */
}

#log-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
    color: #333; /* 默认文字颜色 */
}

#log-list li.log-info {
    color: #34495e;
}

#log-list li.log-action {
    color: #27ae60;
    font-weight: bold;
}

#log-list li.log-death {
    color: #c0392b;
    font-weight: bold;
    background-color: #ffebee;
    padding-left: 5px; /* 增加内边距 */
    border-radius: 4px; /* 圆角 */
}

#log-list li:last-child {
    border-bottom: none;
}

/* 按钮 */
button {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: #3498db; /* 更现代的蓝色 */
    color: #fff;
    border: none;
    border-radius: 30px; /* 更圆的按钮 */
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2); /* 更明显的阴影 */
}

button:hover {
    background-color: #2980b9; /* hover 颜色 */
    transform: translateY(-2px); /* 轻微上浮 */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* 更深的阴影 */
}

button:active {
    transform: translateY(0); /* 按下效果 */
    box-color: #2980b9;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 禁用按钮样式 */
button.disabled-button {
    background-color: #cccccc; /* 灰色背景 */
    cursor: not-allowed; /* 禁用鼠标样式 */
    box-shadow: none; /* 移除阴影 */
    transform: none; /* 移除动画 */
}

button.disabled-button:hover {
    background-color: #cccccc; /* 保持灰色 */
    transform: none; /* 移除动画 */
    box-shadow: none; /* 移除阴影 */
}

#start-game {
    margin-top: 30px;
    background-color: #2ecc71; /* 绿色，表示开始 */
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.3);
}

#start-game:hover {
    background-color: #27ae60;
    box-shadow: 0 8px 16px rgba(46, 204, 113, 0.4);
}

#reset-game {
    margin-top: 20px;
    background-color: #e74c3c; /* 红色，表示重置/危险 */
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.3);
}

#reset-game:hover {
    background-color: #c0392b;
    box-shadow: 0 8px 16px rgba(231, 76, 60, 0.4);
}

.player-card.selected {
    border-color: #2ecc71;
    background-color: #e8f8f5;
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.4);
    transform: scale(1.03); /* 选中时轻微放大 */
}

/* 警长投票区 */
#sheriff-vote-area {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    text-align: center;
}

#sheriff-vote-area h2 {
    margin-top: 0;
    color: #333; /* 设置为深色 */
}

#sheriff-candidates-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.candidate-vote-control {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 5px;
    background-color: #fff;
}

.candidate-vote-control span {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.candidate-vote-control button {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    background-color: #1877f2;
    color: #fff;
    border: none;
    cursor: pointer;
}

.candidate-vote-control button:hover {
    background-color: #166fe5;
}

#confirm-sheriff-vote {
    margin-top: 10px;
}

/* 模态框 */
#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;
}

#modal-content {
    background-color: #fff;
    padding: 40px; /* 增大内边距 */
    border-radius: 12px; /* 增大圆角 */
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4); /* 更明显的阴影 */
}

#modal-text {
    margin: 0 0 20px 0;
    font-size: 18px;
}

#modal-close {
    width: auto;
    padding: 10px 30px;
}

/* Language Switcher */
.language-switcher {
    text-align: right;
    margin-bottom: 10px;
}

.language-switcher button {
    background: none;
    border: 1px solid #ccc;
    color: #333;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-left: 5px;
}

.language-switcher button.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
}
