/* FallingBroken - 128人武斗大会 样式 */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255,255,255,0.04);
    --accent-gold: #ffd700;
    --accent-red: #ff4757;
    --accent-blue: #3742fa;
    --accent-purple: #a29bfe;
    --accent-green: #2ed573;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255,255,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container { max-width: 430px; margin: 0 auto; min-height: 100vh; position: relative; padding: 16px; }

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 标题 */
.game-title { text-align: center; font-size: 26px; font-weight: bold; background: linear-gradient(135deg, var(--accent-gold), var(--accent-red)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.game-subtitle { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.page-title { text-align: center; font-size: 22px; margin-bottom: 20px; color: var(--accent-gold); }

/* 版本号 */
.version-badge { 
    text-align: center; 
    color: var(--text-secondary); 
    font-size: 12px; 
    margin-bottom: 15px;
    padding: 4px 12px;
    background: var(--bg-card);
    border-radius: 12px;
    display: inline-block;
}

/* Tournament 开始页面 */
.tournament-header { text-align: center; margin-bottom: 20px; }
.tournament-subtitle { color: var(--accent-gold); font-size: 14px; }

.tournament-info { margin-bottom: 20px; }

.groups-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin-bottom: 20px;
}

.group-card { 
    background: var(--bg-card); 
    border-radius: 10px; 
    padding: 10px; 
    border: 1px solid var(--border-color);
}

.group-title { 
    font-weight: bold; 
    color: var(--accent-gold); 
    margin-bottom: 8px; 
    font-size: 13px;
}

.group-members { 
    font-size: 11px; 
    color: var(--text-secondary);
    line-height: 1.5;
}

.group-members .highlight { 
    color: var(--accent-gold); 
    font-weight: bold;
}

.participants-list { 
    background: var(--bg-card); 
    border-radius: 12px; 
    padding: 14px; 
    border: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
}

.participants-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; 
    margin-top: 10px;
}

.participant-item { 
    text-align: center; 
    padding: 6px 4px; 
    background: rgba(255,255,255,0.03); 
    border-radius: 6px; 
    font-size: 11px;
}

.participant-avatar { font-size: 16px; display: block; }
.participant-name { 
    font-size: 9px; 
    color: var(--text-secondary); 
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.participant-rank { 
    font-size: 8px; 
    padding: 1px 4px; 
    border-radius: 3px; 
    margin-top: 2px;
    display: inline-block;
}
.participant-rank.ssr { background: #ff6b6b; color: white; }
.participant-rank.sr { background: #feca57; color: #1a1a2e; }
.participant-rank.r { background: #3742fa; color: white; }
.participant-rank.n { background: #57606f; color: white; }

/* 装备栏 */
.equipment-section { margin-bottom: 12px; }
.equipment-section .section-title { 
    color: var(--accent-gold); 
    font-size: 14px; 
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
}
.equipment-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; 
}
.equipment-item { 
    aspect-ratio: 1; 
    background: var(--bg-card); 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    border: 1px solid var(--border-color); 
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
}
.equipment-item:hover { border-color: var(--accent-gold); }
.equipment-item.empty { opacity: 0.3; }
.equipment-icon { font-size: 24px; }
.equipment-name { 
    font-size: 9px; 
    color: var(--text-secondary); 
    text-align: center;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.equipment-rarity { 
    font-size: 8px; 
    padding: 1px 4px; 
    border-radius: 3px; 
    margin-top: 2px;
}
.equipment-rarity.ssr { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); color: white; }
.equipment-rarity.sr { background: linear-gradient(135deg, #feca57, #ff9f43); color: #1a1a2e; }
.equipment-rarity.r { background: linear-gradient(135deg, #3742fa, #5352ed); color: white; }

/* 按钮 */
.btn { display: block; width: 100%; padding: 14px 20px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-bottom: 10px; text-align: center; touch-action: manipulation; }
.btn:active { transform: scale(0.97); }
.btn-gold { background: linear-gradient(135deg, var(--accent-gold), #ff9f43); color: #1a1a2e; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-small { padding: 8px 16px; font-size: 13px; width: auto; display: inline-block; margin-right: 8px; margin-bottom: 0; }

/* 卡片 */
.card { background: var(--bg-card); border-radius: 12px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--border-color); }
.stats-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.stats-row span:first-child { color: var(--text-secondary); }
.stats-row span:last-child { font-weight: bold; }

/* 角色卡片 */
.character-card { background: var(--bg-card); border: 2px solid transparent; border-radius: 10px; padding: 12px; cursor: pointer; transition: all 0.2s; position: relative; margin-bottom: 10px; }
.character-card.selected { border-color: var(--accent-gold); background: rgba(255, 215, 0, 0.1); }
.character-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 10px 10px 0 0; }

.char-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.char-name { font-size: 16px; font-weight: bold; }
.char-rank { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.rank-SSR { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); color: white; }
.rank-SR { background: linear-gradient(135deg, #feca57, #ff9f43); color: #1a1a2e; }
.rank-R { background: linear-gradient(135deg, #3742fa, #2f3542); color: white; }
.rank-N { background: #57606f; color: white; }
.rank-\?\?\? { background: linear-gradient(135deg, #a29bfe, #6c5ce7); color: white; }

.char-series { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.char-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 11px; }
.char-stat { text-align: center; }
.char-stat-value { font-weight: bold; color: var(--accent-gold); font-size: 13px; }
.char-stat-label { color: var(--text-secondary); font-size: 9px; }
.char-power { text-align: center; margin-top: 8px; font-size: 12px; color: var(--accent-gold); }

/* 抽卡 */
.gacha-container { text-align: center; padding: 40px 20px; }
.gacha-ball { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-gold), var(--accent-red)); margin: 0 auto 30px; display: flex; align-items: center; justify-content: center; font-size: 60px; animation: shake 0.5s infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.gacha-text { color: var(--text-secondary); margin-bottom: 20px; }
.gacha-options { display: grid; gap: 10px; }

/* 战斗界面 */
.battle-arena { background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.round-indicator { text-align: center; font-size: 18px; color: var(--accent-gold); margin-bottom: 16px; font-weight: bold; }

.combatants { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.combatant { text-align: center; flex: 1; }
.combatant-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--bg-card); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 32px; border: 2px solid var(--accent-gold); }
.combatant.enemy .combatant-avatar { border-color: var(--accent-red); }
.combatant-name { font-weight: bold; font-size: 14px; margin-bottom: 2px; }
.combatant-info { font-size: 11px; color: var(--text-secondary); }
.vs-badge { font-size: 20px; font-weight: bold; color: var(--accent-gold); padding: 0 10px; }

.hp-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.hp-fill { height: 100%; transition: width 0.3s ease; }
.hp-fill.player { background: linear-gradient(90deg, var(--accent-blue), #70a1ff); }
.hp-fill.enemy { background: linear-gradient(90deg, var(--accent-red), #ff6b81); }

/* 其他对战 */
.other-battles { background: var(--bg-card); border-radius: 10px; padding: 10px; margin-bottom: 10px; font-size: 12px; }
.other-battles .section-title { color: var(--accent-gold); margin-bottom: 8px; }
.battle-result-item { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border-color); }
.battle-result-item:last-child { border-bottom: none; }
.battle-result-item .winner { color: var(--accent-green); }

/* 战斗日志 */
.battle-log { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 12px; height: 160px; overflow-y: auto; font-size: 13px; margin-bottom: 16px; }
.log-entry { margin-bottom: 6px; padding: 6px 10px; border-radius: 6px; animation: slideIn 0.3s ease; border-left: 2px solid; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.log-player { background: rgba(55, 66, 250, 0.15); border-color: var(--accent-blue); }
.log-enemy { background: rgba(255, 71, 87, 0.15); border-color: var(--accent-red); }
.log-system { background: rgba(255, 215, 0, 0.15); border-color: var(--accent-gold); color: var(--accent-gold); }
.log-event { background: rgba(162, 155, 254, 0.15); border-color: var(--accent-purple); }

/* 操作按钮 */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-btn { padding: 14px; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; touch-action: manipulation; }
.action-btn:active { transform: scale(0.95); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-attack { background: linear-gradient(135deg, #ff4757, #ff6348); color: white; }
.btn-defend { background: linear-gradient(135deg, #3742fa, #5352ed); color: white; }
.btn-skill { background: linear-gradient(135deg, #a29bfe, #6c5ce7); color: white; }
.btn-ult { background: linear-gradient(135deg, #ffd700, #ffa502); color: #1a1a2e; }

/* 事件弹窗 */
.event-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85); z-index: 1000; padding: 20px; align-items: center; justify-content: center; }
.event-modal.active { display: flex; }
.event-content { background: var(--bg-secondary); border-radius: 16px; padding: 24px; max-width: 360px; width: 100%; border: 1px solid var(--border-color); }
.event-title { font-size: 20px; font-weight: bold; margin-bottom: 12px; color: var(--accent-gold); }
.event-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.event-choices { display: flex; flex-direction: column; gap: 10px; }

/* 进化选择 */
.evolution-options { display: grid; gap: 12px; }
.evo-card { background: var(--bg-card); border: 2px solid var(--border-color); border-radius: 12px; padding: 16px; cursor: pointer; transition: all 0.2s; }
.evo-card:hover, .evo-card:active { border-color: var(--accent-gold); }
.evo-name { font-size: 16px; font-weight: bold; margin-bottom: 6px; color: var(--accent-gold); }
.evo-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.evo-bonus { font-size: 12px; color: var(--accent-green); }

/* 结果页面 */
.result-container { text-align: center; padding: 60px 20px; }
#result-icon { font-size: 80px; margin-bottom: 20px; }
#result-title { font-size: 28px; margin-bottom: 16px; }
#result-message { font-size: 15px; color: var(--text-secondary); margin-bottom: 30px; }

/* 规则页面 */
.rules-content { max-height: 60vh; overflow-y: auto; margin-bottom: 20px; }
.rules-content h3 { color: var(--accent-gold); margin: 16px 0 8px; font-size: 16px; }
.rules-content ul { list-style: none; padding-left: 0; }
.rules-content li { padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--border-color); }
.rules-content li:last-child { border-bottom: none; }
.rules-content strong { color: var(--accent-gold); }

/* 页脚 */
.footer-note { text-align: center; margin-top: 30px; color: var(--text-secondary); font-size: 12px; }
.footer-note p { margin: 4px 0; }

/* 工具类 */
.hidden { display: none !important; }

/* ===== 新增样式 v1.0.3 ===== */

/* 角色战斗属性显示 */
.combatant-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.combatant-stats span {
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: 4px;
}

/* 角色详情面板 */
.character-detail { margin-bottom: 12px; }
.character-detail .section-title {
    color: var(--accent-gold);
    font-size: 14px;
    cursor: pointer;
    padding: 10px;
    background: rgba(255,215,0,0.1);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.detail-content {
    padding: 12px;
    animation: fadeIn 0.3s ease;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-secondary); }
.detail-row span:last-child { color: var(--accent-gold); font-weight: bold; }

/* 装备栏样式优化 */
.equipment-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.equipment-slot {
    aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
}
.equipment-slot:hover {
    border-color: var(--accent-gold);
    transform: scale(1.05);
}
.equipment-slot.empty {
    opacity: 0.5;
    border-style: dashed;
}
.equipment-slot .slot-icon {
    font-size: 24px;
    margin-bottom: 4px;
}
.equipment-slot .slot-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.equipment-slot .slot-status {
    font-size: 10px;
    color: var(--accent-gold);
}
.equipment-slot.equipped .slot-status {
    color: var(--accent-green);
}

/* 其他战线对战页面 */
.other-battles-container {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 16px;
}
.battle-result-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
}
.battle-result-card.highlight {
    border-color: var(--accent-gold);
    background: rgba(255,215,0,0.1);
}
.battle-fighters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.fighter-info {
    text-align: center;
    flex: 1;
}
.fighter-avatar {
    font-size: 28px;
    margin-bottom: 4px;
}
.fighter-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}
.fighter-rank {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}
.battle-vs {
    font-size: 14px;
    color: var(--accent-gold);
    font-weight: bold;
    padding: 0 10px;
}
.battle-winner {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--accent-green);
}
.tournament-progress {
    margin-top: 16px;
}
