/* ================= DESIGN VARIABLES & RESET ================= */
:root {
    --bg-color: #0b021a;
    --card-bg: rgba(20, 10, 35, 0.65);
    --border-color: rgba(0, 240, 255, 0.2);
    --border-color-hover: rgba(0, 240, 255, 0.5);
    
    --neon-cyan: #00f0ff;
    --neon-pink: #ff007f;
    --neon-green: #39ff14;
    --neon-yellow: #ffd700;
    
    --text-main: #f0ecf5;
    --text-muted: #a69bb5;
    
    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ================= BACKGROUND ELEMENTS ================= */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    z-index: -3;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
    animation: pulse-glow 15s infinite alternate ease-in-out;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-pink) 0%, transparent 70%);
    top: -10vw;
    left: -10vw;
}

.orb-2 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 70%);
    bottom: -15vw;
    right: -10vw;
    animation-delay: -5s;
}

.orb-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, var(--neon-yellow) 0%, transparent 70%);
    top: 30%;
    left: 40%;
    animation-delay: -8s;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulse-glow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(30px, -30px); }
}

/* ================= AUDIO WIDGET ================= */
.audio-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.sound-toggle-btn {
    background: rgba(20, 10, 35, 0.8);
    border: 1px solid var(--border-color);
    color: var(--neon-cyan);
    padding: 10px 18px;
    font-family: var(--font-mono);
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.sound-toggle-btn:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

.sound-wave {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.sound-wave span {
    display: inline-block;
    width: 2px;
    height: 4px;
    background-color: var(--neon-cyan);
    border-radius: 1px;
    transition: height 0.1s linear;
}

.sound-toggle-btn.playing .sound-wave span {
    animation: bounce-sound 0.8s ease infinite alternate;
}

.sound-toggle-btn.playing .sound-wave span:nth-child(2) { animation-delay: 0.15s; }
.sound-toggle-btn.playing .sound-wave span:nth-child(3) { animation-delay: 0.3s; }
.sound-toggle-btn.playing .sound-wave span:nth-child(4) { animation-delay: 0.45s; }

.sound-toggle-btn.playing {
    color: var(--neon-pink);
    border-color: rgba(255, 0, 127, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.2);
}

.sound-toggle-btn.playing .sound-wave span {
    background-color: var(--neon-pink);
}

@keyframes bounce-sound {
    0% { height: 4px; }
    100% { height: 14px; }
}

/* ================= CONTAINER & CARD LAYOUT ================= */
.terminal-container {
    width: 100%;
    max-width: 680px;
    min-height: 520px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 240, 255, 0.05);
    padding: 35px;
    position: relative;
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.terminal-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    border-radius: 16px 16px 0 0;
}

/* ================= SCREENS STATE MANAGEMENT ================= */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* ================= CYBER BOX & HEADER ================= */
.cyber-box {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
}

.security-badge {
    display: inline-block;
    background: rgba(255, 0, 127, 0.15);
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.1);
}

.security-badge.secondary {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.1);
}

h1, h2 {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: #fff;
    text-transform: uppercase;
}

.status-indicator {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator.alert {
    color: var(--neon-yellow);
}

.status-indicator.success {
    color: var(--neon-green);
}

.status-indicator.danger {
    color: var(--neon-pink);
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* ================= GLITCH TEXT EFFECT ================= */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-pink);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-cyan);
    clip: rect(85px, 450px, 140px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(15px, 9999px, 66px, 0); }
    10% { clip: rect(34px, 9999px, 55px, 0); }
    20% { clip: rect(81px, 9999px, 92px, 0); }
    100% { clip: rect(12px, 9999px, 35px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(74px, 9999px, 88px, 0); }
    10% { clip: rect(11px, 9999px, 44px, 0); }
    20% { clip: rect(95px, 9999px, 115px, 0); }
    100% { clip: rect(55px, 9999px, 82px, 0); }
}

/* ================= STAGE 1: SCANNER ================= */
.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
}

.instruction {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 40px;
    max-width: 480px;
}

.scanner-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.scanner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    animation: rotate-ring 20s linear infinite;
}

.scanner-container:hover .scanner-ring {
    border-color: var(--neon-cyan);
}

.scanner-btn {
    width: 140px;
    height: 140px;
    background: rgba(0, 240, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.scanner-btn:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.1);
}

.scanner-btn:active, .scanner-btn.scanning {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--neon-cyan);
}

.fingerprint-icon {
    width: 65px;
    height: 65px;
    fill: var(--text-muted);
    transition: all 0.3s ease;
}

.scanner-btn:hover .fingerprint-icon {
    fill: var(--neon-cyan);
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.5));
}

.scanner-btn.scanning .fingerprint-icon {
    fill: var(--neon-cyan);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.7));
}

.scanner-btn.success .fingerprint-icon {
    fill: var(--neon-green);
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.7));
}

.laser-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    opacity: 0;
    pointer-events: none;
}

.scanner-btn.scanning .laser-line {
    opacity: 1;
    animation: laser-scan 1.5s ease-in-out infinite alternate;
}

.scan-status {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.progress-bar-container {
    width: 100%;
    max-width: 320px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    transition: width 0.1s linear;
}

@keyframes rotate-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes laser-scan {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* ================= STAGE 2: BRIEFING ================= */
.briefing-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.hologram-viewport {
    width: 200px;
    height: 250px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.05);
}

.hologram-viewport::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(rgba(18, 10, 36, 0) 50%, rgba(0, 240, 255, 0.15) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    z-index: 2;
    pointer-events: none;
}

.hologram-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 240, 255, 0.1) 0%, transparent 75%);
    z-index: 1;
}

.hologram-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    filter: saturate(1.1) contrast(1.1) brightness(1.05);
    z-index: 0;
}

.hologram-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.25), transparent);
    animation: hologram-scan 4s linear infinite;
    z-index: 3;
}

.briefing-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}

.terminal-text {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--neon-cyan);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    min-height: 180px;
    white-space: pre-wrap;
    text-shadow: 0 0 2px rgba(0, 240, 255, 0.5);
}

.terminal-text strong {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@keyframes hologram-scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* ================= CYBER BUTTONS ================= */
.cyber-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
    margin-top: 15px;
    align-self: flex-start;
}

.cyber-btn:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.cyber-btn:active {
    transform: scale(0.97);
}

.cyber-btn:disabled {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    cursor: not-allowed;
    background: transparent;
}

.cyber-btn.primary-btn {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.15);
    align-self: center;
    width: 100%;
}

.cyber-btn.primary-btn:hover {
    background: rgba(255, 0, 127, 0.08);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.3);
    text-shadow: 0 0 5px var(--neon-pink);
}

.cyber-btn.secondary {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

.cyber-btn.secondary:hover {
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 5px var(--neon-yellow);
}

/* ================= STAGE 3: SECURITY QUIZ ================= */
.quiz-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.quiz-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.quiz-container {
    min-height: 260px;
    position: relative;
}

.quiz-question-card {
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s ease;
}

.quiz-question-card.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.question-header {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-pink);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option-btn {
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-sans);
}

.option-letter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.option-btn:hover:not(.disabled) {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.option-btn:hover:not(.disabled) .option-letter {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
}

.option-btn.selected-correct {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, 0.08);
    color: #fff;
}

.option-btn.selected-correct .option-letter {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: #000;
}

.option-btn.selected-incorrect {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.08);
}

.option-btn.selected-incorrect .option-letter {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    color: #fff;
}

.option-btn.fade-out {
    opacity: 0.4;
    cursor: not-allowed;
}

.quiz-feedback {
    margin-top: 15px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    min-height: 20px;
    transition: all 0.3s ease;
}

.quiz-feedback.correct {
    color: var(--neon-green);
}

.quiz-feedback.incorrect {
    color: var(--neon-pink);
}

.quiz-navigation {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.quiz-progress-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ================= STAGE 4: PROPOSAL (YES / NO GAME) ================= */
.proposal-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.proposal-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
}

.agent-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
    transition: all 0.5s ease;
}

.agent-avatar-container:first-child .agent-avatar {
    border-color: rgba(255, 0, 127, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.15);
}

.agent-avatar-container:first-child:hover .agent-avatar {
    border-color: var(--neon-pink);
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.4);
    transform: scale(1.05);
}

.agent-avatar-container:last-child .agent-avatar {
    border-color: rgba(0, 240, 255, 0.4);
}

.agent-avatar-container:last-child:hover .agent-avatar {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
    transform: scale(1.05);
}

.avatar-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.versus-icon {
    font-size: 1.5rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    animation: flash-versus 1.5s infinite alternate ease-in-out;
}

@keyframes flash-versus {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)); }
    100% { transform: scale(1.2); filter: drop-shadow(0 0 10px var(--neon-yellow)); }
}

.proposal-content {
    width: 100%;
    text-align: center;
}

.proposal-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 35px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.proposal-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    min-height: 60px; /* Crucial to prevent layout shift when "No" leaves */
    position: relative;
    margin-bottom: 35px;
    width: 100%;
}

.action-btn {
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    border: none;
    outline: none;
}

.accept-btn {
    background: var(--neon-green);
    color: #000;
    padding: 16px 36px;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.accept-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.6);
}

.accept-btn:active {
    transform: scale(0.97);
}

.decline-btn {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 14px 28px;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.1);
    transition: all 0.1s linear; /* Fast movement for runaway */
    z-index: 9;
}

.decline-btn.runaway {
    position: absolute;
    z-index: 9999;
}

/* ================= SYSTEM WARNINGS CONSOLE ================= */
.error-log-console {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 0, 127, 0.15);
    border-radius: 8px;
    font-family: var(--font-mono);
    text-align: left;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.console-header {
    background: rgba(255, 0, 127, 0.08);
    border-bottom: 1px solid rgba(255, 0, 127, 0.15);
    padding: 8px 15px;
    font-size: 0.75rem;
    color: var(--neon-pink);
    letter-spacing: 2px;
}

.console-body {
    padding: 15px;
    font-size: 0.8rem;
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}

.log-line {
    line-height: 1.4;
    color: var(--text-muted);
}

.log-line.system {
    color: var(--neon-cyan);
}

.log-line.error {
    color: var(--neon-pink);
}

/* ================= STAGE 5: PLANNER ================= */
.specs-summary-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.summary-header {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    padding-bottom: 8px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 580px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
    }
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-item .label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.summary-item .value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}

.planner-wrapper {
    width: 100%;
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

/* Option grids for location */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 580px) {
    .choice-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 12px;
    }
}

.choice-card {
    cursor: pointer;
    position: relative;
}

.choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-inner {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-card:hover .card-inner {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.03);
    transform: translateY(-3px);
}

.choice-card input[type="radio"]:checked + .card-inner {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.06);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.2);
}

.choice-card .icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.choice-card .title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.choice-card .desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Cyber inputs */
.cyber-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.cyber-input.textarea {
    min-height: 80px;
    resize: vertical;
}

/* Date/Time Webkit Overrides for neatness */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.9) sepia(1) saturate(5) hue-rotate(160deg);
    cursor: pointer;
}

/* Chip/Badge radio selector */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-option {
    cursor: pointer;
}

.chip-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-option span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.chip-option:hover span {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.chip-option input:checked + span {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.08);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.15);
}

/* ================= STAGE 6: AGENT PASS CARD ================= */
.ticket-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ticket-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
    max-width: 480px;
}

.agent-pass-card {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, #1b0a2f 0%, #0c0217 100%);
    border: 2px solid rgba(255, 215, 0, 0.3); /* Gold border */
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 30px rgba(255, 215, 0, 0.05);
    overflow: hidden;
    position: relative;
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.5s ease;
}

.agent-pass-card:hover {
    transform: translateY(-5px) rotate(1deg);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 20px 45px rgba(0,0,0,0.7), 0 0 35px rgba(255, 215, 0, 0.15);
}

.pass-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.pass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.pass-logo {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--neon-cyan);
    letter-spacing: 2px;
}

.pass-classification {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.1);
    border: 1px solid var(--neon-pink);
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
}

.pass-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.pass-photo-area {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.pass-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.barcode-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.barcode-lines {
    width: 100%;
    height: 30px;
    background-image: repeating-linear-gradient(90deg, 
        #fff 0px, #fff 2px, 
        transparent 2px, transparent 5px, 
        #fff 5px, #fff 8px, 
        transparent 8px, transparent 10px, 
        #fff 10px, #fff 11px, 
        transparent 11px, transparent 14px
    );
    opacity: 0.8;
}

.barcode-number {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.pass-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row.border-top {
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 10px;
}

.detail-row .label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.detail-row .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.detail-row .value-alert {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-pink);
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.3);
    font-weight: 800;
    margin-top: 5px;
    text-transform: uppercase;
}

.pass-footer {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    padding-top: 12px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.ticket-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 480px;
}

.ticket-actions button {
    flex: 1;
    margin-top: 0;
}

/* ================= MOBILE ADAPTABILITY ================= */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .terminal-container {
        padding: 20px 15px;
        min-height: auto;
    }
    
    h1, h2 {
        font-size: 1.35rem;
    }
    
    .briefing-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .hologram-viewport {
        width: 160px;
        height: 200px;
    }
    
    .briefing-info {
        width: 100%;
        min-height: auto;
    }
    
    .terminal-text {
        font-size: 0.85rem;
        min-height: 140px;
    }
    
    .proposal-visual {
        gap: 15px;
    }
    
    .agent-avatar {
        width: 80px;
        height: 80px;
    }
    
    .proposal-text {
        font-size: 0.95rem;
    }
    
    .proposal-actions {
        flex-direction: column;
        gap: 15px;
        min-height: 120px;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .decline-btn.runaway {
        width: auto;
    }
    
    .form-group-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pass-body {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .pass-photo-area {
        width: 160px;
    }
    
    .pass-details {
        width: 100%;
    }
    
    .ticket-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .ticket-actions button {
        width: 100%;
    }
}

/* ================= GLITCH FAILURE OVERLAY & EFFECTS ================= */
.glitch-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: none !important; /* Prevent transform offsets on the fixed overlay */
}

.glitch-screen-overlay.active {
    display: flex;
}

.glitch-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-mono);
    color: var(--neon-green);
    position: relative;
}

.glitch-screen-overlay.active .glitch-content-wrapper {
    animation: screen-shake-severe 0.15s infinite alternate;
}

.glitch-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

.glitch-terminal-input {
    font-size: 1.5rem;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px var(--neon-green);
}

.glitch-terminal-input .prompt {
    color: var(--neon-green);
}

.cursor-blink {
    animation: blinker 0.8s steps(2, start) infinite;
}

/* Screen CRT flicker effect */
@keyframes screen-shake-severe {
    0% { transform: translate(1px, 1px) rotate(0deg); filter: hue-rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); filter: hue-rotate(90deg) contrast(2); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); filter: hue-rotate(0deg); }
}

/* Severe shaking for the card itself */
.terminal-container.shake-hard {
    animation: card-shake 0.3s infinite;
    border-color: var(--neon-pink);
    box-shadow: 0 0 50px rgba(255, 0, 127, 0.4);
}

@keyframes card-shake {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Falling correct button keyframe animation */
#falling-correct-btn.drop-stone {
    animation: drop-stone-anim 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes drop-stone-anim {
    0% {
        transform: translateY(-500px) scaleY(2);
        opacity: 0;
    }
    60% {
        transform: translateY(0) scaleY(0.9);
        opacity: 1;
    }
    75% {
        transform: translateY(-20px) scaleY(1.1);
    }
    90% {
        transform: translateY(0) scaleY(0.95);
    }
    100% {
        transform: translateY(0) scaleY(1);
    }
}

/* ================= INTERACTIVE FINAL COMPONENTS ================= */

/* Decryption Gate Container */
.decryption-gate-container {
    width: 100%;
    max-width: 480px;
    background: rgba(20, 10, 35, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0, 240, 255, 0.05);
    backdrop-filter: blur(8px);
}

.gate-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Locked / Decrypted pass card state */
.agent-pass-card.locked {
    filter: blur(8px) grayscale(0.6);
    opacity: 0.4;
    pointer-events: none;
    transition: all 0.8s ease;
}

.agent-pass-card.decrypting {
    filter: blur(3px) grayscale(0.2);
    opacity: 0.75;
    transition: all 0.2s linear;
}

.agent-pass-card.decrypted {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    border-color: var(--neon-green);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 30px rgba(57, 255, 20, 0.15);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Laser scan animation inside pass card */
.decrypt-laser {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

.agent-pass-card.decrypting .decrypt-laser {
    opacity: 1;
    animation: laser-scan 2s linear infinite alternate;
}

/* Approved stamp */
.approved-stamp {
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%) scale(5);
    border: 4px double var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 900;
    padding: 8px 24px;
    border-radius: 12px;
    letter-spacing: 4px;
    opacity: 0;
    z-index: 105;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
    transform-origin: center;
}

.approved-stamp.active {
    animation: stamp-slam 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stamp-slam {
    0% { transform: translate(-50%, -50%) scale(4) rotate(45deg); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(0.95) rotate(-15deg); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(-12deg); opacity: 0.85; }
}

/* Live Digital Countdown Clock */
.countdown-container {
    width: 100%;
    max-width: 480px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--neon-cyan);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
    animation: fade-in 0.5s ease;
}

.countdown-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.countdown-display {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-cyan);
    word-spacing: 4px;
}

/* Audio Voice Briefing Board */
.audio-briefing-board {
    width: 100%;
    max-width: 480px;
    background: rgba(10, 5, 20, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    animation: fade-in 0.5s ease;
}

.board-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--neon-pink);
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 0, 127, 0.15);
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.3);
}

.player-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.player-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    letter-spacing: 1px;
}

.player-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.player-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.2);
}

.play-btn {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.play-btn:hover:not(:disabled) {
    background: rgba(57, 255, 20, 0.05);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.2);
}

.stop-btn {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
}

.stop-btn:hover:not(:disabled) {
    background: rgba(255, 0, 127, 0.05);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.2);
}

.visualizer-wrapper {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

#audio-wave-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.briefing-transcript {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
    background: rgba(0,0,0,0.25);
    padding: 10px;
    border-radius: 4px;
    min-height: 48px;
    white-space: pre-wrap;
    line-height: 1.4;
    border-left: 2px solid var(--neon-cyan);
    text-shadow: 0 0 2px rgba(0, 240, 255, 0.3);
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


