/* =============================================
   Clash Arena — Lobby  (Glassmorphism Redesign)
   ============================================= */

/* ===== ANIMATIONS ===== */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
    50% { box-shadow: 0 0 14px 2px rgba(255, 107, 0, 0.24); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes trophyShimmer {
    0% { background-position: -100% center; }
    100% { background-position: 200% center; }
}

@keyframes currentDayPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
    50% { box-shadow: 0 0 10px 2px rgba(255, 107, 0, 0.26); }
}

@keyframes battlePulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(255, 69, 0, 0.2); }
    50% { box-shadow: 0 4px 22px rgba(255, 69, 0, 0.3); }
}

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

/* ===== PAGE BACKGROUND ===== */
body.lobby-body {
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #1a1a1b;
    background: var(--surface-lobby);
    background-image:
        radial-gradient(ellipse at 15% 10%, rgba(255, 107, 0, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 20%, rgba(32, 156, 233, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
}

.is-clickable { cursor: pointer; }
.mono-nano { font-family: var(--font-mono); }
.is-hidden { display: none; }

/* ===== GLASS CARD BASE ===== */
.glass-card {
    background: rgba(20, 20, 30, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    max-width: 100%;
}

/* ===== LAYOUT ===== */
.lobby-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 16px;
    padding: 16px;
    min-height: 0;
    animation: fadeIn 0.4s ease;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideInUp 0.5s ease both;
}

/* --- Profile Card --- */
.profile-card {
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cd7f32, #b87333);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    border: 3px solid rgba(205, 127, 50, 0.5);
    box-shadow: 0 0 16px rgba(205, 127, 50, 0.3);
    transition: all 0.3s ease;
}

/* Rank-based avatar colors */
.profile-avatar.rank-silver {
    background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
    border-color: rgba(192, 192, 192, 0.5);
    box-shadow: 0 0 16px rgba(192, 192, 192, 0.3);
}
.profile-avatar.rank-gold {
    background: linear-gradient(135deg, #ffd700, #daa520);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}
.profile-avatar.rank-diamond {
    background: linear-gradient(135deg, #b9f2ff, #4fc3f7);
    border-color: rgba(79, 195, 247, 0.5);
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.3);
}
.profile-avatar.rank-master {
    background: linear-gradient(135deg, #ff4500, #ff8c00, #ffd700);
    border-color: rgba(255, 69, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.4);
}

.rank-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(205, 127, 50, 0.9);
    color: #fff;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.profile-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.username-glow {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.trophy-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trophy-icon {
    font-size: 1rem;
}

.trophy-count {
    font-size: 1.25rem;
    font-weight: 800;
    font-feature-settings: "tnum";
    background: linear-gradient(90deg, #ffd700, #ffaa00, #ffd700);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: trophyShimmer 3s linear infinite;
}

/* Stats pills */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-pill {
    text-align: center;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: border-color 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-pill:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-pill-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-feature-settings: "tnum";
    animation: countUp 0.5s ease both;
}

.stat-pill-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Currency Bar --- */
.currency-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.currency-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: border-color 0.2s, transform 0.15s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.currency-pill:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.currency-icon {
    font-size: 1.2rem;
}

.currency-value {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
    font-feature-settings: "tnum";
    animation: countUp 0.6s ease both;
}

.currency-coins { color: #ffd700; }
.currency-gems { color: #a855f7; }

.currency-coins-pill .currency-value {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.currency-gems-pill .currency-value {
    color: #a855f7;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.currency-nano-pill .currency-icon {
    color: #209CE9;
}

.currency-nano-pill .currency-value {
    color: #209CE9;
    text-shadow: 0 0 10px rgba(32, 156, 233, 0.2);
}

.currency-add {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.15s;
}

.currency-add:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    text-decoration: none;
    transform: scale(1.1);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideInUp 0.5s ease 0.1s both;
}

/* --- Section Card (Daily Rewards, Quests, Trophy Road) --- */
.section-card {
    padding: 16px;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    min-width: 0;
    gap: 8px;
}

.section-card-header > * {
    min-width: 0;
    flex-shrink: 1;
}

.section-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.streak-badge {
    background: linear-gradient(135deg, var(--accent-orange), #ff8c00);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quest-timer-badge {
    background: linear-gradient(135deg, #209CE9, #1a7cb8);
}

.quest-timer-text { font-size: 0.7rem; }

.quest-tabs-row {
    display: flex;
    gap: 4px;
    padding: 0 0 8px;
}

.quest-tab-btn {
    flex: 1;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.quest-tab-active {
    background: var(--accent);
    color: #fff;
}

.quest-tab-inactive {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.quest-daily-cap {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: 4px;
}

/* Daily Rewards Grid */
.daily-rewards-grid {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* Keep original class names for JS rendering */
.reward-day {
    flex: 1;
    padding: 10px 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-align: center;
    position: relative;
    transition: all 0.25s var(--transition-spring);
}

.reward-day.claimed {
    background: rgba(0, 200, 83, 0.08);
    border-color: rgba(70, 209, 96, 0.3);
}

.reward-day.current {
    border-color: rgba(255, 107, 0, 0.6);
    background: rgba(255, 107, 0, 0.08);
    animation: currentDayPulse 2s ease-in-out infinite;
}

.reward-day.locked {
    opacity: 0.4;
    filter: blur(0.5px);
}

.reward-day-num {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.reward-day-icon {
    font-size: 1.3rem;
    margin: 4px 0;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
}

.reward-day-amount {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-feature-settings: "tnum";
}

.reward-day .check-mark {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #46d160, #22c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    box-shadow: 0 2px 8px rgba(70, 209, 96, 0.4);
}

.claim-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, var(--accent-orange), #ff8c00);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-family: var(--font-main);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.claim-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.claim-btn:disabled {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: not-allowed;
    text-shadow: none;
}

.claim-btn.claimed {
    background: linear-gradient(135deg, #46d160, #22c55e);
}

/* --- Battle Card --- */
.battle-card {
    padding: 36px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.battle-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 69, 0, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 140, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.battle-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
    position: relative;
}

.battle-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.9rem;
    position: relative;
}

.battle-btn {
    background: linear-gradient(135deg, #ff6b00, #ff4500);
    color: #fff;
    border: none;
    padding: 16px 56px;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-main);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: battlePulse 2.5s ease-in-out infinite;
    letter-spacing: 0.5px;
}

.battle-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 32px rgba(255, 69, 0, 0.5);
}

.battle-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.3);
}

.rejoin-btn {
    background: linear-gradient(135deg, #46d160, #22c55e);
    animation: none;
}

.rejoin-btn:hover {
    box-shadow: 0 8px 32px rgba(70, 209, 96, 0.5);
}

.quick-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
    position: relative;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    text-decoration: none;
}

/* --- Trophy Road --- */
.trophy-road-scroll {
    overflow-x: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.trophy-road-scroll::-webkit-scrollbar {
    height: 4px;
}

.trophy-road-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

/* ===== RIGHT SIDEBAR — LEADERBOARD ===== */
.sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideInRight 0.5s ease 0.2s both;
}

.leaderboard-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.leaderboard-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 700;
}

.leaderboard-title-between { justify-content: space-between; }
.battle-log-title-group { display: flex; gap: 8px; }
.battle-log-list { flex: 1; overflow-y: auto; }

.leaderboard-list {
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 28px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    font-feature-settings: "tnum";
}

.rank.gold { color: #ffd700; font-size: 1.1rem; }
.rank.silver { color: #c0c0c0; font-size: 1.05rem; }
.rank.bronze { color: #cd7f32; font-size: 1rem; }

.player-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

.player-trophies {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffd700;
    font-weight: 700;
    font-size: 0.875rem;
    font-feature-settings: "tnum";
}

/* ===== MATCHMAKING OVERLAY ===== */
.matchmaking-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.matchmaking-overlay.active {
    display: flex;
}

.matchmaking-content {
    text-align: center;
    max-width: 420px;
}

.matchmaking-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.matchmaking-spinner {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    position: relative;
}

.matchmaking-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.vs-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}

.countdown-display {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-blue);
    margin-bottom: 8px;
    font-feature-settings: "tnum";
}

.countdown-label {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.search-timer {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.cancel-match-btn {
    margin-top: 16px;
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.match-found {
    display: none;
}

.match-found.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.match-found h2 {
    color: var(--success);
    font-weight: 800;
    margin-bottom: 24px;
}

.versus-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.player-box {
    background: rgba(26, 26, 27, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 28px;
    border-radius: 14px;
    text-align: center;
}

.player-box h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.player-box.ai {
    border-color: rgba(255, 69, 0, 0.4);
    box-shadow: 0 0 16px rgba(255, 69, 0, 0.15);
}

.vs-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* ===== BATTLE LOG MODAL ===== */
.battle-log-card {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    padding: 14px;
    margin-bottom: 4px;
    background: rgba(26, 26, 27, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.mobile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #cd7f32, #b87333);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 2px solid rgba(205, 127, 50, 0.4);
}

.mobile-profile-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.mobile-trophies {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #ffd700;
    font-weight: 700;
    font-feature-settings: "tnum";
}

.mobile-currencies {
    display: flex;
    gap: 12px;
}

.mobile-currency {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    font-feature-settings: "tnum";
}

.mobile-currency.coins { color: #ffd700; }
.mobile-currency.gems { color: #a855f7; }
.mobile-currency.nano { color: #209CE9; }

/* ===== PROGRESS BAR GREEN GRADIENT + SHIMMER ===== */
@keyframes progressShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== RESPONSIVE — TABLET ===== */

/* ===== RESPONSIVE — MOBILE ===== */



/* ===== HOVER-ONLY EFFECTS (desktop) ===== */
@media (hover: hover) {
    .stat-pill:hover {
        background: rgba(255, 255, 255, 0.07);
    }

    .reward-day:not(.locked):hover {
        transform: translateY(-2px);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .leaderboard-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ===== TOUCH TARGETS ===== */

/* ============ NANO WALLET MODAL ============ */
.nano-wallet-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nano-wallet-modal.hidden { display: none; }

.nano-wallet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.nano-wallet-panel {
    position: relative;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(200,150,50,0.3);
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    color: #e0e0e0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.nano-wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.nano-wallet-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #f0c040;
}
.nano-wallet-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.nano-wallet-close:hover { color: #fff; }

.nano-balance-display {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}
.nano-balance-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.nano-balance-amount {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #f0c040;
    font-family: 'IBM Plex Mono', monospace;
}

.nano-address-section,
.nano-withdraw-section,
.nano-history-section {
    margin-bottom: 20px;
}
.nano-address-section label,
.nano-withdraw-section label {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nano-address-input-row {
    display: flex;
    gap: 8px;
}
.nano-address-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e0e0e0;
    font-size: 0.8rem;
    font-family: 'IBM Plex Mono', monospace;
    outline: none;
    min-width: 0;
}
.nano-address-input:focus {
    border-color: #f0c040;
}
.nano-address-input-row button {
    background: linear-gradient(135deg, #f0c040, #d4a030);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: #1a1a2e;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}
.nano-address-input-row button:hover { opacity: 0.9; }
.nano-address-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.nano-address-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 6px;
    min-height: 1em;
}

.nano-amount-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.nano-amount-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px 12px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    outline: none;
}
.nano-amount-input:focus { border-color: #f0c040; }
.nano-max-btn {
    background: rgba(240,192,64,0.15);
    border: 1px solid rgba(240,192,64,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #f0c040;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}
.nano-max-btn:hover { background: rgba(240,192,64,0.25); }

.nano-withdraw-info {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 12px;
}

.nano-withdraw-btn {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, #f0c040, #d4a030);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.nano-withdraw-btn:hover { opacity: 0.9; }
.nano-withdraw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.nano-withdraw-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    font-size: 0.85rem;
    text-align: center;
}
.nano-withdraw-status.hidden { display: none; }

.nano-history-section h3 {
    font-size: 0.85rem;
    color: #aaa;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nano-tx-list {
    max-height: 200px;
    overflow-y: auto;
}
.nano-tx-empty {
    text-align: center;
    color: #555;
    padding: 20px;
    font-size: 0.85rem;
}
.nano-tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.nano-tx-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nano-tx-type { font-size: 0.8rem; color: #ccc; }
.nano-tx-date { font-size: 0.7rem; color: #666; }
.nano-tx-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
    .nano-wallet-modal {
        align-items: flex-end;
    }
    .nano-wallet-panel {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
    }
}

/* ===== BATTLE CARD TOP ===== */
.battle-card-top {
    padding: 16px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,69,0,0.15), rgba(255,140,0,0.1), rgba(20,20,30,0.9));
    border: 1px solid rgba(255,140,0,0.3);
}
.battle-card-top .battle-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ff4500);
    border-radius: 14px;
    letter-spacing: 1px;
}
.battle-card-top .battle-glow,
.battle-card-top .battle-title,
.battle-card-top .battle-subtitle {
    display: none;
}

/* ===== MMR BADGE ===== */
.mmr-badge {
    font-size: 0.6rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.06);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ===== AI OFFER TOAST ===== */
.ai-offer-toast {
    background: linear-gradient(135deg, rgba(30,30,40,0.95), rgba(40,35,20,0.95));
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    animation: slideInUp 0.3s ease;
}
.ai-offer-toast.hidden { display: none; }
.ai-offer-buttons { display: flex; gap: 8px; }
.ai-offer-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-main);
}
.ai-offer-buttons button:first-child {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a1b;
}
.ai-offer-buttons .ai-offer-dismiss {
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
}

/* ===== TROPHY ROAD VERTICAL REDESIGN ===== */
@keyframes trophyNodePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0), 0 0 8px rgba(255,215,0,0.3); }
    50% { box-shadow: 0 0 20px 6px rgba(255,215,0,0.4), 0 0 8px rgba(255,215,0,0.3); }
}
@keyframes trophyNodeRing {
    0% { transform: translate(-50%,-50%) rotate(0deg); }
    100% { transform: translate(-50%,-50%) rotate(360deg); }
}

.trophy-road-section {
    background: linear-gradient(180deg, rgba(15,15,25,0.95) 0%, rgba(10,10,20,0.98) 100%);
    position: relative;
    overflow: hidden;
}
.trophy-road-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255,215,0,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.trophy-road-vertical {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 0;
    position: relative;
}

.trophy-road-track-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    padding: 10px 0;
}

.trophy-node {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 340px;
    padding: 4px 0;
}
.trophy-node:nth-child(odd) { flex-direction: row; }
.trophy-node:nth-child(even) { flex-direction: row-reverse; }

.trophy-node-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s;
    border: 3px solid rgba(255,255,255,0.1);
    background: rgba(30,30,45,0.9);
}

.trophy-node.completed .trophy-node-circle {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border-color: #ffd700;
    color: #1a1a1b;
    box-shadow: 0 0 12px rgba(255,215,0,0.3);
}
.trophy-node.current .trophy-node-circle {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #22c55e;
    color: #fff;
    animation: trophyNodePulse 2s ease-in-out infinite;
}
.trophy-node.current .trophy-node-circle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 2px dashed rgba(34,197,97,0.5);
    animation: trophyNodeRing 8s linear infinite;
}
.trophy-node.locked .trophy-node-circle {
    background: rgba(40,40,55,0.7);
    border-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.25);
    filter: grayscale(0.5);
}

.trophy-node-info {
    flex: 1;
    min-width: 0;
}
.trophy-node-trophies {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.trophy-node-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.trophy-node.locked .trophy-node-label { color: rgba(255,255,255,0.3); }

.trophy-node-btn {
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
}
.trophy-node-btn.btn-claim {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 2px 8px rgba(34,197,97,0.3);
}
.trophy-node-btn.btn-claimed {
    background: rgba(255,215,0,0.15);
    color: #ffd700;
    cursor: default;
}
.trophy-node-btn.btn-locked {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.2);
    cursor: not-allowed;
}

.trophy-road-connector {
    width: 3px;
    height: 28px;
    background: rgba(255,255,255,0.08);
    z-index: 1;
}
.trophy-road-connector.completed {
    background: linear-gradient(180deg, #ffd700, #ff8c00);
    box-shadow: 0 0 6px rgba(255,215,0,0.2);
}
