:root {
    --bg: #020617;
    --bg-card: #020617;
    --border: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #fb923c;
    --accent-soft: #451a03;
}

@font-face {
    font-family: 'BricolageGrotesque';
    src: url('/assets/fonts/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

p {
    margin: 0.45rem 0;
}

ul li {
    margin-top: 0.25rem;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at center, #27326c 0, var(--bg) 85%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.shell {
    width: 100%;
    max-width: 880px;
    background: rgba(17, 0, 122, 0.92);
    border-radius: 1.25rem;
    box-shadow:
        0 22px 45px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(148, 163, 184, 0.30);
    padding: 1.75rem 1.75rem 1.4rem;
    backdrop-filter: blur(16px);
}

@media (prefers-color-scheme: dark) {
    .shell {
        background: rgba(15, 23, 42, 0.96);
        box-shadow:
            0 22px 45px rgba(0, 0, 0, 0.65),
            0 0 0 1px rgba(31, 41, 55, 0.9);
    }
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.3rem;
}

.app-store-button-wrapper {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin: 24px;
}

.app-store-button {
    background: none;
    border: none;
    max-width: 300px;
    margin-top: 48px;
    outline: 0px;
    outline-color: transparent;
    padding: 0px;
}

.app-store-button img {
    border-radius: 20px;
    max-width: 100%;
    margin: 0px;
    padding: 0px;
}

.title-block h1 {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.03em;
}

.title-block p {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

main {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr);
    gap: 1.4rem;
}

@media (max-width: 800px) {
    .shell {
        padding: 1.25rem 1.15rem 1.1rem;
        border-radius: 1rem;
    }

    main {
        grid-template-columns: minmax(0, 1fr);
    }
}

form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.field-desc {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    border-radius: 0.7rem;
    border: 1px solid var(--border);
    padding: 0.55rem 0.7rem;
    font: inherit;
    resize: vertical;
    min-height: 2.4rem;
    background: rgba(255, 255, 255, 0.96);
    color: inherit;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

@media (prefers-color-scheme: dark) {

    input[type="text"],
    input[type="email"],
    textarea {
        background: #020617;
    }
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(248, 171, 98, 0.45);
}

textarea {
    min-height: 120px;
}

.dropzone {
    position: relative;
    border-radius: 0.9rem;
    border: 1.5px dashed rgba(148, 163, 184, 0.9);
    background: radial-gradient(circle at top left, var(--accent-soft) 0, rgba(255, 255, 255, 0.92) 55%, rgba(255, 255, 255, 0.92) 100%);
    padding: 0.8rem 0.9rem;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.05s ease;
}

@media (prefers-color-scheme: dark) {
    .dropzone {
        background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.12) 0, #020617 55%, #020617 100%);
    }
}

.dropzone.drag-over {
    border-color: var(--accent);
    background: radial-gradient(circle at top left, var(--accent-soft) 0, rgba(255, 255, 255, 0.98) 60%, rgba(255, 255, 255, 0.98) 100%);
    transform: translateY(-1px);
}

.dropzone h3 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dropzone p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.6);
}

@media (prefers-color-scheme: dark) {
    .chip {
        background: rgba(15, 23, 42, 0.9);
    }
}

.chip button {
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
}

.hidden-input {
    display: none;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.status {
    font-size: 0.8rem;
}

.status.error {
    color: var(--error);
}

.status.success {
    color: var(--success);
}

button[type="submit"] {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 10px 20px rgba(234, 88, 12, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(234, 88, 12, 0.45);
}

button[type="submit"]:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(234, 88, 12, 0.35);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.content p {
    margin: 0.45rem 0;
    font-size: 0.9rem;
    line-height: 1.75;
}

.content ul {
    margin: 0.45rem 0 0.5rem 1.2rem;
    padding: 0;
    font-size: 0.9rem;
}

.content li {
    margin: 0.25rem 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.sidebar {
    padding: 0.9rem 0.9rem 0.6rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.95), rgba(239, 246, 255, 0.96));
    font-size: 0.85rem;
}

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.22) 0, #020617 52%, #020617 100%);
    }
}

.sidebar h2 {
    font-size: 0.9rem;
    margin: 0 0 0.45rem;
}

.sidebar p {
    margin: 0.25rem 0;
    color: var(--muted);
}

.sidebar ul {
    margin: 0.35rem 0 0.4rem 1rem;
    padding: 0;
}

.sidebar li {
    margin: 0.2rem 0;
}

.sidebar small {
    font-size: 0.75rem;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.45rem;
}

@media (prefers-color-scheme: dark) {
    .pill {
        background: rgba(15, 23, 42, 0.9);
    }
}

.nav-links {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.nav-links span {
    margin-right: 0.45rem;
    margin-left: 0.45rem;
}

.nav-links a {
    text-align: center;
}

/* Branded "WagerWith" title, matching AppTitle widget */
.app-title {
    display: inline-flex;
    align-items: baseline;
    font-family: 'BricolageGrotesque', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -1.2px;
}

.app-title .wager {
    font-weight: 800;
}

.app-title .with {
    font-weight: 400;
    opacity: 0.9;
}

.invite-page {
    text-align: center;
}

.invite-title {
    font-size: 1.75rem;
    font-weight: 400;
    font-family: inherit;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.invite-message {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.invite-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0 0 1.5rem;
}

/* Primary CTA: full-width, gradient, like sign-in PrimaryButton.elevated */
.open-app-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 10px 20px rgba(234, 88, 12, 0.35);
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
}

.open-app-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(234, 88, 12, 0.45);
}

.open-app-btn:active {
    transform: translateY(0);
}

.invite-download-link {
    font-size: 0.9rem;
    color: var(--muted);
}

.invite-download-link a {
    color: var(--accent);
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: block;
}

@media (min-width: 769px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}