:root {
    --bg-dark: #09090b;
    --card-bg: rgba(25, 25, 40, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #b3b3cc;
    --accent-cyan: #00f2ff;
    --accent-purple: #a855f7;
    --gradient-pulsar: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    --gradient-danger: linear-gradient(135deg, #f87171, #ef4444);
}

/* FIX IMPORTANTE: Esto evita que el input se salga */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at center, rgba(168, 85, 247, 0.15) 0%, var(--bg-dark) 70%),
        url('https://www.transparenttextures.com/patterns/stardust.png');
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.logo-container {
    margin-bottom: 20px;
    text-align: center;
}

.logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(0, 242, 255, 0.3));
    pointer-events: none;
}

h1 {
    font-size: 1.8rem;
    margin: 0 0 5px 0;
    text-align: center;
}

.gradient-text {
    background: var(--gradient-pulsar);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 25px;
}

.main-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(168, 85, 247, 0.2);
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    position: relative;
    /* FIX: Overflow hidden por si acaso */
    overflow: hidden;
}

.input-group {
    margin-bottom: 15px;
    width: 100%;
}

.input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

input {
    width: 100%;
    padding: 14px 50px 14px 15px;
    /* Espacio para el icono a la derecha */
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 10px;
    outline: none;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    transition: 0.3s;
}

input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
}

.eye-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eye-btn:hover {
    color: #fff;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.btn-reset {
    flex: 2;
    padding: 12px;
    background: var(--gradient-pulsar);
    border: none;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.btn-info {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-info:hover {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.1);
}

.btn-copy-script {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: transparent;
    border: 1px dashed var(--accent-purple);
    color: var(--accent-purple);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.btn-copy-script:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

#status {
    margin-top: 20px;
    font-size: 0.85rem;
    text-align: center;
    min-height: 24px;
    font-weight: 500;
}

.success {
    color: #4ade80;
}

.error {
    color: #f87171;
}

.warning {
    color: #fbbf24;
}

.extra-card {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.info-card {
    text-align: left;
}

.instructions-text {
    font-size: 0.75rem;
    color: #b3b3cc;
    line-height: 1.4;
    margin-top: 5px;
    text-align: left;
    background: rgba(74, 222, 128, 0.05);
    border-left: 3px solid #4ade80;
    padding: 10px;
    border-radius: 4px;
}

.cooldown-active {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.05);
}

.countdown {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.countdown-label {
    font-size: 0.75rem;
    color: #f87171;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

.btn-force {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: var(--gradient-danger);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.2);
}

.btn-force:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    background: #444;
    box-shadow: none;
}

.info-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
    text-align: left;
}

.info-table td {
    padding: 10px 0;
    color: #e5e5e5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-table td:first-child {
    color: var(--accent-purple);
    font-weight: 600;
    width: 40%;
}

.info-table td:last-child {
    text-align: right;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.api-status {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #666;
    transition: 0.3s;
}

.status-online {
    background-color: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .main-card {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-direction: row;
    }

    input {
        font-size: 16px;
    }

    .btn-reset,
    .btn-info {
        padding: 14px;
    }

    .api-status {
        top: 15px;
        right: 15px;
    }
}