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

:root {
    --primary-green: #39ff14;
    --secondary-green: #00cc00;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --terminal-bg: rgba(10, 10, 10, 0.92);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-cyan: #00ffff;
    --windows-blue: #00a8ff;
    --glow-green: rgba(57, 255, 20, 0.7);
    --glow-cyan: rgba(0, 255, 255, 0.5);
}

body {
    font-family: "Fira Code", "Source Code Pro", "Consolas", monospace;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 0rem;
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.08;
    pointer-events: none;
}

.container {
    text-align: center;
    z-index: 10;
    padding: 1rem;
    width: 100%;
    max-width: 950px;
}

.terminal-window {
    background: var(--terminal-bg);
    border: 2px solid var(--secondary-green);
    border-radius: 16px;
    margin: 0 auto;
    box-shadow:
        0 0 60px rgba(57, 255, 20, 0.2),
        0 0 100px rgba(57, 255, 20, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: windowFadeIn 0.8s ease-out;
}

@keyframes windowFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.terminal-window::before {
    content: "";
    position: absolute;
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    background: linear-gradient(45deg, var(--primary-green), var(--accent-cyan), var(--primary-green));
    background-size: 300% 300%;
    border-radius: 18px;
    z-index: -1;
    animation: borderGlow 6s ease infinite;
    opacity: 0.6;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 100;
    opacity: 0.4;
}

.terminal-header {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--secondary-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 14px 14px 0 0;
}

.terminal-buttons { display: flex; gap: 0.6rem; }

.terminal-button {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.terminal-button.close {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}
.terminal-button.minimize {
    background: linear-gradient(135deg, #ffd93d 0%, #f5c800 100%);
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
}
.terminal-button.maximize {
    background: linear-gradient(135deg, #6bcb77 0%, #4ade80 100%);
    box-shadow: 0 0 10px rgba(107, 203, 119, 0.6);
}

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.8rem;
    letter-spacing: 1px;
}

.terminal-content {
    padding: 2rem 2.5rem;
    position: relative;
}

.layout-horizontal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.left-panel {
    flex: 1;
    text-align: left;
    min-width: 0;
}

/* ============ PAC-MAN ANIMATION ============ */
.pacman-banner-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
    min-height: 80px;
    padding-top: 0px; /* Space for characters looping above */
    overflow: visible;
}

.ascii-wrapper {
    position: relative;
    font-family: "Fira Code", monospace;
    z-index: 5;
}

.ascii-line {
    display: block;
    white-space: pre;
    line-height: 1.1;
}

/* Individual ASCII characters */
.ascii-char {
    display: inline-block;
    color: var(--primary-green);
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--glow-green), 0 0 20px var(--glow-green);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

/* Eaten state - character disappears */
.ascii-char.eaten {
    opacity: 0;
    transform: scale(0.3);
}

/* Rebuilding state - character reappears with pop effect */
.ascii-char.rebuilding {
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
        text-shadow: 0 0 20px var(--glow-green), 0 0 40px var(--glow-green);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Particle effects container */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 20;
}

/* Individual particles (crushing debris) */
.particle {
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    pointer-events: none;
    animation: particleFly 0.6s ease-out forwards;
    text-shadow: 0 0 5px currentColor;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--vx), var(--vy)) rotate(360deg) scale(0.3);
    }
}

/* ============ CLASSIC PAC-MAN ============ */
.pacman {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 36px;
    height: 36px;
    transition: opacity 0.2s ease;
    left: -40px;
    opacity: 0;
}

.pacman-top,
.pacman-bottom {
    position: absolute;
    width: 36px;
    height: 18px;
    background: #f2d648;
    left: 0;
}

.pacman-top {
    top: 0;
    border-radius: 36px 36px 0 0;
    animation: chompTop 0.2s ease-in-out infinite;
    transform-origin: bottom center;
}

.pacman-bottom {
    bottom: 0;
    border-radius: 0 0 36px 36px;
    animation: chompBottom 0.2s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes chompTop {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-25deg); }
}

@keyframes chompBottom {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(25deg); }
}

/* ============ GHOST CHARACTER ============ */
.ghost {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 14;
    width: 34px;
    height: 40px;
    left: -40px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ghost-body {
    width: 34px;
    height: 30px;
    background: #ff6b6b;
    border-radius: 17px 17px 0 0;
    position: relative;
    overflow: visible;
}

.ghost-eyes {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.ghost-eye {
    width: 10px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.ghost-pupil {
    width: 5px;
    height: 6px;
    background: #2244aa;
    border-radius: 50%;
    position: absolute;
    top: 4px;
    right: 1px;
    animation: lookAround 2s ease-in-out infinite;
}

@keyframes lookAround {
    0%, 100% { right: 1px; }
    50% { right: 4px; }
}

.ghost-bottom {
    display: flex;
    width: 34px;
    height: 8px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.ghost-wave {
    flex: 1;
    height: 8px;
    background: #ff6b6b;
    animation: ghostWave 0.3s ease-in-out infinite;
}

.ghost-wave:nth-child(1) { border-radius: 0 0 50% 50%; animation-delay: 0s; }
.ghost-wave:nth-child(2) { border-radius: 0 0 50% 50%; animation-delay: 0.075s; }
.ghost-wave:nth-child(3) { border-radius: 0 0 50% 50%; animation-delay: 0.15s; }
.ghost-wave:nth-child(4) { border-radius: 0 0 50% 50%; animation-delay: 0.225s; }

@keyframes ghostWave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.6); }
}

/* Ghost floating animation */
.ghost {
    animation: ghostFloat 0.5s ease-in-out infinite;
}

@keyframes ghostFloat {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -3px; }
}

/* Title */
.title {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

/* Subtitle */
.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: left;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Panel Divider */
.panel-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.divider-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, transparent, var(--primary-green), transparent);
    border-radius: 2px;
}

.divider-icon {
    color: var(--primary-green);
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
    text-shadow: 0 0 15px var(--glow-green);
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Right Panel */
.right-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.os-label {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    text-shadow: 0 0 10px var(--glow-cyan);
}

/* OS Cards */
.os-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.os-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9) 0%, rgba(30, 30, 30, 0.8) 100%);
    border: 2px solid rgba(57, 255, 20, 0.4);
    border-radius: 14px;
    padding: 1.2rem 1.8rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: var(--text-primary);
    width: 180px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.os-card.linux .card-glow {
    background: radial-gradient(circle at center, rgba(57, 255, 20, 0.2) 0%, transparent 70%);
}
.os-card.windows .card-glow {
    background: radial-gradient(circle at center, rgba(0, 168, 255, 0.2) 0%, transparent 70%);
}
.os-card:hover .card-glow { opacity: 1; }
.os-card:hover { transform: translateX(8px) scale(1.02); }

.os-card.linux:hover {
    border-color: var(--primary-green);
    box-shadow:
        0 0 25px rgba(57, 255, 20, 0.4),
        0 0 50px rgba(57, 255, 20, 0.2),
        inset 0 0 25px rgba(57, 255, 20, 0.1);
}

.os-icon {
    margin-bottom: 0.6rem;
    transition: transform 0.3s ease;
}

.os-svg {
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.os-card.linux .os-svg {
    fill: var(--primary-green);
    filter: drop-shadow(0 0 10px var(--glow-green));
}
.os-card.windows .os-svg {
    fill: var(--windows-blue);
    filter: drop-shadow(0 0 10px rgba(0, 168, 255, 0.7));
}
.os-card:hover .os-icon { transform: scale(1.1); }
.os-card.linux:hover .os-svg { filter: drop-shadow(0 0 15px var(--glow-green)); }

.os-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.os-card.linux .os-name {
    color: var(--primary-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}
.os-card.windows .os-name { color: var(--windows-blue); }

.os-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.os-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-green);
    font-size: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
}
.os-card.linux:hover .os-arrow { opacity: 1; right: 0.6rem; }

.os-card.windows:hover .os-arrow {
    color: var(--windows-blue);
    opacity: 1;
    right: 0.6rem;
    /* vvvv Undermaintain should not be allowed vvvv */
    /* cursor: not-allowed;  */
    /* filter: grayscale(40%); */
}
.os-card.windows:hover {
    border-color: var(--windows-blue);
    box-shadow:
        0 0 25px rgba(0, 168, 255, 0.4),
        0 0 50px rgba(0, 168, 255, 0.2),
        inset 0 0 25px rgba(0, 168, 255, 0.1);
}
.os-card.windows:hover .card-glow { opacity: 1; }

/* .coming-soon {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    font-style: italic;
    letter-spacing: 1px;
} */

/* Footer */
.footer {
    margin-top: 1.5rem;
    padding: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.footer a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}
.footer a:hover {
    color: #fff;
    text-shadow: 0 0 15px var(--glow-cyan);
}

/* ============ RESPONSIVE ============ */

/* Tablet and smaller desktops */
@media (max-width: 850px) {
    .layout-horizontal {
        flex-direction: column;
        gap: 2rem;
    }

    .left-panel {
        text-align: center;
        width: 100%;
    }

    .ascii-wrapper, .title, .subtitle {
        text-align: center;
    }

    .pacman-banner-container {
        display: block;
        margin: 0 auto 0.5rem auto;
    }

    .ascii-char {
        font-size: 1.4rem;
    }

    .pacman {
        width: 28px;
        height: 28px;
    }

    .pacman-top, .pacman-bottom {
        width: 28px;
        height: 14px;
    }

    .pacman-top { border-radius: 28px 28px 0 0; }
    .pacman-bottom { border-radius: 0 0 28px 28px; }

    .ghost {
        width: 26px;
        height: 32px;
    }

    .ghost-body {
        width: 26px;
        height: 24px;
        border-radius: 13px 13px 0 0;
    }

    .ghost-bottom {
        width: 26px;
        height: 6px;
    }

    .ghost-eye {
        width: 8px;
        height: 10px;
    }

    .ghost-pupil {
        width: 4px;
        height: 5px;
    }

    .panel-divider {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }

    .divider-line {
        width: 60px;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
    }

    .right-panel {
        width: 100%;
    }

    .os-selection {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .os-card {
        width: 160px;
    }

    .os-card:hover {
        transform: translateY(-5px) scale(1.02);
    }

    .os-arrow { display: none; }

    .title { font-size: 1.6rem; }
    .terminal-content { padding: 1.5rem; }
}

/* Mobile phones */
@media (max-width: 500px) {
    body {
        padding: 0.5rem;
    }

    .container {
        padding: 0.5rem;
    }

    .terminal-content {
        padding: 1.2rem;
    }

    .terminal-header {
        padding: 0.6rem 1rem;
    }

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

    .ascii-char {
        font-size: 1rem;
    }

    .pacman-banner-container {
        margin-bottom: 0.8rem;
    }

    .pacman {
        width: 22px;
        height: 22px;
    }

    .pacman-top, .pacman-bottom {
        width: 22px;
        height: 11px;
    }

    .pacman-top { border-radius: 22px 22px 0 0; }
    .pacman-bottom { border-radius: 0 0 22px 22px; }

    .ghost {
        width: 20px;
        height: 26px;
    }

    .ghost-body {
        width: 20px;
        height: 20px;
        border-radius: 10px 10px 0 0;
    }

    .ghost-bottom {
        width: 20px;
        height: 5px;
    }

    .ghost-eye {
        width: 6px;
        height: 8px;
    }

    .ghost-pupil {
        width: 3px;
        height: 4px;
    }

    .ghost-eyes {
        top: 5px;
        gap: 4px;
    }

    .particle {
        font-size: 0.4rem;
    }

    .title {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .os-label {
        font-size: 0.65rem;
        margin-bottom: 0.8rem;
    }

    .os-selection {
        flex-direction: column;
        align-items: center;
    }

    .os-card {
        width: 100%;
        max-width: 200px;
        padding: 1rem 1.5rem;
    }

    .os-svg {
        width: 32px;
        height: 32px;
    }

    .os-name {
        font-size: 1rem;
    }

    .os-desc {
        font-size: 0.75rem;
    }

    .coming-soon {
        font-size: 0.65rem;
    }

    .divider-line {
        width: 40px;
    }

    .divider-icon {
        font-size: 1rem;
    }

    .footer {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .ascii-char {
        font-size: 0.8rem;
    }

    .title {
        font-size: 1.1rem;
    }

    .os-card {
        max-width: 180px;
    }

    .pacman {
        width: 18px;
        height: 18px;
    }

    .pacman-top, .pacman-bottom {
        width: 18px;
        height: 9px;
    }

    .pacman-top { border-radius: 18px 18px 0 0; }
    .pacman-bottom { border-radius: 0 0 18px 18px; }

    .ghost {
        width: 16px;
        height: 22px;
    }

    .ghost-body {
        width: 16px;
        height: 16px;
        border-radius: 8px 8px 0 0;
    }

    .ghost-bottom {
        width: 16px;
        height: 4px;
    }

    .ghost-eye {
        width: 5px;
        height: 6px;
    }

    .ghost-pupil {
        width: 2px;
        height: 3px;
    }

    .ghost-eyes {
        top: 4px;
        gap: 3px;
    }

    .particle {
        font-size: 0.3rem;
    }
}
