:root {
    /* Primary Colors - More sophisticated blue */
    --primary: #0066cc;
    --primary-glow: rgba(0, 102, 204, 0.15);
    --accent: #5ac8fa;
    
    /* Subtle Neutral Palette */
    --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.03);
    
    --text-main: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #95a5a6;
    
    /* Status Colors - Softened */
    --success: #2ecc71;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;
    
    /* Common */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --blur: 10px;
    --transition: all 0.25s ease-out;
}

/* Dark Mode - Softer dark theme */
[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.4);
    
    --text-main: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #757575;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
}

/* Navbar - Minimalist */
.navbar {
    position: sticky;
    top: 12px;
    z-index: 1000;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    margin: 12px 32px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-nav {
    display: flex;
    gap: 4px;
    list-style: none;
}

.navbar-nav a {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover, .navbar-nav a.active {
    color: var(--primary);
    background: rgba(0, 102, 204, 0.05);
}

/* Layout */
.ctf-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Hero - Subtle */
.hero {
    text-align: center;
    padding: 80px 20px;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards - Elegant */
.card {
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Grid */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.challenge-card {
    display: flex;
    flex-direction: column;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.challenge-title {
    font-size: 16px;
    font-weight: 600;
}

.challenge-points {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.challenge-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Inputs - Clean */
.input-text {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.input-text:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

/* Buttons - Refined */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #0055aa;
}

/* Tag */
.tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Sections */
.section-header { margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 700; }

.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Team Detail Page */
.page-header {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    margin-bottom: 24px;
}

.team-profile {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
}

.team-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.team-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 24px;
}

.team-stat {
    text-align: center;
}

.team-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.team-stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.content-grid {
    max-width: 800px;
    margin: 0 auto;
}

.member-list {
    padding: 0;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.member-item:hover {
    background: var(--glass-bg);
}

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

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 600;
    font-size: 20px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-info {
    flex: 1;
}

.member-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.member-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.member-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .team-stats {
        gap: 24px;
    }
    
    .team-name {
        font-size: 24px;
    }
    
    .team-stat-value {
        font-size: 28px;
    }
}
