.game-card--endless { border-color:#a7b85f;border-left:3px solid #e1c878;background:linear-gradient(125deg,#353628,#251a32 70%); }
.game-card--endless .primary-button { background:#f0d18a;box-shadow:inset 0 1px 0 #fff8,0 3px 0 #8e7139; }
.marathon-emblem { width:46px;height:46px;flex:none;background:#e1c87818;border:1px solid #e1c87850;border-radius:15px;padding:5px; }
.marathon-emblem svg { width:100%;height:100%;fill:none;stroke:#f0d18a;stroke-width:2.7;stroke-linecap:round;stroke-linejoin:round; }
.mode-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); }.mode-tabs button { padding-inline:3px;font-size:12px; }
.endless-lobby { max-width:700px; }.endless-intro { position:relative;border:1px solid #a7976460;background:linear-gradient(90deg,#211b2aee,#211b2a90),url('./public/assets/campaign-street-v1.webp') center/cover;border-radius:21px;padding:19px 17px;overflow:hidden; }
.endless-intro h2 { max-width:75%;font-size:34px;margin:8px 0 12px;line-height:1.1; }.endless-intro p { max-width:68%;margin:0;font-size:13px;line-height:1.5;color:#e1d7e8; }.endless-intro>span:last-child { position:absolute;bottom:12px;right:0;width:100px; }
.endless-lobby .modal-kicker { font-size:10px;letter-spacing:.04em;color:#f0d18a; }.endless-lobby-stats { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0; }.endless-lobby-stats>div { padding:15px;border:1px solid #71597b;border-radius:16px;background:#281e34; }.endless-lobby-stats small { display:block;font-size:12px;color:#c7b9d3; }.endless-lobby-stats strong { display:block;font-size:23px;margin-top:6px; }.endless-lobby>.primary-button { width:100%;background:#f0d18a; }.endless-how { list-style:none;counter-reset:steps;padding:0;margin:22px 0; }.endless-how li { counter-increment:steps;position:relative;padding:0 0 16px 39px; }.endless-how li::before { content:counter(steps);position:absolute;left:0;top:0;display:grid;place-items:center;width:27px;height:27px;background:#e1c87818;border:1px solid #a39a6255;color:#f0d18a;border-radius:9px;font-weight:900; }.endless-how strong { display:block;font-size:15px; }.endless-how span { display:block;margin-top:4px;font-size:13px;line-height:1.5;color:#cfc1dc; }.endless-fair { font-size:12px;line-height:1.6;color:#c7b9d3;border-top:1px solid #5f4968;padding-top:16px; }
.endless-play { position:fixed;inset:0;z-index:30;display:flex;flex-direction:column;height:var(--app-height,100dvh);padding:max(8px,env(safe-area-inset-top),var(--tg-content-safe-area-inset-top,0px)) max(12px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom));gap:8px;background:#110b1b;overflow:hidden;touch-action:none;overscroll-behavior:none; }.endless-play>* { width:100%;max-width:700px;margin-inline:auto; }
.endless-toolbar { display:flex;align-items:center;gap:8px;flex:0 0 44px; }.endless-toolbar>span { width:46px;flex:none; }.endless-toolbar>div { flex:1;min-width:0; }.endless-toolbar strong { font-size:20px; }.endless-toolbar small { display:block;font-size:10px;line-height:1.2;color:#c7b9d3; }.endless-toolbar .icon-button { width:44px;height:44px;flex:none; }
.endless-hud { display:flex;align-items:center;gap:15px;flex:0 0 64px;border:1px solid #80715a66;border-radius:16px;background:#2c2532;padding:8px 14px; }.endless-hud small { display:block;font-size:10px;color:#d7c9df; }.endless-hud strong { display:block;font:700 30px/1 var(--font-display);font-variant-numeric:tabular-nums;color:#f0d18a; }.endless-clock { margin-left:auto;text-align:right;font-size:12px;font-weight:800; }.endless-lives { display:flex;gap:2px; }.endless-lives svg { width:22px;height:32px;fill:#b6ee6770;stroke:#c8f988;stroke-width:1.6; }.endless-lives .is-empty { fill:#302637;stroke:#8b788e;opacity:.5; }
.endless-rule { display:flex;align-items:center;gap:10px;border:1px solid #705e7d;border-radius:16px;padding:8px 10px;background:#281b36;flex:0 0 auto;min-height:86px; }.endless-rule>span { width:62px;flex:none; }.endless-rule svg { width:100%;color:#e1c878; }.endless-rule small,.endless-rule strong,.endless-rule div>span { display:block; }.endless-rule small { font-size:10px;color:#edce83; }.endless-rule strong { font-size:15px;line-height:1.3;color:#fff3ff; }.endless-rule div>span { font-size:11px;margin-top:4px;color:#d5c7df; }
.endless-arena { position:relative;flex:1;min-height:120px;background:radial-gradient(ellipse at 50% 90%,#6e3e8830,transparent 70%),#170e24;border:1px solid #6a4a7d;border-radius:22px;background-position:center;background-size:cover;overflow:hidden;isolation:isolate; }.endless-arena[data-mode="burrow"] { background-image:radial-gradient(ellipse at 50% 60%,#382245aa,transparent 70%),linear-gradient(#100b1b,#21122e); }
.endless-mouse { position:absolute;z-index:2;width:var(--mouse-size,110px);height:var(--mouse-size,110px);transform:translate(-50%,-50%);padding:0;border:0;background:none;touch-action:none;border-radius:20px; }.endless-mouse .rig-character { width:100%;height:100%; }.endless-critter { display:block;position:absolute;inset:0; }.endless-critter>.rig-character { transform:scaleX(var(--facing,1)); }.endless-critter>.firefly { position:absolute;inset:25%; }.endless-portal { display:none;position:absolute;bottom:6%;left:8%;width:84%;height:22%;border:2px solid #77508c;border-radius:50%;background:#050309;box-shadow:inset 0 0 12px #000,0 0 19px #b466d83b; }.endless-arena[data-mode="burrow"] .endless-portal { display:block; }.endless-arena[data-mode="burrow"] .endless-critter { clip-path:inset(0 0 8% 0); }.endless-arena[data-mode="burrow"] .endless-mouse::after { content:'';position:absolute;z-index:3;bottom:6%;left:8%;width:84%;height:22%;border:2px solid #9665b3;border-radius:50%;clip-path:inset(50% 0 0);pointer-events:none; }
.endless-puff { position:absolute;inset:18%;z-index:3;border-radius:50%;pointer-events:none;opacity:0; }.is-bad .endless-puff { opacity:.6;background:radial-gradient(#bad86180,transparent 70%); }.is-caught .endless-puff { opacity:.5;background:radial-gradient(#f4d58180,transparent 70%); }.endless-mouse:focus-visible { outline:3px solid #f0d18a;outline-offset:-5px; }
.endless-empty-hole { position:absolute;width:calc(var(--slot-size,110px)*.84);height:calc(var(--slot-size,110px)*.22);transform:translate(-50%,100%);border:2px solid #5a386e;border-radius:50%;background:#08040f;box-shadow:inset 0 0 9px #000,0 0 14px #b466d81a;pointer-events:none; }
.endless-brief,.endless-cue { position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:20px;text-align:center;background:#16101eef;pointer-events:none; }.endless-brief strong { font-size:clamp(19px,5vw,27px);line-height:1.2;max-width:450px; }.endless-brief .modal-kicker { font-size:12px;letter-spacing:.02em;color:#f0d18a; }.endless-brief small,.endless-cue small { font-size:13px;color:#d6c7e0; }.endless-cue>span:not(.sr-only) { width:min(52%,200px); }.endless-cue strong { font-size:19px; }
.endless-window { flex:0 0 4px;border-radius:4px;background:#4b355b;overflow:hidden; }.endless-window>span { display:block;width:100%;height:100%;transform-origin:left;background:#c3ed78; }
.endless-cue[data-mode="change"] { background:transparent;justify-content:flex-start;padding-top:12px;gap:3px; }.endless-cue[data-mode="change"]>strong,.endless-cue[data-mode="change"]>small { background:#180e27eb;border-radius:10px;padding:5px 10px; }.endless-cue[data-mode="change"]>strong { font-size:18px;color:#f0d18a; }.endless-cue[data-mode="change"]>small { font-size:13px; }.endless-mouse:disabled { opacity:1; }
.endless-phase { position:absolute;z-index:5;top:10px;left:10px;right:10px;width:fit-content;max-width:calc(100% - 20px);margin:auto;padding:7px 13px;border:1px solid #d3b66c65;border-radius:12px;background:#170e25ed;text-align:center;pointer-events:none; }.endless-phase strong,.endless-phase span { display:block; }.endless-phase strong { font-size:16px;color:#f0d18a;line-height:1.25; }.endless-phase span { margin-top:2px;font-size:12px;color:#e1d6ec; }.endless-arena[data-phase="mask"] .endless-phase { inset:0;max-width:none;width:100%;border:0;border-radius:0;display:flex;flex-direction:column;justify-content:center;background:#170e25; }.endless-arena[data-phase="mask"] .endless-phase strong { font-size:25px; }.endless-window[data-phase="cue"]>span { background:#e1c878; }
.endless-rule strong { font-size:16px; }.endless-rule div>span { font-size:12px; }.endless-brief small { font-size:16px;line-height:1.4; }.endless-brief strong { font-size:clamp(21px,5vw,28px); }
.endless-catch-marker { position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;pointer-events:none;opacity:0;color:#ddf6ab;font-size:12px;font-weight:800; }.endless-catch-marker svg { width:34px;height:34px;padding:6px;border:1px solid #c2e59480;border-radius:50%;background:#223e29df;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round; }.endless-arena[data-mode="pair"] .is-caught .endless-critter { opacity:0; }.endless-arena[data-mode="pair"] .is-caught .endless-catch-marker { opacity:1; }
.endless-feedback { flex:0 0 auto;min-height:18px;margin-block:0;text-align:center;font-size:12px;line-height:1.35;color:#d5c4e2; }.endless-next { flex:0 0 auto;display:flex;gap:12px;align-items:center;font-size:11px;color:#c7b9d3; }.endless-next>span { white-space:nowrap; }.endless-next>div { height:5px;border-radius:5px;overflow:hidden;background:#44364a;flex:1; }.endless-next i { display:block;width:100%;height:100%;transform-origin:left;background:#f0d18a; }
.endless-pause>.primary-button,.endless-pause>.text-button,.endless-result>button:not(.modal-close) { width:100%;margin-top:12px; }.endless-result { text-align:center;padding:20px; }.endless-result .result-cat { width:85px;margin:0 auto; }.endless-result h2 { font-size:30px;margin-block:8px; }.endless-result-score { margin:14px 0;color:#c7b9d3;font-size:15px; }.endless-result-score strong { display:block;font:700 56px/1 var(--font-display);color:#f0d18a; }.endless-result .result-stats { grid-template-columns:repeat(3,minmax(0,1fr));gap:7px; }.endless-result .result-stats>div { padding:12px 5px; }.endless-result .result-stats small { font-size:10px; }.endless-result .result-stats strong { font-size:21px; }.endless-result-status { font-size:12px;line-height:1.5;color:#d6c8e1;min-height:36px; }.ranking-play { width:100%;margin-bottom:16px; }
@media(max-height:650px) { .endless-play { gap:5px;padding-block:5px; }.endless-hud { flex-basis:51px; }.endless-rule { min-height:70px; }.endless-rule>span { width:49px; }.endless-rule strong { font-size:13px; }.endless-feedback { font-size:11px; }.endless-brief strong { font-size:19px; }.endless-cue { gap:4px; }.endless-cue>span:not(.sr-only) { width:min(40%,140px); }.endless-result { padding:14px 18px; }.endless-result .result-cat { width:55px; }.endless-result h2 { font-size:24px; }.endless-result-score strong { font-size:43px; }.endless-result>button:not(.modal-close) { margin-top:9px; } }
@media(orientation:landscape) and (max-height:500px) { .endless-play { display:grid;grid-template-columns:210px minmax(0,1fr);grid-template-rows:44px 53px 1fr 50px;gap:6px; }.endless-toolbar { grid-column:1;grid-row:1; }.endless-toolbar>span { width:31px; }.endless-toolbar strong { font-size:15px; }.endless-toolbar small { font-size:8px; }.endless-hud { grid-column:1;grid-row:2;padding:4px 8px;gap:7px; }.endless-hud strong { font-size:24px; }.endless-rule { grid-column:1;grid-row:3;align-self:start;min-height:0; }.endless-rule>span { width:40px; }.endless-arena { grid-column:2;grid-row:1/4;min-height:0; }.endless-window { grid-column:2;grid-row:3;align-self:end;z-index:9;margin-bottom:5px;width:90%; }.endless-feedback { grid-column:1/3;grid-row:4;font-size:12px;align-self:center; }.endless-next { display:none; }.endless-result { max-height:95vh;overflow:auto; }.endless-cue>span:not(.sr-only) { width:130px; } }
@media(prefers-reduced-motion:reduce) { .endless-play * { animation:none!important;transition:none!important; } }
@media(max-height:650px) { .endless-rule strong { font-size:15px; }.endless-brief strong { font-size:21px; }.endless-phase { top:6px;padding:5px 10px; }.endless-phase strong { font-size:15px; } }

/* Confirm scene changes before any live target; the CTA stays in view. */
.endless-brief { position:fixed;inset:0;z-index:40;max-width:none;width:auto;margin:0;padding:16px;background:#100a1bee;pointer-events:auto; }
.endless-play:has(.endless-brief:not([hidden])) { touch-action:pan-y; }
.endless-brief-card { width:min(100%,430px);max-height:calc(var(--app-height,100dvh) - 32px);min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:14px;padding:20px;border:1px solid #9677a4;border-radius:24px;background:linear-gradient(150deg,#34223e,#1d1429);box-shadow:0 16px 70px #0008; }
.endless-brief-body { min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;text-align:left; }
.endless-brief-body .modal-kicker { display:block;margin:0 0 8px;font-size:12px; }
.endless-brief h2 { margin:0 0 13px;font-size:27px;line-height:1.15; }
.endless-brief #endlessBriefRule { display:block;max-width:none;font-size:20px;line-height:1.35; }
.endless-brief-body p { margin:14px 0 10px;font-size:16px;line-height:1.45;color:#f1e7f6; }
.endless-brief-body>small { display:block;font-size:14px;line-height:1.4;color:#dbcbdf; }
.endless-brief-card>.primary-button { width:100%;min-height:54px;margin:0;font-size:16px;background:#f0d18a;box-shadow:inset 0 1px 0 #fff8,0 3px 0 #8e7139; }
.endless-brief-examples { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px; }
.endless-brief-examples>div { padding:8px 6px;border:1px solid #a7b67a;border-radius:16px;background:#32422b75;text-align:center; }
.endless-brief-examples>div[data-decision="release"] { border-color:#a88bbb;background:#46315475; }
.endless-brief-examples>div>span:first-child { display:block;width:90px;height:90px;margin:auto; }
.endless-brief-examples>div>span:last-child { display:block;font-size:14px;font-weight:900;line-height:1.3; }
@media(max-width:350px) { .endless-brief { padding:10px; }.endless-brief-card { padding:16px;max-height:calc(var(--app-height,100dvh) - 20px);gap:12px; }.endless-brief h2 { font-size:24px; }.endless-brief #endlessBriefRule { font-size:18px; }.endless-brief-examples>div>span:first-child { width:74px;height:74px; }.endless-brief-examples>div>span:last-child { font-size:13px; } }
@media(orientation:landscape) and (max-height:500px) { .endless-brief-card { width:min(100%,660px);padding:14px;gap:10px; }.endless-brief-body { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:18px;align-items:start; }.endless-brief-body>.modal-kicker,.endless-brief h2 { grid-column:1; }.endless-brief h2 { font-size:24px;margin-bottom:8px; }.endless-brief #endlessBriefRule { grid-column:1;font-size:18px; }.endless-brief-body p { grid-column:1;font-size:14px;margin:8px 0; }.endless-brief-body>small { grid-column:1;font-size:12px; }.endless-brief-examples { grid-column:2;grid-row:1/6;margin:0; }.endless-brief-examples>div>span:first-child { width:100px;height:100px; }.endless-brief-card>.primary-button { min-height:44px; }.endless-brief-body:not(:has(.endless-brief-examples:not([hidden]))) { display:block; } }
