* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --background: #08090d;
    --surface: #11131a;
    --surface-light: #181b24;
    --border: rgba(255,255,255,.08);
    --text: #f7f7f8;
    --muted: #9297a5;
    --accent: #8b7cff;
    --accent-2: #6c5ce7;
    --success: #55d88a;
    --warning: #f1c40f;
}

html {
    min-height: 100%;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button {
    font: inherit;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.app {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    margin: auto;
    padding-bottom: 105px;
}

.topbar {
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-mark {
    font-size: 24px;
    margin-right: 8px;
    color: #b9b0ff;
}

.brand-name {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.3px;
}

.welcome {
    padding: 30px 20px 24px;
}

.eyebrow {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.welcome h1 {
    font-size: 31px;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
    max-width: 390px;
}

.balance-card {
    margin: 0 20px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(135deg, #242039, #11131a);
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.balance-header,
.balance-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(85,216,138,.5);
}

.balance {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 18px 0;
}

.balance span {
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -2px;
}

.balance small {
    color: var(--muted);
    font-weight: 700;
}

.featured,
.activity {
    padding: 30px 20px 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 21px;
    letter-spacing: -.5px;
}

.video-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 20px;
    transition: border-color .2s, transform .2s;
}

.video-card:hover {
    border-color: rgba(139,124,255,.25);
}

.video-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: #211d38;
    color: #b9b0ff;
    font-size: 16px;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-info h3 {
    font-size: 14px;
    margin-bottom: 5px;
}

.video-info p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.watch-button {
    min-width: 72px;
    height: 40px;
    padding: 0 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 12px;
    font-weight: 750;
    box-shadow: 0 8px 20px rgba(108,92,231,.22);
    transition: transform .15s, opacity .15s;
}

.watch-button:active {
    transform: scale(.96);
}

.text-button {
    background: transparent;
    color: var(--accent);
    font-size: 12px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    padding: 20px;
    text-align: center;
    border-radius: 14px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(480px, calc(100% - 28px));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
    background: rgba(17,19,26,.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 22px;
    z-index: 100;
}

.nav-item {
    padding: 8px 4px;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-item span {
    font-size: 16px;
}

.nav-item small {
    font-size: 9px;
}

.nav-item.active {
    color: white;
}

/* MODAL STYLES */
.custom-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-popup.hidden {
    display: none;
}

.popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.popup-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 25px;
    background: linear-gradient(145deg, #282340, #11131a);
    box-shadow: 0 30px 100px rgba(0,0,0,.7);
    animation: popupAppear .2s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 20px;
    color: white;
}

.close-icon-btn {
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 14px;
}

/* REWARDS SPECIFIC STYLES */
.rate-banner {
    background: rgba(139,124,255,.12);
    border: 1px solid rgba(139,124,255,.25);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #d1cbff;
}

.rate-badge {
    color: white;
    font-weight: 800;
}

.withdrawal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group label {
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1px;
    color: var(--muted);
}

.input-subtext {
    font-size: 10px;
    color: var(--accent);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-suffix {
    position: absolute;
    right: 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.pts-hint {
    font-size: 11px;
    color: var(--muted);
}

.popup-button {
    width: 100%;
    height: 45px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 6px;
}

/* HISTORY SECTION */
.history-section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.history-section h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: white;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-amount {
    font-size: 13px;
    font-weight: 700;
}

.history-date {
    font-size: 10px;
    color: var(--muted);
}

.history-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: capitalize;
}

.history-status.completed {
    background: rgba(85,216,138,.15);
    color: var(--success);
}

.history-status.pending {
    background: rgba(241,196,15,.15);
    color: var(--warning);
}

/* SETTINGS INFO BOX */
.settings-info-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: var(--muted);
    font-weight: 500;
}

.info-value {
    color: #ffffff;
    font-weight: 700;
    font-family: monospace;
    font-size: 12px;
}