:root {
    /* Light, lightly-tinted neutrals (hue ~60, low saturation) */
    --bg: #fafaf7;
    --surface: #ffffff;
    --ink: #141414;
    --ink-soft: #5b5b55;
    --ink-faint: #9a9a92;
    --hairline: #e7e7e0;
    /* Single Telegram-blue accent, used sparingly */
    --accent: #229ed9;
    --accent-ink: #ffffff;
    --accent-soft: #e8f5fc;
    --ok: #1f9d57;

    --radius: 18px;
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* Faint grid wash for depth without clutter */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--hairline) 1px, transparent 1px),
        linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 80%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* ===== FLOATING BACKGROUND DOTS ===== */
.bg-dots {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.dot {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.08;
    animation: floatDot 14s var(--ease-out-quart) infinite;
}

.d1 { width: 14px; height: 14px; top: 18%; left: 14%; animation-delay: 0s; }
.d2 { width: 8px;  height: 8px;  top: 28%; left: 82%; animation-delay: 2s; }
.d3 { width: 20px; height: 20px; top: 70%; left: 20%; animation-delay: 4s; opacity: 0.06; }
.d4 { width: 10px; height: 10px; top: 64%; left: 78%; animation-delay: 1s; }
.d5 { width: 6px;  height: 6px;  top: 12%; left: 50%; animation-delay: 3s; }
.d6 { width: 12px; height: 12px; top: 80%; left: 56%; animation-delay: 5s; opacity: 0.07; }

@keyframes floatDot {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-24px) translateX(12px); }
}

/* hidden attribute must always collapse the element */
[hidden] {
    display: none !important;
}

/* ===== ACCESS DENIED ===== */
.denied {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
}

.denied-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 40px rgba(20, 20, 20, 0.06);
}

.denied-badge {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #d8472b;
    background: #fdecec;
    box-shadow: 0 0 0 8px #fef5f4;
}

.denied-title {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.denied-text {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 32ch;
}

.denied-text strong {
    color: var(--ink);
    font-weight: 600;
}

.denied-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #1f9d57;
    background: #eaf7ef;
    border-radius: 999px;
}

/* ===== STAGE ===== */
.stage {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 640px;
    padding: 32px 24px calc(32px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 56px;
}

.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 100%;
}

/* Eyebrow label */
.eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--surface);
}

.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Bold display title */
.title {
    font-size: clamp(3.5rem, 14vw, 7.5rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.title-dot {
    color: var(--accent);
}

.subtitle {
    font-size: clamp(1rem, 2.4vw, 1.18rem);
    font-weight: 400;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 30ch;
    text-wrap: balance;
}

/* ===== ACTION / CTA ===== */
.action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 26px;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out-quart),
                box-shadow 0.25s var(--ease-out-quart),
                background 0.25s var(--ease-out-quart);
    box-shadow: 0 8px 22px rgba(34, 158, 217, 0.22);
}

.cta-icon {
    flex-shrink: 0;
    transform: translateY(-1px);
}

/* Locked state: no pointer, slightly muted */
.cta.is-locked {
    background: var(--ink);
    box-shadow: 0 8px 22px rgba(20, 20, 20, 0.14);
    cursor: progress;
    pointer-events: none;
}

/* Circular countdown */
.cta-timer {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.ring {
    position: absolute;
    inset: 0;
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}

.ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 3;
}

.ring-progress {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 119.38;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.count {
    position: relative;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

/* Unlocked state */
.cta.is-ready {
    background: var(--accent);
    box-shadow: 0 10px 28px rgba(34, 158, 217, 0.34);
    cursor: pointer;
    pointer-events: auto;
    animation: ctaPulse 2.4s var(--ease-out-quart) infinite;
}

.cta.is-ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(34, 158, 217, 0.42);
}

.cta.is-ready:active {
    transform: translateY(0);
}

@keyframes ctaPulse {
    0%, 100% { box-shadow: 0 10px 28px rgba(34, 158, 217, 0.30); }
    50% { box-shadow: 0 10px 36px rgba(34, 158, 217, 0.50); }
}

/* Ready check badge replaces the timer */
.cta.is-ready .cta-timer {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.cta.is-ready .ring,
.cta.is-ready .count { display: none; }

.cta-check {
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.hint {
    font-size: 0.82rem;
    color: var(--ink-faint);
    letter-spacing: 0.01em;
    transition: color 0.3s var(--ease-out-quart);
}

.hint.is-ready {
    color: var(--ok);
    font-weight: 500;
}

/* ===== FOOTER ===== */
.foot {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.01em;
}

.foot-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(31, 157, 87, 0.14);
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal 0.7s var(--ease-out-expo) forwards;
    animation-delay: var(--delay, 0ms);
}

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 560px) {
    .stage {
        gap: 44px;
        padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    }

    .hero { gap: 18px; }

    .subtitle { max-width: 26ch; }

    .cta {
        font-size: 1rem;
        padding: 13px 14px 13px 22px;
    }
}

@media (max-width: 360px) {
    .eyebrow { font-size: 0.7rem; padding: 6px 13px; }
    .cta { font-size: 0.94rem; }
}

/* Landscape phones */
@media (max-height: 520px) and (orientation: landscape) {
    .stage { gap: 22px; padding-top: 20px; padding-bottom: 20px; }
    .hero { gap: 12px; }
    .title { font-size: clamp(2.6rem, 11vw, 4rem); }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; opacity: 1; transform: none; }
    .dot { animation: none; }
    .cta.is-ready { animation: none; }
    .ring-progress { transition: none; }
}