:root {
    --bg-base: #07060f;
    --bg-surface: rgba(14, 11, 26, 0.85);
    --bg-card: rgba(20, 16, 38, 0.75);
    --bg-card-hover: rgba(28, 22, 53, 0.95);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.45);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --purple: #8b5cf6;
    --cyan: #06b6d4;
    --emerald: #10b981;
    --amber: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

.bg-orb-1 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, #6366f1 0%, rgba(99, 102, 241, 0) 70%);
    top: -200px;
    right: 15%;
}

.bg-orb-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #8b5cf6 0%, rgba(139, 92, 246, 0) 70%);
    bottom: -150px;
    left: 10%;
}

.grid-mesh-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 80%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.brand-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--emerald);
    font-size: 11px;
    font-weight: 700;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
    animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link-studio {
    color: #c7d2fe;
}

.header-user-slot {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-discord-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-discord-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: 14px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.btn-logout {
    color: #f87171;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    margin-right: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-nav-studio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    transition: transform 0.15s;
}

.btn-nav-studio:hover {
    transform: translateY(-1px);
}

.main-content {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.hero-section {
    text-align: center;
    padding: 20px 16px 70px;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
}

.hero-tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
}

.hero-title {
    font-size: clamp(20px, 3.8vw, 44px);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
    color: #ffffff;
    white-space: nowrap;
}

.hero-highlight {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 40%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.quick-join-container {
    max-width: 540px;
    margin: 0 auto 32px;
}

.quick-join-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 14, 34, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    padding: 8px 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 24px rgba(99, 102, 241, 0.18);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-join-box:focus-within {
    border-color: #818cf8;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 32px rgba(99, 102, 241, 0.35);
}

.quick-join-box.has-error {
    border-color: #ef4444;
    box-shadow: 0 12px 36px rgba(239, 68, 68, 0.25), 0 0 24px rgba(239, 68, 68, 0.25);
    animation: quickJoinShake 0.35s ease-in-out;
}

@keyframes quickJoinShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.quick-join-error {
    margin-top: 12px;
    padding: 10px 18px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    backdrop-filter: blur(10px);
}

.input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    color: var(--text-muted);
}

.input-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

.input-wrap input::placeholder {
    color: #64748b;
}

.btn-join-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    padding: 13px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-join-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.6);
}

.hero-cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #ffffff;
    padding: 13px 26px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.2);
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

.features-section {
    padding: 50px 0 20px;
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 36px;
}

.section-title {
    font-size: clamp(24px, 3.5vw, 34px);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.features-bento {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.bento-card {
    background: rgba(18, 15, 34, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    backdrop-filter: blur(14px);
    transition: transform 0.2s, border-color 0.2s;
}

.bento-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.35);
}

.bento-card.highlight {
    background: linear-gradient(135deg, rgba(30, 24, 58, 0.8) 0%, rgba(18, 15, 34, 0.65) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

.bento-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.bento-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.bento-icon.icon-realtime {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.bento-icon.icon-discord {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

.bento-icon.icon-mobile {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.bento-icon.icon-studio {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.3);
    color: #f472b6;
}

.bento-card h3 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
}

.bento-card p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.site-footer {
    border-top: 1px solid var(--border-subtle);
    background: #06050d;
    padding: 40px 24px 30px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.footer-brand-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
}

.footer-brand-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copy {
    max-width: 1200px;
    margin: 20px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hero-title {
        font-size: 20px;
        white-space: normal;
    }

    .quick-join-box {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-join-submit {
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}
