:root {
    color-scheme: light;
    /* Color Palette - Premium Violet & Neutral */
    --primary: #7c3aed;
    --primary-hover: #6d28d9;

    --text-main: #0f172a;
    /* Deep Slate/Charcoal */
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --bg-main: #ffffff;
    /* Pure White */
    --bg-surface: #ffffff;
    --bg-surface-variant: #f8fafc;

    --border-base: #e2e8f0;

    /* Spacing System */
    --s-1: 0.5rem;
    /* 8px */
    --s-2: 1rem;
    /* 16px */
    --s-3: 1.5rem;
    /* 24px */
    --s-4: 2rem;
    /* 32px */
    --s-6: 3rem;
    /* 48px */
    --s-8: 4rem;
    /* 64px */

    /* Typography Scale */
    --f-h1: 3rem;
    --f-h2: 2.25rem;
    --f-h3: 1.5rem;
    --f-body: 1.125rem;
    --f-small: 1rem;
    --f-tiny: 0.875rem;

    /* Shadows - Refined and Subtle */
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);

    /* Border Radius */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 16px;

    /* Transitions */
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-size: var(--f-h1);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: var(--s-4);
}

h2 {
    font-size: var(--f-h2);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: var(--s-2);
}

p {
    margin-bottom: var(--s-2);
}

a {
    transition: var(--transition-base);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--s-2);
}

.flex-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

/* Components */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 480px;
    margin: var(--s-4) auto;
    text-align: center;
    transition: var(--transition-base);
    animation: slideUpFade 0.5s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--r-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    width: 100%;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Session Box & Code Char */
.session-box {
    margin: var(--s-6) 0;
}

.code-label {
    font-size: var(--f-tiny);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--s-3);
    display: block;
}

.code-display {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.code-char {
    width: 42px;
    height: 56px;
    background: var(--bg-surface-variant);
    border: 1px solid var(--border-base);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition-base);
}

.code-char.valid {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-surface);
}

/* Typography Overrides for Join Card */
#joinCard h2 {
    color: var(--primary);
    font-weight: 800;
}

/* Subtitle/Text */
.subtitle {
    color: var(--text-muted);
    font-size: var(--f-body);
    margin-bottom: var(--s-6);
    line-height: 1.6;
}

/* Play Store Button */
.play-store-btn {
    display: inline-block;
    transition: var(--transition-base);
}

.play-store-btn img {
    width: 180px;
    height: auto;
    border-radius: var(--r-sm);
}

.play-store-btn:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Footer */
.footer {
    padding: var(--s-8) var(--s-2);
    text-align: center;
    font-size: var(--f-tiny);
    color: var(--text-muted);
    border-top: 1px solid var(--border-base);
    margin-top: auto;
}

.footer a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    margin: 0 var(--s-1);
    border-bottom: 1px solid transparent;
}

.footer a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Policy Content */
.policy-content {
    max-width: 720px;
    margin: var(--s-8) auto;
    padding: var(--s-8);
    text-align: left;
    box-shadow: none;
    border: none;
}

.policy-content h1 {
    font-size: 2.5rem;
    margin-bottom: var(--s-6);
}

.policy-content h2 {
    font-size: var(--f-h3);
    margin-top: var(--s-8);
}

.policy-content h3 {
    font-size: 1.125rem;
    margin-top: var(--s-6);
    color: var(--text-main);
}

.policy-content p,
.policy-content li {
    font-size: var(--f-small);
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.policy-content ul {
    padding-left: 1.5rem;
}

/* Responsiveness */
@media (max-width: 640px) {
    :root {
        --f-h1: 2.5rem;
        --f-h2: 1.75rem;
    }

    .card {
        padding: var(--s-6);
        box-shadow: none;
        border: none;
    }

    .code-char {
        width: 36px;
        height: 48px;
        font-size: 1.25rem;
    }
}