:root {
    --bg-color: #0d0d14;
    --primary-color: #00ff41; /* Hacker Green / Retro styling */
    --accent-color: #ff00ff; /* Magenta pop */
    --text-color: #e0e0e0;
    --card-bg: #1a1a2e;
    --pixel-border: #ffffff;
}

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

body {
    background-color: var(--bg-color);
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    color: var(--text-color);
    font-family: 'VT323', monospace; /* Easy to read pixel font */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* CRT monitor scanlines effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 999;
    pointer-events: none;
}

.hub-header {
    margin-top: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    z-index: 10;
}

h1 {
    font-family: 'Press Start 2P', cursive; /* Chunky 8-bit font for headers */
    font-size: 3rem;
    text-transform: uppercase;
    color: var(--primary-color);
    text-shadow: 4px 4px 0px #005014;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.desktop-area {
    position: relative;
    width: 100%;
    flex: 1; /* Take remaining height */
    z-index: 10;
    overflow: hidden; /* To keep shortcuts inside boundaries */
    padding: 2rem;
}

/* DESKTOP SHORTCUTS */
.desktop-shortcut {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: max-content;
    padding: 10px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: transform 0.1s;
}

.desktop-shortcut:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.desktop-shortcut .icon-img {
    image-rendering: auto; /* Fallback */
    margin-bottom: 8px;
    text-align: center;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.desktop-shortcut .icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    mix-blend-mode: screen; 
}
.desktop-shortcut .icon-emoji {
    font-size: var(--icon-size, 60px);
    line-height: 1;
    pointer-events: none;
    margin-bottom: 8px;
}

.desktop-shortcut .shortcut-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    pointer-events: none;
}

/* Add shortcut button / Toolbar */
.desktop-toolbar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 15px;
}

.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 3px solid var(--primary-color);
    padding: 10px 15px;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 #000;
}
.pixel-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}
.pixel-btn.primary {
    background: var(--primary-color);
    color: #000;
}
.pixel-btn.primary:hover {
    background: #00cc33;
}
.pixel-btn.danger {
    border-color: red;
    color: red;
}
.pixel-btn.danger:hover {
    background: red;
    color: white;
}
.pixel-btn.text-muted {
    border-color: #666;
    color: #666;
}
.pixel-btn.text-muted:hover {
    background: #666;
    color: #fff;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    width: 400px;
    max-width: 90%;
    background: var(--card-bg);
    border: 4px solid var(--primary-color);
    padding: 20px;
    box-shadow: 10px 10px 0 #000;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--accent-color);
}
.pixel-input {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    padding: 8px;
    background: #000;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    outline: none;
}
.pixel-input:focus {
    background: #111;
    border-color: var(--accent-color);
}
.row-group {
    flex-direction: row;
    gap: 10px;
}
.row-group .col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}


/* PIXEL CARD STYLING */
.pixel-card {
    text-decoration: none;
    color: inherit;
    position: relative;
    display: block;
    background: var(--card-bg);
    padding: 2px; /* Border thickness */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    box-shadow: 
        inset 0 0 0 2px var(--bg-color),
        0 8px 0 var(--accent-color),
        0 15px 20px rgba(0,0,0,0.5);
    border: 4px solid var(--pixel-border);
}

.pixel-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        inset 0 0 0 2px var(--bg-color),
        0 16px 0 var(--primary-color),
        0 20px 25px rgba(0,255,65,0.2);
    border-color: var(--primary-color);
}

.card-inner {
    background-color: var(--card-bg);
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--bg-color); /* Inner border */
}

.icon-container {
    margin-bottom: 1.5rem;
    background: #000;
    padding: 10px;
    border: 3px solid #fff;
    display: flex;
    gap: 15px;
    align-items: center;
}

.pixel-flag {
    width: 60px;
    height: auto;
    image-rendering: pixelated; /* Keeps it sharp and retro */
    display: block;
}

.store-icon {
    width: 60px;
    height: 60px;
    image-rendering: pixelated;
    mix-blend-mode: screen; /* To hide the dark background of the generated image */
}

.bison-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.bison-icon {
    width: 100px;
    height: 100px;
    image-rendering: pixelated;
    mix-blend-mode: normal; /* Lo devolvemos al normal porque ahora el fondo de la página se adaptará a este color con exactitud matemática */
    display: block;
}

/* Smoke coming from the nose */
.bison-smoke {
    position: absolute;
    bottom: 25px; /* Adjust to roughly where the nose holes are */
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    opacity: 0;
    filter: blur(1px);
}

.bison-smoke.left {
    left: 40px;
    animation: blow-smoke 2.5s infinite ease-out;
}

.bison-smoke.right {
    right: 40px;
    animation: blow-smoke 2.5s infinite ease-out 0.2s; /* slight delay for asymmetrical breathing */
}

@keyframes blow-smoke {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-10px, 15px) scale(2); /* move down and outward */
        opacity: 0.4;
    }
    100% {
        transform: translate(-15px, 25px) scale(3);
        opacity: 0;
    }
}

.bison-smoke.right {
    animation-name: blow-smoke-right;
}

@keyframes blow-smoke-right {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(10px, 15px) scale(2); /* move down and outward (right) */
        opacity: 0.4;
    }
    100% {
        transform: translate(15px, 25px) scale(3);
        opacity: 0;
    }
}

.animated-float {
    animation: floating 3s ease-in-out infinite;
}

.animated-bounce {
    animation: pixel-bounce 1.5s steps(4, end) infinite;
}

.animated-pulse {
    animation: pixel-pulse 1s infinite alternate;
}

.animated-spin {
    animation: pixel-spin 4s linear infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes pixel-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes pixel-pulse {
    0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0px var(--primary-color));}
    100% { transform: scale(1.1); filter: brightness(1.2) drop-shadow(0 0 15px var(--accent-color)); }
}

@keyframes pixel-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.pixel-flag {
    width: 80px;
    height: auto;
    image-rendering: pixelated; /* Keeps it sharp and retro */
    display: block;
}

.pixel-card h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #fff;
}

.status {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animations */
.blink-dot {
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    display: inline-block;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Typing effect for subtitle */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 4px solid var(--accent-color);
    width: 0;
    animation: typing 2.5s steps(40, end) forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

/* Glitch effect on title */
.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 86px, 0); }
    10% { clip: rect(61px, 9999px, 8px, 0); }
    20% { clip: rect(4px, 9999px, 16px, 0); }
    30% { clip: rect(98px, 9999px, 64px, 0); }
    40% { clip: rect(32px, 9999px, 32px, 0); }
    50% { clip: rect(54px, 9999px, 97px, 0); }
    60% { clip: rect(18px, 9999px, 7px, 0); }
    70% { clip: rect(60px, 9999px, 81px, 0); }
    80% { clip: rect(15px, 9999px, 35px, 0); }
    90% { clip: rect(53px, 9999px, 12px, 0); }
    100% { clip: rect(91px, 9999px, 99px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(86px, 9999px, 64px, 0); }
    10% { clip: rect(91px, 9999px, 20px, 0); }
    20% { clip: rect(96px, 9999px, 44px, 0); }
    30% { clip: rect(64px, 9999px, 42px, 0); }
    40% { clip: rect(32px, 9999px, 58px, 0); }
    50% { clip: rect(56px, 9999px, 62px, 0); }
    60% { clip: rect(20px, 9999px, 1px, 0); }
    70% { clip: rect(11px, 9999px, 88px, 0); }
    80% { clip: rect(5px, 9999px, 24px, 0); }
    90% { clip: rect(78px, 9999px, 95px, 0); }
    100% { clip: rect(12px, 9999px, 60px, 0); }
}

.hub-footer {
    padding: 2rem;
    margin-top: auto;
    font-size: 1.2rem;
    color: #444;
}
