/*
  ==============================================
  STYLE-F1.CSS - FINAL CLEAN VERSION
  Theme: F1 Cyberpunk Telemetry
  Structure: Desktop First -> Mobile Responsive
  ==============================================
*/

/* --- 1. SETUP & VARIABLES --- */
:root {
    --game-red: #E10600;
    --game-dark: #0B0C10;
    --game-panel: #1F2833;
    --game-text: #FFFFFF;
    --game-accent: #66FCF1;
    
    /* Rarity Colors */
    --common: #45A29E;
    --rare: #007BFF;
    --legendary: #E10600;
    --epic: #FFD700;

    --font-display: 'Russo One', sans-serif;
    --font-ui: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background-color: var(--game-dark);
    color: var(--game-text);
    overflow-x: hidden;
}

/* BACKGROUND */
.game-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at 50% 30%, #1a1c29 0%, #000000 90%); z-index: -2; }
.scanlines { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%); background-size: 100% 4px; pointer-events: none; z-index: -1; }

/* --- 2. HEADER --- */
header {
    position: relative;
    background: rgba(11, 12, 16, 0.95);
    border-bottom: 2px solid var(--game-red);
    padding: 15px 40px;
    display: flex;
    justify-content: center; /* Logo Tengah */
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo-container { display: flex; flex-direction: column; align-items: center; }
.text-logo { font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; letter-spacing: 2px; text-transform: uppercase; }
.logo-park, .logo-eer { color: var(--game-text); }
.logo-r { color: var(--game-red); text-shadow: 0 0 10px var(--game-red); }
.logo-subtitle { font-family: var(--font-body); font-size: 0.9rem; color: var(--game-accent); font-style: italic; margin-top: 2px; }
.logo-line { width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--game-red), transparent); margin-top: 8px; }

/* --- 3. HERO SECTION (DESKTOP) --- */
#home { padding: 60px 40px; min-height: 85vh; display: flex; align-items: center; }
.hero-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; }

/* Kiri: Teks */
.hero-content { flex: 1; padding-right: 50px; z-index: 2; }
.season-text { font-family: var(--font-mono); color: #888; letter-spacing: 2px; margin-bottom: 10px; }
.game-title { font-family: var(--font-display); font-size: 4.5rem; line-height: 0.9; font-style: italic; text-transform: uppercase; margin-bottom: 20px; text-shadow: 5px 5px 0px rgba(0,0,0,0.5); }
.text-red { color: var(--game-red); }
.hero-desc { font-size: 1.2rem; color: #ccc; margin-bottom: 40px; border-left: 4px solid var(--game-red); padding-left: 15px; }

/* Kanan: Mobil */
.hero-visual { flex: 1; position: relative; text-align: center; display: flex; justify-content: center; }
.hero-car { 
    width: 80%; max-width: 600px; 
    transform: rotate(-90deg); /* Default Desktop: Vertikal/Miring */
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.8)); 
    position: relative; z-index: 2; 
}
.car-glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 400px; height: 400px; background: radial-gradient(circle, rgba(225,6,0,0.4) 0%, rgba(0,0,0,0) 70%); z-index: 1; }

/* --- 4. GRID PARKIR (DESKTOP) --- */
#find-spot { padding: 50px 20px; }
.section-header { display: flex; align-items: center; justify-content: center; margin-bottom: 60px; }
.section-header h2 { font-family: var(--font-display); font-style: italic; font-size: 2.5rem; margin: 0 20px; text-transform: uppercase; }
.line-deco { height: 4px; width: 100px; background: var(--game-red); transform: skewX(-45deg); }

.spots-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
}

/* --- DESAIN KARTU --- */
.game-card {
    width: 220px;
    background: linear-gradient(180deg, #2b2b2b 0%, #0d0d0d 100%);
    border: 1px solid #444;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.3s;
    display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-color: white; }
.card-top { display: flex; justify-content: space-between; padding: 8px 10px; font-family: var(--font-mono); font-size: 0.7rem; font-weight: bold; color: #000; }

/* Area Gambar Mobil */
.card-image {
    height: 160px;
    background: radial-gradient(circle at center, #2a2a2a 0%, #111 80%);
    position: relative;
    display: flex; justify-content: center; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}
.card-image img { width: 90%; height: auto; object-fit: contain; transition: 0.5s; opacity: 0; transform: translateY(50px) scale(0.8); }

/* State & Animasi */
.game-card.occupied .card-image img { opacity: 1; animation: floatCar 3s ease-in-out infinite; }
.game-card.reserved .card-image img { opacity: 0.4; filter: grayscale(100%) sepia(100%) hue-rotate(0deg) saturate(400%); transform: scale(0.9); }

@keyframes floatCar {
    0%, 100% { transform: translateY(0px); filter: drop-shadow(0 5px 5px rgba(0,0,0,0.9)); }
    50% { transform: translateY(-10px); filter: drop-shadow(0 25px 15px rgba(0,0,0,0.6)); }
}

.empty-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; font-family: var(--font-display); font-size: 3.5rem; color: rgba(255, 255, 255, 0.1); transition: 0.3s; z-index: 1; }
.game-card.occupied .empty-overlay { opacity: 0; }

/* Info & Tombol */
.card-info { padding: 15px; text-align: center; flex-grow: 1; }
.card-info h3 { font-family: var(--font-display); font-style: italic; margin-bottom: 5px; color: white; }
.stat-bar { height: 6px; width: 100%; background: #333; margin-bottom: 8px; transform: skewX(-20deg); }
.stat-bar .fill { height: 100%; }
.status-text { font-family: var(--font-mono); font-size: 0.8rem; color: #888; }

/* Warna Status */
.game-card.available { border-bottom: 4px solid var(--common); }
.game-card.available .card-top, .game-card.available .stat-bar .fill { background: var(--common); }
.game-card.occupied { border-bottom: 4px solid var(--legendary); }
.game-card.occupied .card-top, .game-card.occupied .stat-bar .fill { background: var(--legendary); color: white; }
.game-card.reserved { border-bottom: 4px solid var(--epic); }
.game-card.reserved .card-top, .game-card.reserved .stat-bar .fill { background: var(--epic); }

/* --- 5. UI FORM & TOMBOL --- */
#reserve-section { padding: 60px 20px; }
.ui-panel { max-width: 600px; margin: 0 auto; background: rgba(20, 20, 20, 0.9); border: 2px solid #444; clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px); }
.ui-header { background: #222; padding: 15px 30px; border-bottom: 2px solid var(--game-red); display: flex; justify-content: space-between; align-items: center; }
.ui-header h3 { font-family: var(--font-display); font-style: italic; }
.ui-body { padding: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-family: var(--font-mono); color: #888; margin-bottom: 5px; }
input, select { width: 100%; background: #111; border: 1px solid #555; color: white; padding: 12px; font-family: var(--font-ui); font-size: 1.1rem; }
.timer-display { font-family: var(--font-mono); font-size: 4rem; text-align: center; color: white; margin-bottom: 20px; }

/* Gaya Tombol Global */
.btn-start, .btn-confirm, .btn-card-action, .btn-success, .btn-danger {
    border: none; cursor: pointer; font-family: var(--font-display); font-style: italic; text-transform: uppercase; transition: 0.3s;
}

.btn-start { background: linear-gradient(90deg, var(--game-red), #990000); color: white; padding: 15px 40px; font-size: 1.5rem; transform: skewX(-20deg); border: 1px solid white; display: inline-block; text-decoration: none; }
.btn-start:hover { transform: skewX(-20deg) scale(1.05); box-shadow: 0 0 20px var(--game-red); }

.btn-card-action { width: 100%; padding: 12px; background: #333; color: white; margin-top: auto; font-weight: bold; }
.btn-card-action:hover { background: white; color: black; }

.btn-confirm { width: 100%; background: var(--game-red); padding: 15px; color: white; font-size: 1.2rem; transform: skewX(-10deg); }
.btn-confirm:hover { background: white; color: var(--game-red); }

.action-buttons { display: flex; gap: 10px; margin-top: 20px; }
.btn-success { flex: 1; background: var(--common); padding: 12px; color: black; transform: skewX(-10deg); }
.btn-danger { flex: 1; background: transparent; border: 2px solid var(--game-red); padding: 12px; color: var(--game-red); transform: skewX(-10deg); }

/* --- 6. FOOTER & CREW --- */
#info-sections { padding: 40px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1000px; margin: 0 auto; }
.info-card { border: 1px solid #333; padding: 20px; background: linear-gradient(45deg, #111, #1a1a1a); }
.info-card h3 { color: var(--game-red); font-family: var(--font-display); font-style: italic; margin-bottom: 10px; }

.team-title { text-align: center; font-family: var(--font-display); font-size: 2.5rem; margin: 40px 0; position: relative; }
.paddock-gate { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; padding: 20px; }
.crew-member { text-align: center; transition: 0.4s; }
.pit-pass { position: relative; transition: 0.5s; cursor: pointer; z-index: 1; }
.id-card-img { width: 180px; border-radius: 8px; border: 1px solid #555; }
.crew-info { margin-top: 15px; opacity: 0.6; transform: translateY(-10px); transition: 0.3s; }
.crew-info h4 { color: white; margin-bottom: 0; }
.crew-info .role { color: var(--game-red); font-size: 0.8rem; font-family: var(--font-mono); }
.crew-member:hover .pit-pass { transform: scale(1.1) rotate(0deg) !important; z-index: 10; filter: drop-shadow(0 0 15px red); }
.crew-member:hover .crew-info { opacity: 1; transform: translateY(0); }

.footer-bottom { margin-top: 50px; text-align: center; padding-bottom: 20px; }
.footer-text-logo { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 2px; color: white; }
.footer-tagline { font-style: italic; color: var(--game-accent); font-size: 0.8rem; }
.copyright { font-family: var(--font-mono); color: #555; font-size: 0.7rem; margin-top: 10px; }


/* ===========================================================
   7. MOBILE RESPONSIVE (THE REAL FIX)
   =========================================================== */

/* Tablet (768px - 900px) - Ukuran pas, tidak diubah */
@media screen and (max-width: 900px) and (min-width: 768px) {
    /* HEADER */
    header { flex-direction: column; gap: 10px; padding: 15px; text-align: center; }
    
    /* HERO SECTION */
    #home { padding: 30px 20px; min-height: auto; }
    .hero-wrapper { flex-direction: column; gap: 20px; }
    
    /* Teks Hero */
    .hero-content { width: 100%; padding-right: 0; text-align: center; order: 1; }
    .game-title { font-size: 3.2rem; margin-bottom: 10px; }
    .hero-desc { font-size: 1rem; border-left: none; border-bottom: 3px solid var(--game-red); padding: 0 0 10px 0; display: inline-block; }

    /* Visual Mobil Hero - TABLET */
    .hero-visual { 
        width: 100%; 
        height: 300px;
        order: 2; 
        display: flex; 
        justify-content: center; 
        align-items: center;
        overflow: visible;
    }
    
    .hero-car {
        width: 280px; /* Tablet: ukuran sedang */
        height: auto;
        transform: rotate(-90deg) !important; 
        margin: 0 auto;
        filter: drop-shadow(0 15px 30px rgba(0,0,0,0.9));
    }
    
    .car-glow { width: 220px; height: 220px; }

    /* GRID & UI */
    .spots-container { gap: 25px; flex-wrap: wrap; justify-content: center; }
    .game-card { width: 45%; min-width: 280px; }
    .ui-panel { width: 95%; clip-path: none; border-radius: 10px; }
}

/* Phone (max 767px) - Mobil dikecilkan */
@media screen and (max-width: 767px) {
    /* HEADER */
    header { flex-direction: column; gap: 10px; padding: 15px; text-align: center; }
    
    /* HERO SECTION */
    #home { padding: 30px 20px; min-height: auto; }
    .hero-wrapper { flex-direction: column; gap: 20px; }
    
    /* Teks Hero */
    .hero-content { width: 100%; padding-right: 0; text-align: center; order: 1; }
    .game-title { font-size: 2.8rem; margin-bottom: 10px; }
    .hero-desc { font-size: 1rem; border-left: none; border-bottom: 3px solid var(--game-red); padding: 0 0 10px 0; display: inline-block; }

    /* Visual Mobil Hero - PHONE (DIKECILKAN) */
    .hero-visual { 
        width: 100%; 
        height: 280px;
        order: 2; 
        margin-top: -10px;
        display: flex; 
        justify-content: center; 
        align-items: center;
        overflow: visible;
    }
    
    .hero-car {
        width: 180px; /* PHONE: dikecilkan dari 240px jadi 180px */
        height: auto;
        transform: rotate(-90deg) !important; 
        margin: 0 auto;
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.9));
    }
    
    .car-glow { width: 150px; height: 150px; } /* Glow juga dikecilkan */

    /* GRID PARKIR (1 KOLOM) */
    .spots-container { gap: 25px; flex-direction: column; align-items: center; }
    .game-card { width: 100%; max-width: 380px; }
    .card-image { height: 200px; }
    .empty-overlay { font-size: 4rem; }

    /* FORM UI */
    .ui-panel { width: 100%; clip-path: none; border-radius: 10px; }
    .timer-display { font-size: 3rem; }
    .btn-start, .btn-confirm, .btn-card-action { width: 100%; padding: 15px; font-size: 1.2rem; }

    /* FOOTER */
    .info-grid { grid-template-columns: 1fr; }
    .paddock-gate { flex-direction: column; gap: 40px; }
    .pit-pass { transform: rotate(0deg) !important; }
    .crew-info { opacity: 1; transform: translateY(0); }
    .action-buttons { flex-direction: column; }
}

/* Very Small Phone (max 380px) - Lebih kecil lagi */
@media screen and (max-width: 380px) {
    .game-title { font-size: 2.4rem; }
    .hero-visual { height: 250px; }
    .hero-car { 
        width: 160px; /* Very small phone: 160px */
    }
    .car-glow { width: 130px; height: 130px; }
}
/* --- TOMBOL ABSEN F1 STYLE --- */
.btn-absen {
    position: absolute;
    right: 40px; /* Jarak dari kanan */
    top: 50%;
    transform: translateY(-50%) skewX(-20deg); /* Posisi tengah vertikal & miring */
    background: transparent;
    border: 2px solid var(--game-red);
    color: var(--game-red);
    padding: 10px 25px;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    z-index: 101;
}

.btn-absen:hover {
    background: var(--game-red);
    color: white;
    box-shadow: 0 0 15px var(--game-red); /* Efek glowing saat di-hover */
    transform: translateY(-50%) skewX(-20deg) scale(1.05);
}

/* --- MOBILE RESPONSIVE UNTUK TOMBOL ABSEN --- */
/* Masukkan atau pastikan ini menimpa style mobile yang ada */
@media screen and (max-width: 900px) {
    .btn-absen {
        position: static; /* Tidak lagi melayang di pojok */
        transform: skewX(-10deg); /* Tetap miring sedikit */
        margin-top: 15px;
        width: 80%; /* Lebar menyesuaikan layar HP */
        text-align: center;
        display: block;
    }
    
    .btn-absen:hover {
        transform: skewX(-10deg) scale(1.05);
    }
}
/* =========================================
   8. ACTIVE SESSION CARD (FIX DESIGN)
   ========================================= */

/* Animasi Muncul */
#booking-active-card {
    animation: fadeIn 0.5s ease-out;
}

/* Header: SESSION ACTIVE */
.active-status h4 {
    color: var(--game-red);
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-transform: uppercase;
    font-style: italic;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(225, 6, 0, 0.3);
}

/* Baris Data (Driver, Plate, Grid) */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.data-row span:first-child {
    font-family: var(--font-mono);
    color: #888;
    font-size: 0.9rem;
}

.data-val {
    font-family: var(--font-ui);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Highlight khusus untuk Grid Position */
#booked-slot {
    color: var(--game-accent);
    text-shadow: 0 0 5px var(--game-accent);
}

/* --- TIMER GEDE --- */
.live-timer {
    margin-top: 30px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    padding: 20px;
    position: relative;
}

/* Label Time Remaining */
.live-timer span {
    font-family: var(--font-mono);
    color: #888;
    font-size: 0.8rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

/* Angka Timer 05:00 */
.timer-big {
    font-family: var(--font-mono); /* Pake font digital */
    font-size: 5rem;  /* Ukuran super besar */
    font-weight: bold;
    color: var(--game-red);
    text-shadow: 0 0 20px var(--game-red), 0 0 40px rgba(225, 6, 0, 0.5); /* Efek neon glow */
    line-height: 1;
    letter-spacing: -2px;
}

/* --- TOMBOL ACTION (VALIDATE & ABORT) --- */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-success {
    flex: 2; /* Tombol Complete lebih lebar */
    background: var(--common); /* Warna Cyan/Hijau teal */
    color: #000;
    font-weight: 900;
    border: none;
    padding: 15px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    transform: skewX(-15deg);
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(69, 162, 158, 0.2);
}

.btn-success:hover {
    background: white;
    box-shadow: 0 0 20px white;
    transform: skewX(-15deg) translateY(-2px);
}

.btn-danger {
    flex: 1; /* Tombol Abort lebih kecil */
    background: transparent;
    border: 2px solid var(--game-red);
    color: var(--game-red);
    font-weight: bold;
    padding: 15px;
    font-family: var(--font-display);
    font-style: italic;
    transform: skewX(-15deg);
    cursor: pointer;
    transition: 0.3s;
}

.btn-danger:hover {
    background: var(--game-red);
    color: white;
    box-shadow: 0 0 15px var(--game-red);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   9. SUCCESS CARD (WINNER SCREEN - PODIUM STYLE)
   ========================================= */

/* Animasi Masuk (Slide Up yang smooth) */
#booking-success-card {
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    padding: 10px;
}

.success-box {
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.15) 0%, rgba(0,0,0,0) 70%); /* Glow Emas Tipis */
    border: 2px solid #FFD700; /* Border Emas */
    padding: 40px 20px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
}

/* --- TROPHY ANIMATION --- */
.trophy {
    font-size: 5rem;
    display: block;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 20px #FFD700); /* Bayangan Emas */
    animation: bounceTrophy 2s infinite ease-in-out;
}

@keyframes bounceTrophy {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.1); }
}

/* --- TEXT STYLING --- */
.success-box h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-style: italic;
    color: #FFD700; /* Warna Emas */
    text-transform: uppercase;
    margin: 10px 0;
    text-shadow: 0 4px 0px rgba(0,0,0,0.8); /* Efek 3D */
    letter-spacing: 2px;
}

.success-box p {
    font-family: var(--font-mono);
    color: #ccc;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* --- SLOT DISPLAY (HURUF BESAR) --- */
#success-slot {
    font-family: var(--font-display);
    font-size: 6rem; /* SANGAT BESAR */
    line-height: 1;
    color: white;
    margin: 20px auto;
    text-shadow: 5px 5px 0px var(--game-red); /* Efek block merah di belakang */
    background: rgba(255, 255, 255, 0.05);
    width: fit-content;
    padding: 10px 40px;
    border-left: 5px solid var(--game-red);
    border-right: 5px solid var(--game-red);
    transform: skewX(-10deg);
}

/* --- TOMBOL NEXT RACE --- */
.btn-restart {
    background: white;
    color: black;
    border: none;
    padding: 18px 50px; /* Tombol besar */
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    text-transform: uppercase;
    transform: skewX(-20deg); /* Miring tajam */
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

/* Efek Hover Tombol */
.btn-restart:hover {
    background: var(--game-red); /* Berubah jadi Merah */
    color: white;
    box-shadow: 0 0 25px var(--game-red); /* Glowing Merah */
    transform: skewX(-20deg) scale(1.05); /* Sedikit membesar */
}

/* Animasi Keyframe */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}