/* ============ 游戏系统样式 ============ */

/* 角色面板 */
#character-panel {
    background: white;
    border: 4px solid black;
    box-shadow: 8px 8px 0px 0px rgba(0,0,0,0.2);
    padding: 24px;
    margin-bottom: 24px;
}

.character-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.character-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #D4FF00, #B8FF9F);
    border: 3px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.character-info h3 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 24px;
    margin: 0;
    color: #000;
}

.character-class {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    color: #666;
}

.character-rank {
    margin-left: auto;
    padding: 8px 16px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 14px;
    color: white;
    border: 3px solid black;
    text-transform: uppercase;
}

/* 属性条 */
.character-bars {
    margin-bottom: 20px;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bar-label {
    width: 40px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 12px;
}

.bar-container {
    flex: 1;
    height: 16px;
    background: #f0f0f0;
    border: 2px solid black;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-value {
    width: 80px;
    text-align: right;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: bold;
}

/* 属性数值 */
.character-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f5f5;
    border: 2px solid black;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-item i {
    font-size: 20px;
    color: #333;
}

.stat-label {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #666;
}

.stat-value {
    font-family: 'Archivo Black', sans-serif;
    font-size: 18px;
    color: #000;
}

/* 属性点通知 */
.attribute-points-notice {
    background: linear-gradient(135deg, #D4FF00, #B8FF9F);
    border: 3px solid black;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
}

.attribute-points-notice button {
    margin-left: auto;
    padding: 8px 16px;
    background: black;
    color: white;
    border: none;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    cursor: pointer;
}

/* PVP数据 */
.character-pvp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.pvp-stat {
    text-align: center;
    padding: 12px;
    background: #f0f0f0;
    border: 2px solid black;
}

.pvp-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.pvp-value {
    font-family: 'Archivo Black', sans-serif;
    font-size: 20px;
    color: #000;
}

/* 战斗按钮 */
.character-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.btn-battle {
    padding: 16px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    border: 3px solid black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn-pve {
    background: linear-gradient(135deg, #4ECDC4, #44A8B3);
    color: white;
    box-shadow: 4px 4px 0px 0px #2C7A7B;
}

.btn-pvp {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    box-shadow: 4px 4px 0px 0px #C53030;
}

.btn-battle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px 0px;
}

.btn-battle:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px;
}

/* ============ 战斗界面 ============ */

#battle-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.battle-container {
    width: 90%;
    max-width: 600px;
    background: white;
    border: 4px solid black;
    box-shadow: 12px 12px 0px 0px rgba(0,0,0,0.3);
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #000, #333);
    color: white;
}

.battle-header h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 24px;
    margin: 0;
}

.battle-round {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    padding: 6px 12px;
    background: #D4FF00;
    color: black;
    border: 2px solid black;
}

.battle-arena {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: #f5f5f5;
}

.combatant {
    width: 40%;
    text-align: center;
}

.combatant-name {
    font-family: 'Archivo Black', sans-serif;
    font-size: 18px;
    margin-bottom: 12px;
}

.combatant .hp-bar,
.combatant .mp-bar {
    height: 20px;
    background: #ddd;
    border: 2px solid black;
    margin-bottom: 4px;
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B, #FF8E53);
    transition: width 0.3s ease;
}

.mp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #44A8B3);
    transition: width 0.3s ease;
}

.enemy-hp .hp-fill {
    background: linear-gradient(90deg, #9B59B6, #8E44AD);
}

.hp-text,
.mp-text {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #666;
}

.shield-indicator {
    margin-top: 8px;
    padding: 4px 12px;
    background: #4ECDC4;
    border: 2px solid black;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
}

.vs-indicator {
    font-family: 'Archivo Black', sans-serif;
    font-size: 32px;
    color: #FF6B6B;
    text-shadow: 2px 2px 0px black;
}

.battle-log {
    height: 150px;
    overflow-y: auto;
    padding: 16px;
    background: #000;
    color: #D4FF00;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.battle-log p {
    margin: 0 0 4px 0;
}

.battle-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 16px;
    background: #f0f0f0;
}

.btn-action {
    padding: 14px 12px;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    border: 3px solid black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn-action.attack {
    background: #D4FF00;
    color: black;
}

.btn-action.skill {
    background: #FF90E8;
    color: black;
}

.btn-action.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.mp-cost {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 11px;
    color: #00FFFF;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 战斗结果 */
.battle-result {
    padding: 32px;
    text-align: center;
}

.battle-result.victory {
    background: linear-gradient(135deg, #D4FF00, #B8FF9F);
}

.battle-result.defeat {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}

.result-title {
    font-family: 'Archivo Black', sans-serif;
    font-size: 48px;
    margin: 0 0 24px 0;
    color: #000;
    text-shadow: 3px 3px 0px rgba(255,255,255,0.5);
}

.result-details {
    margin-bottom: 24px;
}

.result-details p {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    margin: 8px 0;
    color: #000;
}

.result-details .level-up {
    font-size: 20px;
    font-weight: bold;
    color: #9B59B6;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.final-log {
    height: auto;
    max-height: 100px;
    margin-bottom: 24px;
    text-align: left;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.result-actions button {
    padding: 14px 28px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    border: 3px solid black;
    cursor: pointer;
}

.btn-close {
    background: white;
    color: black;
}

.btn-continue {
    background: black;
    color: white;
}

/* ============ 职业选择 ============ */

#create-character-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#create-character-modal > div {
    width: 90%;
    max-width: 800px;
    background: white;
    border: 4px solid black;
    box-shadow: 12px 12px 0px 0px rgba(0,0,0,0.3);
    padding: 32px;
}

#create-character-modal h2 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 36px;
    text-align: center;
    margin: 0 0 8px 0;
}

#create-character-modal > div > p {
    font-family: 'Space Mono', monospace;
    text-align: center;
    color: #666;
    margin-bottom: 24px;
}

#character-name {
    width: 100%;
    padding: 16px;
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    border: 3px solid black;
    margin-bottom: 24px;
    box-sizing: border-box;
}

#profession-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.profession-card {
    padding: 20px;
    border: 3px solid black;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
}

.profession-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px 0px black;
}

.profession-card.selected {
    background: #D4FF00;
    box-shadow: 6px 6px 0px 0px black;
}

.profession-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.profession-card h3 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 18px;
    margin: 0 0 8px 0;
}

.profession-card p {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #666;
    margin: 0 0 12px 0;
}

.profession-stats {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#create-character-modal button[onclick="createCharacter()"] {
    width: 100%;
    padding: 18px;
    background: black;
    color: white;
    border: none;
    font-family: 'Archivo Black', sans-serif;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 4px 4px 0px 0px #D4FF00;
}

/* ============ 成就系统 ============ */

#achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 3px solid black;
    transition: all 0.15s ease;
}

.achievement-item.completed {
    background: linear-gradient(135deg, #D4FF00 0%, #B8FF9F 100%);
}

.achievement-item.claimed {
    opacity: 0.6;
}

.achievement-icon {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border: 2px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.achievement-info {
    flex: 1;
}

.achievement-info h4 {
    font-family: 'Archivo Black', sans-serif;
    font-size: 16px;
    margin: 0 0 4px 0;
}

.achievement-info p {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #666;
    margin: 0 0 8px 0;
}

.achievement-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-progress .progress-bar {
    width: 100px;
    height: 8px;
    background: #ddd;
    border: 1px solid #999;
}

.achievement-progress .progress-fill {
    height: 100%;
    background: #4ECDC4;
}

.progress-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #666;
}

.achievement-reward {
    text-align: right;
}

.exp-reward {
    display: block;
    font-family: 'Archivo Black', sans-serif;
    font-size: 14px;
    color: #9B59B6;
    margin-bottom: 8px;
}

.btn-claim {
    padding: 8px 16px;
    background: #D4FF00;
    border: 2px solid black;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    cursor: pointer;
}

/* ============ 通知 ============ */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border: 3px solid black;
    box-shadow: 4px 4px 0px 0px black;
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #D4FF00;
}

.notification.error {
    background: #FF6B6B;
    color: white;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .character-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .character-pvp-stats {
        grid-template-columns: 1fr;
    }

    .character-actions {
        grid-template-columns: 1fr;
    }

    #profession-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .battle-arena {
        flex-direction: column;
        gap: 20px;
    }

    .combatant {
        width: 100%;
    }

    .vs-indicator {
        margin: 12px 0;
    }

    .battle-actions {
        grid-template-columns: 1fr;
    }
}
