@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Space+Grotesk:wght@600;700&display=swap');

:root {
    --bg-main: #f5f7fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #5b6475;
    --line: #d7deea;
    --accent: #0f766e;
    --accent-soft: #d7f3ef;
    --shadow-soft: 0 14px 32px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 20px;
    color: var(--ink);
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at 8% 0%, #d6f4ff 0%, transparent 26%),
        radial-gradient(circle at 92% 100%, #d9fce8 0%, transparent 30%),
        linear-gradient(165deg, #eff3fb 0%, #f6fbff 48%, #f6f4ff 100%);
}

.container {
    margin: 0 auto;
}

header {
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

header p {
    margin: 10px 0 0;
    color: var(--muted);
}

.device-mode {
    display: inline-block;
    margin-top: 12px;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    background: var(--accent-soft);
    color: #065f55;
}

.network-status {
    display: inline-block;
    margin-top: 12px;
    margin-left: 8px;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
}

.network-status.is-offline {
    background: #fee2e2;
    color: #991b1b;
}

.ios-install-hint {
    margin-top: 10px;
    max-width: 420px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.35;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #dbe7f5;
}

#mobileInstallHint {
    margin-top: 8px;
}

.install-app-btn {
    margin-top: 12px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #f0fdfa;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.28);
    cursor: pointer;
}

.install-app-btn:hover {
    filter: brightness(1.05);
}

.launch-splash {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 18% 10%, #ccfbf1 0%, transparent 38%),
        radial-gradient(circle at 85% 12%, #dbeafe 0%, transparent 32%),
        linear-gradient(165deg, #ecfeff 0%, #f8fafc 100%);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.launch-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-card {
    width: min(320px, 94vw);
    border-radius: 24px;
    padding: 24px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d6e4ef;
    box-shadow: 0 16px 40px rgba(2, 132, 199, 0.15);
    animation: splash-pop 0.45s ease;
}

.splash-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
}

.splash-title {
    margin: 14px 0 2px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.splash-subtitle {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
}

@keyframes splash-pop {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.qr-buttons {
    display: grid;
    gap: 14px;
}

.qr-btn {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    text-align: left;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.qr-btn:hover {
    transform: translateY(-2px);
}

.qr-btn:active {
    transform: translateY(0);
}

.qr-btn:focus-visible,
.close:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 2px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding: 50px 16px 16px;
    overflow: auto;
    background-color: rgba(9, 14, 26, 0.85);
}

.modal-content {
    margin: auto;
    display: block;
    width: 100%;
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    background: #fff;
}

#caption {
    margin: 14px auto 0;
    width: fit-content;
    color: #ecfeff;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.close {
    position: absolute;
    top: 8px;
    right: 16px;
    color: #f8fafc;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #cbd5e1;
}

body.is-mobile {
    padding: 0;
    background:
        radial-gradient(circle at 10% 5%, #ccfbf1 0%, transparent 36%),
        radial-gradient(circle at 100% 0%, #cffafe 0%, transparent 36%),
        linear-gradient(180deg, #ecfeff 0%, #f8fafc 52%, #f1f5f9 100%);
}

body.is-mobile .container {
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 8px 12px 20px;
    padding-top: calc(8px + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.68);
    border-radius: 28px 28px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.55), 0 20px 40px rgba(15, 23, 42, 0.08);
}

body.is-mobile header {
    text-align: left;
    position: sticky;
    top: 0;
    top: env(safe-area-inset-top);
    z-index: 20;
    margin: -8px -12px 14px;
    padding: 16px 12px 12px;
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.98) 0%, rgba(240, 253, 250, 0.92) 78%, rgba(240, 253, 250, 0.45) 100%);
    border-bottom: 1px solid rgba(186, 230, 253, 0.4);
}

@supports (backdrop-filter: blur(8px)) {
    body.is-mobile header {
        backdrop-filter: blur(8px);
    }
}

body.is-mobile header h1 {
    font-size: 32px;
    line-height: 1.02;
}

body.is-mobile header p {
    font-size: 14px;
    margin-top: 7px;
}

body.is-mobile .network-status,
body.is-mobile .device-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    padding: 6px 12px;
}

body.is-mobile .network-status::before,
body.is-mobile .device-mode::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.75;
}

body.is-mobile .network-status {
    margin-left: 6px;
}

body.is-mobile .install-app-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    letter-spacing: 0.01em;
}

body.is-mobile .ios-install-hint {
    margin-top: 8px;
    font-size: 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
}

body.is-mobile .qr-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 4px;
}

body.is-mobile .qr-btn {
    padding: 15px 14px;
    gap: 12px;
    font-size: 15px;
    font-weight: 800;
    min-height: 74px;
    border-radius: 20px;
    border-color: #c9d8ea;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    opacity: 0;
    transform: translateY(8px);
    animation: mobile-card-in 0.35s ease forwards;
}

body.is-mobile .qr-btn:nth-child(1) { animation-delay: 0.03s; }
body.is-mobile .qr-btn:nth-child(2) { animation-delay: 0.06s; }
body.is-mobile .qr-btn:nth-child(3) { animation-delay: 0.09s; }
body.is-mobile .qr-btn:nth-child(4) { animation-delay: 0.12s; }
body.is-mobile .qr-btn:nth-child(5) { animation-delay: 0.15s; }
body.is-mobile .qr-btn:nth-child(6) { animation-delay: 0.18s; }

body.is-mobile .qr-btn:hover {
    transform: translateY(-1px);
}

body.is-mobile .qr-btn:active {
    transform: scale(0.985);
}

body.is-mobile .qr-btn.is-pressed {
    transform: scale(0.975);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

body.is-mobile .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

body.is-mobile .modal {
    padding-top: 72px;
}

body.is-mobile .modal-content {
    max-width: min(400px, 92vw);
    border-radius: 20px;
}

body.is-mobile #caption {
    font-size: 15px;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(186, 230, 253, 0.3);
    border-radius: 999px;
    padding: 6px 12px;
}

@keyframes mobile-card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.is-desktop {
    padding: 30px;
}

body.is-desktop .container {
    max-width: 1020px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
    padding: 34px;
}

body.is-desktop header {
    text-align: left;
}

body.is-desktop header h1 {
    font-size: 42px;
}

body.is-desktop header p {
    font-size: 17px;
}

body.is-desktop .qr-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

body.is-desktop .qr-btn {
    min-height: 86px;
    padding: 16px 18px;
    gap: 14px;
    font-size: 17px;
    font-weight: 700;
}

body.is-desktop .qr-btn:hover {
    border-color: #95d5cc;
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.16);
}

body.is-desktop .modal-content {
    max-width: 430px;
}

@media (max-width: 860px) {
    body.is-desktop .container {
        max-width: 760px;
        padding: 24px;
    }

    body.is-desktop .qr-buttons {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 430px) and (max-width: 760px) {
    body.is-mobile .container {
        max-width: 520px;
        padding-left: 14px;
        padding-right: 14px;
    }

    body.is-mobile .qr-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    body.is-mobile .qr-btn {
        min-height: 78px;
        font-size: 14px;
        padding: 14px 12px;
    }

    body.is-mobile .btn-icon {
        width: 34px;
        height: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .launch-splash,
    .splash-card,
    .qr-btn,
    body.is-mobile .qr-btn {
        animation: none !important;
        transition: none !important;
        opacity: 1;
        transform: none;
    }
}

.qr-btn-label {
    flex: 1;
}