/* ==========================================================================
   Dr.STEP Intro - CRT Phosphor Green Terminal Style
   Architecture: DRY (Don't Repeat Yourself) via Custom Variables & Modular Rules
   Performance: Hardware-Accelerated 3D Transforms & Zero Heavy Shaders
   ========================================================================== */

:root {
    /* --- Phosphor Green Color Palette (DRY Core Variables) --- */
    --bg-void: #010602;
    --crt-bg: #031207;
    --crt-screen-inner: #041709;
    --phosphor-primary: #22c55e;
    --phosphor-bright: #4ade80;
    --phosphor-neon: #86efac;
    --phosphor-dark: #14532d;
    --phosphor-dim: #15803d;
    --phosphor-alpha-low: rgba(34, 197, 94, 0.12);
    --phosphor-alpha-mid: rgba(34, 197, 94, 0.25);
    --phosphor-alpha-high: rgba(34, 197, 94, 0.4);
    
    /* --- Text Colors --- */
    --text-main: #dcfce7;
    --text-muted: #86efac;
    --text-dark: #021a0a;

    /* --- CRT Hardware Shell Colors (Bezel for PC/iPad) --- */
    --bezel-outer: #121812;
    --bezel-inner: #070c07;
    --bezel-border: #1a251a;

    /* --- Shadows & Glows (DRY Reusable Rules) --- */
    --glow-text-sm: 0 0 5px rgba(34, 197, 94, 0.6);
    --glow-text-md: 0 0 10px rgba(34, 197, 94, 0.8), 0 0 20px rgba(34, 197, 94, 0.4);
    --glow-text-lg: 0 0 15px rgba(134, 239, 172, 0.9), 0 0 30px rgba(34, 197, 94, 0.6);
    --glow-box: 0 0 22px rgba(34, 197, 94, 0.22), inset 0 0 18px rgba(34, 197, 94, 0.15);
    --glow-btn: 0 0 25px rgba(74, 222, 128, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.3);

    /* --- Typography & Geometry --- */
    --font-sans: 'Changa', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'VT323', monospace, 'Courier New';
    --radius-card: 14px;
    --radius-btn: 10px;
    --transition-standard: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Setup
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

/* Utility classes for DRY Typography & Glows */
.term-font {
    font-family: var(--font-mono);
    letter-spacing: 1px;
    direction: ltr !important;
    display: inline-block;
}

.text-glow {
    color: var(--phosphor-neon);
    text-shadow: var(--glow-text-md);
}

/* ==========================================================================
   CRT Monitor & Responsive Frame Packaging
   ========================================================================== */
.crt-monitor {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.monitor-bezel {
    position: relative;
    width: 100%;
    transition: var(--transition-standard);
}

.crt-screen {
    position: relative;
    background-color: var(--crt-screen-inner);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--phosphor-dark);
    /* Hardware acceleration for ultra-smooth rendering */
    transform: translateZ(0);
}

/* --- Responsive Adaptation: Tablet (iPad) & Desktop Computers --- */
@media (min-width: 768px) {
    body {
        padding: 35px 20px;
        background: radial-gradient(circle at center, #0a1f0d 0%, var(--bg-void) 100%);
    }

    .monitor-bezel {
        max-width: 840px;
        background: linear-gradient(145deg, var(--bezel-outer), var(--bezel-inner));
        padding: 28px;
        border-radius: 36px;
        border: 2px solid var(--bezel-border);
        box-shadow: 
            0 30px 70px rgba(0, 0, 0, 0.9),
            0 0 0 6px #090e09,
            inset 0 2px 5px rgba(255, 255, 255, 0.08),
            inset 0 -2px 5px rgba(0, 0, 0, 0.8);
    }

    .crt-screen {
        border-radius: 22px;
        min-height: 620px;
        box-shadow: 
            inset 0 0 35px rgba(0, 0, 0, 0.85),
            0 0 15px rgba(34, 197, 94, 0.2);
    }

    .screen-content {
        padding: 32px 38px;
    }

    .main-title {
        font-size: 3rem;
    }
}

/* --- Responsive Adaptation: Mobile Phones & Telegram WebApp View --- */
@media (max-width: 767px) {
    body {
        padding: 0;
        background-color: var(--crt-bg);
    }

    .monitor-bezel {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }

    .crt-screen {
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    }

    .screen-content {
        padding: 18px 16px 30px;
    }

    .main-title {
        font-size: 2.2rem;
    }
}

/* ==========================================================================
   CRT Scanlines & Retro Visual Overlays (Lightweight Pure CSS)
   ========================================================================== */
.scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(3, 18, 7, 0.35) 0px,
        rgba(3, 18, 7, 0.35) 2px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0) 4px
    );
    z-index: 10;
    pointer-events: none;
    opacity: 0.8;
}

.vignette {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0) 55%,
        rgba(2, 8, 3, 0.7) 100%
    );
    z-index: 11;
    pointer-events: none;
}

.flicker {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(34, 197, 94, 0.02);
    z-index: 9;
    pointer-events: none;
    animation: crtFlicker 0.15s infinite alternate;
}

@keyframes crtFlicker {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* ==========================================================================
   Screen Content Layout
   ========================================================================== */
.screen-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
}

/* --- Terminal Status Header --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 22px;
    border-bottom: 1px dashed var(--phosphor-dim);
    font-size: 0.95rem;
    color: var(--phosphor-bright);
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-icon {
    color: var(--phosphor-primary);
    font-size: 0.8rem;
    animation: pulseIcon 1.2s infinite;
    text-shadow: var(--glow-text-sm);
}

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

.badge-online {
    background: var(--phosphor-primary);
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: var(--glow-text-sm);
}

/* --- Hero & Retro Graphics --- */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 26px;
}

.pixel-decorations {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    font-size: 1.6rem;
    color: var(--phosphor-primary);
    margin-bottom: 14px;
    text-shadow: var(--glow-text-sm);
}

.float-item {
    animation: floatAnim 4s ease-in-out infinite alternate;
}

.float-item-reverse {
    animation: floatAnim 4s ease-in-out infinite alternate-reverse;
}

@keyframes floatAnim {
    from { transform: translateY(-5px); }
    to { transform: translateY(6px); }
}

.blink {
    animation: blinkAnim 1s steps(2, start) infinite;
}

@keyframes blinkAnim {
    to { visibility: hidden; }
}

.title-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crt-sub-badge {
    font-size: 0.95rem;
    color: var(--text-muted);
    background: var(--phosphor-alpha-low);
    padding: 3px 12px;
    border-radius: 4px;
    border: 1px solid var(--phosphor-dark);
    margin-bottom: 10px;
    text-shadow: var(--glow-text-sm);
}

.main-title {
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 
        0 0 10px #22c55e,
        0 0 20px #22c55e,
        0 0 40px #16a34a;
}

.phosphor-divider {
    width: 140px;
    height: 3px;
    background: var(--phosphor-primary);
    box-shadow: var(--glow-text-md);
    margin: 8px 0 16px;
    border-radius: 2px;
}

.sub-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--phosphor-neon);
    max-width: 90%;
    line-height: 1.6;
    text-shadow: var(--glow-text-sm);
}

.crt-slogan {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.85;
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.2px;
    text-shadow: var(--glow-text-sm);
}

/* --- Terminal Disclaimer Command Box --- */
.terminal-box {
    background: var(--phosphor-alpha-low);
    border: 1px solid var(--phosphor-dim);
    border-radius: 10px;
    box-shadow: var(--glow-box);
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-standard);
}

.terminal-box:hover {
    border-color: var(--phosphor-bright);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.25), inset 0 0 15px rgba(34, 197, 94, 0.15);
}

.terminal-box-header {
    background: rgba(20, 83, 45, 0.6);
    padding: 6px 12px;
    border-bottom: 1px solid var(--phosphor-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.term-prompt {
    color: var(--phosphor-neon);
    font-weight: bold;
}

.badge-warn {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(234, 179, 8, 0.4);
    font-size: 0.72rem;
}

.terminal-box-body {
    padding: 14px 16px;
}

.disclaimer-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-main);
    text-align: justify;
    font-weight: 400;
}

.highlight-text {
    color: var(--phosphor-bright);
    text-shadow: var(--glow-text-sm);
    font-weight: 700;
    padding: 0 2px;
}

.notice-note {
    display: block;
    font-weight: 500;
    font-size: 0.86rem;
    color: var(--phosphor-neon);
    background: rgba(34, 197, 94, 0.08);
    padding: 8px 12px;
    border-right: 3px solid var(--phosphor-primary);
    border-radius: 4px;
    margin-top: 6px;
    text-shadow: var(--glow-text-sm);
}

/* --- Retro Analytics Row --- */
.analytics-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--phosphor-alpha-low);
    border: 1px solid rgba(21, 128, 61, 0.4);
    padding: 3px 10px;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0px;
    opacity: 0.85;
}

.stat-val {
    font-size: 0.78rem;
    font-weight: bold;
    color: var(--phosphor-bright);
    font-family: var(--font-mono);
}

.ascii-waveform {
    text-align: center;
    font-size: 0.9rem;
    color: var(--phosphor-primary);
    letter-spacing: 1px;
    margin-bottom: 28px;
    text-shadow: var(--glow-text-sm);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- Action Footer & Primary CRT Button --- */
.action-footer {
    margin-top: auto;
    padding-top: 10px;
}

.crt-btn-primary {
    width: 100%;
    background: var(--phosphor-primary);
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid var(--phosphor-neon);
    border-radius: var(--radius-btn);
    padding: 18px 20px;
    cursor: pointer;
    box-shadow: var(--glow-btn);
    transition: var(--transition-standard);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.btn-prompt {
    color: var(--text-dark);
    opacity: 0.85;
    font-size: 1.1rem;
}

.btn-label {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-cursor {
    color: var(--text-dark);
}

.btn-icon {
    font-size: 1.3rem;
    transition: var(--transition-standard);
}

.crt-btn-primary:hover,
.crt-btn-primary:focus {
    background: var(--phosphor-bright);
    border-color: #ffffff;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 35px rgba(74, 222, 128, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.5);
    outline: none;
}

.crt-btn-primary:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

.crt-btn-primary:hover .btn-icon {
    transform: translate(-3px, -3px) scale(1.15);
}

.crt-disclaimer-footnote {
    font-size: 0.72rem;
    color: rgba(134, 239, 172, 0.6);
    text-align: center;
    margin-top: 12px;
    line-height: 1.4;
    font-weight: 400;
}
