:root {
    --primary-bg: #000000;
    --app-bg: #131313;
    --surface-container: #1E1E1E;
    --glass-bg: rgba(255, 255, 255, 0.05);
    /* retain for subtle effects */
    --glass-border: rgba(255, 255, 255, 0.05);
    --accent-purple: #8a2be2;
    --btn-bg: #2A2A2A;
    --btn-hover: #2A2A2A;
    --text-color: #ffffff;
    --logo-purple: #9042ff;
    --dpad-purple: #662D91;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
}

.tactile-button {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.1s ease;
}

.tactile-button:active {
    transform: scale(0.95) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

.glossy-finish {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.1) 100%);
}

.inner-glow {
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}


.container {
    background: var(--app-bg);
    backdrop-filter: blur(20px);
    border: 8px solid #18181b;
    border-radius: 42px;
    padding: 18px 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 370px;
    text-align: center;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 5px;
}

.logo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 15px;
    margin-bottom: 5px;
}

.logo-col-side {
    flex: 0 0 15%;
    display: flex;
    align-items: center;
}

.logo-col-left {
    justify-content: flex-end;
}

.logo-col-right {
    justify-content: flex-start;
    gap: 10px;
}



.logo-col-center {
    flex: 0 0 70%;
    text-align: center;
}

.app-logo {
    font-size: 23px;
    /* Slightly smaller to fit layout */
    font-weight: 900;
    letter-spacing: -1.5px;
    color: #fff;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.app-logo span {
    color: var(--logo-purple);
    margin: 0 1px;
    display: inline-block;
}

.lang-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lang-btn:hover {
    background: var(--btn-bg);
}



.keyboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
    width: 150px;
}

.keyboard-container input {
    width: 100%;
    font-size: 11px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
}

.keyboard-container button {
    width: 100%;
    padding: 6px;
    font-size: 11px;
    border-radius: 8px;
    background: var(--accent-purple);
    border: none;
    color: white;
    cursor: pointer;
}

#typeInput {
    width: 100%;
    background: var(--surface-container);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#typeInput::placeholder {
    color: rgba(179, 167, 184, 0.4);
}

#typeInput:focus {
    border-color: rgba(102, 45, 145, 0.5);
}

#sendTextBtn {
    width: 100%;
    background: var(--dpad-purple);
    border: none;
    border-radius: 12px;
    color: var(--text-color);
    padding: 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.connection-manager {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.form-select {
    flex: 1;
    background: var(--surface-container) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    padding: 10px 32px 10px 12px;
    font-size: 14px;
    font-family: inherit;
    appearance: none;
    cursor: pointer;
    outline: none;
}

.form-select option {
    background: var(--primary-bg);
    color: white;
}

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--surface-container);
    color: #B3A7B8;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    color: #ef4444;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-scan {
    color: #22d3ee;
}

.btn-scan:hover {
    background: rgba(34, 211, 238, 0.1);
}

#statusContainer {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    width: 100%;
}

#status {
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-searching {
    background: #1e1b2e;
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background-image: linear-gradient(to right, 
        rgba(138, 43, 226, 0.3) var(--progress, 0%), 
        transparent var(--progress, 0%));
}

.status-connected {
    background: #1A261A;
    color: #4ade80;
    border: 1px solid rgba(20, 83, 45, 0.5);
}

.status-connected::before {
    content: "";
    /* Animated connection dot */
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-error {
    background: #2A2020;
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.status-error::before,
.status-searching::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #ff4444;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

.manual-config {
    margin-top: 10px;
    padding: 12px;
    background: var(--surface-container);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 12px;
}

.manual-config p {
    margin-bottom: 10px;
    opacity: 0.7;
}

.input-group {
    display: flex;
    gap: 8px;
}

.form-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.form-btn {
    background: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.2s;
}

.form-btn:hover {
    opacity: 0.9;
}

.form-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.form-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.remote-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-bottom: 20px;
}

.grid-parent {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin-top: 15px;
    gap: 12px;
}

.app-shortcuts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.shortcut-btn {
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.1s ease;
    padding: 10px;
    width: 135px;
    background: var(--btn-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.grids-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.grid-container-top,
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 200px;
    height: 200px;
    background: var(--surface-container);
    padding: 12px;
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
    position: relative;
}

/* D-Pad Unified Styles */
.dpad-shape {
    position: absolute;
    background: var(--dpad-purple);
    border-radius: 20px;
    z-index: 0;
}

.dpad-vertical {
    left: 33.33%;
    width: 33.33%;
    height: 100%;
}

.dpad-horizontal {
    top: 33.33%;
    width: 100%;
    height: 33.33%;
}

.empty-cell {
    background: transparent;
    border: none;
}

.power-btn-new {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: #2A2020 !important;
    color: #FF0000 !important;
}

.power-btn-new:hover {
    background: #332727 !important;
}

.custom-combo-container {
    display: flex;
    flex-direction: column;
    width: 135px;
    margin-bottom: 5px;
}

.custom-combo-container label {
    font-size: 12px;
    margin-bottom: 4px;
    text-align: center;
    color: #ccc;
    font-weight: 600;
}

.custom-combo {
    position: relative;
    width: 135px;
    background: var(--surface-container);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
}

.custom-combo:active {
    transform: scale(0.95);
}

.combo-text {
    font-size: 14px;
    font-weight: 400;
    color: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 145px;
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    z-index: 100;
    margin-top: 4px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.combo-dropdown.show {
    display: block;
}

.combo-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    font-size: 12px;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.combo-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.combo-option input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}

.grid-btn {
    border: none;
    border-radius: 12px;
    background: var(--btn-bg);
    color: white;
    font-size: 21px;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
}

.grid-btn:hover {
    background: var(--btn-bg);
}

.btn-primary,
.btn-primary:hover {
    background: transparent;
    border-radius: 12px;
    position: relative;
    z-index: 10;
    transition: background-color 0.1s;
}

.btn-primary:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.dpad-up {
    border-radius: 20px 20px 0 0;
}

.dpad-left {
    border-radius: 20px 0 0 20px;
}

.dpad-right {
    border-radius: 0 20px 20px 0;
}

.dpad-down {
    border-radius: 0 0 20px 20px;
}

/* Resaltado sutil: icono variante "house" (Outlined) y 30% más grande */
.home-btn span {
    font-size: 32px !important;
    transition: transform 0.2s;
}

.home-btn:hover span {
    transform: scale(1.1);
}

.btn-secondary {
    background: var(--btn-bg);
    color: #ffffff;
    font-size: 18px;
}

.grid-btn[data-key="Back"],
.grid-btn[data-key="Back"]:hover {
    background: #2A2A2A;
    color: #ffffff;
    transition: all 0.1s ease;
}

.btn-vol,
.btn-vol:hover {
    background: #2A2A2A;
    color: #22d3ee;
    font-size: 14px;
    flex-direction: column;
    gap: 0;
    line-height: 1;
    transition: all 0.1s ease;
}

.vol-label {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.vol-sign {
    font-size: 14px;
    font-weight: 900;
}

.grid-btn.btn-ok,
.grid-btn.btn-ok:hover {
    background: transparent;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 4px;
    position: relative;
    z-index: 10;
    font-size: 14px;
    font-weight: 900;
}

.ok-text {
    letter-spacing: -0.5px;
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--app-bg);
    backdrop-filter: blur(20px);
    border: 8px solid #18181b;
    border-radius: 42px;
    padding: 24px 18px;
    width: 370px;
    max-width: 90%;
    color: var(--text-color);
    text-align: left;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.close-btn-top {
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
    transition: all 0.2s;
}

.close-btn-top:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 138, 43, 226, 0.5);
}

.modal-content h2 {
    margin: 0;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -1px;
    color: #fff;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    text-align: center;
    flex: 1;
}

.modal-content h2 span {
    color: var(--logo-purple);
    margin: 0 1px;
    display: inline-block;
}

.help-body {
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    padding-right: 5px;
}

.help-body::-webkit-scrollbar {
    width: 4px;
}

.help-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.help-body h3 {
    color: #ffc107;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.help-body ol {
    padding-left: 20px;
}

.help-body ol>li {
    margin-top: 15px;
}


.help-sublist {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.help-footer {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.help-footer p {
    margin: 2px 0;
}

#closeHelpBtn {
    margin-top: 20px;
    width: 100%;
}

.text-xl {
    font-size: 1.25rem;
    /* 20px */
    line-height: 1.75rem;
    /* 28px */
}

.text-2xl {
    font-size: 1.5rem;
    /* 24px */
    line-height: 2rem;
    /* 32px */
}

.w-full {
    width: 100%;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-sm {
    font-size: 0.875rem;
    /* 14px */
    line-height: 1.25rem;
    /* 20px */
}

.p-4 {
    padding: 1rem;
    /* 16px */
}

/* Home Indicator (Cosmetic) */
.home-indicator-wrapper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    padding-bottom: 8px;
}

.home-indicator {
    width: 80px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.btn-pulse {
    animation: pulse-highlight 2s infinite;
    background: rgba(255, 193, 7, 0.3) !important;
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

/* --- MONETIZATION & ADS STYLES --- */

.hidden { display: none !important; }

.ad-banner-container {
    width: 100%;
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #ccc;
}

.ad-tag {
    background: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 10px;
    margin-right: 8px;
}

.banner-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
}

/* Ad Modals (Offerwall, Interstitial, Rewarded) */
.ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.ad-modal-content {
    width: 90%;
    max-width: 400px;
    background: #131313;
    border: 2px solid var(--logo-purple);
    border-radius: 24px;
    padding: 20px;
    color: white;
    box-shadow: 0 0 30px rgba(144, 66, 255, 0.3);
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ad-label {
    font-size: 10px;
    font-weight: 800;
    color: #ffc107;
    letter-spacing: 2px;
}

.ad-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.ad-body {
    text-align: center;
}

.ad-body h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.ad-placeholder {
    width: 100%;
    height: 200px;
    background: #222;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #444;
}

.ad-action-btn {
    width: 100%;
    padding: 15px;
    background: var(--logo-purple);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

/* User Type Selector */
.user-type-selector {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    cursor: pointer;
    font-weight: 600;
    color: var(--logo-purple);
}

.slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #333;
    border-radius: 20px;
    transition: .4s;
    margin-left: 10px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--logo-purple);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

#userTypeToggle { display: none; }

/* Mock elements */
.mock-offers {
    display: flex;
    gap: 10px;
}
.offer {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
}
.mock-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.play-icon { font-size: 40px; color: var(--logo-purple); }