/* ETA Race (Video) — "Maps ETA vs You" duel card.
   Design space is a fixed 1440×760 stage scaled down to fit the preview
   column. With a background video loaded, the preview becomes a 9:16 reel
   with the card composited on the bottom third (80% width) — the same
   layout the server renderer produces. */

@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-Bold.otf'); font-weight: 700; }
@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-ExtraBold.otf'); font-weight: 800; }
@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-Black.otf'); font-weight: 900; }
@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-BoldSlanted.otf'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-ExtraBoldSlanted.otf'); font-weight: 800; font-style: italic; }
@font-face { font-family: 'JTMillburn'; src: url('/static/influencer/assets/JTMillburn-BlackSlanted.otf'); font-weight: 900; font-style: italic; }

.eta-race-preview {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
}

.eta-race-preview.hidden {
    display: none;
}

.eta-download-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.eta-download-note {
    color: #8e95a3;
    font-size: 0.78rem;
    margin: 0;
}

/* Composite wrapper: bare card by default, 9:16 reel when a video is set */
.eta-composite {
    position: relative;
    width: 100%;
    max-width: 760px;
    aspect-ratio: 1440 / 760;
    background: #0a0a0f;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.eta-composite.has-video {
    max-width: 420px;
    aspect-ratio: 9 / 16;
    background: #000;
}

.eta-bg-video {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eta-composite.has-video .eta-bg-video {
    display: block;
}

/* Outer frame keeps layout size; inner stage is fixed-size and scaled */
.eta-frame {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #0a0a0f;
}

.eta-composite.has-video .eta-frame {
    /* bottom third of the reel: 80% width, centered, proportional height */
    inset: auto;
    left: 10%;
    width: 80%;
    aspect-ratio: 1440 / 760;
    bottom: 3%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.09);
}

.eta-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 1440px;
    height: 760px;
    transform-origin: top left;
    font-family: 'JTMillburn', 'SF Pro Expanded', -apple-system, sans-serif;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 85% 110%, rgba(77, 184, 184, 0.10), transparent 60%),
        radial-gradient(100% 80% at 10% -10%, rgba(59, 130, 246, 0.07), transparent 55%),
        #0a0a0f;
}

/* shake lives on an inner box so it never fights the stage's scale() */
.eta-shakebox {
    position: absolute;
    inset: 0;
}

.eta-shakebox.eta-shake {
    animation: eta-shake 0.28s linear;
}

@keyframes eta-shake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-7px, 4px); }
    45% { transform: translate(6px, -5px); }
    70% { transform: translate(-4px, 2px); }
}

/* --- animated background streaks --- */

.eta-streaks {
    position: absolute;
    inset: 0;
    opacity: 0.25;
}

.eta-streak {
    position: absolute;
    height: 3px;
    width: 420px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, rgba(77, 184, 184, 0.5), transparent);
    animation: eta-streak-move linear infinite;
}

@keyframes eta-streak-move {
    from { transform: translateX(1560px); }
    to   { transform: translateX(-560px); }
}

/* --- header: big centered logo, punch-in entrance --- */

.eta-context {
    position: absolute;
    z-index: 5;
    top: 60px;
    left: 60px;
    right: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.eta-context-logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 4px 24px rgba(77, 184, 184, 0.25));
    opacity: 0;
}

.eta-context-arrival {
    font-size: 60px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.22em;
    color: #ffffff;
    text-shadow: 0 0 30px rgba(77, 184, 184, 0.35);
    opacity: 0;
}

.eta-context-logo.eta-punch,
.eta-context-arrival.eta-punch {
    animation: eta-punch 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes eta-punch {
    0%   { opacity: 0; transform: scale(2.6); }
    55%  { opacity: 1; transform: scale(0.92); }
    75%  { transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- the duel --- */

.eta-duel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.eta-card {
    flex: 1;
    padding-top: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    text-align: center;
    position: relative;
}

.eta-card-maps {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.18), rgba(56, 20, 22, 0.60));
    box-shadow: inset 0 0 120px rgba(239, 68, 68, 0.08);
    opacity: 0;
}

/* symmetric center seam, independent of either card */
.eta-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.14);
    z-index: 6;
    pointer-events: none;
}

.eta-card-maps.eta-in {
    animation: eta-slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes eta-slam {
    0% { opacity: 0; transform: translateX(-160px); }
    100% { opacity: 1; transform: translateX(0); }
}

.eta-card-you {
    opacity: 0;
}

.eta-card-you.eta-in {
    animation: eta-rise 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) forwards;
}

@keyframes eta-rise {
    0% { opacity: 0; transform: translateX(160px); }
    100% { opacity: 1; transform: translateX(0); }
}

.eta-card-title {
    font-size: 76px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.12em;
}

.eta-card-maps .eta-card-title { color: #f4a6a6; }


.eta-card-time {
    font-size: 196px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.eta-card-maps .eta-card-time { color: #f0d9d9; }
.eta-card-you .eta-card-time { color: #ffffff; }

/* small AM/PM suffix so the time reads as a clock, not a stopwatch */
.eta-ampm {
    font-size: 0.38em;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-left: 0.14em;
    opacity: 0.75;
}

.eta-card-time.eta-tick {
    animation: eta-tick-pop 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes eta-tick-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* white flash on the flip beat */
.eta-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 40;
}

.eta-flash.eta-go {
    animation: eta-flash-anim 0.32s ease-out;
}

@keyframes eta-flash-anim {
    0% { opacity: 0; }
    18% { opacity: 0.55; }
    100% { opacity: 0; }
}

/* --- finale overlay --- */

.eta-finale {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    background: rgba(10, 10, 15, 0.88);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.eta-finale.eta-show {
    opacity: 1;
}

.eta-finale-saved {
    font-size: 58px;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.3em;
    color: #dfe4ec;
}

.eta-finale-big {
    font-size: 300px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.01em;
    line-height: 1;
    color: #4ade80;
    text-shadow: 0 0 70px rgba(34, 197, 94, 0.4);
    font-variant-numeric: tabular-nums;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.3s;
}

.eta-finale.eta-show .eta-finale-big {
    transform: scale(1);
    opacity: 1;
}
