/* ========================================
   VSCode v1.104 - Level System CSS (Ultra Enhanced)
   ======================================== */

/* レベルシステムコンテナ */
.level-system {
    position: fixed;
    top: 40px;
    right: 10px;
    background: linear-gradient(135deg, #252526 0%, #1e1e1e 100%);
    border: 1px solid #454545;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.level-system:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.level-system.expanded {
    padding: 12px 16px;
}

/* レベルバッジ */
.level-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.level-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.level-icon i {
    font-size: 16px;
}

.level-system:hover .level-icon {
    transform: scale(1.1);
}

.level-number {
    font-size: 14px;
    font-weight: 700;
    color: #cccccc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: color 0.3s ease;
}

/* プログレスバー */
.level-progress {
    width: 60px;
    height: 4px;
    background: #3c3c3c;
    border-radius: 2px;
    overflow: hidden;
}

.level-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007acc, #007acccc);
    border-radius: 2px;
    transition: width 0.5s ease, background 0.3s ease;
}

/* XP表示 */
.level-xp {
    font-size: 11px;
    color: #858585;
    min-width: 70px;
    text-align: right;
}

/* パークパネル */
.level-perks {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: linear-gradient(135deg, #2d2d30 0%, #252526 100%);
    border: 1px solid #454545;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 220px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.level-perks.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.perk-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.perk-title i {
    font-size: 16px;
}

.perk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #cccccc;
}

.perk-item i {
    color: #858585;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.perk-text {
    flex: 1;
}

.perk-value {
    font-weight: 600;
    color: #4ec9b0;
}

/* XPポップアップ */
.xp-popup {
    position: fixed;
    font-size: 16px;
    font-weight: 700;
    color: #4ec9b0;
    pointer-events: none;
    z-index: 10000;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: xpPopup 1s ease-out forwards;
}

@keyframes xpPopup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8);
    }
}

/* レベルアップオーバーレイ */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.level-up-overlay.show {
    opacity: 1;
    visibility: visible;
}

.level-up-content {
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-up-overlay.show .level-up-content {
    transform: scale(1);
}

.level-up-icon {
    margin-bottom: 24px;
    animation: levelUpPulse 1s ease infinite;
}

.level-up-icon svg {
    filter: drop-shadow(0 0 20px currentColor);
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.level-up-content h2 {
    font-size: 48px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    letter-spacing: 4px;
    animation: levelUpText 0.5s ease;
}

@keyframes levelUpText {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.level-up-number {
    font-size: 72px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 4px 30px rgba(255, 215, 0, 0.6);
    margin-bottom: 24px;
    animation: levelUpNumber 0.6s ease 0.2s backwards;
}

@keyframes levelUpNumber {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.level-up-perks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: levelUpPerks 0.6s ease 0.4s backwards;
}

@keyframes levelUpPerks {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.level-up-perk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 18px;
    color: #cccccc;
}

.level-up-perk i {
    font-size: 20px;
}

/* レベルアップフラッシュ */
.level-up-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    animation: levelFlash 0.6s ease-out forwards;
}

@keyframes levelFlash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* ブーストインジケーター */
.boost-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e1e1e 0%, #252526 100%);
    border: 2px solid #007acc;
    border-radius: 12px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 122, 204, 0.4);
    animation: boostIn 0.4s ease;
}

.boost-indicator.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s ease;
}

@keyframes boostIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.boost-indicator i {
    font-size: 24px;
}

/* パーティクルコンテナ */
.level-particles {
    position: fixed;
    top: 40px;
    right: 40px;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 999;
}

.xp-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--color, #4ec9b0);
    border-radius: 50%;
    animation: particleFloat 1s ease-out forwards;
    box-shadow: 0 0 8px var(--color, #4ec9b0);
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0);
    }
}

/* パフォーマンスメーター */
.performance-meter {
    position: fixed;
    top: 40px;
    right: 220px;
    background: linear-gradient(135deg, #252526 0%, #1e1e1e 100%);
    border: 1px solid #454545;
    border-radius: 8px;
    padding: 10px 14px;
    z-index: 999;
    min-width: 160px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.performance-meter:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.perf-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #858585;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #3c3c3c;
}

.perf-header i {
    font-size: 12px;
}

.perf-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perf-stat {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 8px;
}

.perf-label {
    font-size: 10px;
    color: #858585;
}

.perf-bar {
    height: 4px;
    background: #3c3c3c;
    border-radius: 2px;
    overflow: hidden;
}

.perf-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.3s ease;
}

.perf-value {
    font-size: 10px;
    font-weight: 600;
    color: #4ec9b0;
    text-align: right;
}

/* アチーブメントポップアップ */
.achievement-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
    border: 1px solid #ffd700;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
    animation: achievementIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.achievement-popup.fade-out {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

@keyframes achievementIn {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.achievement-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: achievementPulse 1s ease infinite;
}

.achievement-icon i {
    font-size: 24px;
    color: #1e1e1e;
}

@keyframes achievementPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px #ffd700; }
    50% { transform: scale(1.05); box-shadow: 0 0 20px #ffd700; }
}

.achievement-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    color: #cccccc;
}

/* 統計モーダル */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.stats-modal-content {
    position: relative;
    background: linear-gradient(135deg, #252526 0%, #1e1e1e 100%);
    border: 1px solid #454545;
    border-radius: 12px;
    width: 480px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.stats-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #3c3c3c;
}

.stats-modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-close {
    background: none;
    border: none;
    color: #858585;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.stats-close:hover {
    background: #3c3c3c;
    color: #ffffff;
}

.stats-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.stats-section {
    margin-bottom: 24px;
}

.stats-section:last-child {
    margin-bottom: 0;
}

.stats-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: #858585;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    background: #1e1e1e;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #858585;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #4ec9b0;
}

/* レベル別スタイル */
.level-system[data-level="2"] { border-color: #4ec9b0; }
.level-system[data-level="3"] { border-color: #569cd6; }
.level-system[data-level="4"] { border-color: #c586c0; }
.level-system[data-level="5"] { border-color: #ce9178; }
.level-system[data-level="6"] { border-color: #dcdcaa; }
.level-system[data-level="7"] { border-color: #6a9955; }
.level-system[data-level="8"] { border-color: #d7ba7d; }
.level-system[data-level="9"] { border-color: #f14c4c; }
.level-system[data-level="10"] { 
    border-color: #ffd700; 
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* アニメーション用のレベル別グロー */
.level-system[data-level="10"] .level-icon {
    animation: legendGlow 2s ease infinite;
}

@keyframes legendGlow {
    0%, 100% { filter: drop-shadow(0 0 5px #ffd700); }
    50% { filter: drop-shadow(0 0 15px #ffd700); }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .level-system {
        top: auto;
        bottom: 30px;
        right: 10px;
    }
    
    .performance-meter {
        display: none;
    }
    
    .stats-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
