@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

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

body {
    background: #000000;
    color: #33cc33;
    font-family: 'Share Tech Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Film grain/dust effect */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.3),
            rgba(0, 0, 0, 0.3) 1px,
            transparent 1px,
            transparent 2px
        ),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 10;
    opacity: 0.7;
}

/* Scanline animation */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(51, 204, 51, 0.15);
    box-shadow: 0 0 10px rgba(51, 204, 51, 0.3);
    animation: scanline 6s linear infinite;
    z-index: 11;
    pointer-events: none;
    will-change: transform;
}

@keyframes scanline {
    0%   { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.container {
    max-width: 800px;
    padding: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 
        0 0 3px rgba(51, 204, 51, 0.9),
        0 0 8px rgba(51, 204, 51, 0.5),
        0 0 15px rgba(51, 204, 51, 0.2);
    animation: flicker 8s infinite;
    filter: contrast(1.1) brightness(0.9);
    will-change: opacity;
}

/* Flicker only occasionally rather than every 100ms —
   visually identical during the dips, zero cost between them */
@keyframes flicker {
    0%,  19%  { opacity: 0.93; }
    20%        { opacity: 0.88; }
    20.5%      { opacity: 0.93; }
    21%        { opacity: 0.85; }
    21.5%      { opacity: 0.93; }
    55%,  59%  { opacity: 0.93; }
    60%        { opacity: 0.89; }
    60.5%      { opacity: 0.93; }
    100%       { opacity: 0.93; }
}

.header {
    font-size: 2.5rem;
    margin-bottom: 20px;
    letter-spacing: 8px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { 
        text-shadow: 
            0 0 3px rgba(51, 204, 51, 0.8),
            0 0 8px rgba(51, 204, 51, 0.4),
            0 0 15px rgba(51, 204, 51, 0.2);
    }
    50% { 
        text-shadow: 
            0 0 5px rgba(51, 204, 51, 0.9),
            0 0 12px rgba(51, 204, 51, 0.5),
            0 0 20px rgba(51, 204, 51, 0.3);
    }
}

.divider {
    margin: 30px 0;
    font-size: 1.5rem;
    letter-spacing: 4px;
}

.status {
    font-size: 1.2rem;
    margin: 15px 0;
    letter-spacing: 3px;
}

.message {
    font-size: 1rem;
    margin: 30px auto;
    line-height: 1.8;
    letter-spacing: 2px;
    max-width: 600px;
}

.warning {
    color: #cc3300;
    margin: 40px 0;
    font-size: 1.1rem;
    letter-spacing: 2px;
    animation: warning-blink 2s ease-in-out infinite;
    text-shadow: 
        0 0 4px rgba(204, 51, 0, 0.7),
        0 0 8px rgba(204, 51, 0, 0.4);
}

@keyframes warning-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.footer {
    margin-top: 50px;
    font-size: 1.3rem;
    letter-spacing: 4px;
}

.cursor {
    display: inline-block;
    width: 12px;
    height: 20px;
    background: #33cc33;
    margin-left: 5px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px rgba(51, 204, 51, 0.5);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes glitch {
    0%   { transform: translate(0); }
    20%  { transform: translate(-2px, 2px); }
    40%  { transform: translate(-2px, -2px); }
    60%  { transform: translate(2px, 2px); }
    80%  { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch {
    animation: glitch 0.3s ease-in-out;
}

/* ─── TERMINAL OVERLAY ──────────────────────────────────────────── */

#terminal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100;
    flex-direction: column;
    overflow: hidden;
}

#terminal-overlay.active {
    display: flex;
}

#terminal-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

#terminal-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(51, 204, 51, 0.15);
    box-shadow: 0 0 10px rgba(51, 204, 51, 0.3);
    animation: scanline 6s linear infinite;
    z-index: 11;
    pointer-events: none;
}

#terminal-header {
    flex-shrink: 0;
    padding: 20px 30px 10px;
    border-bottom: 1px solid #1a661a;
    text-align: center;
    position: relative;
    z-index: 5;
}

#terminal-header .t-title {
    font-size: 1.4rem;
    letter-spacing: 6px;
    text-shadow: 0 0 8px rgba(51, 204, 51, 0.6);
}

#terminal-header .t-sub {
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: #1a991a;
    margin-top: 4px;
}

#terminal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: none;
    border: 1px solid #33cc33;
    color: #33cc33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 4px 10px;
    cursor: pointer;
    text-shadow: 0 0 5px rgba(51, 204, 51, 0.5);
    transition: background 0.2s;
}

#terminal-close:hover {
    background: #0d330d;
}

#terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    font-size: 0.9rem;
    line-height: 1.7;
    letter-spacing: 1px;
    position: relative;
    z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: #1a661a #000;
}

#terminal-output::-webkit-scrollbar       { width: 6px; }
#terminal-output::-webkit-scrollbar-track { background: #000; }
#terminal-output::-webkit-scrollbar-thumb { background: #1a661a; }

.t-line          { margin: 2px 0; white-space: pre-wrap; word-break: break-word; }
.t-line.prompt   { color: #33cc33; }
.t-line.output   { color: #1a991a; }
.t-line.error    { color: #cc3300; }
.t-line.info     { color: #cc9900; }
.t-line.divider  { color: #1a661a; letter-spacing: 2px; }
.t-line.link a {
    color: #33cc33;
    text-decoration: none;
    border-bottom: 1px solid #1a661a;
    transition: color 0.2s;
}
.t-line.link a:hover { color: #66ff66; }

#terminal-input-row {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 12px 30px 20px;
    border-top: 1px solid #1a661a;
    position: relative;
    z-index: 5;
    gap: 8px;
}

#terminal-input-row .t-prompt-char {
    color: #33cc33;
    font-size: 1rem;
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(51, 204, 51, 0.5);
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #33cc33;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 2px;
    caret-color: #33cc33;
    text-transform: uppercase;
}

#terminal-input::placeholder {
    color: #1a661a;
    letter-spacing: 2px;
}

/* ─── RESPONSIVE ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .header                { font-size: 1.5rem; letter-spacing: 4px; }
    .status, .message      { font-size: 0.9rem; }
    .divider               { font-size: 1rem; }
    #terminal-output       { padding: 14px 16px; font-size: 0.8rem; }
    #terminal-input-row    { padding: 10px 16px 16px; }
    #terminal-header       { padding: 14px 16px 8px; }
    #terminal-header .t-title { font-size: 1rem; }
}

/* ─── LOCKOUT SCREEN ────────────────────────────────────────────── */

#lockout-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: flicker 8s infinite;
}

#lockout-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.3),
        rgba(0, 0, 0, 0.3) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

.lockout-inner {
    max-width: 700px;
    width: 90%;
    text-align: center;
    position: relative;
    z-index: 5;
    padding: 40px 20px;
}

.lockout-header {
    color: #cc3300;
    font-size: 1.4rem;
    letter-spacing: 4px;
    margin: 20px 0;
    animation: warning-blink 1.5s ease-in-out infinite;
    text-shadow:
        0 0 6px rgba(204, 51, 0, 0.8),
        0 0 12px rgba(204, 51, 0, 0.4);
}

.lockout-body {
    color: #cc3300;
    font-size: 0.95rem;
    letter-spacing: 2px;
    line-height: 1.9;
    margin: 24px 0;
    text-shadow: 0 0 4px rgba(204, 51, 0, 0.5);
}

.lockout-timer {
    color: #cc9900;
    font-size: 1rem;
    letter-spacing: 3px;
    margin: 20px 0;
    text-shadow: 0 0 6px rgba(204, 153, 0, 0.5);
}

.lockout-divider {
    color: #660000;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .lockout-header { font-size: 1rem; letter-spacing: 2px; }
    .lockout-body   { font-size: 0.8rem; }
    .lockout-timer  { font-size: 0.85rem; }
}
