@import url('https://fonts.googleapis.com/css2?family=Antonio:wght@400;700&display=swap');

:root {
    --amber: #FF9900; 
    --tan: #FFCC99; 
    --purple: #CC99CC; 
    --periwinkle: #99CCFF;
    --red: #FF3333; 
    --cyan: #00f2ff;
    --blue: #3366FF;
    --black: #010101; 
    --radius: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Antonio', sans-serif; text-transform: uppercase; user-select: none; overflow: hidden; }

body { background: var(--black); color: var(--amber); height: 100vh; width: 100vw; position: relative; }

.carbon-fiber { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png'); opacity: 0.15; z-index: -1; }
.scanline { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%); background-size: 100% 4px; pointer-events: none; z-index: 1500; }

.touch-target { cursor: pointer; min-height: 60px; }
.touch-target:focus { outline: 2px solid var(--periwinkle); box-shadow: 0 0 20px var(--periwinkle); }

.lockdown { background: var(--black); height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--red); text-align: center; }

#initView { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--black); z-index: 2000; display: none; align-items: center; justify-content: center; }
#initView.active { display: flex; }
.init-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; width: 100%; height: 100%; }

.pulse-ring { position: absolute; width: 500px; height: 500px; border: 4px solid var(--amber); border-radius: 50%; animation: pulseInit 4s infinite; opacity: 0; pointer-events: none; }
.delay-1 { animation-delay: 2s; }
@keyframes pulseInit { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.6); opacity: 0; } }

.lcars-btn-glow { background: transparent; border: 2px solid var(--amber); color: var(--amber); padding: 25px 80px; font-size: 36px; border-radius: 60px; box-shadow: 0 0 20px var(--amber); transition: 0.3s; margin-top: 30px; }
.lcars-btn-glow:hover { background: var(--amber); color: #000; box-shadow: 0 0 60px var(--amber); }

.lcars-layout { display: flex; flex-direction: column; height: 100%; padding: 20px; gap: 12px; }
.lcars-header { display: flex; height: 80px; gap: 12px; flex-shrink: 0; }
.lcars-elbow-tl { width: 220px; background: var(--purple); border-top-left-radius: var(--radius); position: relative; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 25px 10px 0; }
.lcars-elbow-tl::after { content: ""; position: absolute; bottom: -30px; left: 0; width: 80px; height: 30px; background: var(--purple); border-bottom-left-radius: 30px; }
.lcars-top-bar { display: flex; flex: 1; gap: 12px; height: 55px; }
.bar-seg { flex: 1; padding: 5px 20px; font-size: 24px; display: flex; align-items: center; justify-content: flex-end; color:#000; font-weight:bold;}
.lcars-title { font-size: 36px; font-weight: bold; color: #000; }

.lcars-body { display: flex; flex: 1; gap: 12px; overflow: hidden; }
.lcars-sidebar { width: 220px; display: flex; flex-direction: column; gap: 12px; padding-top: 40px; flex-shrink: 0; }
.lcars-block-fill { flex: 1; border-radius: 30px; }
.side-status { height: 80px; padding: 15px; font-size: 28px; color: #000; display: flex; align-items: center; justify-content: flex-end; border-radius: 30px; font-weight: bold;}
.side-tag { height: 60px; padding: 15px; font-size: 24px; color: #000; display: flex; align-items: center; justify-content: flex-end; border-radius: 30px; font-weight: bold; }

.lcars-content { flex: 1; padding: 4vh 5vw; background: rgba(0,0,0,0.5); border: 2px solid rgba(153, 204, 255, 0.2); position: relative; display: flex; flex-direction: column; border-radius: 30px; }

/* AUTH VIEW & BOOT SCANNER */
.auth-split-layout { display: flex; flex: 1; align-items: center; justify-content: space-between; }
.auth-left { display: flex; flex-direction: column; width: 500px; }
.auth-right { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: 2px solid rgba(255,204,153,0.2); margin-left: 50px; height: 100%;}

.boot-scanner { position: relative; width: 100%; height: 160px; background: rgba(0, 0, 0, 0.7); border: 2px solid var(--periwinkle); margin-bottom: 30px; border-radius: 15px; display: flex; flex-direction: column; justify-content: center; padding: 15px; overflow:hidden;}
.scanner-lines { font-family: monospace; font-size: 22px; color: var(--periwinkle); letter-spacing: 6px; line-height: 1.5; opacity: 0.9; text-align: center; }
.scanner-beam { position: absolute; top: 0; left: 0; width: 100%; height: 40px; background: linear-gradient(to bottom, rgba(153,204,255,0), rgba(153,204,255,0.8), rgba(153,204,255,0)); animation: scanBeam 1.5s linear infinite alternate; z-index: 2; pointer-events:none;}
@keyframes scanBeam { 0% { transform: translateY(-40px); } 100% { transform: translateY(160px); } }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.keypad-display { font-size: 80px; letter-spacing: 20px; color: var(--tan); text-shadow: 0 0 20px var(--tan); margin-bottom: 25px; text-align: right;}
.lcars-pill { border: none; border-radius: 40px; font-size: 36px; font-weight: bold; cursor: pointer; text-align: right; padding-right: 35px; transition:0.2s;}
.lcars-pill:hover { filter: brightness(1.3); }

/* STARFLEET EMBLEM */
.starfleet-emblem { width: 400px; height: 400px; filter: drop-shadow(0 0 30px var(--amber)); }
.hologram { animation: holoFlicker 4s infinite; }
@keyframes holoFlicker { 0%, 100% { opacity: 1; } 5%, 9% { opacity: 0.8; } 7% { opacity: 0.4; } 45% { opacity: 1; } 46% { opacity: 0.5; } 47% { opacity: 1; } }

/* SECTION 31 HACKING SEQUENCE */
.s31-layout { display: flex; width: 100%; height: 100%; align-items: stretch; justify-content: space-between; }
.s31-col { display: flex; flex-direction: column; }
.s31-stream { width: 220px; font-family: monospace; font-size: 28px; line-height: 1.2; word-break: break-all; text-align: center; }
.tri-digit { display: inline-block; animation: digitPulse infinite alternate; margin: 1px; }
@keyframes digitPulse { 0% { opacity: 0.2; } 100% { opacity: 1; text-shadow: 0 0 10px currentColor; } }

.s31-center { flex: 1; align-items: center; justify-content: center; padding: 0 50px; border-left: 2px solid rgba(0, 242, 255, 0.4); border-right: 2px solid rgba(0, 242, 255, 0.4); margin: 0 30px; display:flex; flex-direction:column;}
.s31-insignia { width: 280px; height: 280px; margin: 30px 0; }
.hologram-cyan { filter: drop-shadow(0 0 35px var(--cyan)); animation: holoFlicker 3s infinite; }
.glow-text-cyan { text-shadow: 0 0 20px var(--cyan); }

.s31-locks { display: flex; gap: 20px; margin: 40px 0; }
.s31-lock { width: 45px; height: 20px; border: 3px solid var(--red); background: rgba(255,0,0,0.2); border-radius: 6px; transition: 0.3s; }
.s31-lock.unlocked { border-color: #0f0; background: rgba(0,255,0,0.6); box-shadow: 0 0 20px #0f0; }

.s31-code-box { font-family: monospace; font-size: 90px; letter-spacing: 20px; text-shadow: 0 0 25px var(--cyan); margin-bottom: 50px; }
.s31-progress-bg { width: 100%; height: 35px; border: 3px solid var(--cyan); border-radius: 20px; background: rgba(0,242,255,0.1); overflow: hidden; }
.s31-progress-fill { height: 100%; width: 0%; box-shadow: 0 0 20px var(--cyan); }

/* LOG */
.system-log { margin-top: 40px; background: rgba(0, 0, 0, 0.7); height: 280px; padding: 20px; display: flex; flex-direction: column; border-radius: 15px; border: 2px solid var(--periwinkle);}
.log-header { font-size: 22px; color: var(--periwinkle); border-bottom: 2px solid var(--periwinkle); margin-bottom: 15px; padding-bottom:10px;}
.log-body { flex: 1; overflow-y: auto; font-size: 22px; color: var(--tan); text-transform: none; font-family: monospace; }
.log-entry::before { content: "> "; color: var(--amber); }

/* COMMANDS */
.command-grid { display: flex; flex-direction: column; gap: 20px; margin-top: 30px;}
.cmd-row { display: flex; align-items: center; gap: 12px; }
.label-pill { width: 180px; border-radius: 35px 0 0 35px; display: flex; align-items: center; justify-content: flex-end; padding-right: 25px; font-size: 28px; color: #000; font-weight: bold; }
.lcars-btn-rect { background: rgba(0,0,0,0.4); border: 3px solid; padding: 0 35px; font-size: 28px; color: #fff; text-align: right; border-radius: 30px; transition: 0.2s; min-width: 400px; display: flex; align-items: center; justify-content: flex-end;}
.lcars-btn-rect:hover { background: rgba(255,255,255,0.2); }
.lcars-btn-rect:active { filter: brightness(1.5); }

/* MAINT & DESTRUCT */
.maint-clock { font-size: 140px; margin: 40px 0; }
.progress-bar-container { height: 50px; border: 3px solid var(--amber); border-radius: 25px; overflow: hidden; width: 100%; margin-top:40px;}
.progress-bar-fill { height: 100%; width: 0%; }

/* FOOTER */
.lcars-footer { display: flex; height: 85px; gap: 12px; flex-shrink: 0; align-items: flex-end; }
.lcars-elbow-bl { width: 220px; height: 80px; background: var(--amber); border-bottom-left-radius: var(--radius); position: relative; }
.lcars-elbow-bl::before { content: ""; position: absolute; top: -30px; left: 0; width: 80px; height: 30px; background: var(--amber); border-top-left-radius: 30px; }
.lcars-bottom-bar { display: flex; flex: 1; gap: 12px; height: 55px; }

/* UTILS */
h1 { font-size: 60px; margin-bottom: 25px; font-weight: bold; letter-spacing: 3px;}
h2 { font-size: 40px; margin-bottom: 25px; font-weight: normal; }

.bg-periwinkle { background: var(--periwinkle); } .bg-tan { background: var(--tan); } .bg-purple { background: var(--purple); } .bg-red { background: var(--red); } .bg-amber { background: var(--amber); } .bg-cyan { background: var(--cyan); }
.border-periwinkle { border-color: var(--periwinkle); color:var(--periwinkle);} .border-purple { border-color: var(--purple); color:var(--purple);} .border-amber { border-color: var(--amber); color:var(--amber);} .border-red { border-color: var(--red); color:var(--red);} .border-tan { border-color: var(--tan); color:var(--tan);}
.text-amber { color: var(--amber); } .text-periwinkle { color: var(--periwinkle); } .text-red { color: var(--red); } .text-tan { color: var(--tan); } .text-cyan { color: var(--cyan); }
.glow-text { text-shadow: 0 0 20px var(--amber); }
.blink { animation: bl 1s steps(2) infinite; }
@keyframes bl { 50% { opacity: 0; } }
.hidden { display: none !important; }
.view { display: none; flex-direction: column; height: 100%; }
.view.active { display: flex; }

/* RED ALERT */
body.red-alert-mode .bg-amber, body.red-alert-mode .bg-tan, body.red-alert-mode .bg-purple, 
body.red-alert-mode .bg-periwinkle, body.red-alert-mode .lcars-elbow-tl, body.red-alert-mode .lcars-elbow-bl { background-color: var(--red) !important; }

/* OMEGA MASKING CLASSES */
.omega-mask { font-family: 'Antonio', sans-serif; letter-spacing: 15px; }