/**
 * CTF (Capture The Flag) Page Styles
 * Competitive challenge interface with event cards, leaderboard, and challenge modals
 * Enhanced with glassmorphism + neon effects
 */

/* ===== CTF Page Header ===== */
.ctf-page-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(168, 85, 247, 0.1) 50%, rgba(14, 165, 233, 0.1) 100%);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.ctf-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #a855f7, #0ea5e9, #ef4444);
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
}

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

/* Keep original animation name as alias */
@keyframes ctfGradientFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.ctf-header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.ctf-header-icon {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(168, 85, 247, 0.2));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg, 16px);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ctf-header-text h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.ctf-header-text h1 .title-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #ef4444, #a855f7);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.75rem;
}

.ctf-header-text p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 600px;
}

.ctf-header-stats {
    margin-left: auto;
    display: flex;
    gap: 1.5rem;
}

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

.ctf-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: var(--neon-green-text, 0 0 20px rgba(0, 255, 136, 0.4));
}

.ctf-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Event Cards Grid ===== */
.ctf-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ctf-event-card {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    position: relative;
    overflow: hidden;
}

.ctf-event-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glass, linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%));
    pointer-events: none;
}

.ctf-event-card:hover {
    border-color: rgba(0, 255, 136, 0.2);
    transform: translateY(-3px);
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.ctf-event-card.active-event {
    border-color: rgba(0, 255, 136, 0.4);
}

.ctf-event-card.active-event::after {
    content: 'LIVE';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    animation: ctfPulse 2s ease-in-out infinite;
    letter-spacing: 1px;
    z-index: 2;
}

@keyframes ctfPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ctf-event-type {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.ctf-event-type.permanent {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.ctf-event-type.weekly {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.ctf-event-type.timed {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ctf-event-type.special {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.ctf-event-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.ctf-event-card .event-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ctf-event-meta {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    z-index: 1;
}

.ctf-event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ctf-event-meta-item i {
    color: var(--primary);
    font-size: 0.8rem;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.4));
}

.ctf-event-progress {
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.ctf-event-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.ctf-event-progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    transition: width 0.5s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
}

.ctf-event-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-align: right;
}

/* ===== Event Detail View ===== */
.ctf-event-detail {
    animation: fadeIn 0.3s ease;
}

.ctf-event-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.ctf-back-btn {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.ctf-back-btn:hover {
    border-color: rgba(0, 255, 136, 0.2);
    color: var(--primary);
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.ctf-event-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.ctf-event-actions {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

.ctf-leaderboard-btn {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.ctf-leaderboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* ===== Challenge Categories ===== */
.ctf-category-section {
    margin-bottom: 2rem;
}

.ctf-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ctf-category-title .category-count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Challenge Cards ===== */
.ctf-challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.ctf-challenge-card {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    position: relative;
    overflow: hidden;
}

.ctf-challenge-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glass, linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%));
    pointer-events: none;
}

.ctf-challenge-card:hover {
    border-color: rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.ctf-challenge-card.solved {
    border-color: rgba(0, 255, 136, 0.3);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, rgba(18, 18, 26, 0.3) 100%);
}

.ctf-challenge-card.solved::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #00ff88;
    font-size: 1rem;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.4));
    background: none;
    inset: auto;
    z-index: 2;
}

.ctf-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.ctf-challenge-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    padding-right: 0.5rem;
}

.ctf-challenge-points {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f59e0b;
    white-space: nowrap;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.ctf-challenge-points span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-shadow: none;
}

.ctf-challenge-difficulty {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.ctf-challenge-difficulty.easy {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
}

.ctf-challenge-difficulty.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.ctf-challenge-difficulty.hard {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ctf-challenge-difficulty.expert {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.ctf-challenge-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ctf-challenge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    z-index: 1;
}

.ctf-challenge-solves {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ctf-challenge-solves i {
    font-size: 0.7rem;
}

.ctf-first-blood {
    font-size: 0.7rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}

/* ===== Challenge Modal ===== */
.ctf-challenge-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px) saturate(0.5);
    -webkit-backdrop-filter: blur(12px) saturate(0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.ctf-challenge-modal-content {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.8) 0%, rgba(18, 18, 26, 0.5) 100%);
    backdrop-filter: blur(40px) saturate(1.3);
    -webkit-backdrop-filter: blur(40px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

.ctf-challenge-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.6), transparent);
    pointer-events: none;
}

.ctf-challenge-modal-content::-webkit-scrollbar {
    width: 4px;
}

.ctf-challenge-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.ctf-challenge-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.15);
    border-radius: 2px;
}

.ctf-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    z-index: 2;
}

.ctf-modal-close:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.ctf-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
    position: relative;
    z-index: 1;
}

.ctf-modal-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.ctf-modal-description {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    white-space: pre-line;
    position: relative;
    z-index: 1;
}

/* Flag Submission */
.ctf-flag-form {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.ctf-flag-input-group {
    display: flex;
    gap: 0.5rem;
}

.ctf-flag-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.ctf-flag-input:focus {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1), var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.ctf-flag-input::placeholder {
    color: var(--text-muted);
}

.ctf-flag-submit {
    background: var(--gradient);
    border: none;
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.ctf-flag-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.ctf-flag-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ctf-flag-result {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.ctf-flag-result.success {
    display: block;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
    text-shadow: var(--neon-green-text, 0 0 20px rgba(0, 255, 136, 0.4));
}

.ctf-flag-result.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.ctf-flag-result.already-solved {
    display: block;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #0ea5e9;
}

/* Hints Section */
.ctf-hints-section {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.ctf-hints-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ctf-hint-btn {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: left;
}

.ctf-hint-btn:hover {
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}

.ctf-hint-btn .hint-cost {
    margin-left: auto;
    color: #f59e0b;
    font-weight: 600;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.ctf-hint-content {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

.ctf-hint-content i {
    color: #f59e0b;
    margin-right: 0.4rem;
}

/* ===== Leaderboard ===== */
.ctf-leaderboard-container {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.6) 0%, rgba(18, 18, 26, 0.3) 100%);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    position: relative;
}

.ctf-leaderboard-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glass, linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%));
    pointer-events: none;
}

.ctf-leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(245, 158, 11, 0.05);
    position: relative;
    z-index: 1;
}

.ctf-leaderboard-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ctf-leaderboard-header h3 i {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.ctf-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
}

.ctf-leaderboard-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-weight: 600;
}

.ctf-leaderboard-table td {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ctf-leaderboard-table tr:hover td {
    background: rgba(0, 255, 136, 0.03);
}

.ctf-leaderboard-table .rank-cell {
    font-weight: 700;
    font-size: 1.1rem;
    width: 60px;
}

.ctf-leaderboard-table .rank-1 {
    color: #fbbf24;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}
.ctf-leaderboard-table .rank-2 {
    color: #94a3b8;
    text-shadow: 0 0 8px rgba(148, 163, 184, 0.3);
}
.ctf-leaderboard-table .rank-3 {
    color: #cd7f32;
    text-shadow: 0 0 8px rgba(205, 127, 50, 0.3);
}

.ctf-leaderboard-table .score-cell {
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
    text-shadow: var(--neon-green-text, 0 0 20px rgba(0, 255, 136, 0.4));
}

.ctf-leaderboard-table .solves-cell {
    color: var(--text-muted);
}

.ctf-leaderboard-table .blood-cell {
    color: #ef4444;
    font-weight: 600;
}

/* ===== Timer/Countdown ===== */
.ctf-timer {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ctf-timer.urgent {
    color: #ef4444;
    animation: ctfPulse 1s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.ctf-timer i {
    font-size: 0.8rem;
}

/* ===== Loading State ===== */
.ctf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.ctf-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.4));
}

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

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

/* ===== Empty State ===== */
.ctf-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.ctf-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.ctf-empty p {
    font-size: 1rem;
}

/* ===== Custom Scrollbar for Scrollable Containers ===== */
.ctf-leaderboard-container::-webkit-scrollbar,
.ctf-events-grid::-webkit-scrollbar,
.ctf-challenges-grid::-webkit-scrollbar {
    width: 4px;
}

.ctf-leaderboard-container::-webkit-scrollbar-track,
.ctf-events-grid::-webkit-scrollbar-track,
.ctf-challenges-grid::-webkit-scrollbar-track {
    background: transparent;
}

.ctf-leaderboard-container::-webkit-scrollbar-thumb,
.ctf-events-grid::-webkit-scrollbar-thumb,
.ctf-challenges-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.15);
    border-radius: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ctf-header-content {
        flex-direction: column;
        text-align: center;
    }

    .ctf-header-stats {
        margin-left: 0;
        justify-content: center;
    }

    .ctf-events-grid {
        grid-template-columns: 1fr;
    }

    .ctf-challenges-grid {
        grid-template-columns: 1fr;
    }

    .ctf-event-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ctf-event-actions {
        margin-left: 0;
        width: 100%;
    }

    .ctf-leaderboard-btn {
        flex: 1;
        justify-content: center;
    }

    .ctf-flag-input-group {
        flex-direction: column;
    }

    .ctf-modal-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ctf-leaderboard-table th,
    .ctf-leaderboard-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .ctf-page-header { background: rgba(18, 18, 26, 0.95); }
    .ctf-event-card { background: rgba(18, 18, 26, 0.95); }
    .ctf-challenge-card { background: rgba(18, 18, 26, 0.95); }
    .ctf-modal .modal { background: rgba(15, 15, 22, 0.98); }
}
