/* --- PLAYFOURTH GLOBAL THEME --- */
:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --card-elev: #182235;
    --surface-2: #0f172a;
    --stroke: #334155;
    --lime-neon: #bef264;
    --lime-dark: #a3e635;
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --text-primary: #f8fafc;
    --btn-text: #000;
    --overlay: rgba(0, 0, 0, 0.85);
}

body[data-theme="sport"] {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --card-elev: #182235;
    --surface-2: #0f172a;
    --stroke: #334155;
    --lime-neon: #bef264;
    --lime-dark: #a3e635;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --btn-text: #000;
    --overlay: rgba(0, 0, 0, 0.85);
}

body[data-theme="glass"] {
    --bg-dark: #0b1328;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-elev: rgba(255, 255, 255, 0.06);
    --surface-2: rgba(255, 255, 255, 0.03);
    --stroke: rgba(255, 255, 255, 0.22);
    --lime-neon: #93f5d1;
    --lime-dark: #7ceac3;
    --text-primary: #e7edf9;
    --text-muted: #b8c5dc;
    --btn-text: #041317;
    --overlay: rgba(4, 8, 17, 0.75);
}

body[data-theme="light"] {
    --bg-dark: #f4f7fb;
    --card-bg: #ffffff;
    --card-elev: #f8fbff;
    --surface-2: #f2f6fc;
    --stroke: #d4deeb;
    --lime-neon: #8ac926;
    --lime-dark: #7ab51f;
    --text-primary: #0f172a;
    --text-muted: #51617a;
    --btn-text: #06120a;
    --overlay: rgba(15, 23, 42, 0.45);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    line-height: 1.5;
    transition: background-color 240ms ease, color 240ms ease;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 18px 14px 100px;
}

h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--lime-neon);
    margin-bottom: 4px;
}

h2,
h3 {
    margin: 0 0 8px;
}

.muted {
    color: var(--text-muted);
    margin: 0;
}

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

.theme-switcher {
    display: inline-flex;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 12px;
}

.theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.theme-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    border: 1px solid var(--stroke);
    color: var(--text-muted);
    background: var(--surface-2);
}

.theme-btn.is-active {
    background: var(--lime-neon);
    color: var(--btn-text);
}

.theme-btn.is-active .theme-icon {
    border-color: color-mix(in srgb, var(--btn-text) 25%, transparent);
    color: var(--btn-text);
    background: color-mix(in srgb, #ffffff 60%, transparent);
}

.text-action {
    background: none;
    border: none;
    color: var(--lime-neon);
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.profile-btn {
    background: rgba(190, 242, 100, 0.15);
    border: 1px solid rgba(190, 242, 100, 0.4);
    color: var(--lime-neon);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.hero {
    margin-bottom: 12px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--lime-neon);
    margin: 0 0 10px;
}

.hero h2 {
    font-size: 1.65rem;
    line-height: 1.2;
    margin-bottom: 6px;
}

.hero-actions {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.text-link {
    margin-top: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 4px 0;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--stroke);
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: var(--lime-neon);
    color: var(--lime-neon);
}

.trust-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.trust-chip {
    border: 1px solid #334155;
    color: #cbd5e1;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
}

.hero-stats {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.section-stats {
    margin: 10px 0 14px;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-top: 10px;
}

.filter-mode-toggle {
    display: inline-flex;
    gap: 6px;
    margin-top: 8px;
}

.filter-hint {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.filters-row select {
    width: 100%;
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}

.dupr-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dupr-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.dupr-inputs input {
    width: 100%;
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}

.dupr-pick-btn {
    padding: 8px 10px;
}

.hero-stat {
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

.hero-stat strong {
    display: block;
    color: var(--lime-neon);
    font-size: 12px;
    line-height: 1.2;
}

.hero-stat span {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.3;
}

.section-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--stroke) 55%, transparent);
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 14px 0;
}

.quick-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px;
}

.quick-item p {
    margin: 0;
    font-weight: 700;
    font-size: 13px;
}

.quick-item span {
    color: var(--text-muted);
    font-size: 12px;
}

.steps {
    display: grid;
    gap: 8px;
}

.step {
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    transition: background-color 220ms ease, border-color 220ms ease;
}

.step span {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: 700;
    background: rgba(190, 242, 100, 0.15);
    color: var(--lime-neon);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.live-pill {
    color: var(--lime-neon);
    border: 1px solid rgba(190, 242, 100, 0.4);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    white-space: nowrap;
}

/* --- SESSION CARDS --- */
.session-card {
    background: var(--card-elev);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--stroke) 55%, transparent);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.join-btn {
    background: var(--lime-neon);
    color: var(--btn-text);
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 800;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.join-btn:hover {
    background: var(--lime-dark);
    transform: translateY(-2px);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--stroke);
    border: 3px solid var(--card-bg);
    margin-right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.card-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.mini-btn {
    border: 1px solid var(--stroke);
    background: transparent;
    color: #cbd5e1;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.mini-btn.is-active {
    background: var(--lime-neon);
    color: var(--btn-text);
    border-color: transparent;
}

.mini-btn.danger {
    border-color: #7f1d1d;
    color: #fca5a5;
}

.match-pill {
    margin: 0 0 10px;
    color: #86efac;
    font-size: 12px;
    font-weight: 700;
}

.testimonial {
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
}

.testimonial strong {
    display: block;
    color: var(--lime-neon);
    margin-top: 8px;
    font-size: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    padding: 12px 0 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
}

/* --- FLOATING ACTION BUTTON --- */
.fab {
    position: fixed;
    bottom: 84px;
    right: 14px;
    width: 54px;
    height: 54px;
    background: var(--lime-neon);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #000;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: transform 0.2s;
    border: none;
    z-index: 100;
}

.fab:hover { transform: scale(1.1); }

.mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-dark) 88%, transparent);
    border-top: 1px solid var(--stroke);
    z-index: 120;
    transition: background-color 220ms ease, border-color 220ms ease;
}

.mobile-cta .join-btn {
    flex: 1;
}

.mobile-cta .secondary-btn {
    min-width: 104px;
}

/* --- HOSTING MODAL (The Fix) --- */
.modal {
    display: none; /* This ensures it stays hidden until you click + */
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: var(--overlay);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    margin: 10vh auto;
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    color: var(--text-primary);
    border-radius: 10px;
    box-sizing: border-box; /* Keeps the input from spilling out of the box */
}

.modal-content h2 {
    margin-top: 0;
}

.dupr-picker-content {
    max-width: 430px;
}

.dupr-wheel-wrap {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dupr-wheel-label {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.dupr-wheel {
    width: 100%;
    height: 180px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    padding: 8px;
}

.dupr-wheel option {
    padding: 6px;
}
/* Success state for the Join button */
.join-btn.success {
    background: #ffffff !important;
    color: #059669 !important; /* A nice forest green */
    border: 2px solid #059669;
    transform: scale(1.05);
    cursor: default;
}

/* Optional: Add a little pop animation */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

.animate-pop {
    animation: pop 0.3s ease-out forwards;
}

body[data-theme="glass"] .section-card,
body[data-theme="glass"] .session-card,
body[data-theme="glass"] .modal-content {
    backdrop-filter: blur(12px);
}

body[data-theme="light"] .profile-btn {
    background: #edf8d7;
    border-color: #b9d98b;
}

@media (min-width: 480px) {
    .container {
        padding: 20px 16px 102px;
    }

    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h2 {
        font-size: 1.75rem;
    }
}

@media (min-width: 700px) {
    .container {
        max-width: 760px;
        padding: 24px 20px 24px;
    }

    .hero-actions {
        grid-template-columns: 1fr 1fr;
    }

    .hero h2 {
        font-size: 1.9rem;
    }

    .section-card {
        padding: 18px;
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }

    .mobile-cta {
        display: none;
    }

    .hero-stats {
        gap: 10px;
    }

    .hero-stat strong {
        font-size: 13px;
    }

    .hero-stat span {
        font-size: 11px;
    }
}

@media (max-width: 520px) {
    .filters-row {
        grid-template-columns: 1fr;
    }

    .dupr-inputs {
        grid-template-columns: 1fr;
    }

    .dupr-wheel-wrap {
        grid-template-columns: 1fr;
    }

    .filters-row .mini-btn {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 28px 28px 30px;
    }

    .hero {
        margin-bottom: 18px;
    }

    .hero h2 {
        font-size: 2.1rem;
        max-width: 20ch;
    }

    .section-card {
        padding: 20px;
    }

    .quick-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}