/* DragonBet Refer a Friend – Clean casino promotional style */

:root {
    --bg: #0d0d12;
    --bg-card: #16161f;
    --bg-dark: #0a0a0e;
    --red: #fefe43;
    --red-dark: #d4d420;
    --gold: #f4a261;
    --gold-light: #ffd166;
    --text: #f1f1f1;
    --text-muted: #a0a0b0;
    --border: #2a2a38;
    --success: #2a9d8f;
    --error: #e63946;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-light);
}

.logo .dragon {
    font-size: 1.6rem;
}

nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--gold);
}

.btn-nav {
    background: var(--red);
    color: #111 !important;
    padding: 8px 18px;
    border-radius: 50px;
}

.btn-nav:hover {
    background: var(--red-dark);
}

/* Referral arrival banner */
.ref-banner {
    background: rgba(234, 179, 8, 0.12);
    border-bottom: 1px solid rgba(234, 179, 8, 0.35);
    padding: 12px 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text);
}

.ref-banner code {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--gold-light);
    font-size: 0.9rem;
}

.ref-banner .badge-pending {
    margin-left: 4px;
}

/* Hero */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: radial-gradient(ellipse at top, #1a0a0f 0%, var(--bg) 70%);
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 30%, var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #111;
    box-shadow: 0 4px 20px rgba(254, 254, 67, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(254, 254, 67, 0.55);
}

.btn-secondary {
    background: transparent;
    color: var(--gold-light);
    border: 2px solid var(--gold);
}

.btn-secondary:hover {
    background: rgba(244, 162, 97, 0.1);
}

.btn-copy {
    background: var(--gold);
    color: #111;
    margin-top: 12px;
    padding: 10px 22px;
    font-size: 0.9rem;
}

/* Sections */
.section {
    padding: 70px 0;
}

.section h2 {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
}

.section-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.section-dark {
    background: var(--bg-dark);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
    margin-top: 40px;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: border-color 0.2s;
}

.step:hover {
    border-color: var(--gold);
}

.step-num {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #111;
    font-weight: 800;
    font-size: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards & Forms */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow);
}

.card-single {
    max-width: 480px;
    margin: 0 auto;
}

.card h2 {
    font-size: 1.4rem;
    text-align: left;
    margin-bottom: 20px;
}

.logout-form {
    margin-top: 24px;
}

.btn-logout {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.15s, border-color 0.15s;
}

.btn-logout:hover {
    color: #fda4af;
    border-color: var(--error);
}

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.form input:focus {
    outline: none;
    border-color: var(--gold);
}

.form button {
    width: 100%;
    margin-top: 8px;
}

/* Your code display */
.your-code {
    text-align: center;
}

.your-code p {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.code-display {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--gold-light);
    background: var(--bg);
    border: 2px dashed var(--gold);
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
    user-select: all;
}

.share-link {
    margin-top: 20px;
    font-size: 0.9rem;
}

.share-link code {
    display: block;
    background: var(--bg);
    padding: 10px;
    border-radius: 6px;
    margin-top: 6px;
    word-break: break-all;
    color: var(--gold);
    font-size: 0.85rem;
}

.stats {
    margin-top: 18px;
    font-size: 1rem;
}

.stats-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.stat-box {
    flex: 1;
    max-width: 120px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.stat-box .stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-box.approved .stat-num { color: #5eead4; }
.stat-box.pending .stat-num { color: #fbbf24; }

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
    text-align: center;
}

.alert-success {
    background: rgba(42, 157, 143, 0.15);
    border: 1px solid var(--success);
    color: #5eead4;
}

.alert-error {
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid var(--error);
    color: #fda4af;
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 780px;
    margin: 0 auto;
}

.lb-header,
.lb-row {
    display: grid;
    grid-template-columns: 50px 1fr 100px 80px 80px;
    padding: 14px 16px;
    align-items: center;
    gap: 4px;
}

.lb-header {
    background: var(--bg-dark);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lb-row {
    border-top: 1px solid var(--border);
    transition: background 0.15s;
}

.lb-row:hover {
    background: rgba(255,255,255,0.03);
}

.lb-row.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
}

.lb-row.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.08), transparent);
}

.lb-row.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.08), transparent);
}

.rank {
    font-size: 1.2rem;
    font-weight: 700;
}

.name {
    font-weight: 600;
}

.code {
    font-family: monospace;
    color: var(--gold);
    font-size: 0.9rem;
}

.count {
    font-weight: 800;
    font-size: 1.1rem;
    text-align: center;
}

.approved-count {
    color: #5eead4;
}

.pending-count {
    color: var(--text-muted);
}

.badge-pending {
    display: inline-block;
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 800;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Terms */
.section-terms {
    background: var(--bg-dark);
    padding: 40px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.section-terms h3 {
    margin-bottom: 12px;
    color: var(--text);
}

.section-terms ul {
    padding-left: 20px;
}

.section-terms li {
    margin-bottom: 6px;
}

.section-terms a {
    color: var(--gold);
}

/* Footer */
.footer {
    background: #050508;
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer .rg {
    margin-top: 8px;
    font-size: 0.85rem;
}

.footer a {
    color: var(--gold);
}

/* Responsive */
@media (max-width: 640px) {
    nav a:not(.btn-nav) {
        display: none;
    }

    .lb-header,
    .lb-row {
        grid-template-columns: 40px 1fr 60px 60px;
    }

    .lb-header span:nth-child(3),
    .lb-row .code {
        display: none;
    }

    .hero {
        padding: 50px 0 40px;
    }
}

/* ----- Selected Casino + Select button ----- */
.selected-casino {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 8px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.casino-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.casino-name {
    font-weight: 700;
    color: var(--gold-light);
}

.btn-select {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s, color 0.15s;
}

.btn-select:hover {
    background: var(--red);
    color: #111;
}

.btn-copy-link {
    margin-top: 10px;
    width: auto;
}

/* ----- Modal ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 8px;
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    text-align: left;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.modal-sub {
    padding: 0 24px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.casino-grid {
    overflow-y: auto;
    padding: 0 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.casino-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.casino-card:hover {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.03);
}

.casino-card.active {
    border-color: var(--red);
    background: rgba(254, 254, 67, 0.08);
}

.casino-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.casino-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.casino-info strong {
    font-size: 0.95rem;
}

.casino-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.casino-check {
    font-size: 1.1rem;
    color: var(--red);
    font-weight: 700;
    width: 24px;
    text-align: center;
}

/* Claim / referral landing modal */
.claim-overlay {
    display: flex;
    z-index: 1100;
    padding: 16px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
}

.claim-modal {
    position: relative;
    max-width: 400px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 20px;
    border: 1px solid rgba(254, 254, 67, 0.25);
    background: linear-gradient(180deg, #1a1a24 0%, #12121a 100%);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.claim-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    border: none;
    cursor: pointer;
}

.claim-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.claim-body {
    padding: 28px 24px 28px;
}

.claim-top {
    text-align: center;
    margin-bottom: 22px;
    padding-right: 20px;
}

.claim-pill {
    display: inline-block;
    background: rgba(254, 254, 67, 0.12);
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 6px 12px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.claim-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: #fff;
    letter-spacing: -0.02em;
}

.claim-casino {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.claim-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.claim-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.claim-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--red);
    color: #111;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.claim-step strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
    color: #fff;
}

.claim-step span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.claim-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    box-sizing: border-box;
}

.claim-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.claim-divider::before,
.claim-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.claim-form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.claim-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.claim-form input:focus {
    outline: none;
    border-color: var(--red);
}

.claim-submit {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .modal {
        max-height: 90vh;
    }

    .casino-info span {
        white-space: normal;
    }
}
