* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 3em;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.start-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 身份选择 */
.character-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.character-card {
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.character-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
    background: white;
}

.character-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.character-emoji {
    font-size: 4em;
    margin-bottom: 10px;
}

.character-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.character-card p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

.character-card .desc {
    margin-top: 10px;
    font-style: italic;
    color: #999;
}

/* 属性栏 */
.stats-bar {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2em;
    color: #667eea;
}

/* 事件区域 */
.event-area {
    margin: 30px 0;
}

.event-text {
    font-size: 1.3em;
    line-height: 1.8;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    margin-bottom: 25px;
    min-height: 100px;
}

.event-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 1em;
    line-height: 1.6;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(5px);
}

.option-btn:active {
    transform: translateX(2px);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 结局界面 */
.ending-text {
    font-size: 1.2em;
    line-height: 1.8;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.ending-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin: 20px 0;
}

.ending-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 模态框 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

#poster-canvas {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin: 20px auto;
    display: block;
}

.poster-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* 游戏头部 - 计时器和进度 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 20px;
    color: white;
}

.timer-container, .progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-label, .progress-label {
    font-weight: 600;
}

.timer-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffd700;
}

.progress-value {
    font-size: 1.2em;
    font-weight: 700;
}

.timer-unit {
    font-size: 0.9em;
}

/* 弹幕区域 */
.danmaku-area {
    background: #f9f9f9;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.danmaku-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.danmaku-header h4 {
    margin: 0;
    color: #333;
}

.btn-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: #333;
}

.danmaku-list {
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.danmaku-item {
    background: white;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.danmaku-text {
    flex: 1;
    color: #333;
    font-size: 0.95em;
}

.danmaku-votes {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-weight: 600;
}

.danmaku-vote-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.danmaku-vote-btn:hover {
    background: #5568d3;
}

.danmaku-vote-btn.voted {
    background: #4caf50;
}

.danmaku-input-area {
    display: flex;
    gap: 10px;
}

.danmaku-input-area input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
}

.danmaku-input-area input:focus {
    outline: none;
    border-color: #667eea;
}

.danmaku-trigger {
    margin-top: 15px;
    width: 100%;
}

/* 排行榜 */
.leaderboard-list {
    margin: 30px 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    width: 50px;
    text-align: center;
}

.leaderboard-rank.top1 {
    color: #ffd700;
}

.leaderboard-rank.top2 {
    color: #c0c0c0;
}

.leaderboard-rank.top3 {
    color: #cd7f32;
}

.leaderboard-info {
    flex: 1;
    margin-left: 20px;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.leaderboard-stats {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
}

.leaderboard-time {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

.leaderboard-abstract {
    font-size: 1.3em;
    font-weight: 700;
    color: #667eea;
}

.leaderboard-buttons {
    margin-top: 30px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .character-select {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }

    .start-buttons,
    .ending-buttons,
    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .danmaku-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .danmaku-votes {
        width: 100%;
        justify-content: flex-end;
    }
}

