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

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

body {
    background: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    font-family: 'VT323', monospace;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.crt-container {
    position: relative;
    width: clamp(300px, 90vw, 1200px);
    height: clamp(400px, 90vh, 900px);
    background: #1a1a1a;
    border-radius: 20px;
    padding: clamp(20px, 5vw, 40px);
    box-shadow: 0 0 100px rgba(0, 255, 0, 0.3);
}

.power-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #333, #111);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    box-shadow:
            inset 0 2px 5px rgba(0, 0, 0, 0.5),
            0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    border: 2px solid #222;
}

.power-button:hover {
    background: radial-gradient(circle, #444, #1a1a1a);
    box-shadow:
            inset 0 2px 5px rgba(0, 0, 0, 0.5),
            0 2px 15px rgba(0, 255, 0, 0.2);
}

.power-button:active {
    box-shadow:
            inset 0 3px 8px rgba(0, 0, 0, 0.8),
            0 1px 5px rgba(0, 0, 0, 0.3);
}

.power-button::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 3px solid #555;
    border-radius: 50%;
    border-top-color: transparent;
}

.power-button::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 11px;
    background: #555;
    border-radius: 2px;
    top: 3px;
}

.power-led {
    position: absolute;
    top: -30px;
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow:
            0 0 5px #ff0000,
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.power-led.on {
    background: #00ff00;
    box-shadow:
            0 0 10px #00ff00,
            0 0 20px #00ff00,
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.screen {
    position: absolute;
    top: clamp(20px, 5vw, 40px);
    left: clamp(20px, 5vw, 40px);
    right: clamp(20px, 5vw, 40px);
    bottom: clamp(20px, 5vw, 40px);
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
            0deg,
            rgba(0, 255, 0, 0.03) 0px,
            rgba(0, 255, 0, 0.03) 1px,
            transparent 1px,
            transparent 2px
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 10px;
}

.screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 11;
    border-radius: 10px;
}

.screen-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all 0.3s;
    z-index: 1;
    overflow: hidden;
    border-radius: 10px;
}

.screen-content.turning-off {
    animation: powerOff 0.8s cubic-bezier(0.4, 0.0, 1, 1) forwards;
}

.screen-content.turning-on {
    animation: powerOn 1.2s cubic-bezier(0.0, 0.0, 0.2, 1) forwards;
}

.screen-content.powered-off {
    clip-path: inset(50% 50% 50% 50%);
    filter: brightness(0);
    opacity: 0;
}

.power-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    display: none;
}

@keyframes powerOff {
    0% {
        opacity: 1;
        clip-path: inset(0% 0% 0% 0%);
        filter: brightness(1);
        background: transparent;
    }
    20% {
        opacity: 1;
        clip-path: inset(5% 0% 5% 0%);
        filter: brightness(1.5);
        background: rgba(200, 200, 200, 0.1);
    }
    50% {
        opacity: 1;
        clip-path: inset(30% 0% 30% 0%);
        filter: brightness(2.5);
        background: rgba(220, 220, 220, 0.3);
    }
    75% {
        opacity: 1;
        clip-path: inset(49% 10% 49% 10%);
        filter: brightness(4);
        background: rgba(240, 240, 240, 0.6);
    }
    90% {
        opacity: 1;
        clip-path: inset(49.5% 40% 49.5% 40%);
        filter: brightness(6);
        background: rgba(255, 255, 255, 0.8);
    }
    95% {
        opacity: 1;
        clip-path: inset(49.8% 49% 49.8% 49%);
        filter: brightness(8);
        background: rgba(255, 255, 255, 0.95);
    }
    100% {
        opacity: 0;
        clip-path: inset(50% 50% 50% 50%);
        filter: brightness(10);
        background: #ffffff;
    }
}

@keyframes powerOn {
    0% {
        opacity: 0;
        clip-path: inset(50% 50% 50% 50%);
        filter: brightness(10);
        background: #ffffff;
    }
    5% {
        opacity: 1;
        clip-path: inset(49.8% 49% 49.8% 49%);
        filter: brightness(8);
        background: rgba(255, 255, 255, 0.95);
    }
    10% {
        opacity: 1;
        clip-path: inset(49.5% 40% 49.5% 40%);
        filter: brightness(6);
        background: rgba(255, 255, 255, 0.8);
    }
    25% {
        opacity: 1;
        clip-path: inset(49% 10% 49% 10%);
        filter: brightness(4);
        background: rgba(240, 240, 240, 0.6);
    }
    50% {
        opacity: 1;
        clip-path: inset(30% 0% 30% 0%);
        filter: brightness(2.5);
        background: rgba(220, 220, 220, 0.3);
    }
    80% {
        opacity: 1;
        clip-path: inset(5% 0% 5% 0%);
        filter: brightness(1.5);
        background: rgba(200, 200, 200, 0.1);
    }
    100% {
        opacity: 1;
        clip-path: inset(0% 0% 0% 0%);
        filter: brightness(1);
        background: transparent;
    }
}

.scanline {
    position: absolute;
    width: 100%;
    height: 100px;
    background: linear-gradient(
            to bottom,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 100%
    );
    animation: scan 8s linear infinite;
    pointer-events: none;
    z-index: 4;
    top: 0;
}

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

.flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.95; }
}

.content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: clamp(10px, 3vw, 20px);
    color: #00ff00;
    font-size: clamp(18px, 2.5vw, 24px);
    z-index: 1;
    overflow: hidden;
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
    display: flex;
    flex-direction: column;
}

.content::-webkit-scrollbar {
    width: 10px;
}

.content::-webkit-scrollbar-track {
    background: #001100;
}

.content::-webkit-scrollbar-thumb {
    background: #00ff00;
    box-shadow: 0 0 5px #00ff00;
}

.header {
    padding-bottom: 10px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.header-top {
    border-top: 2px solid #00ff00;
    border-left: 2px solid #00ff00;
    border-right: 2px solid #00ff00;
    height: 0;
}

.header-title {
    border-left: 2px solid #00ff00;
    border-right: 2px solid #00ff00;
    padding: 5px 10px;
    text-align: center;
}

.header-bottom {
    border-bottom: 2px solid #00ff00;
    border-left: 2px solid #00ff00;
    border-right: 2px solid #00ff00;
    height: 0;
}

.output {
    margin-bottom: 20px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.line {
    margin-bottom: 5px;
}

.prompt {
    display: flex;
    align-items: center;
    margin-top: 10px;
    position: relative;
    flex-shrink: 0;
}

.prompt span {
    margin-right: 5px;
    white-space: nowrap;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

#input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: inherit;
    outline: none;
    flex: 1;
    text-shadow: 0 0 5px #00ff00;
    caret-color: transparent;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1em;
    background: #00ff00;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px #00ff00;
    position: absolute;
    left: 0;
    pointer-events: none;
}

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

.button-panel {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    flex-shrink: 0;
}

.social-panel {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.social-button {
    background: transparent;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    font-family: 'VT323', monospace;
    font-size: 18px;
    cursor: pointer;
    text-shadow: 0 0 5px #00ff00;
    transition: all 0.1s;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.social-button svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 0 3px #00ff00);
}

.social-button:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
    text-shadow: none;
}

.social-button:hover svg {
    filter: none;
}

.social-button:active {
    transform: scale(0.95);
}

.crt-button {
    background: transparent;
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 22px;
    cursor: pointer;
    text-shadow: 0 0 5px #00ff00;
    transition: all 0.1s;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.crt-button:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
    text-shadow: none;
}

.crt-button:active {
    transform: scale(0.95);
}

.glitch {
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, 2px); }
    92% { transform: translate(2px, -2px); }
    93% { transform: translate(-2px, -2px); }
    94% { transform: translate(2px, 2px); }
}