/* ============================================================
   TUNARENA ARENA - Styles (Light Theme)
   ============================================================ */

/* === Arena Title === */
.arena-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* === Arena Button === */
.btn-arena {
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.btn-arena:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 106, 244, 0.3);
}

/* === Rank Badges === */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25em 0.75em;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.rank-bronze { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }
.rank-silver { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); color: #000; }
.rank-gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-platinum { background: linear-gradient(135deg, #E5E4E2, #B4C5D4); color: #000; }
.rank-diamond { background: linear-gradient(135deg, #B9F2FF, #7DF9FF); color: #000; }

/* === Mode Selector Cards === */
.mode-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    text-align: left;
    transition: all 0.2s;
    cursor: default;
    height: 100%;
    box-shadow: var(--card-shadow-md);
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-lg);
}

.mode-card-standard { border-left: 4px solid var(--primary); }
.mode-card-blitz { border-left: 4px solid var(--orange); }
.mode-card-survival { border-left: 4px solid var(--danger); }
.mode-card-party { border-left: 4px solid var(--purple); }

.mode-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.mode-card-standard .mode-card-icon { background: var(--primary); box-shadow: 0 4px 12px rgba(37, 106, 244, 0.3); }
.mode-card-blitz .mode-card-icon { background: var(--orange); box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3); }
.mode-card-survival .mode-card-icon { background: var(--danger); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.mode-card-party .mode-card-icon { background: var(--purple); box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3); }

.mode-card-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.mode-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.mode-card-entry {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2em 0.6em;
    border-radius: var(--radius);
    background: var(--primary-10);
    color: var(--primary);
}

/* === Blitz Game Clock === */
.game-clock {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    padding: 0.15em 0.5em;
    border-radius: var(--radius);
    background: var(--primary-10);
    border: 1px solid var(--primary-light);
}

.game-clock-urgent {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    animation: combo-pulse 0.6s infinite alternate;
}

/* === Survival Lives === */
.lives-display { display: flex; gap: 3px; align-items: center; }
.life-heart { color: var(--danger); font-size: 1.1rem; transition: opacity 0.3s; }
.life-heart.empty { opacity: 0.15; }

@keyframes heart-break {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); color: var(--danger); }
    100% { transform: scale(0.8); opacity: 0.15; }
}
.life-lost-anim { animation: heart-break 0.5s ease-out forwards; }

/* === Matchmaking === */
.matchmaking-searching { padding: 2rem; }

.searching-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.searching-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    animation: dot-pulse 1.4s infinite ease-in-out;
}

.searching-dots span:nth-child(2) { animation-delay: 0.2s; }
.searching-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   DUEL UI
   ============================================================ */

/* === Zone A: Top Bar === */
.duel-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.duel-topbar-left { display: flex; align-items: center; gap: 10px; }
.duel-topbar-center { flex-shrink: 0; }
.duel-topbar-right { display: flex; align-items: center; }

.duel-round {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.duel-combo {
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--primary);
    padding: 0.15em 0.5em;
    border-radius: var(--radius);
    background: var(--primary-10);
    border: 1px solid var(--primary-light);
}

.duel-combo.combo-fire {
    animation: combo-pulse 0.6s infinite alternate;
    color: #FF4500;
    border-color: #FF4500;
    background: rgba(255, 69, 0, 0.1);
}

@keyframes combo-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* Timer */
.duel-timer { position: relative; width: 60px; height: 60px; }
.timer-text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem; font-weight: 800; color: var(--text);
}

/* Scores */
.duel-scores { display: flex; align-items: center; gap: 8px; }
.score-me, .score-opp { display: flex; flex-direction: column; align-items: center; }
.score-label {
    font-size: 0.7rem; color: var(--text-secondary);
    max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.score-value { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.score-vs { font-size: 0.8rem; color: var(--text-muted); }

/* === Duel Main Layout === */
.duel-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 70px);
    background: var(--bg);
}

.duel-zone-b {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.duel-zone-c {
    padding: 1rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}

@media (min-width: 992px) {
    .duel-main { flex-direction: row; }
    .duel-zone-b { flex: 1; }
    .duel-zone-c {
        width: 280px; border-top: none;
        border-left: 1px solid var(--border);
        display: flex; flex-direction: column; justify-content: center;
    }
}

/* === Duel Timeline === */
.duel-timeline-wrapper {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.duel-timeline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1rem;
    flex-wrap: nowrap;
    width: fit-content;
    margin: 0 auto;
    min-width: 100%;
    justify-content: center;
}

.duel-timeline .timeline-card {
    flex-shrink: 0;
    width: 85px;
    height: 110px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    box-shadow: var(--card-shadow);
}

.duel-timeline .timeline-card .card-year {
    color: var(--primary);
}

.duel-timeline .timeline-drop {
    flex-shrink: 0;
    width: 44px;
    height: 110px;
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
    color: var(--primary-light);
    font-size: 1.2rem;
}

.duel-timeline .timeline-drop:hover,
.duel-timeline .timeline-drop.drop-hover {
    background-color: var(--primary-10);
    border-color: var(--primary);
    opacity: 1;
    transform: scale(1.05);
}
.duel-timeline .timeline-drop.drop-hover {
    background-color: rgba(108, 43, 217, 0.15);
    box-shadow: 0 0 12px rgba(108, 43, 217, 0.3);
}

/* Drag states */
.music-card[draggable="true"] { cursor: grab; }
.music-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}
.drag-ghost {
    position: fixed;
    width: 48px; height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(108, 43, 217, 0.4);
    transform: translate(-50%, -50%);
}

/* === Timeline Skins === */

/* Neon */
.duel-timeline.skin-neon .timeline-card {
    border-color: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3), inset 0 0 8px rgba(0, 255, 136, 0.05);
    background: linear-gradient(145deg, #f0fff7, #e0fff0);
}
.duel-timeline.skin-neon .timeline-card .card-year {
    color: #059669;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.4);
}
.duel-timeline.skin-neon .timeline-drop { border-color: rgba(0, 255, 136, 0.4); color: #059669; }
.duel-timeline.skin-neon .timeline-drop:hover { background-color: rgba(0, 255, 136, 0.1); border-color: #00ff88; }

/* Retro */
.duel-timeline.skin-retro .timeline-card {
    border-color: #c4956a;
    background: linear-gradient(145deg, #fdf6ee, #f5ead8);
    border-radius: 4px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.duel-timeline.skin-retro .timeline-card .card-year { color: #92400e; font-family: 'Courier New', monospace; }
.duel-timeline.skin-retro .timeline-card .card-title-small,
.duel-timeline.skin-retro .timeline-card .card-artist-small { color: #a16207; }
.duel-timeline.skin-retro .timeline-drop { border-color: rgba(196, 149, 106, 0.4); border-radius: 4px; color: #92400e; }
.duel-timeline.skin-retro .timeline-drop:hover { background-color: rgba(196, 149, 106, 0.1); border-color: #c4956a; }

/* Vinyl */
.duel-timeline.skin-vinyl .timeline-card {
    border-color: #374151;
    background: radial-gradient(circle at 30% 30%, #f9fafb, #e5e7eb);
    border-radius: 50% 50% 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.duel-timeline.skin-vinyl .timeline-card .card-year { color: #111827; }
.duel-timeline.skin-vinyl .timeline-drop { border-color: rgba(0,0,0,0.15); color: #6b7280; }
.duel-timeline.skin-vinyl .timeline-drop:hover { background-color: rgba(0,0,0,0.04); border-color: #6b7280; }

/* Gold */
.duel-timeline.skin-gold .timeline-card {
    border-color: #fbbf24;
    background: linear-gradient(145deg, #fffbeb, #fef3c7);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}
.duel-timeline.skin-gold .timeline-card .card-year { color: #92400e; text-shadow: 0 0 4px rgba(255, 215, 0, 0.4); }
.duel-timeline.skin-gold .timeline-card .card-title-small,
.duel-timeline.skin-gold .timeline-card .card-artist-small { color: #a16207; }
.duel-timeline.skin-gold .timeline-drop { border-color: rgba(255, 215, 0, 0.3); color: #b45309; }
.duel-timeline.skin-gold .timeline-drop:hover { background-color: rgba(255, 215, 0, 0.1); border-color: #fbbf24; }

/* Holographique */
.duel-timeline.skin-holographique .timeline-card {
    border: 2px solid transparent;
    background: var(--bg-white);
    background-clip: padding-box;
    position: relative;
    box-shadow: 0 0 6px rgba(255, 0, 128, 0.15), 0 0 6px rgba(0, 200, 255, 0.15);
}
.duel-timeline.skin-holographique .timeline-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 14px;
    background: linear-gradient(135deg, #ff0080, #7928ca, #00c8ff, #00ff88, #ff0080);
    background-size: 300% 300%; animation: holo-shift 3s ease-in-out infinite; z-index: -1;
}
@keyframes holo-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.duel-timeline.skin-holographique .timeline-card .card-year {
    background: linear-gradient(90deg, #ff0080, #7928ca, #00c8ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.duel-timeline.skin-holographique .timeline-drop { border-color: rgba(121, 40, 202, 0.3); color: #7928ca; }
.duel-timeline.skin-holographique .timeline-drop:hover {
    background: linear-gradient(135deg, rgba(255,0,128,0.05), rgba(0,200,255,0.05)); border-color: #7928ca;
}

/* === Music Card (Zone C) === */
.music-card { text-align: center; }

.music-card-visual {
    width: 120px; height: 120px; margin: 0 auto 1rem;
    background: var(--bg); border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: var(--card-shadow-md);
}

.music-card-visual i { font-size: 3rem; color: var(--primary-light); }
.music-card-visual img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-lg); }
.music-card-info { margin-bottom: 1rem; font-size: 0.9rem; color: var(--text); }

.audio-progress { margin-top: 0.75rem; }
.audio-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.audio-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px; width: 0; transition: width 0.5s linear;
}
.audio-time { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   ROUND RESULT
   ============================================================ */

.round-result-card {
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--card-shadow-lg);
    animation: reveal-in 0.4s ease-out;
}

.result-song { margin-bottom: 1.5rem; }
.result-song-year { font-size: 3rem; font-weight: 900; color: var(--primary); }
.result-song-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.result-song-artist { font-size: 0.9rem; color: var(--text-secondary); }

.result-comparison { display: flex; align-items: flex-start; justify-content: center; gap: 1.5rem; }
.result-player { flex: 1; max-width: 180px; }
.result-player-label {
    font-weight: 700; color: var(--text-secondary); font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.result-feedback { font-size: 1.3rem; font-weight: 900; margin-bottom: 0.25rem; }
.result-perfect { color: var(--success); }
.result-close { color: var(--secondary); }
.result-far { color: var(--danger); }
.result-points { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.result-detail { font-size: 0.75rem; color: var(--text-muted); }
.result-vs { color: var(--text-muted); font-size: 0.9rem; padding-top: 2rem; }
.result-scores { font-size: 1.5rem; }

/* ============================================================
   MATCH END
   ============================================================ */

.match-end { text-align: center; padding: 3rem 1.5rem; max-width: 450px; margin: 0 auto; }
.match-end-result { font-size: 3rem; font-weight: 900; margin-bottom: 1rem; }
.result-victory .match-end-result { color: var(--primary); }
.result-defeat .match-end-result { color: var(--danger); }
.result-draw .match-end-result { color: var(--text-secondary); }

.match-end-scores {
    font-size: 2.5rem; font-weight: 800; color: var(--text);
    display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 1rem;
}
.match-end-scores .vs { color: var(--text-muted); font-size: 1.5rem; }
.match-end-elo { font-size: 1.5rem; font-weight: 800; }
.match-end-coins { font-size: 1.3rem; font-weight: 800; margin-top: 0.5rem; }

/* ============================================================
   RANKINGS PAGE
   ============================================================ */

.rankings-title {
    font-size: 2rem; font-weight: 900; color: var(--text);
}

.rank-distribution { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.rank-dist-bronze { background: #CD7F32; }
.rank-dist-silver { background: #C0C0C0; }
.rank-dist-gold { background: #FFD700; }
.rank-dist-platinum { background: #B4C5D4; }
.rank-dist-diamond { background: #7DF9FF; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */

/* Hero section */
.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 1rem;
    background: var(--bg-white);
    position: relative;
}

.profile-frame {
    background: linear-gradient(45deg, var(--primary), #9333ea, var(--primary));
    padding: 4px;
    border-radius: 50%;
    position: relative;
}

.profile-avatar-img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: var(--bg);
    border: 4px solid var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.profile-level-badge {
    position: relative;
    margin-top: -0.75rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
    border: 2px solid var(--bg-white);
    box-shadow: 0 2px 8px rgba(37, 106, 244, 0.3);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0.75rem 0 0.15rem;
}

.profile-rank-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.profile-rank-pos {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-joined {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

/* Stats section */
.profile-stats-section {
    padding: 1.25rem 0;
}

.profile-section {
    padding: 1.25rem 0;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.profile-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
}

.profile-stat-card-wide { grid-column: span 2; }

.profile-stat-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-stat-meta i { font-size: 0.8rem; }

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
}

.profile-stat-extra {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
}

/* Elo chart */
.profile-elo-chart {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--card-shadow);
}

.profile-elo-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 80px;
}

.profile-elo-bar {
    flex: 1;
    min-width: 3px;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: 2px 2px 0 0;
    transition: height 0.3s;
}

.profile-elo-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.elo-positive { color: var(--success); font-weight: 700; }
.elo-negative { color: var(--danger); font-weight: 700; }
.elo-neutral { color: var(--text-muted); }

/* ============================================================
   SHOP
   ============================================================ */

.shop-header-sub {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
}

.wallet-chip-coins {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--primary-10);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

/* Category tabs */
.shop-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.shop-tabs::-webkit-scrollbar { display: none; }

.shop-tab {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.shop-tab-active {
    background: var(--primary);
    color: #fff;
}

/* Shop grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.shop-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s;
}

.shop-card:active { transform: scale(0.98); }
.shop-card-owned { opacity: 0.85; }

.shop-card-visual {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
    overflow: hidden;
}

.shop-card-rarity {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 9999px;
    letter-spacing: 0.03em;
}

.shop-card-rarity.rarity-common { background: rgba(100,116,139,0.15); color: #64748b; }
.shop-card-rarity.rarity-rare { background: var(--primary-10); color: var(--primary); }
.shop-card-rarity.rarity-epic { background: rgba(147,51,234,0.12); color: var(--purple); }
.shop-card-rarity.rarity-legendary { background: rgba(249,115,22,0.12); color: var(--orange); }

.shop-card-info { display: flex; flex-direction: column; }
.shop-card-name { font-size: 0.85rem; font-weight: 700; color: var(--text); margin: 0; }
.shop-card-type { font-size: 0.65rem; font-weight: 500; color: var(--text-muted); margin: 0; }

.shop-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 0.45rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.shop-card-btn:active { transform: scale(0.95); }

.shop-card-btn-buy {
    background: var(--primary);
    color: #fff;
}

.shop-card-btn-buy.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shop-card-btn-equip {
    background: var(--bg);
    color: var(--primary);
    border: 1px solid var(--primary-20);
}

.shop-card-btn-equipped {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.shop-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.shop-empty i { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }

/* Legacy classes (backward compat) */
.shop-item { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: 0.75rem; text-align: center; }
.shop-item-rarity { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; }
.shop-item-rarity.rarity-common { background: rgba(100,116,139,0.1); color: #64748b; }
.shop-item-rarity.rarity-rare { background: var(--primary-10); color: var(--primary); }
.shop-item-rarity.rarity-epic { background: rgba(147,51,234,0.1); color: var(--purple); }
.shop-item-rarity.rarity-legendary { background: rgba(249,115,22,0.1); color: var(--orange); }

/* ============================================================
   MISSIONS
   ============================================================ */

.mission-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-lg); padding: 1rem; transition: all 0.2s;
    box-shadow: var(--card-shadow);
}

.mission-card.mission-done { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1); }
.mission-card.mission-claimed { border-color: var(--success); opacity: 0.7; }

.mission-icon {
    width: 48px; height: 48px; border-radius: var(--radius-lg);
    background: var(--primary-10); display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--primary); flex-shrink: 0;
}
.mission-done .mission-icon { background: rgba(245, 158, 11, 0.1); color: var(--secondary); }
.mission-claimed .mission-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.mission-label { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.mission-desc { font-size: 0.8rem; color: var(--text-secondary); }

.mission-progress { display: flex; align-items: center; gap: 8px; }
.mission-progress-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.mission-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px; transition: width 0.3s;
}
.mission-done .mission-progress-fill { background: linear-gradient(90deg, var(--secondary), var(--orange)); }
.mission-reward { flex-shrink: 0; }

/* === Party Scoreboard === */
.party-scores { display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.party-player-row {
    display: flex; justify-content: space-between; padding: 2px 8px;
    border-radius: var(--radius); font-size: 0.85rem; color: var(--text-secondary);
}
.party-player-me { background: var(--primary-10); color: var(--primary); font-weight: 600; }

.party-result-grid { display: flex; flex-direction: column; gap: 4px; }
.party-result-player {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 4px 8px; border-radius: var(--radius); font-size: 0.85rem; color: var(--text-secondary);
}
.party-result-player.party-player-me { background: var(--primary-10); color: var(--primary); font-weight: 600; }

/* ============================================================
   BATTLE PASS
   ============================================================ */

.bp-track-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bp-track { display: flex; gap: 0; padding: 1rem 0; min-width: max-content; }

.bp-tier {
    min-width: 80px; text-align: center; position: relative;
    padding: 0.75rem 0.5rem; border-right: 1px solid var(--border-light); transition: all 0.2s;
}
.bp-tier-locked { opacity: 0.35; }
.bp-tier-current {
    border: 2px solid var(--primary); border-radius: var(--radius-lg);
    background: var(--primary-10);
}
.bp-tier-claimed { opacity: 0.6; }
.bp-tier-number { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.25rem; }
.bp-tier-reward { font-size: 1.2rem; margin-bottom: 0.25rem; }
.bp-tier-premium {
    font-size: 0.9rem; padding: 2px 4px; border-radius: 4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
}
.bp-claim-btn { font-size: 0.7rem; padding: 0.15rem 0.4rem; }
.bp-xp-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bp-xp-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px; transition: width 0.5s;
}

/* === Live indicator === */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--danger); position: relative;
}

.live-dot::before {
    content: ''; position: absolute; inset: -2px;
    border-radius: 50%; background: var(--danger);
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite; opacity: 0.6;
}

@keyframes ping {
    0% { transform: scale(1); opacity: 0.6; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

/* ============================================================
   LOBBY (arena.php redesign)
   ============================================================ */

.lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.75rem;
}

.lobby-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.live-badge-dot {
    position: relative;
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
}

.live-badge-dot::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--danger);
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
    opacity: 0.6;
}

.live-badge-text {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Lobby mode cards */
.lobby-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow-md);
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.lobby-card:active { transform: scale(0.98); }

.lobby-card-entry {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2em 0.65em;
    border-radius: var(--radius);
    z-index: 1;
}

.lobby-card-body {
    padding: 1.25rem;
}

.lobby-card-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 1rem;
}

.lobby-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.lobby-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.lobby-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lobby-card-players {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.lobby-card-players-dot {
    font-size: 6px;
    color: var(--success);
}

.lobby-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.lobby-card-btn:hover { opacity: 0.9; color: #fff; }

/* Matchmaking card */
.matchmaking-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--card-shadow-md);
    margin-bottom: 1rem;
}

.matchmaking-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1rem;
}

.matchmaking-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Recent duels */
.lobby-recent {
    margin-top: 1.5rem;
}

.lobby-recent-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lobby-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lobby-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    box-shadow: var(--card-shadow);
}

.lobby-recent-opponent {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lobby-recent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.lobby-recent-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.lobby-recent-score {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lobby-recent-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-result {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-win { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-loss { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-draw { background: rgba(100, 116, 139, 0.1); color: var(--text-secondary); }

.lobby-recent-elo {
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
}

.elo-pos { color: var(--success); }
.elo-neg { color: var(--danger); }

/* ============================================================
   AUTH (login/register pages)
   ============================================================ */

.auth-hero {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}

.auth-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #5a8ff7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(37, 106, 244, 0.3);
}

.auth-hero-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.auth-hero-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow-md);
}

.auth-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .arena-title { font-size: 1.5rem; }
    .duel-topbar { padding: 0.4rem 0.5rem; gap: 4px; }
    .duel-round { font-size: 0.8rem; }
    .score-value { font-size: 1rem; }
    .score-label { font-size: 0.6rem; max-width: 50px; }
    .duel-timer { width: 48px; height: 48px; }
    .duel-timer svg { width: 48px; height: 48px; }
    .timer-text { font-size: 1rem; }
    .duel-timeline { gap: 4px; padding: 0.5rem; }
    .duel-timeline .timeline-card { width: 70px; height: 95px; }
    .duel-timeline .timeline-card .card-year { font-size: 1.2rem; }
    .duel-timeline .timeline-drop { width: 36px; height: 95px; }
    .music-card-visual { width: 90px; height: 90px; }
    .round-result-card { padding: 1.5rem 1rem; }
    .result-song-year { font-size: 2.5rem; }
    .result-comparison { gap: 0.75rem; }
    .result-feedback { font-size: 1.1rem; }
    .match-end-result { font-size: 2.2rem; }
    .match-end-scores { font-size: 2rem; }
}

@media (max-width: 480px) {
    .duel-scores { gap: 4px; }
    .score-vs { display: none; }
    .duel-timeline .timeline-card { width: 60px; height: 85px; }
    .duel-timeline .timeline-drop { width: 32px; height: 85px; font-size: 1rem; }
}
