/* =========================================
   BATTLESTREAM LIVE - SUPPORT PORTAL UI
   ========================================= */

:root {
    /* --- Palette --- */
    --bg-app: #000000;
    --bg-surface: #121212;
    --bg-surface-hover: #1e1e1e;
    --bg-glass: rgba(18, 18, 18, 0.85);
    
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #2563eb);
    --primary-glow: rgba(59, 130, 246, 0.4);
    
    --accent-live: #ef4444;
    --accent-gold: #fbbf24;
    --accent-gold-dim: rgba(251, 191, 36, 0.15);
    --accent-green: #10b981;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-lime: #84cc16;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #52525b;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(255, 255, 255, 0.2);
    
    /* --- Spacing & Radius --- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --header-height: 60px;
    --bottom-nav-height: 64px; /* + safe area */
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    
    /* Central Layout Config */
    --content-max-width: 600px;
}

@media (min-width: 1024px) {
    :root {
        --content-max-width: 800px;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    background-image: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #000 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    overscroll-behavior-y: none; /* Prevent rubber-banding on body */
}

a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
button { font-family: inherit; cursor: pointer; user-select: none; }
img { display: block; max-width: 100%; }

/* --- Layout Architecture --- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top, 20px); /* Handle notch */
    padding-bottom: env(safe-area-inset-bottom, 20px); /* Handle bottom bar */
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    background-color: var(--bg-app);
    position: relative;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow-x: hidden;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 0 16px;
    width: 100%;
    /* No specialized width here, inherits from parent if flow permits, 
       but if sticky/fixed needs matching width */
    max-width: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center; /* Centers the wrapper */
}

.header-secondary-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4px 16px;
}

.header-content-wrapper {
    width: 100%;
    max-width: var(--content-max-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Ensure flex items behave */
.header-logo { flex-shrink: 0; }
.user-info { flex-shrink: 0; }
.desktop-nav { flex-shrink: 0; }

.main-content {
    flex: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    display: flex;
    flex-direction: column;
    position: relative;
}

.page {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* Prevent clicks on hidden pages */
    position: absolute; /* Prevent stacking */
    top: 16px; left: 0; right: 0; /* Align correctly */
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative; /* Restore flow for active page */
}

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

/* --- Components: Typography --- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.text-muted { color: var(--text-secondary); }
.brand-text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.brand-live-text {
    color: #ffffff;
    font-weight: 800;
    margin-left: 2px;
}

.brand-record-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    margin: 0 4px;
    box-shadow: 0 0 6px #ef4444;
    animation: recordGlow 1.5s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes recordGlow {
    0% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px #ef4444; }
    50% { opacity: 0.4; transform: scale(0.9); box-shadow: 0 0 2px #ef4444; }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px #ef4444; }
}

/* --- Components: Header (Glass) --- */
/* Header styles moved up for specificity */
.header-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 1.25rem;
    cursor: pointer;
}
.header-logo img { height: 32px; width: 32px; border-radius: 8px; }

/* Desktop Nav (Hidden on Mobile) */
.desktop-nav { display: none; gap: 24px; }
.desktop-nav a { 
    font-weight: 600; font-size: 0.95rem; color: var(--text-secondary); 
    padding: 8px 12px; border-radius: var(--radius-sm);
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* User Info Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Components: Mobile Bottom Nav (Glass / Xcode Dock Style) --- */
.mobile-nav {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 200px;
    max-width: 95%;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    height: 60px;
    padding: 0 10px; /* Reduced padding */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* Reduced gap */
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    flex-direction: row; /* Force row layout */
    flex-wrap: nowrap; /* Prevent wrapping */
    white-space: nowrap;
}

.nav-item {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    flex: 0 0 auto; /* Prevent growing/shrinking */
    height: 44px; width: 44px;
    color: var(--text-secondary);
    background: transparent;
    border-radius: 50%;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0; /* Remove default margins */
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.nav-item.active { 
    color: #fff; 
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-icon {
    width: 22px; height: 22px;
    background-color: currentColor;
    mask-size: contain; -webkit-mask-size: contain;
    mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
    mask-position: center; -webkit-mask-position: center;
}

/* Hide labels for cleaner Xcode-like look, or make them tooltip-like if needed */
.nav-label { 
    display: none; 
}

/* Icons Masks */
.icon-home { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E"); }
.icon-battle { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolygon points='10 8 16 12 10 16 10 8'%3E%3C/polygon%3E%3C/svg%3E"); }
.icon-tokens { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpath d='M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8'%3E%3C/path%3E%3Cline x1='12' y1='18' x2='12' y2='22'%3E%3C/line%3E%3Cline x1='12' y1='2' x2='12' y2='6'%3E%3C/line%3E%3C/svg%3E"); }
.icon-profile { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E"); }
.icon-msg { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E"); }

/* --- Components: Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5); }
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.05);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* --- Components: Cards --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-focus); }

/* --- Components: Badges/Pills --- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase;
}
.badge-live { background: rgba(239, 68, 68, 0.2); color: var(--accent-live); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-gold { background: var(--accent-gold-dim); color: var(--accent-gold); border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-gray { background: rgba(255,255,255,0.1); color: var(--text-secondary); }

/* --- Dashboard Specific Styles (New) --- */
.home-stats {
    margin-top: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.section-header {
    /* Ensure section header clears floating elements and sits in flow */
    clear: both;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hc-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    text-align: center;
}

.stat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #000;
}
.stat-circle.pink { background: var(--accent-pink); box-shadow: 0 0 10px rgba(236, 72, 153, 0.4); }
.stat-circle.yellow { background: var(--accent-gold); box-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
.stat-circle.cyan { background: var(--accent-cyan); box-shadow: 0 0 10px rgba(6, 182, 212, 0.4); }
.stat-circle.green { background: var(--accent-lime); box-shadow: 0 0 10px rgba(132, 204, 22, 0.4); }

.badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.info-badge {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ccc;
}

/* Chips/Filters */
.chip {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.chip:hover { border-color: #555; color: #fff; }
.chip.active {
    background: #222;
    border-color: #fff;
    color: #fff;
}

/* Battle Card Specifics */
.battles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.battle-card {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
}
.battle-card:hover {
    border-color: #333;
    transform: translateY(-2px);
    background: #111;
}
.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.battle-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.battle-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.battle-status.live { background: #ef4444; color: #fff; }
.battle-status.upcoming { background: var(--accent-gold); color: #000; }
.battle-status.completed { background: #333; color: #aaa; }

.battle-description {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
    line-height: 1.4;
    flex: 1;
}

.battle-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.battle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #ccc;
}

.featured-card {
    background: linear-gradient(135deg, #111, #0a0a0a);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.featured-header h2 { margin: 0; font-size: 1.5rem; }
.live-indicator {
    background: #ef4444; color: #fff;
    padding: 4px 8px; border-radius: 4px;
    font-weight: 800; font-size: 0.75rem;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
.featured-description { color: #aaa; margin-bottom: 16px; }
.featured-meta { display: flex; gap: 16px; margin-bottom: 20px; font-size: 0.9rem; color: #888; }


.featured-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.featured-actions .btn {
    font-size: 0.9rem;
    padding: 8px;
}

/* --- Specific Views: Live Player --- */
.video-stage {
    width: 100%; aspect-ratio: 9/16;
    background: #000;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-subtle);
}
@media (min-width: 768px) { .video-stage { aspect-ratio: 16/9; } }

/* --- Live Vertical Feed (TikTok Style) --- */
.live-feed-container {
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background: #000;
    position: relative;
}

.battle-slide {
    height: 100%;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #000;
}

/* Split Screen Video */
.split-video-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.video-pane {
    flex: 1;
    position: relative;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.video-pane img, .video-pane video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-pane .user-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(4px);
}

.vs-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    background: url('assets/logos/Icon%20Exports/Icon-iOS-Default-60x60@2x.png') center/cover; /* Or specific VS graphic */
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: white; text-shadow: 0 2px 4px black;
}

/* Overlays */
.live-overlays {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; /* Let clicks pass through to controls */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: auto;
}

.live-score-bar {
    flex: 1;
    margin: 0 1rem;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.score-fill { height: 100%; transition: width 0.3s; }
.score-fill.left { background: #3b82f6; float: left; }
.score-fill.right { background: #ef4444; float: right; }

.bottom-controls {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-preview-overlay {
    max-height: 200px;
    overflow-y: auto;
    mask-image: linear-gradient(to bottom, transparent, black 20%);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%);
    margin-bottom: 10px;
    text-shadow: 0 1px 2px black;
}
.chat-msg { font-size: 0.9rem; margin-bottom: 4px; color: #fff; }
.chat-user { font-weight: 700; color: #fbbf24; margin-right: 5px; }

.gift-tray-trigger {
    align-self: flex-end;
    background: linear-gradient(45deg, #f59e0b, #ec4899);
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-weight: bold;
    display: flex; align-items: center; gap: 5px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    animation: pulse 2s infinite;
}

/* --- Gift Bottom Sheet --- */
.gift-sheet {
    position: fixed; /* Changed from absolute to fixed to ensure it stays on screen */
    bottom: 0; left: 50%;
    transform: translateX(-50%) translateY(100%); /* Combine centers */
    width: 100%;
    max-width: var(--content-max-width);
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100; /* Above mobile nav */
    pointer-events: auto;
}
.gift-sheet.active { transform: translateX(-50%) translateY(0); }

.gift-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.gift-item:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
.gift-img { font-size: 2rem; margin-bottom: 5px; }
.gift-cost { font-size: 0.75rem; color: #fbbf24; font-weight: 600; }

/* Gamification Profile */
.profile-progress-container {
    background: #18181b;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #27272a;
}
.level-badge {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Forms --- */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="datetime-local"], 
input[type="tel"],
input[type="search"],
textarea, 
select {
    width: 100%;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
    appearance: none; /* Remove default styling */
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { 
    border-color: var(--primary); 
    background: var(--bg-surface); 
}

/* --- Modals (Fixed) --- */
.modal, .upsell-modal, .token-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content, .modal-card {
    background: #111;
    border: 1px solid #333;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    text-align: center;
}

.modal-title { font-size: 1.25rem; margin-bottom: 0.5rem; font-weight: 700; color: #fff; }
.modal-actions { display: flex; gap: 1rem; margin-top: 1.5rem; justify-content: center; }

/* --- Mobile Fixes --- */
@media (max-width: 768px) {
    .modal-content { max-width: 90%; }
    .upsell-modal { padding: 0; }
    .modal-card { border-radius: 16px; margin: auto; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #111;
    z-index: 10;
}

.modal-title { font-size: 1.25rem; margin: 0; font-weight: 700; }

.close-btn {
    background: #222;
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    cursor: pointer;
}

.modal form { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #ccc; }

.venue-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

/* Fix for modal overlapping native controls */
@media (max-width: 768px) {
    .modal { padding: 0; }
    .modal-content { 
        height: 100%; 
        max-height: 100%; 
        border-radius: 0; 
        border: none;
    }
}

/* --- Responsive Adjustments --- */
@media (min-width: 768px) {
    .mobile-nav { display: none; }
    .desktop-nav { display: flex; }
    .header { padding: 0 32px; }
    .main-content { padding-top: 24px; }
    
    /* Sidebar Layout for Desktop - Disabled for now as Header must be top */
    /* .app-shell { flex-direction: row; } */
    .header { 
        position: sticky; 
        width: 100%; 
        max-width: none;
        top: 0; 
        left: 0;
        right: 0;
        z-index: 1000;
        transform: none;
    }
    .main-content { 
        padding-top: 24px; 
        width: 100%;
        max-width: 100%; /* Parent constraints apply */
        margin: 0 auto;
    }
}

/* --- Profile Specific Styles --- */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.profile-name-section h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.profile-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .profile-card-grid {
        grid-template-columns: 300px 1fr;
    }
}

.profile-sidebar-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin-bottom: 16px;
    background: #222;
}

.profile-role-badge {
    position: absolute;
    top: 16px;
    right: 16px;
}

.profile-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    width: 100%;
    margin: 16px 0;
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val { font-weight: 800; font-size: 1.1rem; color: #fff; }
.stat-lbl { font-size: 0.75rem; color: #888; text-transform: uppercase; }

.profile-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.profile-main-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #888; }
.info-value { font-weight: 500; color: #fff; }

.bio-box {
    background: #151515;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ccc;
    border: 1px solid #333;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.media-item {
    aspect-ratio: 1;
    background: #151515;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
}
.media-item:hover { border-color: #555; background: #222; }
.media-icon { font-size: 1.5rem; opacity: 0.7; }
.media-label { font-size: 0.8rem; color: #888; }

.account-type-toggle {
    display: flex;
    background: #151515;
    padding: 4px;
    border-radius: 50px;
    margin-top: 8px;
}
.type-option {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
}
.type-option.active {
    background: #333;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* --- Marketplace / Shop --- */
.token-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.token-package {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.token-package:hover { border-color: #444; background: #111; }
.token-package.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.token-amount { font-size: 1.25rem; font-weight: 800; color: #fff; margin: 8px 0; }
.token-price { font-size: 0.9rem; color: #aaa; }
.token-bonus { font-size: 0.75rem; color: var(--accent-green); font-weight: 700; }
.popular-badge {
    position: absolute; top: 0; right: 0;
    background: var(--accent-gold); color: #000;
    font-size: 0.6rem; font-weight: 700; padding: 2px 6px;
    border-bottom-left-radius: 8px;
}

/* --- Venues --- */
.venue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.venue-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}
.venue-card:hover { border-color: #444; }
.venue-image {
    height: 100px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #222;
}
.venue-header { display: flex; justify-content: space-between; align-items: center; }
.venue-name { font-weight: 700; font-size: 0.95rem; }
.venue-theme { font-size: 0.8rem; color: #888; }
.certified-badge { background: var(--accent-green); color: #000; border-radius: 4px; padding: 2px 4px; font-size: 0.65rem; font-weight: 700; }

/* --- Leaderboard Podium --- */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 32px;
    padding-top: 20px;
}
.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}
.podium-card:nth-child(1) { order: 2; transform: scale(1.1); }
.podium-card:nth-child(2) { order: 1; }
.podium-card:nth-child(3) { order: 3; }

.avatar.ring-gold { border: 3px solid var(--accent-gold); box-shadow: 0 0 15px rgba(251,191,36,0.3); }
.avatar.ring-silver { border: 3px solid #e5e7eb; }
.avatar.ring-bronze { border: 3px solid #d97706; }

/* --- Utilities --- */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* --- Animations --- */
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.animate-slide-up { animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* --- Footer Styles (Website Match) --- */
.site-footer {
    background: #000;
    padding: 60px 20px;
    border-top: 1px solid #222;
    text-align: center;
    color: #888;
}

.footer-linear-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.footer-row-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.footer-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin-bottom: 16px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 30px;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #3b82f6;
}

.footer-copyright {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #555;
    border-top: 1px solid #111;
    padding-top: 30px;
    width: 100%;
}
