/* =========================================================================
   VARIABLES GLOBALES Y CONFIGURACIÓN BASE
   Aquí se definen los colores, bordes y fuentes que usa toda la página.
   Si quieres cambiar un color principal, hazlo aquí y afectará a todo.
   ========================================================================= */
:root {
    --bg-color: #080a12;
    --card-bg: #141622;
    --card-bg-light: #1c1f2e;
    --text-primary: #ffffff;
    --text-secondary: #929ab1;
    --accent-blue: #0071e3;
    --accent-purple: #4facfe;
    --accent-pink: #00f2fe;
    --accent-green: #00e676;
    --border-color: #272a3b;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --border-radius: 20px;
    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

#app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding-bottom: 40px;
}

.screen {
    display: none;
    padding: 24px 20px;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   PANTALLA 1: INICIO (Buscador y Título Superior)
   ========================================================================= */
header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(179, 56, 255, 0.1);
    border: 1px solid rgba(179, 56, 255, 0.2);
    color: #e5b3ff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.dot-small {
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-green);
}

h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.gradient-text {
    background: linear-gradient(90deg, #00f2fe, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 242, 254, 0.3));
}

header p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.4;
    padding: 0 10px;
}

.search-container input {
    width: 100%;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: rgba(26, 26, 33, 0.8);
    backdrop-filter: blur(10px);
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    font-family: var(--font-family);
}
.search-container input:focus {
    border-color: rgba(179, 56, 255, 0.5);
    background-color: rgba(36, 36, 46, 0.9);
}

/* =========================================================================
   CUADRÍCULA DE JUEGOS (Grid)
   Aquí se le da estilo a las tarjetas con los iconos de los juegos.
   ========================================================================= */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 15px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.app-card:active {
    transform: scale(0.92);
}

.app-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}

.app-card span {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #e0e0e0;
}

/* =========================================================================
   PANTALLA 2: GENERADOR (Pantalla interior del juego)
   Botones de regreso, iconos, formulario y selector de recursos.
   ========================================================================= */
.header-nav {
    padding: 10px 0 24px 0;
}

.nav-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.2s;
}
.nav-btn:active {
    background: rgba(255,255,255,0.1);
}

.game-header {
    text-align: center;
    margin-bottom: 24px;
}

.icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.game-icon-large {
    width: 90px;
    height: 90px;
    border-radius: 20%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.status-dot-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background-color: var(--accent-green);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
}

.game-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.game-name-highlight {
    color: #00f2fe;
}
.hack-text {
    color: #ffffff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(17, 212, 123, 0.1);
    border: 1px solid rgba(17, 212, 123, 0.2);
    color: var(--accent-green);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
}

.generator-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}
.step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--card-bg-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.step.active {
    background-color: var(--accent-purple);
    color: white;
    box-shadow: 0 0 12px rgba(179, 56, 255, 0.5);
}
.steps-indicator .line {
    height: 1px;
    width: 50px;
    background-color: var(--border-color);
    margin: 0 12px;
}

.form-group {
    margin-bottom: 24px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #e0e0e0;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
}
.dark-input.with-icon {
    padding-left: 48px;
}

.dark-input, .dark-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-light);
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    transition: all 0.2s;
}
.dark-input:focus, .dark-select:focus {
    border-color: rgba(179, 56, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(179, 56, 255, 0.1);
}

.alert-box {
    background-color: rgba(255, 204, 0, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: #ffd633;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.alert-icon { font-size: 16px; }
.highlight-yellow { color: #fff; border-bottom: 1px solid #ffd633; }

.platform-selector {
    display: flex;
    gap: 12px;
}
.platform-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-light);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.platform-btn:active {
    transform: scale(0.95);
}
.platform-btn.active {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.resource-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card-bg-light);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
}
.resource-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.res-name-label {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}
.resource-row .dark-select {
    width: 120px;
    padding: 8px 12px;
    font-weight: 600;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(90deg, #b338ff, #ff38a2);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(179, 56, 255, 0.3);
}
.primary-btn:active {
    transform: scale(0.98);
}

/* =========================================================================
   CONSOLA DE TERMINAL NEGRA (Animación de progreso)
   Estilos para la ventana que simula inyectar los códigos.
   ========================================================================= */
.terminal-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}
.terminal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.terminal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(179, 56, 255, 0.2);
    border-top-color: #b338ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.terminal-title h3 {
    font-size: 18px;
    margin-bottom: 4px;
}
.terminal-title p {
    font-size: 13px;
    color: var(--text-secondary);
}

.terminal-window {
    background-color: #0b0c10;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    height: 180px;
    overflow-y: auto;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 20px;
}
.term-line { margin-bottom: 6px; color: #a0a0a0; }
.term-success { color: var(--accent-green); }
.term-time { color: var(--text-secondary); margin-right: 8px; }

.progress-bar-container {
    width: 100%;
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}
.progress-track {
    width: 100%;
    height: 8px;
    background-color: var(--card-bg-light);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #b338ff, #ff38a2);
    transition: width 0.3s ease;
}

/* =========================================================================
   NOTIFICACIONES EN VIVO (Live Activity)
   Estilos de los popups falsos de personas inyectando recursos en tiempo real.
   ========================================================================= */
.live-activity-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}
.live-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.live-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}
.live-title-box h3 {
    font-size: 15px;
    font-weight: 700;
}
.live-dot-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(17, 212, 123, 0.4);
    animation: pulseLive 2s infinite;
}
@keyframes pulseLive {
    0% { box-shadow: 0 0 0 0 rgba(17, 212, 123, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(17, 212, 123, 0); }
    100% { box-shadow: 0 0 0 0 rgba(17, 212, 123, 0); }
}
.real-time-badge {
    background: var(--card-bg-light);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    color: var(--text-secondary);
}

.live-activity-list {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}
.live-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 13px;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.live-flag { font-size: 16px; margin-right: 12px; }
.live-text { flex: 1; color: var(--text-secondary); }
.live-text strong { color: #fff; }
.live-amount { color: #ff38a2; font-weight: 700; }
.live-time { font-size: 11px; color: var(--text-secondary); }

/* =========================================================================
   DESCRIPCIÓN DEL JUEGO (Banner grande inferior)
   ========================================================================= */
.game-description-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}
.desc-banner {
    position: relative;
    height: 120px;
    background-size: cover;
    background-position: center;
}
.banner-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, var(--card-bg) 0%, rgba(26,26,33,0.3) 100%);
}
.desc-banner-content {
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 2;
}
.desc-banner-content img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.desc-banner-text h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}
.desc-banner-text p {
    font-size: 12px;
    color: #e0e0e0;
}
.desc-text {
    padding: 20px;
}
.desc-text h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.desc-text p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Legal Footer */
.legal-footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.legal-footer p {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}
.legal-footer .disclaimer {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.4;
}

/* Animations */
@keyframes popAnim {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pop-anim {
    animation: popAnim 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.footer-simple {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Toasts / Burbujas flotantes */
.toast-error {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 56, 56, 0.95);
    color: white;
    padding: 14px 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(255, 56, 56, 0.4);
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
}
.toast-error.show {
    top: 20px;
}

.live-toast-container {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    pointer-events: none;
    align-items: flex-start;
}
.live-toast {
    background: rgba(20, 22, 34, 0.95);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 13px;
    line-height: 1.4;
    max-width: 100%;
    box-sizing: border-box;
    animation: slideInLeft 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes slideInLeft {
    from { transform: translateX(-120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =========================================================================
   PANTALLA FINAL: VERIFICACIÓN ANTI-BOT (CPA)
   Estilos para el botón final y las instrucciones obligatorias.
   ========================================================================= */
.verification-section {
    margin-bottom: 24px;
}
.success-banner {
    background: rgba(17, 212, 123, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(17, 212, 123, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 auto 20px auto;
    width: 100%;
    justify-content: center;
}
.user-info-box {
    text-align: center;
    margin-bottom: 24px;
}
.user-info-box h3 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}
.user-info-box p {
    font-size: 13px;
    color: var(--text-secondary);
}
.generated-resources-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.gen-res-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.res-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.gen-res-card h4 {
    color: var(--accent-pink);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}
.gen-res-card span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.warning-box {
    background: rgba(255, 179, 123, 0.05);
    border: 1px solid rgba(255, 179, 123, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}
.warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.warning-icon {
    color: #ffb37b;
    font-size: 18px;
}
.warning-header h4 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}
.warning-box p {
    color: #d0d0d0;
    font-size: 13px;
    line-height: 1.5;
}
.steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.step-card {
    background: var(--card-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}
.step-number {
    width: 28px;
    height: 28px;
    background: var(--accent-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
    box-shadow: 0 0 10px rgba(179, 56, 255, 0.4);
}
.step-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.pink-text {
    color: var(--accent-pink);
    font-weight: 600;
}
.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}
.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    font-size: 12px;
    color: #d0d0d0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.final-verif-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.verif-line {
    width: 4px;
    height: 20px;
    background: var(--accent-purple);
    border-radius: 2px;
}
.final-verif-header h3 {
    font-size: 20px;
    font-weight: 800;
}
.verification-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: linear-gradient(90deg, #b338ff, #ff38a2);
    color: white;
    text-decoration: none;
    padding: 20px;
    border-radius: 100px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(179, 56, 255, 0.4);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.verification-btn:active {
    transform: scale(0.97);
}
.timer-box {
    background: rgba(255, 204, 0, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13px;
    color: #ffd633;
    line-height: 1.5;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.yellow-text { color: #ffeb3b; }
