@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: transparent;
    --bg2: transparent;
    --card: transparent;
    --card-hover: transparent;

    --border: rgba(255, 255, 255, 0.25);
    --border-hover: rgba(99, 102, 241, 0.6);

    --text: #ffffff;
    --muted: #e2e8f0;

    --primary: #6366f1;
    --primary-light: #818cf8;

    --cyan: #22d3ee;
    --green: #34d399;
    --yellow: #fbbf24;
    --pink: #f472b6;

    --shadow: none;
    --radius: 16px;
}
#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: -999; /* Đẩy video xuống lớp nền sâu nhất */
    object-fit: cover;
    filter: brightness(0.4); /* Làm tối video để không bị chói mắt, làm nổi bật giao diện HUD */
}
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: transparent !important;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================
   VIDEO BACKGROUND (Vừa vặn, không phóng to)
========================= */
/* 1. Video nền phủ toàn màn hình ở lớp đáy sâu nhất */
#bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: -9999; /* Đẩy hẳn xuống dưới cùng, không bao giờ đè lên chữ */
    pointer-events: none; /* Cho phép click xuyên qua video */
}

/* Ép toàn bộ khung giao diện chức năng nổi lên trên video */
.quantum-container {
    position: relative;
    z-index: 10;
}

/* Các khung popup hoặc modal cũng cần z-index cao hơn */
.scan-popup-overlay {
    z-index: 1000;
}
/* 2. Các hiệu ứng nền phụ nằm đè lên video nhưng nằm dưới nội dung */
#matrix-canvas, .cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none; /* Cho phép click xuyên qua hiệu ứng để bấm được các chức năng */
}

/* 3. Khung chứa toàn bộ chức năng (HUD) phải có z-index cao hơn video */
.quantum-container {
    position: relative;
    z-index: 10; /* Đảm bảo nổi lên trên video và hiệu ứng nền */
}

#matrix-canvas, .cyber-grid {
    display: none !important;
}

/* =========================
   MAIN CONTAINER
========================= */
.quantum-container {
    position: relative;
    z-index: 1;
    width: min(100% - 20px, 600px);
    margin: 0 auto;
    padding: 15px 0 40px;
}

/* =========================
   HEADER (TRONG SUỐT 100%)
========================= */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px;
    margin-bottom: 15px;
    background: transparent !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.header h1::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary);
}

.header-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: var(--muted);
    font-size: 12px;
}

#live-clock {
    color: #a5b4fc;
    font-family: monospace;
}

.status-badge, .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.9);
}

/* =========================
   CARD (HUD SECTIONS - TRONG SUỐT 100%)
========================= */
.hud-section,
.intro-card,
.tele-item,
.scan-control,
.next-scan-box,
.history-stat,
.intro-main {
    position: relative;
    margin-bottom: 15px;
    padding: 18px;
    background: transparent !important;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: hidden;
}

.hud-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.section-number {
    color: var(--muted) !important;
    font-family: monospace;
    font-size: 10px;
    font-weight: 500;
}

/* =========================
   LIST
========================= */
.hud-list {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 12px;
}

.hud-list li {
    position: relative;
    padding: 8px 0 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-list li:last-child {
    border-bottom: 0;
}

.hud-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    font-size: 9px;
}

/* =========================
   BUTTON (Tối ưu cảm ứng Mobile)
========================= */
.cyber-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(99, 102, 241, 0.8);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(79, 70, 229, 0.8));
    backdrop-filter: blur(4px);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

.cyber-btn:active {
    transform: scale(0.98);
}

.cyber-btn.accent {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.8), rgba(37, 99, 235, 0.8));
    border-color: transparent;
}

/* =========================
   SCAN CONTROL & INPUTS
========================= */
.scan-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: transparent !important;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.scan-status {
    color: var(--green);
    font-family: monospace;
    font-size: 11px;
}

.input-group {
    margin-bottom: 14px;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.cyber-select, .cyber-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    outline: none;
    color: #fff;
    background: rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: none !important;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.cyber-select:focus, .cyber-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.cyber-select option {
    background: #0b1020;
    color: white;
}

.cyber-input::placeholder {
    color: #94a3b8;
}

/* =========================
   PROGRESS & HISTORY (TRONG SUỐT)
========================= */
.progress-container {
    position: relative;
    height: 38px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #6366f1, #22d3ee);
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
}

.support-wrap {
    margin-top: 12px;
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.live-indicator {
    color: var(--green);
    font-size: 10px;
    font-weight: 600;
}

.history-note {
    padding: 10px 12px;
    margin-bottom: 10px;
    color: var(--muted);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    font-size: 11px;
}

.next-scan-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 10px;
    color: var(--muted);
    font-size: 11px;
}

.next-scan-box b {
    color: var(--cyan);
    font-family: monospace;
}

.game-history,
.console-feed,
.scan-log-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: none !important;
}

.game-history > div,
.console-feed .feed-stream > div {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: monospace;
    font-size: 11px;
}

.history-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
}

@media(min-width: 480px) {
    .history-footer {
        grid-template-columns: repeat(3, 1fr);
    }
}

.history-stat {
    padding: 10px;
    background: transparent !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
}

.history-stat span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
}

.history-stat b {
    color: #fff;
    font-family: monospace;
    font-size: 11px;
}

/* =========================
   FEED, INTRO & TELEMETRY
========================= */
.console-feed {
    min-height: 150px;
    padding: 5px;
}

.feed-stream {
    font-family: monospace;
    font-size: 11px;
    color: var(--muted);
}

.intro-box {
    color: var(--muted);
    font-size: 12px;
}

.intro-main {
    padding: 14px;
    margin: 0 0 14px;
    background: transparent !important;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.intro-highlight {
    color: #a5b4fc;
    font-weight: 700;
}

.intro-grid, .telemetry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

@media(min-width: 480px) {
    .intro-grid, .telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.intro-card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
    font-size: 13px;
}

.intro-card h4 {
    margin: 0 0 5px;
    color: #fff;
    font-size: 12px;
}

.intro-card p, .tele-item span {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.intro-features {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 11px;
}

.intro-features li {
    margin-bottom: 5px;
}

.tele-item span {
    display: block;
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .5px;
}

.tele-item b {
    display: block;
    overflow: hidden;
    color: #fff;
    font-family: monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================
   POPUP
========================= */
.scan-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: rgba(2, 6, 15, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

.scan-popup-box {
    width: 100%;
    max-width: 420px;
    padding: 18px;
    background: rgba(9, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.6);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.scan-popup-title {
    margin-bottom: 14px;
    color: #a5b4fc;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.scan-log-list {
    max-height: 160px;
    padding: 10px;
    background: rgba(4, 6, 11, 0.5) !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-family: monospace;
    font-size: 10px;
    line-height: 1.8;
}
.scan-popup-overlay {
    display: none; /* Mặc định ẩn */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #02030a;
    border: 1px solid var(--neon-blue, #00ffe1);
    border-top: none;
    display: none;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
}

.dropdown-list.active {
    display: block;
}

.dropdown-item {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(0, 255, 225, 0.2);
    cursor: pointer;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(0, 255, 225, 0.15);
}

.game-name {
    color: #fff;
    font-size: 13px;
}

.game-percent {
    color: #34d399;
    margin-left: 6px;
}

.register-btn {
    background: var(--neon-blue, #00ffe1);
    color: #000;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.register-btn:hover {
    background: #fff;
    box-shadow: 0 0 8px var(--neon-blue, #00ffe1);
}