/* LOOP RUNNER ∞ — интерфейс поверх WebGL. Размеры от контейнера (cq-единицы). */
.lr { position: absolute; inset: 0; overflow: hidden; container-type: size; background: #05040c; color: #f2f4f8; font-family: Inter, system-ui, sans-serif; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.lr-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.lr button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.lr kbd { display: inline-block; min-width: 1.6em; padding: .05em .4em; margin: 0 .1em; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); border-bottom-width: 2px; font: 600 .9em 'JetBrains Mono', monospace; text-align: center; background: rgba(255,255,255,.06); }

/* ---------- экраны ---------- */
.lr-scr { position: absolute; inset: 0; z-index: 5; display: grid; place-content: safe center; overflow-y: auto; overscroll-behavior: contain; justify-items: center; gap: clamp(10px, 2.6cqh, 26px); padding: clamp(14px, 4cqmin, 40px); text-align: center;
  background: radial-gradient(70% 70% at 50% 50%, rgba(5,4,12,.25), rgba(5,4,12,.72)); opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s; }
.lr-scr.is-on { opacity: 1; visibility: visible; }
.lr-scr[data-s="title"] { background: linear-gradient(90deg, rgba(5,4,12,.82) 0%, rgba(5,4,12,.35) 55%, rgba(5,4,12,0) 100%); place-content: center start; justify-items: start; text-align: left; padding-left: clamp(18px, 7cqw, 90px); }
.lr-scr h4 { margin: 0; font: 800 clamp(18px, 4.6cqmin, 40px)/1.05 Unbounded, Inter, sans-serif; letter-spacing: -.02em; display: flex; gap: .6em; align-items: center; flex-wrap: wrap; justify-content: center; }

.lr-logo { display: grid; gap: clamp(4px, 1.2cqh, 12px); }
.lr-logo__inf { width: clamp(70px, 16cqmin, 150px); overflow: visible; filter: drop-shadow(0 0 14px rgba(139,92,246,.9)); }
.lr-logo__inf path { fill: none; stroke: url(#lrg); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 72 28; animation: lrInf 2.6s linear infinite; }
@keyframes lrInf { to { stroke-dashoffset: -100; } }
.lr-logo h3 { margin: 0; font: 900 clamp(34px, 11cqmin, 104px)/.86 Unbounded, Inter, sans-serif; letter-spacing: -.045em; text-shadow: 0 0 40px rgba(139,92,246,.45); }
.lr-logo h3 span { background: linear-gradient(100deg, #22e3ff, #8b5cf6 50%, #ff3d8a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 18px rgba(255,61,138,.35)); }
.lr-logo p { margin: 0; font: 600 clamp(10px, 2.2cqmin, 15px) 'JetBrains Mono', monospace; letter-spacing: .16em; text-transform: uppercase; color: #9fe9ff; }
.lr-menu { display: grid; gap: clamp(7px, 1.6cqh, 12px); width: min(100%, 420px); }
.lr-row { display: flex; flex-wrap: wrap; gap: clamp(6px, 1.4cqmin, 10px); justify-content: center; }
.lr-scr[data-s="title"] .lr-row { justify-content: flex-start; }
.lr-row--s { align-items: center; }
.lr-btn { position: relative; padding: clamp(9px, 2.1cqmin, 15px) clamp(14px, 3.4cqmin, 26px); border-radius: 999px; font-weight: 700 !important; font-size: clamp(12px, 2.4cqmin, 16px) !important; border: 1px solid rgba(255,255,255,.2) !important; background: rgba(12,12,28,.6) !important; backdrop-filter: blur(8px); transition: transform .2s, border-color .2s, box-shadow .2s; flex: 1 1 auto; }
.lr-btn:hover, .lr-btn:focus-visible { transform: translateY(-2px); border-color: #22e3ff !important; box-shadow: 0 0 24px -6px #22e3ff; outline: none; }
.lr-btn--main { border: 0 !important; background: linear-gradient(100deg, #22e3ff, #8b5cf6 55%, #ff3d8a) !important; color: #fff; box-shadow: 0 14px 40px -12px rgba(139,92,246,.95), inset 0 1px 0 rgba(255,255,255,.4); font-size: clamp(13px, 2.8cqmin, 18px) !important; padding-block: clamp(11px, 2.6cqmin, 17px) !important; }
.lr-btn--main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat; animation: lrShine 3.2s ease-in-out infinite; }
@keyframes lrShine { 60%, 100% { background-position: 200% 0; } }
.lr-chip { padding: .5em .9em; border-radius: 999px; font: 600 clamp(10px, 2cqmin, 13px) 'JetBrains Mono', monospace !important; border: 1px solid rgba(255,255,255,.18) !important; background: rgba(12,12,28,.55) !important; white-space: nowrap; }
.lr-chip:hover { border-color: #22e3ff !important; }
.lr-chip:disabled { opacity: .45; cursor: not-allowed; }
.lr-chip.is-ok { border-color: #b8ff3c !important; color: #b8ff3c; box-shadow: 0 0 18px -8px #b8ff3c; }
.lr-wallet { display: inline-flex; align-items: center; gap: .4em; font: 700 clamp(12px, 2.4cqmin, 16px) 'JetBrains Mono', monospace; padding: .35em .8em; border-radius: 999px; background: rgba(184,255,60,.1); color: #d9ff9e; }
.lr-wallet svg, .lr-coins svg { width: 1.7em; height: .85em; overflow: visible; }
.lr-wallet svg path, .lr-coins svg path { fill: none; stroke: url(#lrg); stroke-width: 6; stroke-linecap: round; }
.lr-hint { margin: 0; max-width: 46ch; font-size: clamp(10px, 2cqmin, 13px); line-height: 1.7; color: rgba(242,244,248,.7); }

/* секторы */
.lr-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(6px, 1.4cqmin, 12px); width: min(100%, 760px); }
@container (max-aspect-ratio: 1/1) { .lr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lr-lv { grid-template-columns: auto 1fr; align-items: center; column-gap: .6em; padding: 8px 10px !important; } .lr-lv b { grid-row: span 2; } }
.lr-lv { display: grid; gap: .25em; padding: clamp(8px, 1.8cqmin, 14px) !important; border-radius: 16px; text-align: left; border: 1px solid rgba(255,255,255,.14) !important; background: linear-gradient(160deg, rgba(34,227,255,.08), rgba(139,92,246,.1)) !important; transition: transform .2s, border-color .2s; }
.lr-lv:hover:not(:disabled) { transform: translateY(-3px); border-color: #22e3ff !important; }
.lr-lv b { font: 800 clamp(16px, 3.6cqmin, 28px) Unbounded, sans-serif; background: linear-gradient(100deg, #22e3ff, #ff3d8a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lr-lv span { font-size: clamp(10px, 2cqmin, 13px); font-weight: 600; }
.lr-lv i { font-style: normal; font-size: clamp(10px, 2cqmin, 13px); color: #ffd23c; letter-spacing: .1em; }
.lr-lv.is-boss { border-color: rgba(255,61,90,.55) !important; background: linear-gradient(160deg, rgba(255,61,90,.2), rgba(139,92,246,.12)) !important; }
.lr-lv.is-lock { opacity: .4; cursor: not-allowed; }

/* ангар */
.lr-shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 1.4cqmin, 10px); width: min(100%, 760px); max-height: 58cqh; overflow: auto; text-align: left; }
@container (max-aspect-ratio: 1/1) { .lr-shop { grid-template-columns: 1fr; max-height: 62cqh; } }
.lr-up { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7em; padding: clamp(8px, 1.6cqmin, 12px); border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(10,10,26,.66); backdrop-filter: blur(8px); }
.lr-up__ic { width: 2.2em; height: 2.2em; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(140deg, rgba(34,227,255,.25), rgba(255,61,138,.25)); font-size: clamp(14px, 2.6cqmin, 18px); }
.lr-up b { display: block; font-size: clamp(11px, 2.2cqmin, 14px); }
.lr-up small { display: block; font-size: clamp(9px, 1.8cqmin, 11.5px); color: rgba(242,244,248,.6); line-height: 1.35; }
.lr-up i { font-style: normal; font-size: clamp(9px, 1.8cqmin, 11px); color: #22e3ff; letter-spacing: .15em; }

/* результаты */
.lr-res { display: grid; justify-items: center; gap: clamp(8px, 2cqh, 16px); padding: clamp(16px, 4cqmin, 34px); border-radius: 28px; background: rgba(8,8,22,.72); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px -30px rgba(0,0,0,.9), 0 0 80px -40px #8b5cf6; max-width: 640px; animation: lrIn .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes lrIn { from { transform: translateY(20px) scale(.92); opacity: 0; } }
.lr-res__k { font: 600 clamp(9px, 1.9cqmin, 12px) 'JetBrains Mono', monospace; letter-spacing: .2em; text-transform: uppercase; color: #22e3ff; }
.lr-res h4 { font-size: clamp(20px, 5.4cqmin, 42px); }
.lr-res__tip { margin: 0; font-size: clamp(10px, 2cqmin, 13px); color: rgba(242,244,248,.65); }
.lr-stars { display: flex; gap: .2em; font-size: clamp(28px, 7cqmin, 56px); }
.lr-stars i { font-style: normal; color: rgba(255,255,255,.12); transform: scale(0); animation: lrStar .5s cubic-bezier(.34,1.56,.64,1) var(--d) forwards; }
.lr-stars i.is-on { color: #ffd23c; text-shadow: 0 0 24px rgba(255,210,60,.8); }
@keyframes lrStar { to { transform: scale(1); } }
.lr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 1.4cqmin, 12px); margin: 0; }
@container (max-aspect-ratio: 1/1) { .lr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lr-stats div { padding: .6em .9em; border-radius: 14px; background: rgba(255,255,255,.05); }
.lr-stats dt { font: 600 clamp(8px, 1.7cqmin, 11px) 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: rgba(242,244,248,.55); }
.lr-stats dd { margin: 0; font: 800 clamp(14px, 3.2cqmin, 24px) Unbounded, sans-serif; }

/* ---------- HUD ---------- */
.lr-hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; padding: clamp(8px, 2.2cqmin, 20px); font-family: 'JetBrains Mono', monospace; }
.lr-hud[hidden] { display: none; }
.lr-hud__l { position: absolute; left: clamp(8px, 2.2cqmin, 20px); top: clamp(8px, 2.2cqmin, 20px); display: grid; gap: .3em; }
.lr-score b { display: block; font: 800 clamp(18px, 4.6cqmin, 38px)/1 Unbounded, sans-serif; letter-spacing: -.02em; text-shadow: 0 0 20px rgba(34,227,255,.55); }
.lr-score span { font-size: clamp(8px, 1.7cqmin, 11px); letter-spacing: .2em; text-transform: uppercase; color: rgba(242,244,248,.55); }
.lr-combo { justify-self: start; padding: .25em .6em; border-radius: 999px; font-size: clamp(9px, 2cqmin, 13px); font-weight: 700; background: linear-gradient(100deg, #ff3d8a, #8b5cf6); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s cubic-bezier(.34,1.56,.64,1); }
.lr-combo.is-on { opacity: 1; transform: none; }
.lr-hud__c { position: absolute; left: 50%; top: clamp(8px, 2.2cqmin, 20px); transform: translateX(-50%); width: min(42cqw, 360px); display: grid; gap: .4em; justify-items: center; }
@container (max-aspect-ratio: 1/1) { .lr-hud__c { top: auto; bottom: clamp(70px, 16cqh, 120px); width: 60cqw; } }
.lr-lvname { font-size: clamp(9px, 1.9cqmin, 12px); letter-spacing: .14em; text-transform: uppercase; color: #9fe9ff; white-space: nowrap; }
.lr-prog { position: relative; width: 100%; height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.lr-prog i, .lr-prog u { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); }
.lr-prog i { background: linear-gradient(90deg, #22e3ff, #8b5cf6, #ff3d8a); box-shadow: 0 0 12px #8b5cf6; }
.lr-prog u { background: linear-gradient(90deg, #ff3d5a, #ffb347); box-shadow: 0 0 14px #ff3d5a; }
.lr.is-bosslv .lr-prog { height: 10px; }
.lr-hud__r { position: absolute; right: clamp(8px, 2.2cqmin, 20px); top: clamp(8px, 2.2cqmin, 20px); display: grid; justify-items: end; gap: .35em; }
.lr-coins { display: flex; align-items: center; gap: .4em; font: 800 clamp(14px, 3.2cqmin, 24px) Unbounded, sans-serif; }
.lr-lives { display: flex; gap: .15em; font-size: clamp(13px, 2.8cqmin, 20px); }
.lr-lives i { font-style: normal; color: #ff3d8a; text-shadow: 0 0 12px #ff3d8a; }
.lr-lives i.is-off { color: rgba(255,255,255,.15); text-shadow: none; }
.lr-lives i.is-sh { color: #22e3ff; text-shadow: none; font-size: .8em; margin-left: .3em; }
.lr-ico { pointer-events: auto; width: clamp(30px, 6cqmin, 40px); height: clamp(30px, 6cqmin, 40px); border-radius: 50% !important; border: 1px solid rgba(255,255,255,.2) !important; background: rgba(10,10,26,.5) !important; font-size: clamp(10px, 2cqmin, 13px) !important; }
.lr-turbo { position: absolute; left: clamp(8px, 2.2cqmin, 20px); bottom: clamp(8px, 2.2cqmin, 20px); display: grid; gap: .3em; font-size: clamp(8px, 1.7cqmin, 11px); letter-spacing: .2em; color: rgba(242,244,248,.6); }
.lr-turbo i { display: block; width: clamp(90px, 22cqmin, 180px); height: 7px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.lr-turbo b { display: block; height: 100%; transform-origin: left; background: linear-gradient(90deg, #ff3d8a, #ffb347); box-shadow: 0 0 12px #ff3d8a; }
.lr-pads { position: absolute; right: clamp(10px, 2.6cqmin, 22px); bottom: clamp(10px, 2.6cqmin, 22px); display: none; gap: 12px; }
.lr-pad { pointer-events: auto; width: clamp(54px, 13cqmin, 76px); height: clamp(54px, 13cqmin, 76px); border-radius: 50% !important; border: 1px solid rgba(255,255,255,.25) !important; background: rgba(10,10,26,.45) !important; backdrop-filter: blur(6px); font-size: clamp(20px, 5cqmin, 30px) !important; font-weight: 800 !important; touch-action: none; }
.lr-pad--t { border-color: #ff3d8a !important; color: #ffb3d3; box-shadow: 0 0 22px -8px #ff3d8a; }
.lr-pad:active { transform: scale(.92); background: rgba(139,92,246,.4) !important; }
@media (hover: none), (pointer: coarse) { .lr-pads { display: flex; } }

/* обратный отсчёт и всплывашки */
.lr-count { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; font: 900 clamp(60px, 22cqmin, 200px) Unbounded, sans-serif; color: #fff; text-shadow: 0 0 40px #8b5cf6, 0 0 90px #22e3ff; opacity: 0; }
.lr-count.is-on { animation: lrCount .9s ease-out forwards; }
@keyframes lrCount { 0% { opacity: 0; transform: scale(1.8); } 20% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
.lr-fx { position: absolute; left: 0; right: 0; top: 24%; z-index: 4; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.lr-toast { font: 800 clamp(12px, 3cqmin, 22px) Unbounded, sans-serif; letter-spacing: .02em; padding: .35em .9em; border-radius: 999px; background: rgba(10,10,26,.55); border: 1px solid rgba(34,227,255,.5); text-shadow: 0 0 14px #22e3ff; animation: lrToast 1.5s ease-out forwards; white-space: nowrap; }
.lr-toast.is-warn { border-color: rgba(255,61,90,.7); text-shadow: 0 0 14px #ff3d5a; }
.lr-toast.is-boss { font-size: clamp(16px, 4.6cqmin, 36px); border-color: #ff3d5a; color: #ffd0d8; background: rgba(60,0,16,.55); }
@keyframes lrToast { 0% { opacity: 0; transform: translateY(16px) scale(.8); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px); } }
.lr-err { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 2rem; text-align: center; font-weight: 600; background: #07060f; }
.lr-err[hidden] { display: none; }

/* портрет (телефон): заголовок по центру */
@container (max-aspect-ratio: 1/1) {
  .lr-scr[data-s="title"] { place-content: end center; justify-items: center; text-align: center; padding: 18px 18px 26px; background: linear-gradient(0deg, rgba(5,4,12,.9) 0%, rgba(5,4,12,.4) 55%, rgba(5,4,12,0) 100%); }
  .lr-scr[data-s="title"] .lr-row { justify-content: center; }
  .lr-logo { justify-items: center; }
}
@media (prefers-reduced-motion: reduce) { .lr-logo__inf path, .lr-btn--main::after { animation: none; } }
