:root {
    --iron: #050505; --iron-lite: #0d0d0d;
    --mint: #00ff9d; --mint-glow: rgba(0, 255, 157, 0.25);
    --slate: #4b5563; --text: #f3f4f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; cursor: crosshair; }

body { 
    background: var(--iron); color: var(--text); 
    font-family: 'Fira Code', 'Courier New', monospace; 
    height: 100vh; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}

/* THE FOG (REACTIVE BACKGROUND) */
.chaos-fog {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #111 0%, var(--iron) 70%);
    z-index: -1;
}

/* SCANLINE EFFECT */
body::after {
    content: " "; position: fixed; 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% 2px, 3px 100%; pointer-events: none; z-index: 100;
}

/* THE PORTAL CARD */
.portal-frame {
    width: 90%; max-width: 500px;
    background: var(--iron-lite); border: 1px solid #1a1a1a;
    padding: 50px 40px; border-radius: 2px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    position: relative; z-index: 10;
}

.portal-frame::before {
    content: ""; position: absolute; top: -1px; left: -1px; width: 20px; height: 20px;
    border-top: 2px solid var(--mint); border-left: 2px solid var(--mint);
}

/* TABS & INPUTS */
.tabs { display: flex; gap: 20px; margin-bottom: 30px; }
.tab { font-size: 10px; color: var(--slate); letter-spacing: 2px; text-transform: uppercase; cursor: pointer; transition: 0.3s; }
.tab.active { color: var(--mint); text-shadow: 0 0 10px var(--mint-glow); }

.input-container { display: none; }
.input-container.active { display: block; animation: terminalIn 0.4s ease; }

input, select {
    width: 100%; background: #000; border: 1px solid #222; 
    padding: 14px; color: var(--mint); margin-bottom: 15px; outline: none;
    font-size: 12px;
}
input:focus { border-color: var(--mint); box-shadow: 0 0 10px var(--mint-glow); }

/* CANVAS (THE ENTROPY KEY) */
#canvas-wrap { margin-top: 10px; text-align: center; }
canvas { background: #000; border: 1px solid #1a1a1a; touch-action: none; cursor: crosshair; }

.btn-initiate {
    width: 100%; background: var(--mint); color: #000; border: none;
    padding: 16px; font-weight: 900; letter-spacing: 3px; cursor: pointer;
    margin-top: 20px; text-transform: uppercase;
}
.btn-initiate:hover { filter: brightness(1.2); box-shadow: 0 0 30px var(--mint-glow); }

@keyframes terminalIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
