/* assets/css/race.css
   Loaded only on /race/*.php pages.
   Namespaced under .race-page to avoid touching the main site. */

.race-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.race-hero { padding: 2rem 0 3rem; }
.race-hero__inner { max-width: 820px; }
.race-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.35rem 0.9rem; border-radius: 50px;
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent-gold); border: 1px solid rgba(212, 175, 55, 0.35);
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; margin-bottom: 1.25rem;
}
.race-hero__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.08; margin: 0 0 1rem;
}
.race-hero__sub { color: var(--text-muted, #b8bcc4); font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.75rem; }
.race-ref-banner {
    display: flex; align-items: center; gap: 10px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px; padding: 0.85rem 1.1rem;
    color: var(--text-light, #f5f5f5); font-size: 0.92rem; margin-bottom: 1.5rem;
}
.race-ref-banner i { color: var(--accent-gold); }

/* ── Auth zone ────────────────────────────────────────────── */
.race-auth-zone { margin-top: 0.5rem; }
.race-auth-loading {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text-muted, #b8bcc4); font-size: 0.95rem;
}
.race-auth-login { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.race-auth-hint { color: var(--text-muted, #b8bcc4); font-size: 0.85rem; margin: 0; max-width: 460px; }
.race-auth-continue { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.race-auth-welcome { margin: 0; font-size: 1rem; color: var(--text-light, #f5f5f5); }
.race-auth-error {
    color: #fca5a5; background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35); border-radius: 10px;
    padding: 0.8rem 1rem; font-size: 0.9rem; margin-top: 0.5rem;
}
.btn-race--lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

/* ── How it works ─────────────────────────────────────────── */
.race-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 1.5rem;
}
.race-how { padding: 2rem 0 3rem; border-top: 1px solid var(--border-strong, #26282d); }
.race-how__grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.race-how__card {
    background: var(--bg-elevated, #14161a);
    border: 1px solid var(--border-strong, #26282d);
    border-radius: 16px; padding: 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.race-how__card:hover { transform: translateY(-2px); border-color: rgba(212, 175, 55, 0.4); }
.race-how__card i { font-size: 1.4rem; color: var(--accent-gold); margin-bottom: 0.6rem; display: block; }
.race-how__card h3 { font-size: 1rem; margin: 0 0 0.4rem; }
.race-how__card p { font-size: 0.88rem; color: var(--text-muted, #b8bcc4); margin: 0; line-height: 1.55; }

.race-windows {
    display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem;
}
.race-window {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0.45rem 0.85rem; border-radius: 50px;
    background: var(--bg-elevated, #14161a);
    border: 1px solid var(--border-strong, #26282d);
    font-size: 0.85rem; color: var(--text-light, #f5f5f5);
}
.race-window i { color: var(--accent-gold); }

/* ── Rules ────────────────────────────────────────────────── */
.race-rules { padding: 2rem 0; border-top: 1px solid var(--border-strong, #26282d); }
.race-rules__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.race-rules__list li {
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 0.95rem; color: var(--text-muted, #b8bcc4); line-height: 1.6;
}
.race-rules__list i { color: var(--accent-gold); margin-top: 3px; flex-shrink: 0; }
/* ═══════════════════════════════════════════════════════════════
   AUTH ZONE — clean, state-driven, animated
   ═══════════════════════════════════════════════════════════════ */

.race-auth-zone {
    margin-top: 2.5rem;
    min-height: 260px;            /* keeps layout stable across state swaps */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.race-auth-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    animation: race-auth-fade-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes race-auth-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading state: large animated spinner ───────────────────── */
.race-auth-state--loading {
    gap: 1.5rem;
}

.race-auth-spinner {
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
    height: 56px;
}

.race-auth-spinner span {
    display: block;
    width: 14px;
    border-radius: 7px;
    background: var(--accent-gold, #d4af37);
    animation: race-bounce 1.1s ease-in-out infinite;
}

.race-auth-spinner span:nth-child(1) { height: 28px; animation-delay: 0s; }
.race-auth-spinner span:nth-child(2) { height: 44px; animation-delay: 0.15s; }
.race-auth-spinner span:nth-child(3) { height: 28px; animation-delay: 0.3s; }

@keyframes race-bounce {
    0%, 100% { transform: scaleY(0.6); opacity: 0.55; }
    50%      { transform: scaleY(1);   opacity: 1; }
}

.race-auth-loading-text {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text-muted, #b8bcc4);
}

/* ── Login state: Google button, centered ────────────────────── */
.race-auth-google {
    display: flex;
    justify-content: center;
    transform: scale(1.08);
    transform-origin: center;
}

/* ── Continue state: welcome + big animated button ───────────── */
.race-auth-welcome {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted, #b8bcc4);
    text-align: center;
}

.race-enter-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 1.1rem 2.4rem;
    border-radius: 50px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #07080a;
    background: linear-gradient(135deg, #e6c14a 0%, #d4af37 100%);
    border: 1px solid rgba(212, 175, 55, 0.9);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: race-enter-pulse 2.8s ease-in-out infinite;
}

.race-enter-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.45);
}

.race-enter-btn:active {
    transform: translateY(0) scale(0.99);
}

.race-enter-btn i {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.race-enter-btn:hover i {
    transform: translateX(4px);
}

/* Shine sweep */
.race-enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: race-enter-shine 3.2s ease-in-out infinite;
    pointer-events: none;
}
.race-auth-state[hidden] {
    display: none !important;
}
@keyframes race-enter-shine {
    0%, 55%   { left: -60%; }
    75%, 100% { left: 130%; }
}

@keyframes race-enter-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
    50%      { box-shadow: 0 0 0 12px rgba(212, 175, 55, 0); }
}

/* ── Error state ─────────────────────────────────────────────── */
.race-auth-state--error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.92rem;
    max-width: 460px;
    text-align: center;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .race-auth-state,
    .race-enter-btn,
    .race-enter-btn::before,
    .race-auth-spinner span {
        animation: none !important;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .race-auth-zone { min-height: 220px; margin-top: 1.75rem; }
    .race-enter-btn {
        padding: 1rem 1.8rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }
    .race-auth-google { transform: scale(1); }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .race-page { padding: 1.5rem 1rem 3rem; }
    .race-hero { padding: 1rem 0 2rem; }
    .race-auth-login, .race-auth-continue { width: 100%; }
}