/* =================================================================== */
/* ==   THEME: "KINETIC" - RESTORED INDEX STYLES (NO HEADER)        == */
/* =================================================================== */

:root {
    --accent-blue: #00aaff;
    --accent-glow: rgba(0, 170, 255, 0.4);
    --bg-main: #101012;
    --bg-panel: rgba(22, 22, 26, 0.98);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a8;
    --border-color: rgba(0, 170, 255, 0.2);
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 1. RESET & GLOBALS === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes scroll-grid { 0% { background-position: 0 0; } 100% { background-position: -50px -50px; } }
@keyframes pulse-glow { 0%, 100% { opacity: 0.6; text-shadow: 0 0 5px var(--accent-glow); } 50% { text-shadow: 0 0 15px var(--accent-glow); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 200%; height: 200%;
    background-image: linear-gradient(rgba(0, 170, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0, 170, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: scroll-grid 20s linear infinite;
    z-index: -1;
}

.container { width: 100%; max-width: 950px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4 { font-family: var(--font-mono); color: var(--text-primary); text-transform: uppercase; letter-spacing: 1px; }
a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }

/* === 2. COMPONENTS === */
.btn {
    display: inline-block; padding: 0.6rem 1.4rem; font-family: var(--font-mono); font-weight: 700; text-transform: uppercase; font-size: 0.7rem; border: none; cursor: pointer; transition: var(--transition);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { box-shadow: 0 0 15px var(--accent-glow); transform: translateY(-1px); }
.btn-primary-outline { border: 1px solid var(--accent-blue); color: var(--accent-blue); background: transparent; }
.btn-primary-outline:hover { background: var(--accent-blue); color: #000; }

.kinetic-panel {
    background: var(--bg-panel); border: 1px solid var(--border-color); padding: 1.5rem; position: relative;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

/* === 3. HERO SECTION (RESTORED SLIM GLOW) === */
.hero-panel {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 40px var(--accent-glow); 
    margin: 2rem auto 3rem;
    max-width: 850px;
}
.hero-panel h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); margin: 0.5rem 0 1rem; line-height: 1; }
.hero-panel h2 { font-size: 0.75rem; letter-spacing: 4px; }
.hero-panel p { font-size: 0.95rem; max-width: 500px; margin: 0 auto 2rem; color: var(--text-secondary); }
.live-indicator { animation: pulse-glow 2s infinite; }
.cta-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.animate-hero > * { opacity: 0; animation: fadeInUp 0.6s ease-out forwards; }
.animate-hero h2 { animation-delay: 0.1s; }
.animate-hero h1 { animation-delay: 0.3s; }
.animate-hero p  { animation-delay: 0.5s; }
.animate-hero .cta-row { animation-delay: 0.7s; }

/* === 4. ACTIVITY FEED === */
.laps-grid-compact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 850px; margin: 0 auto 4rem; }
.lap-card-slim {
    background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-color); padding: 0.8rem 1rem; position: relative; transition: 0.3s;
    border-left: 2px solid #333; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.lap-card-slim:hover { border-left-color: var(--accent-blue); background: rgba(0, 170, 255, 0.05); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.3rem; }
.tag { font-family: var(--font-mono); font-size: 0.5rem; padding: 1px 5px; font-weight: 700; border-radius: 2px; }
.tag.acc { background: #ff4444; color: #fff; }
.tag.iracing { background: #66c0f4; color: #000; }
.timestamp { font-size: 0.55rem; opacity: 0.3; }

.card-main { display: flex; justify-content: space-between; align-items: flex-end; }
.driver-data .name { font-weight: 800; font-size: 0.85rem; color: #fff; }
.driver-data .track-info { font-size: 0.65rem; color: var(--text-secondary); }
.time-display { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; color: var(--accent-blue); }

/* === 5. ANNOUNCEMENT & GAMES === */
.announcement-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; text-align: left; }
.feature-bullets { list-style: none; margin: 1rem 0; }
.feature-bullets li { display: flex; align-items: center; gap: 8px; margin-bottom: 0.4rem; font-size: 0.85rem; }
.feature-bullets i { color: var(--accent-blue); font-size: 0.8rem; }
.announcement-image img { width: 100%; border: 1px solid var(--border-color); border-radius: 4px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.section-label { text-align: center; margin-bottom: 2rem; font-size: 0.8rem; letter-spacing: 4px; color: var(--text-secondary); }
.small-panel { padding: 1.5rem; text-align: center; }

/* === 6. UNIVERSAL STATS (FOOTER) === */
.stat-item { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-secondary); }
.stat-item span { font-weight: 700; color: #fff; font-size: 0.7rem; }
.stat-divider { color: rgba(255, 255, 255, 0.1); font-family: var(--font-mono); font-weight: 300; }

@media (max-width: 992px) {
    .laps-grid-compact { grid-template-columns: 1fr; }
    .announcement-grid { grid-template-columns: 1fr; text-align: center; }
    .announcement-image { order: -1; max-width: 300px; margin: 0 auto; }
}

/* --- MANDATORY MODAL STYLES --- */
.mandatory-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(16, 16, 18, 0.95);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
.mandatory-modal-overlay .custom-modal-content {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    max-width: 550px;
    width: 100%;
    border-top: 3px solid var(--accent-blue);
    text-align: center;
}
.mandatory-modal-overlay .modal-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}
.mandatory-modal-overlay .redirect-notice {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    opacity: 0.7;
}
.mandatory-modal-overlay .settings-form { display: flex; flex-direction: column; gap: 1rem; }
.mandatory-modal-overlay .input-group { display: flex; flex-direction: column; text-align: left; }
.mandatory-modal-overlay label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.4rem; }
.mandatory-modal-overlay input { background-color: rgba(0,0,0,0.3); border: 1px solid var(--border-color); color: var(--text-primary); padding: 0.7rem; font-size: 0.9rem; border-radius: 4px; }
.mandatory-modal-overlay input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 10px var(--accent-glow); }
.mandatory-modal-overlay .input-hint { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.5rem; }
.mandatory-modal-overlay .alert-danger { padding: 0.8rem 1rem; margin-bottom: 1rem; border-radius: 4px; font-size: 0.85rem; border: 1px solid rgba(255, 68, 68, 0.3); background-color: rgba(255, 68, 68, 0.1); color: #ff4444; }

/* =================================================================== */
/* ==   GLOBAL BACK BUTTON STYLES (NO ALIGNMENT)                    == */
/* =================================================================== */
.global-back-button {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.global-back-button:hover {
    color: var(--accent-blue);
}
.global-back-button i {
    margin-right: 8px;
}

/* =================================================================== */
/* ==   FOOLPROOF ALIGNMENT CONTROLS (FLEXBOX METHOD)               == */
/* =================================================================== */
.global-back-button-container {
    display: flex; /* This activates Flexbox */
    
    /* VERTICAL SPACING: Controls the gap above and below the button */
    margin-top: 2rem;
    margin-bottom: 1.5rem;

    /* HORIZONTAL ALIGNMENT: THIS IS THE LINE YOU CHANGE */
    justify-content: flex-start; /* 'flex-start' (left), 'center', or 'flex-end' (right) */
}