* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: 'Be Vietnam Pro', 'Segoe UI', sans-serif; }

/* ===== Giao diện 1: video toàn màn hình ===== */
.stage { position: fixed; inset: 0; background: #000; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }
.stage-mb { display: none; }
@media (max-width: 768px) { .stage-pc { display: none; } .stage-mb { display: block; } }
.stage:focus-visible { outline: 3px solid #fcd116; outline-offset: -3px; }

/* ===== Dùng chung cho popup ===== */
@keyframes spin-med { to { transform: rotate(360deg); } }
.divider { width: 40px; height: 1px; margin: 6px 0 10px; }
button.btn { all: unset; display: inline-block; padding: 10px 24px; border-radius: 8px; cursor: pointer; background: #fff; color: #111; font-size: 13px; font-weight: 700; font-family: 'Oswald', sans-serif; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; text-align: center; box-shadow: 0 2px 16px rgba(0,0,0,.4); position: relative; overflow: hidden; transition: transform .2s; }
button.btn::before { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: rgba(255,255,255,.4); transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0%, 65%, 100% { left: -60%; opacity: 0 } 45% { left: 120%; opacity: 1 } }
button.btn:hover { transform: scale(1.05) translateY(-1px); }

/* ===== Cổng chuyển hướng ===== */
.gate { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,4,12,0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: gate-in .35s ease both; }
.gate[hidden] { display: none; }
body.gate-open { overflow: hidden !important; }
@keyframes gate-in { from { opacity: 0 } to { opacity: 1 } }
.gate-panel { position: relative; width: min(420px, 100%); border-radius: 24px; padding: 28px 24px 22px; text-align: center; overflow: hidden;
  background: linear-gradient(160deg, rgba(8,16,40,0.92), rgba(3,6,18,0.96)); border: 1px solid rgba(0,56,168,0.55);
  box-shadow: 0 0 0 1px rgba(206,17,38,0.25), 0 20px 80px rgba(0,0,0,0.7), 0 0 60px rgba(0,56,168,0.35); display: flex; flex-direction: column; align-items: center; }
.gate-scan { position: absolute; left: 0; right: 0; height: 90px; top: -90px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(80,140,255,0.18), transparent); animation: gate-scan 2.4s linear infinite; }
@keyframes gate-scan { to { top: 100%; } }
.gate-sub { font: 11px 'Courier New', monospace; letter-spacing: .25em; color: rgba(255,255,255,.45); }
.gate-title { margin: 6px 0 0; font: 900 22px 'Roboto', sans-serif; letter-spacing: .1em; color: #E8A000; text-shadow: 0 0 22px rgba(220,140,0,.55); }
.gate-divider { background: linear-gradient(90deg, transparent, rgba(80,140,255,.8), transparent); margin: 12px 0 14px; width: 60px; }
.gate-steps { list-style: none; width: 100%; margin: 0 0 16px; padding: 0; text-align: left; display: grid; gap: 8px; }
.gate-steps li { display: flex; align-items: center; gap: 10px; font: 600 13px 'Be Vietnam Pro', sans-serif; color: rgba(255,255,255,.4); transition: color .3s; }
.gate-steps b { color: #fcd116; }
.gate-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); position: relative; transition: all .3s; }
.gate-steps li.active { color: #fff; }
.gate-steps li.active .gate-ic { border-color: #3b82f6 #3b82f6 transparent transparent; animation: spin-med 0.9s linear infinite; }
.gate-steps li.done { color: rgba(255,255,255,.85); }
.gate-steps li.done .gate-ic { background: #16a34a; border-color: #16a34a; animation: none; }
.gate-steps li.done .gate-ic::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.gate-bar { width: 100%; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.gate-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3b82f6, #fcd116, #ce1126); box-shadow: 0 0 12px rgba(252,209,22,.6); }
.gate-count { margin: 12px 0 14px; font: 600 13px 'Be Vietnam Pro', sans-serif; color: rgba(255,255,255,.75); }
.gate-count b { color: #fcd116; font-size: 18px; }
.gate-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.gate-go { min-width: 180px; min-height: 44px; text-align: center; padding: 12px 24px !important; font-size: 14px !important; }
.gate-cancel { all: unset; cursor: pointer; font: 600 12px 'Be Vietnam Pro', sans-serif; color: rgba(255,255,255,.5); padding: 10px 14px; min-height: 24px; text-decoration: underline; }
.gate-cancel:hover, .gate-cancel:focus-visible { color: #fff; }
button.btn:focus-visible, .gate-cancel:focus-visible { outline: 2px solid #fcd116; outline-offset: 3px; }
@media (max-width: 480px) { .gate-title { font-size: 18px; } .gate-panel { padding: 22px 16px 18px; } }
@media (prefers-reduced-motion: reduce) { .gate-scan, .gate, button.btn::before { animation: none !important; } }

/* ===== Khung hacker trong cổng ===== */
.gate-term { position: relative; width: 100%; height: 190px; margin-bottom: 16px; border: 1px solid #1a6d36; border-radius: 8px; overflow: hidden; background: #020a05;
  box-shadow: 0 0 24px rgba(32,194,14,.18), inset 0 0 30px #000; text-align: left; font-family: 'Share Tech Mono', 'Courier New', monospace; }
.term-rain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.term-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(0,25,10,.9); border-bottom: 1px solid #1a6d36; font-size: 11px; color: #20c20e; }
.term-bar i { width: 8px; height: 8px; border-radius: 50%; background: #1a6d36; }
.term-bar i:first-child { background: #ff5f56; } .term-bar i:nth-child(2) { background: #ffbd2e; } .term-bar i:nth-child(3) { background: #27c93f; }
.term-bar span { margin-left: 6px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-log { position: relative; z-index: 2; padding: 8px 10px; font-size: 12px; line-height: 1.55; color: #20c20e; text-shadow: 0 0 6px rgba(32,194,14,.7);
  background: linear-gradient(180deg, rgba(0,12,5,.82), rgba(0,12,5,.55)); height: calc(100% - 28px); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl b { color: #1a8f2e; font-weight: 400; }
.tl.ok span { color: #7dff8a; } .tl.warn span { color: #ffd24a; text-shadow: 0 0 6px rgba(255,210,74,.6); }
.term-crt { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.25) 50%); background-size: 100% 4px; box-shadow: inset 0 0 40px rgba(0,0,0,.9); }
@media (max-width: 480px) { .gate-term { height: 170px; } .term-log { font-size: 11px; } }
