/* ===========================
   RESET
=========================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===========================
   BODY
=========================== */

body {
    background: #3a6ea5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: black;
    position: relative;
    overflow: hidden;

    filter: saturate(0.85) contrast(1.05);
    animation: flicker 0.15s infinite;

    background-image: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.02),
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 2px);
}

/* ===========================
   CRT SCANLINES
=========================== */

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.12),
            rgba(0, 0, 0, 0.12) 1px,
            transparent 1px,
            transparent 3px);
    pointer-events: none;
    filter: blur(0.3px);
}

/* ===========================
   NOISE
=========================== */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("noise.png");
    opacity: 0.06;
    pointer-events: none;
}

/* ===========================
   DESKTOP (AREA DE VENTANAS)
=========================== */

.desktop {
    position: relative;
    /* IMPORTANTE */
    width: 900px;
    height: 600px;
}

/* ===========================
   WINDOW
=========================== */

.window {
    width: 420px;
    background: #ece9d8;
    border: 3px solid #dfdfdf;
    box-shadow:
        3px 3px 0 #404040,
        inset -2px -2px 0 #808080;
    image-rendering: pixelated;

    position: absolute;
    /* IMPORTANTE */
}

/* ===========================
   TITLE BAR
=========================== */

.titlebar {
    background: linear-gradient(#0058ee, #0037aa);
    color: white;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    cursor: move;
    /* arrastrable */
}

/* ===========================
   BUTTONS
=========================== */

.buttons {
    display: flex;
    gap: 4px;
}

.btn {
    width: 14px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid #404040;
    box-shadow:
        inset 1px 1px 0 white,
        inset -1px -1px 0 #808080;
}

/* ===========================
   CONTENT
=========================== */

.content {
    padding: 16px;
    background: #ece9d8;
}

/* ===========================
   AVATAR
=========================== */

.avatar {
    width: 120px;
    height: 120px;
    border: 2px solid black;
    margin-bottom: 10px;
    image-rendering: pixelated;
}

/* ===========================
   TEXT
=========================== */

h1 {
    font-size: 28px;
}

.subtitle {
    color: #444;
}

h2 {
    margin-top: 14px;
    font-size: 22px;
}

p {
    line-height: 1.4;
}

p,
h1,
h2,
li {
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* ===========================
   DIVIDER
=========================== */

hr {
    margin: 10px 0;
    border: none;
    height: 2px;
    background: #808080;
}

/* ===========================
   LIST
=========================== */

ul {
    list-style: none;
}

ul li::before {
    content: "- ";
}

/* ===========================
   LINKS
=========================== */

.links a {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 4px 10px;
    background: #c0c0c0;
    border: 2px solid black;
    text-decoration: none;
    color: black;
    box-shadow:
        inset 1px 1px 0 white,
        inset -1px -1px 0 #808080;
}

.links a:hover {
    background: #000080;
    color: white;
}

/* ===========================
   FLAGS
=========================== */

.flags {
    margin: 8px 0 12px;
}

.flags img {
    width: 32px;
    border: 1px solid black;
    margin-right: 6px;
    image-rendering: pixelated;
}

.flags img:hover {
    transform: scale(1.2);
}

/* ===========================
   POKEMON TEAM
=========================== */

.pokemon-team {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.pokemon-team img {
    width: 100%;
    background: #c0c0c0;
    border: 2px solid black;
    padding: 4px;
    image-rendering: pixelated;
}

/* ===========================
   DRAG FEEDBACK
=========================== */

.dragging {
    opacity: 0.9;
}

/* ===========================
   FLICKER
=========================== */

@keyframes flicker {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.98;
    }

    100% {
        opacity: 1;
    }
}


/* ===========================
   MUSIC PLAYER
=========================== */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 20px;

    background: #c0c0c0;
    border: 2px solid black;
    padding: 6px;
    width: 200px;

    box-shadow:
        inset 1px 1px 0 white,
        inset -1px -1px 0 #808080;
}

.music-title {
    font-size: 16px;
    margin-bottom: 4px;
}


/* ===========================
   PROJECTS
=========================== */

.project-card {
    display: flex;
    gap: 12px;
    background: #d4d0c8;
    border: 2px solid black;
    padding: 10px;
    margin-top: 10px;
}

.project-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border: 2px solid black;
}



.project-info h3 {
    font-size: 22px;
    margin-bottom: 4px;
}

.project-info p {
    font-size: 18px;
    margin-bottom: 6px;
}

.project-info a {
    display: inline-block;
    padding: 4px 10px;
    background: #000080;
    color: white;
    text-decoration: none;
    border: 2px solid black;
}

.project-info a:hover {
    background: #2020ff;
}

/* ===========================
   MOBILE RESPONSIVE
=========================== */

@media (max-width: 900px) {

    body {
        overflow: auto;
        /* Allow scrolling on mobile */
        height: auto;
        /* Remove fixed height */
        padding: 20px 0;
        /* Add some vertical spacing */
        display: block;
        /* Override flex center */
    }

    .desktop {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 80px;
        /* Space for music player */
    }

    .window {
        position: relative;
        top: auto !important;
        left: auto !important;
        width: 90%;
        max-width: 420px;
        margin-bottom: 20px;
        transform: none !important;
        /* Disable drag transforms just in case */
    }

    .project-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .project-thumb {
        width: 100%;
        height: auto;
        max-width: 300px;
    }

    .music-player {
        width: 90%;
        left: 50%;
        transform: translateX(-50%);
        bottom: 10px;
    }
}