:root {
    --bg-color: #0d0d12;
    --card-bg: rgba(24, 24, 32, 0.4);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Animation */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #09090b;
}

.sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.sphere-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: #7c3aed;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.sphere-3 {
    width: 200px;
    height: 200px;
    background: #2563eb;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

.app-wrapper {
    padding: 20px 16px;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lightning {
    font-size: 20px;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.6));
}

.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Main Status Card */
.main-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Add a subtle highlight to the top edge */
.main-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
}

.user-profile {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 14px;
    margin-bottom: 24px;
    transform: translateZ(20px);
    /* 3D pop */
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-heading);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: max-content;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.expired {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-badge.loading {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Progress Ring */
.progress-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 10px 0 24px;
    transform: translateZ(30px);
}

.progress-ring {
    width: 160px;
    height: 160px;
    transform: rotate(-90deg);
}

.progress-ring__bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 12;
}

.progress-ring__circle {
    fill: transparent;
    stroke: url(#gradientActive);
    stroke-width: 12;
    stroke-dasharray: 439.8;
    /* 2 * PI * 70 */
    stroke-dashoffset: 439.8;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    filter: url(#glow);
}

.progress-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.days-value {
    font-family: var(--font-heading);
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.days-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Action Card & Keys */
.action-card h2,
.ref-card h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 700;
    transform: translateZ(10px);
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
    transform: translateZ(10px);
}

.key-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    transform: translateZ(15px);
}

.key-container:active {
    transform: translateZ(15px) scale(0.98);
    background: rgba(255, 255, 255, 0.05);
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #a5b4fc;
    word-break: break-all;
    padding-right: 12px;
}

.copy-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s;
}

.key-container:hover .copy-icon {
    color: #fff;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    font-family: var(--font-ui);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    outline: none;
    transform: translateZ(20px);
}

.btn:active {
    transform: translateZ(20px) scale(0.96);
}

.btn-glow {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.quick-connect {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateZ(15px);
}

.btn-app {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    justify-content: flex-start;
    gap: 16px;
}

.btn-app.ios-btn {
    color: #60a5fa;
}

.btn-app.android-btn {
    color: #34d399;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.btn-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Referrals */
.ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    transform: translateZ(10px);
}

.ref-header h2 {
    margin: 0;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-ui);
}

.ref-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 16px;
    transform: translateZ(15px);
}

.ref-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ref-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
}

.ref-val {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.ref-val.accent {
    color: var(--success);
}

.ref-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-hint {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 10px;
}

.text-center {
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
    transform: translateZ(10px);
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 16px;
}

.stat-text {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

/* Promo Input */
.promo-input-group {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    transform: translateZ(15px);
}

.promo-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: var(--font-ui);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.promo-input:focus {
    border-color: var(--primary);
}

.promo-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    width: 46px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
}

.promo-btn:active {
    transform: scale(0.95);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 18, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== TARIFF MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    /* Dark semi-transparent background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.tariff-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tariff-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tariff-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tariff-card.popular {
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.tariff-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tariff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tariff-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.tariff-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 5px;
}

.btn-pay-fk {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pay-fk:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-pay-fk:active {
    transform: scale(0.96);
}

.btn-pay-stars {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05));
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pay-stars:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(56, 189, 248, 0.1));
    border-color: rgba(56, 189, 248, 0.5);
}

.btn-pay-stars:active {
    transform: scale(0.96);
}