/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #080808;       /* Hampir hitam */
    --primary: #ffb800;        /* Amber retro monitor */
    --secondary: #332600;      /* Amber gelap buat background elemen */
    --accent: #ff003c;         /* Merah darah buat highlight horror */
    --grid-line: #1a1a1a;      /* Warna garis grid */
    --font-head: 'Syncopate', sans-serif;
    --font-body: 'Space Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    padding: 20px; /* Default desktop */
}

/* --- CRT & SCANLINE EFFECTS --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 99;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(255, 184, 0, 0.05);
    opacity: 0.4;
    animation: scan 6s linear infinite;
    pointer-events: none;
    z-index: 98;
}

@keyframes scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* --- LAYOUT UTAMA --- */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    border: 2px solid var(--primary);
    position: relative;
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 20px 20px;
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.1);
}

/* --- HEADER --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary);
    padding: 10px;
    font-size: 0.8rem;
    background: var(--bg-color);
}

.blink {
    animation: blinker 1s linear infinite;
    color: var(--accent);
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* --- HERO SECTION --- */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 2px solid var(--primary);
}

.hero-visual {
    /* Layout dasar */
    border-right: 2px solid var(--primary);
    position: relative;
    height: 400px; /* Default desktop height */
    overflow: hidden;
    padding: 0;
    display: block;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) sepia(100%) hue-rotate(-50deg) saturate(300%) contrast(1.2);
    transition: filter 0.3s ease;
}

.hero-visual:hover .hero-img {
    filter: grayscale(0%) contrast(1.2); 
    cursor: help;
}

.caption-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--bg-color);
    padding: 5px 10px;
    border: 1px solid var(--primary);
    font-size: 0.8rem;
}

.hero-text {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    font-family: var(--font-head);
    font-size: 3.5rem;
    line-height: 0.9;
    letter-spacing: -2px;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 2px 2px var(--accent);
}

.subtitle {
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 20px;
}

.separator {
    width: 50px;
    height: 5px;
    background: var(--primary);
    margin-bottom: 20px;
}

.meta-box {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px dotted var(--primary);
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

.accent {
    color: var(--accent);
}

/* --- NAVIGATION GRID --- */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.nav-item {
    border-right: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
    padding: 30px;
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Trik selektor CSS biar border kanan ilang di elemen genap (mode desktop) */
.nav-item:nth-child(2n) {
    border-right: none;
}

.nav-item:hover {
    background: var(--primary);
    color: var(--bg-color);
    cursor: crosshair;
}

.nav-code {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 10px;
    display: block;
}

.nav-item h3 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.active-hazard:hover {
    background: var(--accent);
}

/* --- FOOTER MARQUEE --- */
.marquee-container {
    background: var(--primary);
    color: var(--bg-color);
    overflow: hidden;
    white-space: nowrap;
    padding: 5px 0;
    font-weight: bold;
    font-family: var(--font-head);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
}

/* Link flaticon biar gak ngerusak layout */
.marquee-container a {
    font-size: 0.6rem;
    color: var(--bg-color);
    text-decoration: none;
    margin-right: 10px;
    flex-shrink: 0;
    opacity: 0.5;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* =========================================
   MOBILE RESPONSIVE TWEAKS 
   ========================================= */

@media (max-width: 768px) {
    body {
        padding: 10px; /* Kurangi padding body biar lega */
    }

    /* Hero jadi tumpuk vertikal */
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        border-right: none;
        border-bottom: 2px solid var(--primary);
        height: 250px; /* Kurangi tinggi gambar di HP */
    }

    .hero-text {
        padding: 20px; /* Padding dalem lebih tipis */
    }

    h1 {
        font-size: 2.2rem; /* Font judul dikecilin */
    }
    
    .nav-item {
        padding: 20px; /* Tombol navigasi lebih compact */
    }
}

@media (max-width: 480px) {
    /* Navigasi jadi 1 kolom full ke bawah di layar kecil banget */
    .nav-grid {
        grid-template-columns: 1fr;
    }

    .nav-item {
        border-right: none !important; /* Hapus border kanan */
        border-bottom: 1px solid var(--primary);
    }
    
    .hero-visual {
        height: 200px; /* Makin pendek biar konten teks naik */
    }
    
    h1 {
        font-size: 1.8rem; /* Aman buat layar sempit */
    }

    .nav-item h3 {
        font-size: 1.2rem;
    }
    
    /* Sembunyiin status kanan di top bar kalo sempit */
    .status-right {
        display: none;
    }
    
    /* Caption gambar dikecilin atau diumpetin opsional */
    .caption-overlay {
        font-size: 0.6rem;
        padding: 2px 5px;
        bottom: 10px;
        left: 10px;
    }
}

/* =========================================
   LABORATORY SECTION STYLES 
   ========================================= */

/* Link balik ke home */
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}

.back-link:hover {
    background: var(--primary);
    color: var(--bg-color);
}

/* Grid Layout buat Kartu Game */
.lab-grid {
    display: grid;
    /* Ini trik responsif: otomatis ngisi kolom, minimal lebar 280px */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    padding: 30px;
}

/* Styling Tiap Kartu */
.lab-card {
    border: 1px solid var(--primary);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 184, 0, 0.02); /* Transparan dikit */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lab-card:hover {
    transform: translateY(-5px); /* Efek melayang dikit pas di hover */
    box-shadow: 5px 5px 0px var(--primary); /* Bayangan kasar retro */
    background: var(--bg-color);
}

/* Header kecil di dalam kartu (versi & status) */
.card-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--primary);
    padding-bottom: 5px;
    opacity: 0.7;
}

.lab-card h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.lab-card p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Tombol Launch */
.launch-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
    font-family: var(--font-head);
    font-size: 0.8rem;
}

.launch-btn:hover {
    background: var(--primary);
    color: var(--bg-color);
}

/* --- VARIAN KARTU (Hazard / Locked) --- */

/* Varian Bahaya (Merah) */
.hazard {
    border-color: var(--accent);
}

.hazard-btn {
    border-color: var(--accent);
    color: var(--accent);
}

.hazard-btn:hover {
    background: var(--accent);
    color: var(--bg-color);
}

/* Varian Terkunci (Abu-abu) */
.locked {
    border-color: #444;
    color: #666;
    pointer-events: none; /* Gak bisa diklik */
}

.locked .card-header, .locked h3 {
    color: #666;
}

.disabled {
    border-color: #444;
    color: #444;
    cursor: not-allowed;
}

/* Mobile Tweaks buat Lab */
@media (max-width: 480px) {
    .lab-grid {
        grid-template-columns: 1fr; /* 1 Kolom penuh di HP */
        padding: 20px;
    }
}