/* ===========================
   CSS Reset & Base Styles
   =========================== */

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

html {
    font-size: 16px;
}

body {
    font-family: 'Courier New', 'Courier', monospace;
    background-color: #1a1a1a;
    color: #00FF41;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Terminal Window
   =========================== */

.terminal-window {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    max-height: 800px;
    background-color: #000000;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 255, 65, 0.2), 0 0 0 1px rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-titlebar {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-buttons {
    position: absolute;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.terminal-button {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: #999;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    user-select: none;
}

.terminal-button:hover {
    background-color: rgba(0, 255, 65, 0.2);
    color: #00FF41;
    border-color: rgba(0, 255, 65, 0.4);
}

.terminal-button.close:hover {
    background-color: rgba(255, 95, 86, 0.3);
    color: #ff5f56;
    border-color: rgba(255, 95, 86, 0.5);
}

.terminal-title {
    color: #00FF41;
    font-size: 0.875rem;
    opacity: 0.8;
}

.terminal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
    background-color: #000000;
}

/* Custom scrollbar */
.terminal-content::-webkit-scrollbar {
    width: 10px;
}

.terminal-content::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: #00FF41;
    border-radius: 5px;
}

.terminal-content::-webkit-scrollbar-thumb:hover {
    background: #00cc33;
}

/* ===========================
   Container & Layout
   =========================== */

.container {
    width: 100%;
    padding: 0 2rem;
    margin: 0 auto;
}

/* ===========================
   Terminal Header
   =========================== */

.terminal-header {
    margin-bottom: 3rem;
    font-size: 1rem;
    opacity: 0.7;
}

.prompt {
    color: #00FF41;
    text-shadow: 0 0 5px #00FF41;
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    margin-bottom: 2rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.typing-container {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 0 10px #00FF41;
}

#typed-text {
    color: #00FF41;
}

/* ===========================
   Terminal Prompt Prefix
   =========================== */

.terminal-prompt {
    color: #00FF41;
    opacity: 0.7;
    margin-right: 0.5rem;
    text-shadow: 0 0 5px #00FF41;
}

/* ===========================
   Terminal Output & Input
   =========================== */

.terminal-output {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    line-height: 1.8;
    min-height: 200px;
    width: 100%;
}

.terminal-line {
    margin-bottom: 0.5rem;
    display: block;
    color: #00FF41;
    text-shadow: 0 0 10px #00FF41;
    font-family: 'Courier New', 'Courier', monospace;
    white-space: pre-wrap;
    line-height: 1.8;
    word-break: break-word;
}

/* ASCII Art Styling */
.ascii-art-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ascii-art {
    text-align: left;
    white-space: pre;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    line-height: 1.2;
    margin-bottom: 0.2rem;
    opacity: 0.95;
    display: inline-block;
}

/* Nuclear Explosion Animation */
.explosion-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #00FF41;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    animation: flash 100ms ease-out;
}

@keyframes flash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
    }
}

.explosion-appear {
    animation: explosionAppear 500ms ease-out forwards;
}

@keyframes explosionAppear {
    0% {
        opacity: 0;
        transform: scale(1.3);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.95;
        transform: scale(1);
    }
}

.input-prompt-line {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.terminal-input-container {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    flex: 1;
}

.input-prompt {
    display: none; /* Hidden - prompt is now on line above */
}

.terminal-input {
    background: transparent;
    border: none;
    color: #00FF41;
    font-family: 'Courier New', 'Courier', monospace;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    outline: none;
    flex: 1;
    text-shadow: 0 0 10px #00FF41;
    caret-color: #00FF41;
    padding: 0;
    text-transform: uppercase;
}

.terminal-input::placeholder {
    color: #00FF41;
    opacity: 0.5;
}

.terminal-input:focus {
    outline: none;
}

/* Game List Styling */
.game-list {
    margin-top: 1rem;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    line-height: 2;
    opacity: 0.9;
}

.game-item {
    display: block;
    padding-left: 2rem;
    color: #00FF41;
    text-shadow: 0 0 8px #00FF41;
}

/* User Input Echo */
.user-input {
    color: #00FF41;
    opacity: 0.8;
}

/* ===========================
   Cursor Animation
   =========================== */

.cursor {
    display: inline;
    color: #00FF41;
    animation: blink 0.7s infinite;
    font-weight: 400;
    text-shadow: 0 0 10px #00FF41;
    vertical-align: baseline;
    line-height: inherit;
}

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

/* ===========================
   Social Links
   =========================== */

.social-links {
    position: fixed;
    bottom: 2rem;
    left: calc(50% - min(90vw, 1000px) / 2);
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: auto;
    z-index: 1000;
}

.social-links.visible {
    opacity: 1;
    pointer-events: auto;
}

.social-link {
    display: inline-block;
    color: #00FF41;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #00FF41;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.social-link:hover {
    background-color: #00FF41;
    color: #000000;
    box-shadow: 0 0 20px #00FF41, 0 0 40px #00FF41;
    transform: translateY(-2px);
}

.social-link:active {
    transform: translateY(0);
}

.prompt-symbol {
    margin-right: 0.5rem;
    font-weight: bold;
}

/* ===========================
   Footer
   =========================== */

.footer {
    background: linear-gradient(to top, #1a1a1a, #0d0d0d);
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    text-align: center;
}

.status-text {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: #00FF41;
    opacity: 0.7;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .terminal-window {
        width: 95%;
        height: 85vh;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero {
        margin-bottom: 2rem;
    }

    .typing-container {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .social-links {
        bottom: 1.5rem;
        left: calc(50% - min(95vw, 1000px) / 2);
    }

    .social-link {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }

    .status-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .terminal-window {
        width: 100%;
        height: 90vh;
        border-radius: 4px;
    }

    .container {
        padding: 0 1rem;
    }

    .typing-container {
        font-size: 1.25rem;
    }

    .social-links {
        bottom: 1rem;
        left: calc(50% - 50vw);
    }

    .social-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .terminal-titlebar {
        padding: 0.5rem 0.75rem;
    }

    .terminal-title {
        font-size: 0.75rem;
    }

    .terminal-buttons {
        right: 0.75rem;
    }

    .terminal-button {
        width: 20px;
        height: 20px;
        font-size: 0.875rem;
    }
}

/* ===========================
   Accessibility
   =========================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.social-link:focus-visible {
    outline: 2px solid #00FF41;
    outline-offset: 4px;
}
