:root {
    --fonbet-red: #ED1C24;
    --fonbet-red-hi: #FF3E45;
    --fonbet-red-lo: #B80C12;
    --bg: #0A0A0A;
    --surface: #131313;
    --surface-hi: #1B1B1B;
    --border: rgba(255, 255, 255, 0.06);
    --text: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.62);
    --text-faint: rgba(255, 255, 255, 0.38);
    --gold-hi: #FFE999;
    --radius: 16px;
    --radius-lg: 22px;
}

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

html {
    background: var(--bg);
    min-height: 100%;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* atmospheric background */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 55% at 50% -10%, rgba(237, 28, 36, 0.35) 0%, rgba(237, 28, 36, 0.08) 40%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(237, 28, 36, 0.18) 0%, transparent 60%);
}

#app {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 20px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* hero */
.hero {
    text-align: center;
    padding-top: 4px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.brand-badge {
    width: 38px;
    height: 38px;
    background: var(--fonbet-red);
    border-radius: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 18px -4px rgba(237, 28, 36, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    letter-spacing: -0.04em;
}

.brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.hero-sub {
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 500;
}

/* stage layout */
.stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
}

/* prize card */
.prize {
    position: relative;
    background:
        linear-gradient(135deg, var(--fonbet-red) 0%, var(--fonbet-red-lo) 100%);
    border-radius: var(--radius-lg);
    padding: 30px 20px 28px;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 20px 48px -16px rgba(237, 28, 36, 0.55),
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.prize::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 40%),
        radial-gradient(circle at 10% 110%, rgba(255, 220, 130, 0.22) 0%, transparent 55%);
    pointer-events: none;
    z-index: -1;
}

.prize::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -100%;
    width: 80%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: sweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.prize-spark {
    position: absolute;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    pointer-events: none;
    animation: twinkle 2.6s ease-in-out infinite;
}
.spark-1 { top: 14px; right: 20px; font-size: 18px; animation-delay: 0s; }
.spark-2 { top: 24px; left: 22px; font-size: 12px; animation-delay: 0.8s; }
.spark-3 { bottom: 40px; right: 30px; font-size: 16px; animation-delay: 1.5s; }

.prize-kicker {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}

.prize-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    line-height: 1;
}

.prize-number {
    font-size: 60px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--gold-hi) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(255, 233, 153, 0.3));
}

.prize-unit {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    margin-left: 2px;
}

.prize-caption {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

/* steps */
.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, background 0.2s;
}

.step:hover {
    border-color: rgba(237, 28, 36, 0.3);
    background: var(--surface-hi);
}

.step-num {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fonbet-red) 0%, var(--fonbet-red-lo) 100%);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px -2px rgba(237, 28, 36, 0.5);
}

.step-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.step-desc {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

/* CTA */
.cta {
    margin-top: 4px;
    border: none;
    background: linear-gradient(135deg, var(--fonbet-red-hi) 0%, var(--fonbet-red) 50%, var(--fonbet-red-lo) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding: 18px 28px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 10px 28px -10px rgba(237, 28, 36, 0.8),
        0 2px 6px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.12s ease-out, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shimmer 2.8s ease-in-out infinite;
    z-index: -1;
}

.cta:active {
    transform: translateY(1px) scale(0.99);
    box-shadow:
        0 6px 16px -8px rgba(237, 28, 36, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.cta-arrow {
    font-size: 20px;
    font-weight: 700;
    transition: transform 0.2s ease-out;
}

.cta:not(:disabled):hover .cta-arrow {
    transform: translateX(4px);
}

/* warn (shown if opened outside Telegram) */
.warn {
    color: var(--fonbet-red-hi);
    text-align: center;
    font-weight: 600;
    padding: 16px;
    background: rgba(237, 28, 36, 0.08);
    border: 1px solid rgba(237, 28, 36, 0.25);
    border-radius: var(--radius);
}

/* footer */
.foot {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-faint);
    font-size: 11px;
    line-height: 1.45;
}

.age {
    flex: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 800;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}

.foot-text {
    padding-top: 2px;
}

/* animations */
@keyframes twinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1.15); }
}

@keyframes sweep {
    0%, 100% { transform: translateX(-100%) skewX(-20deg); }
    50%      { transform: translateX(260%)  skewX(-20deg); }
}

@keyframes shimmer {
    0%   { left: -120%; }
    60%  { left: 140%; }
    100% { left: 140%; }
}

/* small screens */
@media (max-width: 360px) {
    .prize-number { font-size: 50px; }
    .prize-unit   { font-size: 32px; }
    .hero-title   { font-size: 26px; }
    #app { padding-left: 16px; padding-right: 16px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .prize::after, .prize-spark, .cta::before { animation: none !important; }
}
