:root {
    --bg: #050a08;
    --panel: #0b1511;
    --neon: #00ff9c;
    --neon-soft: rgba(0, 255, 156, 0.25);
    --text: #d6ffe9;
    --muted: #7ddfc1;
    --danger: #ff4d4d;
}

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

    /* 🔥 mobile UX */
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    background: #050a08; /* 🔥 fallback for Android Chrome */
}

body {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        calc(env(safe-area-inset-top) + 1.2rem)
        1.2rem
        calc(env(safe-area-inset-bottom) + 1.2rem);

    background: radial-gradient(circle at top, #0d1f17, #050a08);
    color: var(--text);

    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;

    /* smoother text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================= APP CONTAINER ================= */

.container {
    width: 100%;
    max-width: 420px;

    background: linear-gradient(180deg, #0c1c15, var(--panel));
    border: 1px solid var(--neon-soft);
    border-radius: 16px;

    padding: 2rem;

    box-shadow:
        0 0 25px rgba(0,255,156,0.08),
        inset 0 0 20px rgba(0,255,156,0.03);

    backdrop-filter: blur(8px);
}

/* ================= TYPOGRAPHY ================= */

h1 {
    text-align: center;
    color: var(--neon);
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.8rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ================= INPUT ================= */

input {
    width: 100%;
    padding: 0.8rem 1rem;

    background: #040907;
    border: 1px solid var(--neon-soft);
    border-radius: 10px;

    color: var(--text);
    font-size: 0.95rem;

    margin-bottom: 1.2rem;
    outline: none;

    transition: 0.2s ease;
}

input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 10px rgba(0,255,156,0.25);
}

/* ================= BUTTON ================= */

button {
    width: 100%;
    padding: 0.85rem;

    border: none;
    border-radius: 12px;

    background: linear-gradient(135deg, #00ff9c, #00c27a);
    color: #012015;

    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;

    transition: 0.12s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(0,255,156,0.4);
}

button:active {
    transform: scale(0.96);
}

.button-link,
.room-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00ff9c, #00c27a);
    color: #012015;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: 0.12s ease;
}

.room-actions button:hover,
.button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(0,255,156,0.4);
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.room-card {
    border: 1px solid rgba(0,255,156,0.12);
    border-radius: 18px;
    padding: 1.3rem;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.18);
}

.room-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.room-summary h2 {
    margin: 0;
    font-size: 1.1rem;
}

.room-code {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.room-badge {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(0,255,156,0.1);
    color: var(--neon);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ================= LINKS ================= */

.link {
    text-align: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
}

.link a {
    color: var(--neon);
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

/* ================= SELECTION ================= */

::selection {
    background: rgba(0,255,156,0.25);
    color: #fff;
}

/* ================= SCROLLBAR ================= */

/* Chrome / Edge */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,255,156,0.25);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,255,156,0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,156,0.3) transparent;
}

/* ================= MOBILE ================= */

@media (max-width: 420px) {
    .container {
        padding: 1.5rem;
    }
}

/* ================= TABLET / DESKTOP IMPROVEMENTS ================= */
@media (min-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: calc(env(safe-area-inset-top) + 2.4rem);
    }

    .container {
        max-width: 720px;
        padding: 2.5rem;
        border-radius: 14px;
    }

    h1 {
        font-size: 1.9rem;
        margin-bottom: 0.6rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    /* Make primary buttons nicer on wider screens */
    button {
        width: auto;
        display: inline-block;
        padding: 0.9rem 1.3rem;
    }

    /* Override inline stacked CTA containers on larger screens to show side-by-side */
    .container > div[style*="flex-direction: column"] {
        display: flex !important;
        flex-direction: row !important;
        gap: 1rem !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Make feature lists easier to scan in two columns */
    .container ul {
        column-count: 2;
        column-gap: 1.2rem;
    }

    .link {
        text-align: center;
    }

    .hero__device {
        display: none;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 900px;
        padding: 3rem;
        box-shadow: 0 10px 40px rgba(0,255,156,0.06), inset 0 0 30px rgba(0,255,156,0.02);
    }

    h1 {
        font-size: 2.3rem;
    }

    /* Slightly larger readable text */
    body, input, button, .subtitle, label {
        font-size: 1rem;
    }

    /* Improve how "How it Works" and features lay out on wide screens */
    .container ol, .container ul {
        max-width: 820px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Keep buttons visually grouped but not full width */
    .container button {
        font-size: 1.02rem;
    }
}

/* ================= HERO SPLIT LAYOUT ================= */
.hero.split {
    margin-top: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    align-items: stretch;
}

.hero__info,
.hero__device {
    flex: 1 1 50%;
}

.hero__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
}

.hero__device {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .hero.split {
        flex-direction: column !important;
        gap: 1.2rem;
    }

    .hero__info,
    .hero__device {
        flex: unset !important;
        width: 100% !important;
    }

    .hero:not(.auth-page) .hero__device {
        display: none !important;
    }

    .auth-page .hero__info {
        display: none !important;
    }
}

@media all and (display-mode: standalone) and (max-width: 768px) {
    .hero__device {
        display: none !important;
    }
}

.hero__device .form-panel {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(180deg, #0c1c15, rgba(11, 21, 17, 0.95));
    border: 1px solid rgba(0,255,156,0.12);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.device-mock {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(180deg, #07110b, #03100a);
    border-radius: 28px;
    padding: 14px;
    border: 1px solid rgba(0,255,156,0.06);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6), 0 6px 18px rgba(0,255,156,0.03) inset;
}

.device-mock .screen {
    width: 100%;
    min-height: 520px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #07110b, #020903);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 1.4rem;
}
.device-mock .screen .auth-container {
    width: 100%;
    margin: 0;
}

.device-mock img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .hero.split {
        flex-direction: row;
        gap: 2rem;
        align-items: center;
    }

    .hero__info {
        padding-right: 1rem;
        align-items: center;
        text-align: center;
    }

    .cta-group button {
        width: auto;
    }
}

/* Specific adjustments to make the left column act like a centered single column */
.hero__info .features ul,
.hero__info .how ol {
    margin-left: 0;
    padding-left: 0;
    list-style-position: inside;
    max-width: 640px;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    column-count: 1 !important; /* ensure single column here */
    column-gap: 0;
    padding: 0.2rem 0.4rem;
}

.hero__info .features ul li,
.hero__info .how ol li {
    text-align: left; /* keep list items readable */
    margin: 0.5rem 0;
}

.hero__info h1,
.hero__info .subtitle,
.hero__info h2 {
    width: 100%;
    max-width: 720px;
}

@media (min-width: 1200px) {
    .device-mock {
        max-width: 420px;
    }
}