/* Dragon Money — Design Portal · pixel build (v=frame2 · fixed-aspect "screen" window)
 * Geometry is authored in mockup pixels (frame 1440×972) and scaled with --s.
 * Generated from /workspace/mv/pixel/styles.src.css ("Nu" = N * --s). */
@font-face {
  font-family: "EKRAN";
  src: url("fonts/Ekran-Bold.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: block;
  ascent-override: 75%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "DragonM";
  src: url("fonts/DragonM_Classic.otf") format("opentype");
  font-weight: 400 900;
  font-style: normal;
  font-display: block;
  ascent-override: 75%;
  descent-override: 25%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Muller";
  src: url("fonts/MullerRegular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  ascent-override: 78%;
  descent-override: 22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Muller";
  src: url("fonts/MullerMedium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
  ascent-override: 78%;
  descent-override: 22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Muller";
  src: url("fonts/MullerBold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
  ascent-override: 78%;
  descent-override: 22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Muller";
  src: url("fonts/MullerExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
  ascent-override: 78%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  /* inset "screen" frame: margin around the window + its corner radius */
  --fm: 16px;
  --fr: 28px;
  --fm-t: max(var(--fm), env(safe-area-inset-top));
  --fm-r: max(var(--fm), env(safe-area-inset-right));
  --fm-b: max(var(--fm), env(safe-area-inset-bottom));
  --fm-l: max(var(--fm), env(safe-area-inset-left));
  /* frame height (fill mode); desktop mode overrides it with the fixed-aspect window */
  --fh: calc(100vh - var(--fm-t) - var(--fm-b));
  /* --s scales the 1440×972 mockup into the FRAME (viewport minus the inset) */
  --s: clamp(0.62px, min(calc((100vw - var(--fm-l) - var(--fm-r)) / 1440), calc((100vh - var(--fm-t) - var(--fm-b)) / 972)), 4px);
  --orange: #FF9719;
  --grad: linear-gradient(180deg, #FF981A 0%, #E94D00 100%);
  --font: "Muller", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "DragonM", "EKRAN", "Oswald", "Arial Narrow", sans-serif;
  --rail: calc(113 * var(--s));
}
@supports (height: 100dvh) {
  :root {
    --fh: calc(100dvh - var(--fm-t) - var(--fm-b));
    --s: clamp(0.62px, min(calc((100vw - var(--fm-l) - var(--fm-r)) / 1440), calc((100dvh - var(--fm-t) - var(--fm-b)) / 972)), 4px);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: #fff;
  background: #070405;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ===== Page backdrop outside the frame: near-black + warm ember glow ===== */
body::before {
  content: ""; position: fixed; inset: -14%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% -6%, rgba(255,151,25,0.30) 0%, rgba(255,151,25,0) 62%),
    radial-gradient(55% 60% at 100% 55%, rgba(233,77,0,0.22) 0%, rgba(233,77,0,0) 60%),
    radial-gradient(50% 55% at 0% 100%, rgba(150,52,6,0.30) 0%, rgba(150,52,6,0) 62%),
    radial-gradient(60% 50% at 55% 108%, rgba(255,120,20,0.26) 0%, rgba(255,120,20,0) 60%),
    #070405;
}

/* ===== Frame ("screen") shared by gate + app ===== */
.gate, .app {
  position: fixed; z-index: 1;
  top: var(--fm-t); right: var(--fm-r); bottom: var(--fm-b); left: var(--fm-l);
  border-radius: var(--fr);
  /* no dark ring / drop shadow: they read as a black halo on the orange lava (fix: corners) */
  box-shadow:
    0 0 0 1px rgba(255,214,176,0.10),
    0 0 90px rgba(255,130,25,0.10);
}
/* thin hairline border drawn on top of the clipped content (keeps inner geometry exact) */
.gate::after, .shell::after {
  content: ""; position: absolute; inset: 0; z-index: 30; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,226,200,0.09);
}

/* ===== Gate ===== */
.gate {
  z-index: 50;
  display: grid; place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #000; /* glow now drawn by .lava-gate blobs (same spot/strength at rest) */
  padding: 24px;
}
/* login2 — measured on Elia's 1440×972 frame mockup (calc(1 * var(--s)) = 1 mockup px) */
.gate { display: block; padding: 0; --gy: calc(50% - calc(486 * var(--s))); }
.gate-logo {
  position: absolute; z-index: 1; left: calc(50% - calc(116 * var(--s))); top: calc(var(--gy) + calc(245 * var(--s)));
  width: calc(232 * var(--s)); height: auto; display: block; margin: 0;
}
.gate > .gate-card {
  position: absolute; z-index: 1;
  left: calc(50% - calc(325 * var(--s))); top: calc(var(--gy) + calc(311 * var(--s)));
  width: calc(650 * var(--s)); height: calc(313 * var(--s));
  padding: calc(24 * var(--s)) calc(24 * var(--s)) 0;
  border-radius: calc(14 * var(--s));
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(255,255,255,0.27);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  text-align: center;
}
.gate-card h1 {
  margin: 0; height: calc(125 * var(--s));
  font-family: "DragonM", var(--font-display); font-weight: 400;
  font-size: calc(117 * var(--s)); line-height: calc(125 * var(--s)); letter-spacing: -0.013em;
  text-transform: uppercase; color: #fff; white-space: nowrap;
}
#gate-form { display: grid; gap: calc(14 * var(--s)); }
#gate-input {
  height: calc(61 * var(--s)); padding: 0 calc(20 * var(--s)); border-radius: calc(12 * var(--s));
  background: rgba(0,0,0,0.38); border: 1px solid rgba(255,255,255,0.22);
  color: #fff; font-size: calc(15.5 * var(--s)); text-align: center; outline: none;
}
#gate-input::placeholder { color: rgba(255,255,255,0.46); opacity: 1; }
#gate-input.is-error::placeholder { color: #E04646; }
#gate-input.is-error { border-color: rgba(224,70,70,0.45); }
#gate-input:focus { border-color: var(--orange); }
#gate-form button {
  height: calc(61 * var(--s)); border: 0; border-radius: calc(12 * var(--s));
  background: linear-gradient(180deg, #FF9C1B 0%, #FB8D17 45%, #E94800 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  color: #fff; font-weight: 700; font-size: calc(20 * var(--s));
}
.gate-error { margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gate-error.sr-only.hidden { display: block !important; visibility: hidden; }
.gate-lang {
  position: absolute; z-index: 1; left: 50%; top: calc(var(--gy) + calc(690 * var(--s))); translate: -50% 0;
  display: flex; gap: calc(3 * var(--s));
}
.gate-lang-opt {
  width: calc(50 * var(--s)); height: calc(30 * var(--s)); padding: 0; border-radius: calc(6 * var(--s));
  border: 1px solid transparent; background: rgba(0,0,0,0.72);
  color: #fff; font-weight: 700; font-size: calc(15 * var(--s)); line-height: 1;
}
.gate-lang-opt.is-active {
  background: linear-gradient(180deg, #FF981A 0%, #E94D00 100%);
  border-color: rgba(255,226,206,0.75);
}
.gate-lang-opt:not(.is-active):hover { background: rgba(30,12,4,0.85); }
.gate-lang-opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ===== Shell ===== */
.shell {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #000;
  isolation: isolate;
}

/* ===== Rail ===== */
.rail {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--rail);
  background: #141216 url("assets/ui/rail-bg.png?v=pixel1") 0 0 / 100% 100% no-repeat;
  z-index: 5;
}
.rail-btn {
  position: absolute; left: calc(27 * var(--s));
  width: calc(60 * var(--s)); height: calc(60 * var(--s));
  padding: 0; border: 0; background: none;
  border-radius: calc(9 * var(--s));
  outline: none;
}
.rail-home { top: calc(40 * var(--s)); }
.rail-search { top: calc(165 * var(--s)); }
.rail-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.rail-img-on { opacity: 0; }
.rail-btn.is-active .rail-img-on,
.rail-btn.is-open .rail-img-on { opacity: 1; }
.rail-btn.is-active .rail-img-off,
.rail-btn.is-open .rail-img-off { opacity: 0; }
.rail-btn:not(.is-active):not(.is-open):hover .rail-img-on { opacity: .55; }
.rail-btn:focus-visible { box-shadow: 0 0 0 2px rgba(255,151,25,0.65); }

/* ===== Main + backgrounds ===== */
.main {
  position: absolute; top: 0; bottom: 0; right: 0;
  left: var(--rail);
  overflow: hidden;
  /* frame offset: content is authored on a calc(972 * var(--s))-tall frame, centred vertically */
  --oy: calc((100% - calc(972 * var(--s))) / 2);
}
.bgs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg {
  position: absolute; inset: 0;
  /* edge-extended copies: centre 1327×972 = mockup frame, padding fills wider/taller screens */
  background: 50% 50% / calc(2653 * var(--s)) calc(1944 * var(--s)) no-repeat;
  opacity: 0;
  transition: opacity .45s ease;
}
.bg-assets-closed { background-image: url("assets/ui/bg-assets-closed-wide.jpg?v=pixel1"); }
.bg-assets-open   { background-image: url("assets/ui/bg-assets-open-wide.jpg?v=pixel1"); }
.app[data-view="assets"]:not(.menu-open):not(.has-results) .bg-assets-closed { opacity: 1; }
.app[data-view="assets"].menu-open .bg-assets-open,
.app[data-view="assets"].has-results:not(.menu-open) .bg-assets-open { opacity: 1; }

/* ===== Header ===== */
.topbar { position: absolute; inset: 0 0 auto 0; height: 0; z-index: 6; }
.lang-toggle {
  position: absolute; top: calc(52 * var(--s)); right: calc(154 * var(--s));
  display: flex;
  height: calc(34 * var(--s)); width: calc(104 * var(--s));
  border-radius: calc(6 * var(--s));
  background: rgba(0,0,0,0.42);
}
.lang-opt, .logout-btn {
  height: calc(34 * var(--s));
  border: 0;
  background: transparent;
  font-weight: 700; font-size: calc(16 * var(--s)); line-height: calc(30 * var(--s));
  padding-top: calc(4 * var(--s));
  letter-spacing: -0.02em;
  color: #fff;
  border-radius: calc(6 * var(--s));
  outline: none;
}
.lang-opt { width: calc(52 * var(--s)); }
.lang-opt.is-active {
  background: var(--grad);
  box-shadow: inset 0 0 0 calc(1 * var(--s)) rgba(255, 214, 186, 0.85);
}
.logout-btn {
  position: absolute; top: calc(52 * var(--s)); right: calc(50 * var(--s));
  width: calc(86 * var(--s));
  background: rgba(0,0,0,0.42);
}
.lang-opt:not(.is-active):hover, .logout-btn:hover { color: var(--orange); }
.lang-opt:focus-visible, .logout-btn:focus-visible { box-shadow: 0 0 0 2px rgba(255,151,25,0.7); }
.logout-btn:disabled { opacity: 0.5; cursor: wait; }

/* ===== Views ===== */
.view { position: absolute; inset: 0; z-index: 2; }
.view:not(.is-active) { display: none; }

/* ===== Hero ===== */
.hero { position: absolute; inset: 0; }
.hero-mascot {
  position: absolute; right: 0; bottom: 0;
  /* when the frame is taller than 1440:972 the mascot sits on the bottom edge;
     soften its top edge over the extra space so there is no hard line */
  --oyv: max(0px, calc((var(--fh) - calc(972 * var(--s))) / 2));
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 calc(var(--oyv) * 2.5));
          mask-image: linear-gradient(180deg, transparent 0, #000 calc(var(--oyv) * 2.5));
  width: calc(970 * var(--s)); height: calc(972 * var(--s));
  display: block;
  pointer-events: none;
}
.hero-mascot img { width: 100%; height: 100%; display: block; }
.hero-logo {
  position: absolute; left: calc(51 * var(--s)); top: calc(var(--oy) + calc(40 * var(--s)));
  width: calc(121 * var(--s)); height: auto;
  display: block;
}
.hero-title {
  position: absolute; left: calc(48 * var(--s)); top: calc(var(--oy) + calc(260.5 * var(--s)));
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(120 * var(--s));
  line-height: calc(105 * var(--s));
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-transform: uppercase;
}
.hero-title span { display: block; }
.hero-title-a { color: #fff; }
.hero-title-b {
  margin-top: calc(-2 * var(--s));
  background: linear-gradient(180deg, #FF9719 0%, #FF9719 48%, #F1690A 81%, #EC5A06 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  white-space: pre;
}
.hero-lead {
  position: absolute; left: calc(50 * var(--s)); top: calc(var(--oy) + calc(460 * var(--s)));
  margin: 0;
  font-weight: 700;
  font-size: calc(22 * var(--s));
  line-height: calc(24 * var(--s));
  letter-spacing: -0.01em;
  color: #fff;
}
.hero-cta {
  position: absolute; left: calc(51 * var(--s)); top: calc(var(--oy) + calc(660 * var(--s)));
  width: calc(224 * var(--s)); height: calc(55 * var(--s));
  border: 0; border-radius: calc(9 * var(--s));
  background: #fff;
  color: #000;
  font-weight: 700; font-size: calc(21 * var(--s)); letter-spacing: 0;
  box-shadow: inset 0 calc(-3 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,0.18);
  transition: transform .15s ease, filter .15s ease;
}
.hero-cta:hover { filter: brightness(0.95); }
.hero-cta:active { transform: translateY(1px); }
.hero-cta:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ===== Hero scroll hint ===== */
.hero-scroll {
  appearance: none;
  position: absolute; left: calc(51 * var(--s)); top: calc(var(--oy) + calc(868 * var(--s)));
  display: flex; align-items: center; gap: calc(14 * var(--s));
  padding: calc(6 * var(--s)) calc(6 * var(--s)) calc(6 * var(--s)) 0;
  border: 0; background: transparent;
  color: rgba(255,255,255,0.55);
  font: inherit; font-weight: 500; font-size: calc(16 * var(--s)); letter-spacing: -0.02em;
  cursor: pointer; z-index: 4;
  transition: color .16s ease;
}
.hero-scroll:hover, .hero-scroll:focus-visible { color: #fff; outline: none; }
.hero-scroll:focus-visible .hero-scroll-mouse { box-shadow: 0 0 0 3px rgba(255,151,25,0.45); }
.hero-scroll-mouse {
  position: relative; flex: none;
  width: calc(26 * var(--s)); height: calc(40 * var(--s));
  border-radius: calc(14 * var(--s));
  border: 1.5px solid rgba(255,255,255,0.32);
}
.hero-scroll-mouse i {
  position: absolute; left: 50%; top: calc(8 * var(--s));
  width: calc(4 * var(--s)); height: calc(9 * var(--s)); margin-left: calc(-2 * var(--s));
  border-radius: calc(2 * var(--s));
  background: #FF9719;
  box-shadow: 0 0 8px rgba(255,151,25,0.7);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  70% { transform: translateY(calc(13 * var(--s))); opacity: 0; }
  100% { transform: translateY(calc(13 * var(--s))); opacity: 0; }
}
@media (max-width: 760px) {
  .hero-scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-mouse i { animation: none; opacity: 1; }
}

/* ===== Assets ===== */
.assets-stage { position: absolute; inset: 0; --cx: 50%; }
.assets-search {
  position: absolute;
  left: calc(50% - calc(494.5 * var(--s))); top: calc(var(--oy) + calc(345 * var(--s)));
  width: calc(990 * var(--s)); height: calc(62 * var(--s));
  display: flex; align-items: center;
  border-radius: calc(10 * var(--s));
  border: calc(1 * var(--s)) solid rgba(255,255,255,0.23);
  background: linear-gradient(90deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.33) 100%);
  z-index: 3;
}
.app.menu-open .assets-search,
.app.has-results .assets-search { top: calc(var(--oy) + calc(208 * var(--s))); }
.menu-toggle {
  position: absolute; left: calc(29 * var(--s)); top: 50%;
  width: calc(22 * var(--s)); height: calc(22 * var(--s)); margin-top: calc(-11 * var(--s));
  padding: 0; border: 0; background: none;
  display: grid; place-items: center;
  outline: none;
}
.burger { width: calc(22 * var(--s)); height: calc(15.4 * var(--s)); display: block; overflow: visible; }
.burger-lines { stroke: #fff; }
.menu-toggle[aria-expanded="true"] .burger-lines { stroke: url(#burgerGrad); }
.menu-toggle:focus-visible { box-shadow: 0 0 0 2px rgba(255,151,25,0.7); border-radius: calc(4 * var(--s)); }
#chat-input {
  position: absolute; left: calc(81 * var(--s)); right: calc(70 * var(--s)); top: 0; bottom: 0;
  border: 0; outline: none; background: transparent;
  font-weight: 400; font-size: calc(15.5 * var(--s)); letter-spacing: 0;
  color: #fff;
  padding: 0;
}
#chat-input::placeholder { color: rgba(255,255,255,0.42); opacity: 1; }
.search-btn {
  position: absolute; right: calc(29.5 * var(--s)); top: 50%;
  width: calc(22 * var(--s)); height: calc(22 * var(--s)); margin-top: calc(-11 * var(--s));
  padding: 0; border: 0; background: none;
  color: #fff;
  outline: none;
}
.search-btn svg { width: calc(22 * var(--s)); height: calc(22 * var(--s)); display: block; }
.search-btn:hover { color: var(--orange); }

.asset-menu {
  position: absolute;
  left: calc(50% - calc(494.5 * var(--s))); top: calc(var(--oy) + calc(270 * var(--s)));
  width: calc(990 * var(--s)); height: calc(300 * var(--s));
  z-index: 2;
}
.asset-menu-list { position: absolute; left: calc(33 * var(--s)); top: calc(7 * var(--s)); width: calc(906 * var(--s)); }
.asset-menu-item {
  position: relative;
  display: flex; align-items: center;
  width: calc(906 * var(--s)); height: calc(50 * var(--s));
  margin: 0 0 calc(7 * var(--s));
  padding: 0 0 0 calc(30 * var(--s));
  border: 0; border-radius: calc(8 * var(--s));
  background: transparent;
  font-weight: 500; font-size: calc(16 * var(--s)); letter-spacing: 0;
  text-align: left;
  color: #fff;
  outline: none;
}
.asset-menu-item.is-hover { background: rgba(0,0,0,0.45); }
.enter-ico {
  position: absolute; right: calc(30 * var(--s)); top: calc(15 * var(--s));
  width: calc(18 * var(--s)); height: calc(20 * var(--s));
  opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 20' fill='none'%3E%3Cpath d='M16.6 0.7v12.6c0 1.2-.7 1.9-1.9 1.9H1.4M5.5 11.1 1.4 15.2 5.5 19.3' stroke='%23E2E0DE' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.asset-menu-item.is-hover .enter-ico { opacity: 1; }
.asset-menu-item.is-disabled { color: #fff; cursor: default; }
.asset-menu-item.is-disabled .soon {
  margin-left: calc(10 * var(--s));
  font-size: calc(12 * var(--s)); font-weight: 500;
  color: rgba(255,255,255,0.45);
  opacity: 0; transition: opacity .15s;
}
.asset-menu-item.is-disabled.is-hover .soon,
.asset-menu-item.is-disabled:focus-visible .soon { opacity: 1; }
.asset-menu-item.is-disabled.is-hover { background: rgba(0,0,0,0.3); }
.asset-menu-scroll {
  position: absolute; left: calc(974 * var(--s)); top: calc(47 * var(--s));
  width: calc(5 * var(--s)); height: calc(197 * var(--s));
  border-radius: calc(3 * var(--s));
  background: #fff;
}

.asset-chips {
  position: absolute;
  left: calc(50% - calc(446.5 * var(--s))); top: calc(var(--oy) + calc(439 * var(--s)));
  display: flex; gap: calc(24 * var(--s));
  z-index: 2;
}
.app.menu-open .asset-chips { top: calc(var(--oy) + calc(619 * var(--s))); }
.app.has-results:not(.menu-open) .asset-chips { top: calc(var(--oy) + calc(302 * var(--s))); }
.asset-chip {
  width: calc(205 * var(--s)); height: calc(71 * var(--s));
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: calc(10 * var(--s));
  border: calc(1 * var(--s)) solid rgba(255,255,255,0.085);
  background: linear-gradient(100deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.12) 100%);
  box-shadow: inset 0 calc(-2 * var(--s)) calc(3 * var(--s)) rgba(255,255,255,0.05), 0 calc(3 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,0.32);
  outline: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.asset-chip strong {
  display: block;
  margin-top: calc(14 * var(--s));
  font-weight: 700; font-size: calc(22 * var(--s)); line-height: calc(24 * var(--s)); letter-spacing: -0.02em;
  color: #fff;
}
.asset-chip small {
  display: block;
  margin-top: calc(1 * var(--s));
  font-weight: 400; font-size: calc(15 * var(--s)); line-height: calc(18 * var(--s)); letter-spacing: 0;
  color: rgba(255,255,255,0.5);
}
.asset-chip:hover, .asset-chip.is-active { border-color: rgba(255,151,25,0.55); }
.asset-chip:focus-visible { border-color: var(--orange); }

/* results (chip / menu / search delivery) */
.assets-results {
  position: absolute;
  left: calc(50% - calc(446.5 * var(--s))); width: calc(892 * var(--s));
  top: calc(var(--oy) + calc(405 * var(--s))); bottom: calc(100% - var(--oy) - calc(860 * var(--s)));
  overflow-y: auto;
  display: flex; flex-direction: column; gap: calc(18 * var(--s));
  padding: calc(4 * var(--s)) calc(6 * var(--s)) calc(8 * var(--s)) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.7) transparent;
  z-index: 2;
}
.app.menu-open .assets-results { display: none; }

/* shared message styles */
.msg { display: flex; flex-direction: column; gap: calc(10 * var(--s)); }
.msg.user { align-items: flex-end; }
.msg.bot { align-items: flex-start; }
.msg.user.is-quiet { display: none; }
.bubble {
  max-width: calc(600 * var(--s));
  padding: calc(16 * var(--s)) calc(22 * var(--s));
  border-radius: calc(10 * var(--s));
  font-size: calc(14 * var(--s)); line-height: calc(18 * var(--s)); letter-spacing: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble { background: rgba(255,255,255,0.075); }
.msg.bot .bubble { background: rgba(0,0,0,0.42); border: calc(1 * var(--s)) solid rgba(255,255,255,0.08); }
.bubble code { font-size: calc(12 * var(--s)); color: #ffcf9a; }
.bubble strong { font-weight: 700; }
.bubble--card { padding: 0; background: none !important; border: 0 !important; }
.msg-choices { display: flex; gap: calc(11 * var(--s)); flex-wrap: wrap; }
.chip.msg-choice {
  min-width: calc(149 * var(--s)); height: calc(55 * var(--s)); padding: 0 calc(22 * var(--s));
  border-radius: calc(6 * var(--s)); border: 0;
  background: #D9D9D9; color: #111;
  font-weight: 700; font-size: calc(16 * var(--s)); letter-spacing: 0;
}
.chip.msg-choice:hover { background: #fff; }
.chip.msg-choice.is-picked { background: var(--grad); color: #fff; }
.msg-choices.is-done .chip.msg-choice:not(.is-picked) { opacity: 0.4; }
.preview {
  max-width: calc(320 * var(--s));
  padding: calc(12 * var(--s)); border-radius: calc(8 * var(--s));
  background: #D9D9D9;
}
.preview.dark-plate { background: #111; }
.preview img { display: block; max-width: 100%; max-height: calc(120 * var(--s)); object-fit: contain; }
.file-result { display: inline-flex; margin-top: calc(10 * var(--s)); }
a.file-link {
  display: inline-flex; align-items: center; gap: calc(8 * var(--s));
  min-height: calc(55 * var(--s)); padding: 0 calc(18 * var(--s));
  border-radius: calc(6 * var(--s));
  background: #D9D9D9; color: #111;
  font-weight: 700; font-size: calc(14 * var(--s)); text-decoration: none;
  white-space: nowrap;
}
a.file-link:hover { background: #fff; }
.file-link-icon {
  width: calc(16 * var(--s)); height: calc(16 * var(--s)); flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 4v11M12 15l-5-5M12 15l5-5M5 20h14' stroke='%23E94D00' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hint-list { margin: calc(8 * var(--s)) 0 0; padding-left: calc(18 * var(--s)); color: rgba(255,255,255,0.7); }
.hint-list a { color: var(--orange); }
.dl-card {
  display: flex; align-items: center; gap: calc(14 * var(--s));
  width: min(calc(520 * var(--s)), 100%);
  padding: calc(12 * var(--s)) calc(12 * var(--s)) calc(12 * var(--s)) calc(14 * var(--s));
  border-radius: calc(6 * var(--s));
  background: #D9D9D9; color: #111;
}
.dl-card-icon { width: calc(34 * var(--s)); height: calc(34 * var(--s)); flex: none; display: grid; place-items: center; color: #E94D00; }
.dl-card-icon svg { width: calc(26 * var(--s)); height: calc(26 * var(--s)); }
.dl-card-body { display: flex; flex-direction: column; gap: calc(2 * var(--s)); min-width: 0; flex: 1 1 auto; white-space: normal; }
.dl-card-title { font-weight: 700; font-size: calc(14 * var(--s)); line-height: calc(17 * var(--s)); }
.dl-card-meta { color: #6b4a22; font-size: calc(12 * var(--s)); font-weight: 500; }
.dl-card-name { color: #555; font-size: calc(11 * var(--s)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-card-btn {
  display: inline-flex; align-items: center; gap: calc(6 * var(--s)); flex: none;
  height: calc(36 * var(--s)); padding: 0 calc(14 * var(--s));
  border-radius: calc(6 * var(--s));
  background: var(--grad); color: #fff;
  font-weight: 700; font-size: calc(13 * var(--s)); text-decoration: none;
}
.dl-card-btn svg { width: calc(14 * var(--s)); height: calc(14 * var(--s)); }
.dl-card-btn:hover { filter: brightness(1.06); }

/* file tiles inside an assets reply */
.agent-file-row { display: flex; flex-wrap: wrap; gap: calc(11 * var(--s)); margin: 0 0 calc(16 * var(--s)); white-space: normal; }
.agent-file {
  position: relative;
  width: calc(148 * var(--s)); height: calc(54 * var(--s));
  display: flex; align-items: center; justify-content: center; gap: calc(8 * var(--s));
  padding: 0 calc(10 * var(--s));
  border-radius: calc(6 * var(--s));
  background: #D9D9D9;
  color: #111;
  font-weight: 700; font-size: calc(12 * var(--s)); line-height: calc(14 * var(--s));
  text-decoration: none;
  overflow: hidden;
}
.agent-file img { max-width: calc(56 * var(--s)); max-height: calc(40 * var(--s)); object-fit: contain; flex: none; }
.agent-file span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agent-file.is-dark { background: #1d1b1e; color: #fff; }
.agent-file:hover { box-shadow: inset 0 0 0 calc(2 * var(--s)) var(--orange); }
/* logo delivery: intro → ZIP card → even tile grid, one column width */
.logo-delivery { display: flex; flex-direction: column; gap: calc(14 * var(--s)); width: min(calc(520 * var(--s)), 100%); white-space: normal; }
.logo-delivery > .agent-files-intro { margin: 0; }
.logo-delivery .dl-card { width: 100%; }
.agent-file-row.logo-file-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(10 * var(--s)); margin: 0; width: 100%; }
.logo-file-row .agent-file { width: auto; min-width: 0; height: auto; min-height: calc(58 * var(--s)); padding: calc(8 * var(--s)) calc(12 * var(--s)) calc(8 * var(--s)) calc(10 * var(--s)); justify-content: flex-start; gap: calc(10 * var(--s)); text-align: left; }
.logo-file-row .agent-file img { width: calc(40 * var(--s)); max-width: calc(40 * var(--s)); max-height: calc(40 * var(--s)); }
.logo-file-row .agent-file span { min-width: 0; overflow: visible; display: block; -webkit-line-clamp: unset; overflow-wrap: anywhere; hyphens: auto; }
.assets-results .msg.bot .logo-delivery { width: min(calc(520 * var(--s)), 100%); }
.assets-search:focus-within { border-color: rgba(255,255,255,0.36); }

/* ===== Mobile (narrow / portrait phones) ===== */
@media (max-width: 760px) {
  :root { --s: calc((100vw - var(--fm-l) - var(--fm-r)) / 760); --rail: 0px; }
  .rail {
    top: auto; bottom: 0; right: 0; width: auto; height: 76px;
    background: rgba(18,16,20,0.96);
    display: flex; justify-content: center; gap: 22px; align-items: center;
  }
  .rail-btn { position: relative; left: auto; top: auto !important; width: 50px; height: 50px; }
  .main { bottom: 76px; --oy: 0px; }
  .lang-toggle { top: 18px; right: 112px; height: 32px; width: 96px; }
  .lang-opt, .logout-btn { height: 32px; line-height: 32px; font-size: 14px; }
  .lang-opt { width: 48px; }
  .logout-btn { top: 18px; right: 16px; width: 80px; }
  .hero-logo { left: 18px; top: 20px; width: 92px; }
  .hero-mascot { top: auto; bottom: 0; right: -18%; width: 112%; height: auto; aspect-ratio: 970 / 972;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%); }
  .hero-title { left: 16px; top: 84px; font-size: 54px; line-height: 48px; }
  .hero-lead { left: 18px; top: 190px; font-size: 15px; line-height: 19px; }
  .hero-cta { left: 18px; top: 244px; width: 196px; height: 48px; font-size: 17px; }
  .assets-search { left: 14px; right: 14px; width: auto; height: 54px; }
  .assets-search { top: 78px !important; }
  #chat-input { left: 58px; right: 52px; font-size: 16px; }
  .menu-toggle { left: 18px; }
  .search-btn { right: 18px; }
  .asset-menu { left: 14px; right: 14px; width: auto; top: 132px; height: 300px; }
  .asset-menu-list { left: 8px; right: 8px; width: auto; }
  .asset-menu-item { width: 100%; font-size: 16px; height: 48px; padding-left: 20px; }
  .asset-menu-scroll { display: none; }
  .asset-chips { left: 14px; right: 14px; top: 150px !important; gap: 8px; }
  .app.menu-open .asset-chips { top: 440px !important; }
  .asset-chip { flex: 1 1 0; width: auto; height: 64px; }
  .asset-chip strong { font-size: 16px; margin-top: 12px; line-height: 20px; }
  .asset-chip small { font-size: 12px; }
  .assets-results { left: 14px; right: 14px; width: auto; top: 228px; bottom: 56px; }
  .app.menu-open .assets-results { display: none; }
  .bubble { font-size: 14px; line-height: 18px; max-width: 100%; }
  .logo-delivery, .assets-results .msg.bot .logo-delivery { width: 100%; gap: 12px; }
  .assets-results .msg.bot:has(.logo-delivery), .assets-results .msg.bot .bubble:has(.logo-delivery) { width: 100%; }
  .agent-file-row.logo-file-row { gap: 8px; }
  .logo-file-row .agent-file { min-height: 56px; padding: 8px 10px; gap: 8px; font-size: 12px; line-height: 15px; }
  .logo-file-row .agent-file img { width: 36px; max-width: 36px; max-height: 36px; }
}

/* ===== Frame metrics per breakpoint ===== */
@media (max-width: 1024px) {
  :root { --fm: 10px; --fr: 22px; }
}
@media (max-width: 480px) {
  :root { --fm: 6px; --fr: 18px; }
}

/* ===== Desktop: fixed-aspect window (exactly the mockup's 1440×972), centred =====
 * Width = min(1440px cap, 90% of the viewport width, viewport width − 2×48px,
 *             [min(90% of height, height − 2×40px)] × 1440/972).
 * --s = width/1440, so every mockup coordinate lands exactly where it is in the mockup.
 * Portrait / narrow (<900px) / very short (<520px) screens keep the fill-mode inset frame above. */
@media (min-width: 900px) and (min-height: 520px) and (min-aspect-ratio: 1/1) {
  :root {
    --fw: min(1440px, 90vw, calc(100vw - 96px), calc(min(90vh, calc(100vh - 80px)) * 1440 / 972));
    --fh: calc(var(--fw) * 972 / 1440);
    --s: calc(var(--fw) / 1440);
    --fr: calc(30 * var(--s));
  }
  @supports (height: 100dvh) {
    :root { --fw: min(1440px, 90vw, calc(100vw - 96px), calc(min(90dvh, calc(100dvh - 80px)) * 1440 / 972)); }
  }
  .gate, .app {
    inset: 0; margin: auto;
    width: var(--fw); height: var(--fh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg, .hero-cta, .asset-chip { transition: none; }
}

/* =====================================================================================
 * FX (v=fx1) — glass cursor sheen + control motion. Motion/interaction ONLY:
 * nothing here changes geometry, colour or position at rest.
 *  - --mx/--my (px, local to the host) are written by ONE shared rAF-throttled pointer
 *    listener in app.js (bindPointerFx). Sheen = a blob moved with transform; border
 *    light = a 1px masked ring. Both fade with opacity on :hover.
 *  - keyframe motion uses the individual `translate` / `scale` properties so it never
 *    fights the hover/press `transform`.
 * ===================================================================================== */
@property --fxo { syntax: "<number>"; inherits: true; initial-value: 0; }
:root { --ease: cubic-bezier(.2,.8,.2,1); }

/* ---- glass hosts (stacking context + clip; all already rounded) ---- */
.asset-chip, .dl-card, .gate-card, .msg .bubble:not(.bubble--card) { position: relative; }
.assets-search, .asset-menu, .asset-menu-item, .asset-chip, .agent-file, .dl-card, .logout-btn, .gate-card {
  isolation: isolate;
  overflow: hidden;
}
/* hosts whose edges must not be re-clipped (image tiles, gradient pill, bubbles) */
.msg .bubble:not(.bubble--card), .rail-btn, .lang-toggle, .hero-cta { isolation: isolate; }

/* sheen blob (moved with transform only) */
.assets-search::before, .asset-menu::before, .asset-menu-item::after, .asset-chip::before,
.agent-file::before, .dl-card::before, .logout-btn::before, .gate-card::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: -1;
  width: var(--fx-d); height: var(--fx-d);
  margin: calc(var(--fx-d) / -2) 0 0 calc(var(--fx-d) / -2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,238,218,0.17) 0%, rgba(255,176,96,0.085) 42%, rgba(255,150,60,0) 100%);
  transform: translate3d(var(--mx, -999px), var(--my, -999px), 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--ease);
}
/* unclipped hosts: painted sheen inside the host's own rounded box instead of a moving blob */
.msg .bubble:not(.bubble--card)::before, .rail-btn::before, .lang-toggle::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle var(--fx-pr, calc(150 * var(--s))) at var(--mx, 50%) var(--my, 50%), rgba(255,238,218,0.15), rgba(255,176,96,0.07) 45%, rgba(255,150,60,0) 100%);
  opacity: 0; transition: opacity .32s var(--ease);
}
/* border light near the pointer (1px masked ring) */
.assets-search::after, .asset-chip::after,
.msg .bubble:not(.bubble--card)::after, .agent-file::after, .dl-card::after, .rail-btn::after,
.lang-toggle::after, .logout-btn::after, .gate-card::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(circle var(--fx-rr) at var(--mx, 50%) var(--my, 50%), rgba(255,222,186,0.62) 0%, rgba(255,170,90,0.24) 42%, rgba(255,150,60,0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .32s var(--ease);
}
.assets-search { --fx-d: calc(380 * var(--s)); --fx-rr: calc(150 * var(--s)); }
.asset-menu { --fx-d: calc(520 * var(--s)); }
.asset-menu-item { --fx-d: calc(300 * var(--s)); }
.asset-chip { --fx-d: calc(280 * var(--s)); --fx-rr: calc(120 * var(--s)); }
.msg .bubble { --fx-rr: calc(130 * var(--s)); }
.agent-file, .dl-card { --fx-d: calc(200 * var(--s)); --fx-rr: calc(90 * var(--s)); }
.rail-btn { --fx-pr: calc(60 * var(--s)); --fx-rr: calc(46 * var(--s)); }
.rail-btn::before { z-index: 2; }
.lang-toggle { --fx-pr: calc(70 * var(--s)); --fx-rr: calc(56 * var(--s)); }
.logout-btn { --fx-d: calc(130 * var(--s)); --fx-rr: calc(56 * var(--s)); }
.gate-card { --fx-d: 460px; --fx-rr: 170px; }
/* the gate input can't host pseudos: painted sheen faded through a registered number */
#gate-input {
  background-image: radial-gradient(circle 170px at var(--mx, 50%) var(--my, 50%), rgba(255,226,196,calc(0.13 * var(--fxo))), rgba(255,170,90,calc(0.05 * var(--fxo))) 45%, rgba(255,150,60,0) 100%);
  transition: border-color .25s var(--ease), --fxo .32s var(--ease);
}

/* ---- pointer-following frame glow (element injected by app.js) ---- */
.fx-glow {
  position: absolute; left: 0; top: 0; z-index: 1;
  width: calc(1100 * var(--s)); height: calc(1100 * var(--s)); margin: calc(-550 * var(--s)) 0 0 calc(-550 * var(--s));
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,150,40,0.07) 0%, rgba(255,120,20,0.028) 48%, rgba(255,120,20,0) 100%);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
  transition: opacity .6s var(--ease);
}

/* ---- transitions (shared timing) ---- */
.hero-cta { overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.hero-cta::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: -55%; width: 45%; z-index: -1;
  background: linear-gradient(100deg, rgba(255,166,72,0) 0%, rgba(255,166,72,0.42) 50%, rgba(255,166,72,0) 100%);
  transform: skewX(-18deg);
  opacity: 0; pointer-events: none;
}
.hero-scroll { transition: color .25s var(--ease); }
.hero-scroll-mouse { transition: border-color .25s var(--ease), transform .3s var(--ease); }
.hero-scroll-label { transition: transform .3s var(--ease); }
.asset-chip { transition: border-color .25s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease); }
.rail-btn { transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.rail-img { transition: opacity .3s var(--ease), filter .25s var(--ease); }
.lang-opt, .logout-btn { transition: color .2s var(--ease), transform .18s var(--ease), background-color .2s var(--ease); }
.lang-opt:focus-visible { box-shadow: inset 0 0 0 2px rgba(255,151,25,0.8); }
.search-btn { transition: color .2s var(--ease); }
.search-btn svg { transition: transform .26s var(--ease); }
.burger line { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .3s var(--ease); }
.assets-search { transition: border-color .25s var(--ease); }
a.file-link, .dl-card-btn, .chip.msg-choice, .agent-file, .dl-card {
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease), filter .2s var(--ease), opacity .2s var(--ease);
}
#gate-form button { transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .2s var(--ease); }

/* dropdown rows: highlight drawn by ::before so it can slide/fade (identical at rest) */
.asset-menu-item.is-hover, .asset-menu-item.is-disabled.is-hover { background: transparent; }
.asset-menu-item::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transform: scaleX(.94); transform-origin: 0 50%;
  transition: opacity .22s var(--ease), transform .3s var(--ease);
}
.asset-menu-item.is-disabled::before { background: rgba(0,0,0,0.3); }
.asset-menu-item.is-hover::before { opacity: 1; transform: none; }
.asset-menu-item { transition: transform .16s var(--ease); }
.enter-ico { transform: translateX(calc(-10 * var(--s))); transition: opacity .22s var(--ease), transform .3s var(--ease); }
.asset-menu-item.is-hover .enter-ico { transform: none; }

/* ---- keyframes ---- */
@keyframes fxIn   { from { opacity: 0; translate: 0 calc(14 * var(--s)); } }
@keyframes fxInSm { from { opacity: 0; translate: 0 calc(8 * var(--s)); } }
@keyframes fxInX  { from { opacity: 0; translate: calc(26 * var(--s)) 0; } }
@keyframes fxFade { from { opacity: 0; } }
@keyframes fxRow  { from { opacity: 0; translate: 0 calc(-6 * var(--s)); } }
@keyframes fxPop  { 0% { scale: 1; } 40% { scale: 1.09; } 100% { scale: 1; } }
@keyframes ctaShine { 0% { opacity: 0; translate: 0 0; } 18% { opacity: 1; } 100% { opacity: 1; translate: 380% 0; } }
@keyframes burgerOpen  { 0% { scale: 1 1; } 45% { scale: .28 1; } 100% { scale: 1 1; } }
@keyframes burgerClose { 0% { scale: 1 1; } 45% { scale: .5 1; } 100% { scale: 1 1; } }

/* ---- motion: entrance, menu, press (all input types) ---- */
@media (prefers-reduced-motion: no-preference) {
  /* view entrance (runs when a view goes display:none → block) */
  .view.is-active .hero-mascot  { animation: fxInX .45s var(--ease) backwards; }
  .view.is-active .hero-logo    { animation: fxIn .4s var(--ease) backwards; }
  .view.is-active .hero-title-a { animation: fxIn .42s var(--ease) .04s backwards; }
  .view.is-active .hero-title-b { animation: fxIn .42s var(--ease) .09s backwards; }
  .view.is-active .hero-lead    { animation: fxIn .4s var(--ease) .14s backwards; }
  .view.is-active .hero-cta     { animation: fxIn .4s var(--ease) .19s backwards; }
  .view.is-active .hero-scroll  { animation: fxIn .4s var(--ease) .24s backwards; }
  .view.is-active .assets-search { animation: fxIn .4s var(--ease) backwards; }
  .view.is-active .asset-chip    { animation: fxIn .4s var(--ease) .06s backwards; }
  .view.is-active .asset-chip:nth-child(2) { animation-delay: .1s; }
  .view.is-active .asset-chip:nth-child(3) { animation-delay: .14s; }
  .view.is-active .asset-chip:nth-child(4) { animation-delay: .18s; }
  .view.is-active .assets-results { animation: fxInSm .4s var(--ease) .06s backwards; }
  /* new messages */
  .assets-results .msg { animation: fxInSm .35s var(--ease) backwards; }
  /* dropdown opening: rows cascade in */
  .asset-menu:not([hidden]) .asset-menu-item { animation: fxRow .32s var(--ease) backwards; }
  .asset-menu:not([hidden]) .asset-menu-item:nth-child(2) { animation-delay: .03s; }
  .asset-menu:not([hidden]) .asset-menu-item:nth-child(3) { animation-delay: .06s; }
  .asset-menu:not([hidden]) .asset-menu-item:nth-child(4) { animation-delay: .09s; }
  .asset-menu:not([hidden]) .asset-menu-item:nth-child(5) { animation-delay: .12s; }
  .asset-menu:not([hidden]) .asset-menu-scroll { animation: fxFade .35s var(--ease) .08s backwards; }
  /* burger: lines ripple on open / close */
  .menu-toggle[aria-expanded="true"] .burger line  { animation: burgerOpen .42s var(--ease) backwards; }
  .menu-toggle[aria-expanded="false"] .burger line { animation: burgerClose .42s var(--ease) backwards; }
  .menu-toggle .burger line:nth-child(2) { animation-delay: .04s; }
  .menu-toggle .burger line:nth-child(3) { animation-delay: .08s; }
  .menu-toggle .burger line:nth-child(4) { animation-delay: .12s; }
  /* rail: active tile pops */
  .rail-btn.is-active { animation: fxPop .36s var(--ease); }

  /* press feedback (touch included) */
  .hero-cta:active { transform: scale(.97); }
  .asset-chip:active { transform: scale(.97); }
  .rail-btn:active { transform: scale(.93); }
  .lang-opt:active, .logout-btn:active:not(:disabled) { transform: scale(.93); }
  .search-btn:active svg { transform: scale(.86); }
  .menu-toggle:active .burger { transform: scale(.9); }
  .asset-menu-item:active:not(.is-disabled) { transform: scale(.99); }
  a.file-link:active, .dl-card-btn:active, .chip.msg-choice:active, .agent-file:active { transform: scale(.97); }
  #gate-form button:active { transform: scale(.97); }
  .hero-scroll:active .hero-scroll-mouse { transform: translateY(calc(3 * var(--s))) scale(.94); }
  .burger { transition: transform .18s var(--ease); }
}

/* ---- hover (fine pointers only, motion allowed): sheen, lift, nudges ---- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* glass sheen + border light */
  .assets-search:hover::before, .asset-menu:hover::before, .asset-menu-item:hover::after, .asset-chip:hover::before,
  .msg .bubble:not(.bubble--card):hover::before, .agent-file:hover::before, .dl-card:hover::before, .rail-btn:hover::before,
  .lang-toggle:hover::before, .logout-btn:hover::before, .gate-card:hover::before,
  .assets-search:hover::after, .asset-chip:hover::after, .msg .bubble:not(.bubble--card):hover::after,
  .agent-file:hover::after, .dl-card:hover::after, .rail-btn:hover::after,
  .lang-toggle:hover::after, .logout-btn:hover::after, .gate-card:hover::after { opacity: 1; }
  .asset-menu-item.is-disabled:hover::after { opacity: .6; }
  .asset-menu:hover::before { opacity: .55; } /* rows add their own sheen on top */
  #gate-input:hover, #gate-input:focus { --fxo: 1; }
  #gate-input:hover:not(:focus) { border-color: rgba(255,255,255,0.36); }
  .app.fx-in .fx-glow { opacity: 1; }

  /* hero CTA: lift + shine sweep */
  .hero-cta:hover {
    transform: translateY(calc(-2 * var(--s)));
    box-shadow: inset 0 calc(-3 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,0.18), 0 calc(12 * var(--s)) calc(28 * var(--s)) rgba(255,140,30,0.30), 0 calc(4 * var(--s)) calc(10 * var(--s)) rgba(0,0,0,0.35);
  }
  .hero-cta:hover::before { animation: ctaShine .8s var(--ease) forwards; }
  .hero-cta:hover:active { transform: translateY(calc(-1 * var(--s))) scale(.97); }

  /* scroll hint */
  .hero-scroll:hover .hero-scroll-mouse { border-color: rgba(255,151,25,0.75); transform: translateY(calc(2 * var(--s))); }
  .hero-scroll:hover .hero-scroll-label { transform: translateX(calc(3 * var(--s))); }

  /* chips: lift + subtle tilt toward the pointer + warm under-glow */
  .asset-chip:hover {
    transform: perspective(800px) translate3d(0, calc(-3 * var(--s)), 0) rotateX(calc(var(--ty, 0) * -2deg)) rotateY(calc(var(--tx, 0) * 2.5deg));
    box-shadow: inset 0 calc(-2 * var(--s)) calc(3 * var(--s)) rgba(255,255,255,0.05), inset 0 calc(-30 * var(--s)) calc(36 * var(--s)) calc(-22 * var(--s)) rgba(255,151,25,0.24), 0 calc(3 * var(--s)) calc(4 * var(--s)) rgba(0,0,0,0.32), 0 calc(12 * var(--s)) calc(26 * var(--s)) rgba(0,0,0,0.38);
  }
  .asset-chip:hover:active { transform: perspective(800px) translate3d(0, calc(-1 * var(--s)), 0) scale(.97); }

  /* rail tiles */
  .rail-btn:hover { transform: scale(1.06); box-shadow: 0 0 calc(20 * var(--s)) rgba(255,151,25,0.22); }
  .rail-btn:hover::after { opacity: 0; }
  .rail-btn:hover:active { transform: scale(.95); }

  /* burger: lines stagger on hover */
  .menu-toggle:hover .burger line:nth-child(2) { transform: scaleX(.7); }
  .menu-toggle:hover .burger line:nth-child(3) { transform: scaleX(.85); }
  
  /* icons nudge */
  .search-btn:hover svg { transform: rotate(-12deg) scale(1.12); }
  .search-btn:hover:active svg { transform: rotate(-12deg) scale(.88); }

  /* header */
  .logout-btn:hover:not(:disabled) { transform: translateY(calc(-1 * var(--s))); }
  .logout-btn:hover:active:not(:disabled) { transform: scale(.93); }

  /* footer link: underline wipes in from the left */

  /* downloads + file cards */
  a.file-link:hover, .dl-card-btn:hover, .chip.msg-choice:hover { transform: translateY(calc(-2 * var(--s))); box-shadow: 0 calc(8 * var(--s)) calc(18 * var(--s)) rgba(0,0,0,0.35); }
  .dl-card:hover { transform: translateY(calc(-2 * var(--s))); box-shadow: 0 calc(10 * var(--s)) calc(22 * var(--s)) rgba(0,0,0,0.38); }
  .agent-file:hover { transform: translateY(calc(-2 * var(--s))); box-shadow: inset 0 0 0 calc(2 * var(--s)) var(--orange), 0 calc(8 * var(--s)) calc(18 * var(--s)) rgba(0,0,0,0.38); }
  a.file-link:hover:active, .dl-card-btn:hover:active, .chip.msg-choice:hover:active, .agent-file:hover:active { transform: translateY(calc(-1 * var(--s))) scale(.97); }

  /* gate */
  #gate-form button:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 10px 24px rgba(233,77,0,0.35); }
  #gate-form button:hover:active { transform: scale(.97); }
}

/* touch / coarse pointers: no sheen, no glow (press feedback above still applies) */
@media (hover: none), (pointer: coarse) {
  .fx-glow { display: none; }
}
/* reduced motion: no tilt, sheen, glow, entrance or keyframes */
@media (prefers-reduced-motion: reduce) {
  .fx-glow { display: none; }
  .hero-cta, .asset-chip, .rail-btn, .rail-img, .lang-opt, .logout-btn, .search-btn svg,
  .burger line, .asset-menu-item, .asset-menu-item::before, .enter-ico,
  a.file-link, .dl-card-btn, .chip.msg-choice, .agent-file, .dl-card, #gate-form button,
  .hero-scroll-mouse, .hero-scroll-label { transition: none; }
}


/* =====================================================================================
 * LAVA (v=lava1) — slow, constant "lava-lamp" motion of the background glows.
 *  - blobs = pre-blurred radial gradients on dedicated layers; ONLY translate / scale /
 *    rotate / opacity are animated (compositor-only, no JS, no filter:blur).
 *  - each blob runs 3–4 independent loops with co-prime durations (19–97 s) and negative
 *    delays, so the motion never visibly repeats and has no "start".
 *  - layers:  body::before (page backdrop)   .lava-gate (login)
 *             .lava-hero (screen-blended over the mascot plate, under the text)
 *             .lava-app  (over the baked .bg glow plates of the assets screen) + .bg plate drift
 * ===================================================================================== */
.lava {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  contain: strict;
  border-radius: inherit;
}
.lb {
  --c: 255 151 25; --a: .2;
  --x: 50%; --y: 50%; --w: 60%; --h: 60%;
  position: absolute;
  left: calc(var(--x) - var(--w) / 2); top: calc(var(--y) - var(--h) / 2);
  width: var(--w); height: var(--h);
  border-radius: 50%;
  /* "pre-blurred": smooth gaussian-like falloff, no filter */
  background: radial-gradient(closest-side,
    rgb(var(--c) / var(--a)) 0%,
    rgb(var(--c) / calc(var(--a) * .78)) 22%,
    rgb(var(--c) / calc(var(--a) * .48)) 45%,
    rgb(var(--c) / calc(var(--a) * .2)) 70%,
    rgb(var(--c) / calc(var(--a) * .05)) 88%,
    rgb(var(--c) / 0) 100%);
  backface-visibility: hidden;
}
.lb-ember, .lava .lb.ember { --c: 119 41 4; }

/* ---- login gate: lb1 reproduces the old static glow (60%×60% ellipse at 80% 20%, .28) ---- */
.gate > .lava { z-index: 0; }
.gate > .gate-card { z-index: 1; }
/* login2: one big orange glow entering from the right edge (centre ≈ 100% 55%), peach core */
.lava-gate .lb1 { --x: 100%; --y: 55%; --w: 128%; --h: 132%;
  background: radial-gradient(closest-side,
    rgb(255 230 204) 0%, rgb(255 178 84) 13%, rgb(251 150 28) 28%, rgb(214 116 18) 44%,
    rgb(160 72 9) 58%, rgb(96 34 4) 71%, rgb(48 16 2 / .85) 82%, rgb(20 6 1 / .5) 91%, rgb(0 0 0 / 0) 100%); }
.lava-gate .lb2 { --x: 92%; --y: 96%; --w: 60%; --h: 50%; --a: .22; --c: 119 41 4; }
.lava-gate .lb3 { --x: 100%; --y: 50%; --w: 30%; --h: 36%; --a: .18; --c: 255 214 170; }
.lava-gate .lb4 { --x: 82%; --y: 14%; --w: 40%; --h: 34%; --a: .08; --c: 233 77 0; }

/* ---- hero: screen-blended over the mascot plate (adds light only), under the text ---- */
.lava-hero { mix-blend-mode: screen; }
.lava-hero .lb1 { --x: 92%; --y: 24%; --w: 62%; --h: 74%; --a: .2; }
.lava-hero .lb2 { --x: 6%;  --y: 96%; --w: 62%; --h: 56%; --a: .5; --c: 119 41 4; }
.lava-hero .lb3 { --x: 58%; --y: 4%;  --w: 50%; --h: 36%; --a: .1; --c: 255 152 26; }
.lava-hero .lb4 { --x: 104%; --y: 74%; --w: 40%; --h: 56%; --a: .16; --c: 233 77 0; }

/* ---- assets: blobs ride the baked glow of the plate ---- */
.lava-app { z-index: 1; opacity: 0; transition: opacity .6s ease; }
.app[data-view="assets"] .lava-app,
.app[data-view="guide"] .lava-app { opacity: 1; }
.lava-app .lb { transition: left 1.2s var(--ease, ease), top 1.2s var(--ease, ease), width 1.2s var(--ease, ease), height 1.2s var(--ease, ease); }
/* defaults = assets (closed): horizontal glow on the right, mid-height */
.lava-app .lb1 { --x: 90%;  --y: 50%; --w: 46%; --h: 54%; --a: .16; }
.lava-app .lb2 { --x: 70%;  --y: 58%; --w: 34%; --h: 40%; --a: .42; --c: 119 41 4; }
.lava-app .lb3 { --x: 84%;  --y: 14%; --w: 44%; --h: 36%; --a: .12; --c: 233 77 0; }
.lava-app .lb4 { --x: 10%;  --y: 94%; --w: 60%; --h: 50%; --a: .38; --c: 119 41 4; }
.lava-app .lb5 { --x: 98%;  --y: 86%; --w: 36%; --h: 40%; --a: .1; }
/* assets (menu open / results): glow band across the top */
.app[data-view="assets"].menu-open .lava-app .lb1,
.app[data-view="assets"].has-results .lava-app .lb1 { --x: 64%; --y: 2%;  --w: 62%; --h: 40%; }
.app[data-view="assets"].menu-open .lava-app .lb2,
.app[data-view="assets"].has-results .lava-app .lb2 { --x: 40%; --y: 12%; --w: 40%; --h: 30%; }
.app[data-view="assets"].menu-open .lava-app .lb3,
.app[data-view="assets"].has-results .lava-app .lb3 { --x: 96%; --y: 8%;  --w: 40%; --h: 34%; }

/* mobile: frame is portrait — make blobs rounder/larger so they read the same */
@media (max-width: 760px) {
  .lava .lb { --h: calc(var(--w) * .62); }
  .lava-hero .lb1 { --x: 86%; --y: 52%; --w: 110%; --a: .18; }
  .lava-hero .lb2 { --x: 4%;  --y: 98%; --w: 100%; }
  .lava-hero .lb3 { --x: 70%; --y: 6%;  --w: 90%; --a: .08; }
  .lava-hero .lb4 { --x: 100%; --y: 84%; --w: 70%; }
  .lava-gate .lb1 { --x: 104%; --y: 59%; --w: 200%; --h: 62%; }
  .lava-gate .lb2 { --x: 26%; --y: 77%; --w: 120%; --h: 40%; --a: .7; --c: 196 88 12; }
  .lava-gate .lb3 { --x: 100%; --y: 53%; --w: 60%; --h: 26%; }
  .lava-gate .lb4 { --w: 80%; }
  .lava-app .lb { --w: 90%; }
}

/* ---- keyframes: drift (translate, % of the blob), morph (non-uniform scale), spin, breathe ---- */
@keyframes lavaDriftA { 0%,100% { translate: 0 0; } 23% { translate: 9% -7%; } 49% { translate: -5% 9%; } 74% { translate: -11% -3%; } }
@keyframes lavaDriftB { 0%,100% { translate: 0 0; } 31% { translate: -10% 6%; } 58% { translate: 7% 10%; } 82% { translate: 6% -9%; } }
@keyframes lavaDriftC { 0%,100% { translate: 0 0; } 27% { translate: 12% 5%; } 52% { translate: 2% -10%; } 78% { translate: -9% 4%; } }
@keyframes lavaMorphA { 0%,100% { scale: 1 1; } 30% { scale: 1.16 .88; } 62% { scale: .9 1.12; } }
@keyframes lavaMorphB { 0%,100% { scale: 1.04 .96; } 40% { scale: .86 1.1; } 71% { scale: 1.12 1.02; } }
@keyframes lavaSpin   { to { rotate: 360deg; } }
@keyframes lavaSpinR  { to { rotate: -360deg; } }
@keyframes lavaBreathe { 0%,100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes lavaPlate  { 0%,100% { translate: 0 0; scale: 1; } 33% { translate: 1.4% -1%; scale: 1.025; } 67% { translate: -1.2% 1.1%; scale: 1.04; } }
@keyframes lavaBackdrop { 0%,100% { translate: 0 0; scale: 1; rotate: 0deg; } 35% { translate: 4% -3%; scale: 1.06; rotate: 3deg; } 70% { translate: -3% 4%; scale: 1.03; rotate: -2deg; } }

@media (prefers-reduced-motion: no-preference) {
  .lb { will-change: transform, opacity; }
  .lb1 { animation: lavaDriftA 29s ease-in-out -7s infinite, lavaMorphA 23s ease-in-out -3s infinite, lavaSpin 89s linear -20s infinite, lavaBreathe 19s ease-in-out -5s infinite; }
  .lb2 { animation: lavaDriftB 37s ease-in-out -15s infinite, lavaMorphB 26s ease-in-out -9s infinite, lavaSpinR 97s linear -41s infinite; }
  .lb3 { animation: lavaDriftC 31s ease-in-out -22s infinite, lavaMorphA 34s ease-in-out -14s infinite, lavaSpinR 73s linear -8s infinite, lavaBreathe 27s ease-in-out -11s infinite; }
  .lb4 { animation: lavaDriftA 41s ease-in-out -30s infinite, lavaMorphB 29s ease-in-out -18s infinite, lavaSpin 83s linear -52s infinite; }
  .lb5 { animation: lavaDriftB 33s ease-in-out -4s infinite, lavaMorphA 21s ease-in-out -12s infinite, lavaSpin 79s linear -33s infinite, lavaBreathe 23s ease-in-out -17s infinite; }
  /* the baked glow plates themselves drift/scale a touch (element oversized so no edge shows) */
  .bg { inset: -4%; will-change: transform; animation: lavaPlate 38s ease-in-out infinite; }
  .bg-assets-open { animation-delay: -9s; }
  body::before { will-change: transform; animation: lavaBackdrop 47s ease-in-out -12s infinite; }
  /* hidden plates/blobs don't need to tick */
  .app[data-view="hero"] .lava-app .lb { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .lava-app .lb { transition: none; }
}


/* =====================================================================================
 * FONT (v=fontbtn1) — 4th rail tile «Шрифт» + glass flyout with a download of the brand
 * typeface. The preview uses its OWN @font-face family ("DM Font Preview") that is applied
 * only inside .font-preview / .dl-card-icon--font, so no site font changes.
 * ===================================================================================== */
@font-face {
  font-family: "DM Font Preview";
  src: url("assets/downloads/DragonM_Classic.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
.font-flyout {
  max-height: min(78vh, calc(760 * var(--s)));
  overflow: auto;
  position: absolute; z-index: 9;
  left: calc(50% - calc(230 * var(--s))); top: calc(var(--oy) + calc(120 * var(--s)));
  width: calc(460 * var(--s)); box-sizing: border-box;
  padding: calc(22 * var(--s)) calc(24 * var(--s)) calc(22 * var(--s));
  border-radius: calc(12 * var(--s));
  border: calc(1 * var(--s)) solid rgba(255,255,255,0.18);
  background: linear-gradient(120deg, rgba(10,8,10,0.94) 0%, rgba(14,10,10,0.80) 100%);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 calc(18 * var(--s)) calc(44 * var(--s)) rgba(0,0,0,0.55), 0 0 0 calc(1 * var(--s)) rgba(0,0,0,0.4), inset 0 calc(1 * var(--s)) 0 rgba(255,255,255,0.05);
  color: #fff;
  isolation: isolate; overflow: hidden;
  --fx-d: calc(420 * var(--s)); --fx-rr: calc(160 * var(--s));
  /* closed */
  opacity: 0; visibility: hidden; pointer-events: none;
  translate: 0 calc(10 * var(--s)); scale: .97; transform-origin: 50% 0;
  transition: opacity .2s var(--ease), translate .26s var(--ease), scale .26s var(--ease), visibility 0s linear .26s;
}
.font-flyout.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
  translate: 0 0; scale: 1;
  transition: opacity .22s var(--ease), translate .32s var(--ease), scale .32s var(--ease), visibility 0s;
}
/* little notch pointing at the rail tile */
.font-flyout-kicker {
  margin: 0 0 calc(4 * var(--s));
  font-size: calc(12 * var(--s)); line-height: calc(14 * var(--s)); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.font-flyout-title { margin: 0 0 calc(14 * var(--s)); font-weight: 700; font-size: calc(20 * var(--s)); line-height: calc(24 * var(--s)); letter-spacing: -0.01em; }
.font-preview {
  display: flex; flex-direction: column; gap: calc(10 * var(--s));
  padding: calc(16 * var(--s)) calc(16 * var(--s)) calc(14 * var(--s));
  border-radius: calc(9 * var(--s));
  background: linear-gradient(100deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.18) 100%);
  border: calc(1 * var(--s)) solid rgba(255,255,255,0.085);
  font-family: "DM Font Preview", var(--font);
  font-weight: 400;
}
.font-preview-big {
  font-size: calc(50 * var(--s)); line-height: calc(46 * var(--s)); letter-spacing: 0.01em;
  background: linear-gradient(180deg, #FF9719 0%, #FF9719 48%, #F1690A 81%, #EC5A06 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.font-preview-abc { font-size: calc(17 * var(--s)); line-height: calc(21 * var(--s)); letter-spacing: 0.04em; color: rgba(255,255,255,0.86); word-break: break-all; }
.font-flyout-foot { display: flex; align-items: center; gap: calc(14 * var(--s)); margin-top: calc(16 * var(--s)); }
.font-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--s));
  height: calc(44 * var(--s)); padding: 0 calc(20 * var(--s));
  border-radius: calc(9 * var(--s));
  background: var(--grad); color: #fff;
  font-weight: 700; font-size: calc(15 * var(--s)); text-decoration: none;
  outline: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .2s var(--ease);
}
.font-dl svg { width: calc(16 * var(--s)); height: calc(16 * var(--s)); flex: none; }
.font-dl:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,0.85); }
.font-flyout-meta { color: rgba(255,255,255,0.5); font-size: calc(12 * var(--s)); font-weight: 500; }
/* chat download card for the font: "Aa" badge (same glyph style as the rail tile) */
.dl-card-icon--font { font-family: var(--font); font-weight: 800; font-size: calc(19 * var(--s)); line-height: 1; letter-spacing: -0.02em; color: #E94D00; }

/* glass sheen + border light, same as the other glass hosts */
.font-flyout::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: -1;
  width: var(--fx-d); height: var(--fx-d);
  margin: calc(var(--fx-d) / -2) 0 0 calc(var(--fx-d) / -2);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,238,218,0.12) 0%, rgba(255,176,96,0.06) 42%, rgba(255,150,60,0) 100%);
  transform: translate3d(var(--mx, -999px), var(--my, -999px), 0);
  opacity: 0; pointer-events: none;
  transition: opacity .32s var(--ease);
}
.font-flyout::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(circle var(--fx-rr) at var(--mx, 50%) var(--my, 50%), rgba(255,222,186,0.55) 0%, rgba(255,170,90,0.22) 42%, rgba(255,150,60,0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .32s var(--ease);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .font-flyout:hover::before, .font-flyout:hover::after { opacity: 1; }
  .font-dl:hover { transform: translateY(calc(-1 * var(--s))); filter: brightness(1.07); box-shadow: 0 calc(10 * var(--s)) calc(24 * var(--s)) rgba(233,77,0,0.35); }
  .font-dl:hover:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: no-preference) {
  .font-dl:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  .font-flyout, .font-flyout.is-open { transition: opacity .01s, visibility 0s; translate: none; scale: none; }
  .font-dl { transition: none; }
}

/* mobile: the rail is the bottom tab bar → the flyout opens above it, full width */
@media (max-width: 760px) {
  .font-flyout {
    left: 12px; right: 12px; top: auto; bottom: 88px; width: auto;
    padding: 18px 18px 18px; border-radius: 14px;
    translate: 0 12px; transform-origin: 50% 100%;
  }
  .font-flyout-kicker { font-size: 11px; line-height: 13px; }
  .font-flyout-title { font-size: 19px; line-height: 23px; margin-bottom: 12px; }
  .font-preview { padding: 14px; gap: 8px; }
  .font-preview-big { font-size: 38px; line-height: 36px; }
  .font-preview-abc { font-size: 13px; line-height: 17px; }
  .font-flyout-foot { margin-top: 14px; }
  .font-dl { height: 46px; font-size: 15px; padding: 0 18px; flex: 1 1 auto; }
  .font-dl svg { width: 16px; height: 16px; }
  .font-flyout-meta { font-size: 12px; }
}


/* Font rail tile open state (v=sec1): orange rim like active, without stealing view .is-active */
.rail-btn.is-open {
  box-shadow: 0 0 0 2px rgba(255,151,25,0.65), 0 0 calc(20 * var(--s)) rgba(255,151,25,0.22);
}

/* =====================================================================
 * GAME (v=game1) — 5th rail tile «Игра» + Dragon Run view
 * ===================================================================== */
.rail-guide { top: calc(249 * var(--s)); }
.rail-game { top: calc(333 * var(--s)); }
.view-game { z-index: 3; }
.game-root { position: absolute; inset: 0; }
.game-root[aria-busy="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(28 * var(--s)); height: calc(28 * var(--s)); margin: calc(-14 * var(--s));
  border: calc(3 * var(--s)) solid rgba(255,151,25,0.25); border-top-color: var(--orange); border-radius: 50%;
  animation: gSpin .8s linear infinite;
}
@keyframes gSpin { to { transform: rotate(360deg); } }
.g-wrap {
  position: absolute;
  left: calc(50% - calc(560 * var(--s))); width: calc(1120 * var(--s));
  top: calc(var(--oy) + calc(120 * var(--s))); height: calc(732 * var(--s));
  display: flex; flex-direction: column;
}
.g-head { display: flex; align-items: center; justify-content: space-between; height: calc(64 * var(--s)); margin-bottom: calc(18 * var(--s)); }
.g-title { margin: 0; font-family: "EKRAN", var(--font-display); font-weight: 700; font-size: calc(46 * var(--s)); line-height: 1; letter-spacing: .02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-tools { display: flex; gap: calc(12 * var(--s)); }
.g-btn {
  border: 0; padding: 0 calc(24 * var(--s)); height: calc(46 * var(--s)); border-radius: 999px;
  font-family: "EKRAN", var(--font-display); font-size: calc(21 * var(--s)); letter-spacing: .04em; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.g-btn-ghost { background: rgba(12,10,10,0.72); border: calc(1.5 * var(--s)) solid rgba(119,41,4,0.95); color: var(--orange); }
.g-btn-ghost:hover { border-color: var(--orange); box-shadow: 0 0 calc(18 * var(--s)) rgba(255,151,25,0.25); }
.g-btn-cta { background: var(--grad); color: #fff; height: calc(58 * var(--s)); padding: 0 calc(40 * var(--s)); font-size: calc(26 * var(--s)); box-shadow: 0 calc(8 * var(--s)) calc(26 * var(--s)) rgba(233,77,0,0.35); }
.g-btn-cta:hover { box-shadow: 0 calc(8 * var(--s)) calc(32 * var(--s)) rgba(255,151,25,0.5); transform: translateY(-1px); }
.g-btn-cta:active { transform: scale(.97); }
.g-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.g-btn:disabled { opacity: .55; cursor: wait; }
.g-stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: grid; place-items: center;
  border-radius: calc(22 * var(--s));
  border: calc(1.5 * var(--s)) solid rgba(255,151,25,0.55);
  background: rgba(8,6,6,0.82);
  box-shadow: 0 0 calc(40 * var(--s)) rgba(255,151,25,0.10), inset 0 calc(1 * var(--s)) 0 rgba(255,255,255,0.04);
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.g-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; outline: none; border-radius: 4px; }
.g-canvas:focus-visible { box-shadow: 0 0 0 2px rgba(255,151,25,0.7); }
.g-overlay {
  position: absolute; inset: 0; padding: calc(14 * var(--s));
  display: none; place-items: center; pointer-events: none;
}
.g-overlay.is-on { display: grid; }
.g-overlay > * { pointer-events: auto; }
.g-start { text-align: center; pointer-events: none !important; padding: 0 16px; background: radial-gradient(closest-side, rgba(0,0,0,0.72), rgba(0,0,0,0)); }
.g-keys { display: flex; gap: calc(12 * var(--s)); justify-content: center; color: var(--orange); margin-bottom: calc(14 * var(--s)); }
.g-key { width: calc(40 * var(--s)); height: calc(40 * var(--s)); }
.g-key-wide { width: calc(88 * var(--s)); }
.g-start-title { margin: 0; font-family: "EKRAN", var(--font-display); font-size: calc(48 * var(--s)); line-height: 1.05; color: #fff; text-shadow: 0 0 calc(22 * var(--s)) rgba(255,151,25,0.55); }
.g-start-hint { margin: calc(10 * var(--s)) 0 0; font-size: calc(17 * var(--s)); color: rgba(255,255,255,0.72); }
@media (prefers-reduced-motion: no-preference) {
  .g-start-title { animation: gBlink 1.6s steps(2, jump-none) infinite; }
}
@keyframes gBlink { 50% { opacity: .55; } }
.g-panel {
  width: min(calc(640 * var(--s)), 94%); max-height: 100%; overflow: auto;
  padding: calc(26 * var(--s)) calc(34 * var(--s)) calc(24 * var(--s)); border-radius: calc(22 * var(--s));
  background: linear-gradient(140deg, rgba(22,16,13,0.94), rgba(12,9,8,0.9));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: calc(1.5 * var(--s)) solid rgba(119,41,4,0.95);
  box-shadow: 0 calc(18 * var(--s)) calc(48 * var(--s)) rgba(0,0,0,0.6), 0 0 calc(36 * var(--s)) rgba(255,151,25,0.12);
  text-align: center; scrollbar-width: none;
}
.g-panel-sm { width: min(calc(520 * var(--s)), 94%); }
.g-over { margin: 0 0 calc(12 * var(--s)); font-family: "EKRAN", var(--font-display); font-size: calc(40 * var(--s)); line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.g-nums { display: flex; justify-content: center; gap: calc(70 * var(--s)); margin: calc(4 * var(--s)) 0 calc(12 * var(--s)); }
.g-num { display: flex; flex-direction: column; align-items: center; }
.g-num small { font-size: calc(14 * var(--s)); letter-spacing: .12em; color: rgba(255,255,255,0.55); }
.g-num strong { font-family: "EKRAN", var(--font-display); font-size: calc(40 * var(--s)); line-height: 1.05; color: #fff; font-weight: 700; }
.g-num-hi strong { color: var(--orange); }
.g-quote { margin: 0 0 calc(14 * var(--s)); padding: calc(12 * var(--s)) 0 0; border-top: calc(1 * var(--s)) solid rgba(119,41,4,0.8); }
.g-quote p { margin: 0; font-weight: 700; font-size: calc(22 * var(--s)); line-height: 1.25; color: #fff; }
.g-quote cite { display: block; margin-top: calc(4 * var(--s)); font-style: normal; font-size: calc(14 * var(--s)); color: rgba(255,255,255,0.55); }
.g-sub { margin: 0 0 calc(12 * var(--s)); font-size: calc(15 * var(--s)); color: rgba(255,255,255,0.7); }
.g-err { color: #FF9719 !important; }
.g-ok { color: var(--orange); margin-top: calc(10 * var(--s)); }
.g-row { display: flex; align-items: center; justify-content: center; gap: calc(16 * var(--s)); }
.g-hint { font-size: calc(14 * var(--s)); color: rgba(255,255,255,0.5); }
.g-form { margin-top: calc(16 * var(--s)); padding-top: calc(14 * var(--s)); border-top: calc(1 * var(--s)) solid rgba(119,41,4,0.8); text-align: left; }
.g-form-title { margin: 0 0 calc(10 * var(--s)); font-weight: 700; font-size: calc(17 * var(--s)); color: var(--orange); }
.g-fields { display: flex; gap: calc(10 * var(--s)); align-items: flex-end; }
.g-field { flex: 1 1 0; display: flex; flex-direction: column; gap: calc(4 * var(--s)); min-width: 0; }
.g-field span { font-size: calc(13 * var(--s)); color: rgba(255,255,255,0.6); }
.g-field input {
  height: calc(44 * var(--s)); padding: 0 calc(14 * var(--s)); border-radius: calc(12 * var(--s)); min-width: 0;
  background: rgba(0,0,0,0.6); border: calc(1.5 * var(--s)) solid rgba(255,255,255,0.18); color: #fff; font-size: calc(16 * var(--s)); outline: none;
}
.g-field input:focus { border-color: var(--orange); box-shadow: 0 0 0 calc(3 * var(--s)) rgba(255,151,25,0.18); }
.g-btn-save { height: calc(44 * var(--s)); font-size: calc(19 * var(--s)); padding: 0 calc(22 * var(--s)); }
.g-note { margin: calc(8 * var(--s)) 0 0; font-size: calc(12 * var(--s)); color: rgba(255,255,255,0.5); }
.g-msg { margin: calc(4 * var(--s)) 0 0; font-size: calc(13 * var(--s)); min-height: 1em; }
.g-lb-list { list-style: none; margin: calc(4 * var(--s)) 0 calc(16 * var(--s)); padding: 0; text-align: left; }
.g-lb-list li { display: flex; align-items: center; gap: calc(16 * var(--s)); padding: calc(9 * var(--s)) calc(14 * var(--s)); border-radius: calc(12 * var(--s)); }
.g-lb-list li + li { margin-top: calc(2 * var(--s)); }
.g-lb-list li.is-first { background: linear-gradient(90deg, rgba(255,151,25,0.22), rgba(119,41,4,0.18)); box-shadow: inset 0 0 0 calc(1 * var(--s)) rgba(255,151,25,0.45); }
.g-lb-rank { width: calc(22 * var(--s)); font-family: "EKRAN", var(--font-display); font-size: calc(26 * var(--s)); color: rgba(255,255,255,0.45); }
.is-first .g-lb-rank, .is-first .g-lb-who b { color: var(--orange); }
.g-lb-who { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.g-lb-who b { font-size: calc(19 * var(--s)); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-lb-who small { font-size: calc(13 * var(--s)); color: rgba(255,255,255,0.5); }
.g-lb-score { font-family: "EKRAN", var(--font-display); font-size: calc(28 * var(--s)); }
.g-lb-empty { justify-content: center; color: rgba(255,255,255,0.6); }
.g-foot { margin: calc(10 * var(--s)) 0 0; text-align: right; font-size: calc(14 * var(--s)); color: rgba(255,255,255,0.4); }

@media (max-width: 760px) {
  .rail { gap: 14px; }
  .rail-btn { width: 50px; height: 50px; }
  .g-wrap { left: 10px; right: 10px; width: auto; top: 78px; bottom: 12px; height: auto; }
  .g-head { height: 40px; margin-bottom: 10px; }
  .g-title { font-size: 26px; }
  .g-tools { gap: 8px; }
  .g-btn { height: 36px; font-size: 15px; padding: 0 14px; }
  .g-btn-cta { height: 46px; font-size: 19px; padding: 0 26px; }
  .g-stage { border-radius: 16px; place-items: start center; padding-top: 12px; }
  .g-overlay { padding: 10px; }
  .g-overlay:has(.g-start) { place-items: start center; }
  .g-start { margin-top: calc(var(--gh) + 34px); background: none; }
  .g-start-title { font-size: 24px; } .g-start-hint { font-size: 13px; margin-top: 8px; }
  .g-keys { margin-bottom: 10px; } .g-key { width: 30px; height: 30px; } .g-key-wide { width: 66px; }
  .g-panel { padding: 18px 16px; border-radius: 16px; }
  .g-over { font-size: 26px; }
  .g-nums { gap: 40px; } .g-num strong { font-size: 28px; } .g-num small { font-size: 11px; }
  .g-quote p { font-size: 16px; } .g-quote cite { font-size: 12px; }
  .g-fields { flex-wrap: wrap; } .g-field { flex: 1 1 100%; } .g-field input { height: 42px; font-size: 16px; }
  .g-btn-save { width: 100%; }
  .g-lb-who b { font-size: 16px; } .g-lb-score { font-size: 22px; } .g-lb-rank { font-size: 20px; }
  .g-foot { display: none; }
  .g-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .g-btn, .g-btn-cta { transition: none; }
}

/* login2 mobile — measured on the 378×832 mockup frame; 1g = frame width / 378 */
@media (max-width: 760px) {
  .gate { --g: calc((100vw - var(--fm-l) - var(--fm-r)) / 378); --gy: calc(50% - 416 * var(--g)); }
  .gate-logo { left: calc(50% - 64 * var(--g)); top: calc(var(--gy) + 275 * var(--g)); width: calc(128 * var(--g)); }
  .gate > .gate-card { left: calc(50% - 141 * var(--g)); top: calc(var(--gy) + 313 * var(--g)); width: calc(282 * var(--g)); height: calc(173 * var(--g));
    padding: calc(10 * var(--g)) calc(10 * var(--g)) 0; border-radius: calc(9 * var(--g)); }
  .gate-card h1 { height: calc(72 * var(--g)); font-size: calc(65 * var(--g)); line-height: calc(70 * var(--g)); letter-spacing: -0.01em; }
  #gate-form { gap: calc(8 * var(--g)); }
  #gate-input { height: calc(34 * var(--g)); border-radius: calc(8 * var(--g)); font-size: max(16px, calc(8.6 * var(--g))); padding: 0 8px; }
  #gate-input:placeholder-shown:not(:focus) { font-size: calc(8.6 * var(--g)); }
  #gate-input.is-error:placeholder-shown { font-size: calc(7.4 * var(--g)); text-overflow: ellipsis; }
  #gate-form button { height: calc(35 * var(--g)); border-radius: calc(8 * var(--g)); font-size: calc(11.5 * var(--g)); }
  .gate-lang { top: calc(var(--gy) + 522 * var(--g)); gap: 1px; }
  .gate-lang-opt { width: calc(29 * var(--g)); height: calc(18 * var(--g)); border-radius: calc(4 * var(--g)); font-size: calc(9 * var(--g)); }
}

/* login2: the main gate glow must keep its composition — drift + breathe only (no spin/morph, which turned the wide ellipse into a hard-edged stripe) */
@media (prefers-reduced-motion: no-preference) {
  .lava-gate .lb1 { animation: lavaDriftA 34s ease-in-out -7s infinite, lavaBreathe 19s ease-in-out -5s infinite; }
}
@keyframes lavaGateBreathe { 0%,100% { opacity: 1; } 50% { opacity: .86; } }
@media (prefers-reduced-motion: no-preference) {
  .lava-gate .lb1 { animation-name: lavaDriftA, lavaGateBreathe; }
}

/* ===== game3: Mario-like retro panels (pixel borders) ===== */
.g-stage { background: #1a120c; }
.g-overlay.is-on { background: rgba(26,14,6,0.28); }
.g-panel.g-retro {
  border-radius: 0; border: 0;
  background: #140d09; -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: 0 0 0 calc(4 * var(--s)) #000, 0 0 0 calc(8 * var(--s)) #FF9719, 0 0 0 calc(12 * var(--s)) #000, calc(8 * var(--s)) calc(12 * var(--s)) 0 calc(12 * var(--s)) rgba(0,0,0,0.35);
  clip-path: polygon(calc(-12 * var(--s)) 0, 0 calc(-12 * var(--s)), 100% calc(-12 * var(--s)), calc(100% + calc(12 * var(--s))) 0, calc(100% + calc(12 * var(--s))) 100%, 100% calc(100% + calc(12 * var(--s))), 0 calc(100% + calc(12 * var(--s))), calc(-12 * var(--s)) 100%);
  margin: calc(14 * var(--s)); max-height: calc(100% - calc(28 * var(--s)));
}
.g-retro .g-over { font-size: calc(38 * var(--s)); letter-spacing: .04em; background: none; color: #FF9719; text-shadow: calc(3 * var(--s)) calc(3 * var(--s)) 0 #772904; }
.g-retro .g-btn-cta { border-radius: 0; background: #FF9719; color: #fff; text-shadow: calc(2 * var(--s)) calc(2 * var(--s)) 0 #772904;
  box-shadow: inset calc(-4 * var(--s)) calc(-4 * var(--s)) 0 #E94D00, inset calc(4 * var(--s)) calc(4 * var(--s)) 0 #FFC46B, 0 0 0 calc(3 * var(--s)) #000; }
.g-retro .g-btn-cta:hover { box-shadow: inset calc(-4 * var(--s)) calc(-4 * var(--s)) 0 #E94D00, inset calc(4 * var(--s)) calc(4 * var(--s)) 0 #FFD58F, 0 0 0 calc(3 * var(--s)) #000, 0 0 0 calc(6 * var(--s)) rgba(255,151,25,0.35); }
.g-retro .g-btn-cta:active { box-shadow: inset calc(4 * var(--s)) calc(4 * var(--s)) 0 #E94D00, 0 0 0 calc(3 * var(--s)) #000; transform: translateY(calc(2 * var(--s))); }
.g-retro .g-field input { border-radius: 0; height: calc(46 * var(--s)); background: #FFF4E4; color: #1a120c; border: calc(3 * var(--s)) solid #000; box-shadow: inset calc(3 * var(--s)) calc(3 * var(--s)) 0 #E8C9A2; font-weight: 700; font-size: calc(18 * var(--s)); }
.g-retro .g-field input::placeholder { color: #a9896a; font-weight: 500; }
.g-retro .g-field input:focus { border-color: #000; box-shadow: inset calc(3 * var(--s)) calc(3 * var(--s)) 0 #E8C9A2, 0 0 0 calc(3 * var(--s)) #FF9719; }
.g-retro .g-field input[aria-invalid="true"] { box-shadow: inset calc(3 * var(--s)) calc(3 * var(--s)) 0 #E8C9A2, 0 0 0 calc(3 * var(--s)) #E94D00; }
.g-retro .g-field span { font-family: "EKRAN", var(--font-display); font-size: calc(16 * var(--s)); letter-spacing: .06em; color: #FFC46B; text-transform: uppercase; }
.g-retro .g-quote { border-top: calc(3 * var(--s)) dashed #772904; }
.g-retro .g-num small { font-family: "EKRAN", var(--font-display); font-size: calc(16 * var(--s)); color: #FFC46B; }
.g-retro .g-lb-list li { border-radius: 0; }
.g-retro .g-lb-list li.is-first { background: rgba(255,151,25,0.16); box-shadow: inset 0 0 0 calc(3 * var(--s)) #FF9719; }
.g-name { width: min(calc(520 * var(--s)), 94%); text-align: left; }
.g-name .g-over { text-align: center; margin-bottom: calc(18 * var(--s)); }
.g-fields-col { flex-direction: column; align-items: stretch; gap: calc(14 * var(--s)); }
.g-fields-col .g-field { flex: none; }
.g-btn-go { width: 100%; height: calc(60 * var(--s)); font-size: calc(30 * var(--s)); margin-top: calc(6 * var(--s)); }
.g-name .g-keys { margin: calc(16 * var(--s)) 0 0; }
.g-name .g-key { width: calc(30 * var(--s)); height: calc(30 * var(--s)); } .g-name .g-key-wide { width: calc(66 * var(--s)); }
.g-name .g-start-hint { text-align: center; margin-top: calc(6 * var(--s)); font-size: calc(14 * var(--s)); }
.g-name .g-note { text-align: center; }
.g-name .g-msg { margin: calc(8 * var(--s)) 0 calc(4 * var(--s)); font-weight: 700; }
.g-link { background: none; border: 0; padding: calc(4 * var(--s)) calc(2 * var(--s)); color: #FFC46B; font-size: calc(15 * var(--s)); text-decoration: underline; text-underline-offset: calc(3 * var(--s)); cursor: pointer; }
.g-link:hover { color: #fff; }
.g-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.g-panel .g-hint { display: block; margin: calc(10 * var(--s)) 0 0; }
.g-ok { font-weight: 700; }
@media (max-width: 760px) {
  .g-overlay:has(.g-name) { place-items: start center; }
  .g-panel.g-retro { margin: 8px; max-height: calc(100% - 16px); box-shadow: 0 0 0 3px #000, 0 0 0 6px #FF9719, 0 0 0 9px #000; }
  .g-name { width: calc(100% - 28px); padding: 16px 14px; }
  .g-panel.g-retro:not(.g-name) { width: calc(100% - 28px); }
  .g-retro .g-field span, .g-retro .g-num small { font-size: 12px; }
  .g-name .g-note { font-size: 11px; }
  .g-retro .g-over { font-size: 24px; }
  .g-name .g-over { margin-bottom: 10px; }
  .g-fields-col { gap: 8px; }
  .g-retro .g-field input { height: 42px; font-size: 16px; }
  .g-btn-go { height: 48px; font-size: 22px; }
  .g-name .g-keys, .g-name .g-start-hint { display: none; }
  .g-panel .g-hint { display: block; font-size: 12px; }
  .g-link { font-size: 14px; }
}

/* ===== game4: game fills the panel — stage continues the scene around the canvas ===== */
.g-canvas { image-rendering: pixelated; border-radius: 0; }
@media (min-width: 761px) {
  .g-stage {
    border-color: rgba(255,151,25,0.55); border-width: calc(1.5 * var(--s)); /* no black frame: thin orange ring like the catalog tiles / mobile */
    background:
      linear-gradient(#000, #000) 0 var(--g-bot, 100%) / 100% 1px no-repeat,
      repeating-linear-gradient(180deg, transparent 0 calc(var(--g-px, 3px) * 7), #B03A00 calc(var(--g-px, 3px) * 7) calc(var(--g-px, 3px) * 8)) 0 var(--g-bot, 100%) / 100% 100% no-repeat,
      linear-gradient(180deg, #FFF7EA 0, #FFF7EA var(--g-top, 0px), transparent var(--g-top, 0px)),
      #E94D00;
    box-shadow: 0 0 0 calc(1.5 * var(--s)) rgba(255,151,25,0.55), 0 0 calc(40 * var(--s)) rgba(255,151,25,0.10);
  }
}
.g-canvas:focus-visible { box-shadow: none; }
.g-stage:has(.g-canvas:focus-visible) { outline: 2px solid rgba(255,151,25,0.8); outline-offset: 3px; }

/* ===== lava2: WebGL lava-lamp layers (lava.js); CSS .lb blobs remain the no-WebGL fallback ===== */
.lava-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.lava.gl-on > .lb { display: none; }
.lava-backdrop { position: fixed; inset: 0; z-index: 0; border-radius: 0; contain: strict; }
html.lava-gl-on body::before { display: none; }
.lava-app.gl-on { mix-blend-mode: screen; }
.app[data-view="font"] .lava-app, .app[data-view="game"] .lava-app { opacity: 1; }

/* ===== lava3: lava strictly BEHIND content, normal blending (never lightens the mascot / content) ===== */
.hero { isolation: isolate; }
.lava-hero.gl-on { mix-blend-mode: normal; z-index: -1; }
.lava-app.gl-on { mix-blend-mode: normal; }
html.lava-gl-on .bg { display: none; }  /* the lava replaces the baked glow plates (same look as the gate) */

/* ===== game5: no outer header — buttons live inside the panels, all as pixel CTA blocks ===== */
.g-head { display: none; }
.g-row-btns { flex-wrap: wrap; gap: calc(12 * var(--s)); }
.g-row-btns .g-btn-cta { height: calc(52 * var(--s)); padding: 0 calc(26 * var(--s)); font-size: calc(22 * var(--s)); }
.g-name .g-row-btns { margin-top: calc(14 * var(--s)); }
.g-name .g-row-btns .g-btn-cta { flex: 1 1 0; }
.g-ready .g-btn-go { margin-top: calc(4 * var(--s)); }
.g-week { font-size: calc(13 * var(--s)); margin-top: calc(-6 * var(--s)); }
@media (max-width: 760px) {
  .g-row-btns { gap: 8px; }
  .g-row-btns .g-btn-cta { height: 42px; padding: 0 14px; font-size: 16px; flex: 1 1 auto; }
  .g-week { font-size: 11px; }
}

/* ===== game6 → gamescreen (Elia mockup 23.10): title + 3 glass cards, 1326×972 frame = .main ===== */
.game-root[hidden], .game-cat[hidden] { display: none !important; }
.game-cat {
  position: absolute; left: 0; right: 0; top: var(--oy); height: calc(972 * var(--s));
  display: flex; flex-direction: column; align-items: center; overflow: auto;
  padding-top: calc(182 * var(--s)); box-sizing: border-box; scrollbar-width: none;
}
.game-cat::-webkit-scrollbar { display: none; }
.gc-head { text-align: center; }
.gc-title { margin: 0; font-family: "DragonM", "EKRAN", var(--font-display); font-weight: 400; font-size: calc(120 * var(--s)); line-height: 1; color: #fff; letter-spacing: -0.02em; white-space: nowrap; }
.gc-title-a { background: linear-gradient(180deg, #FF9719 0%, #E94D00 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.gc-sub { margin: calc(-6 * var(--s)) 0 0; font-family: "Muller", var(--font-body); font-weight: 400; font-size: calc(15.6 * var(--s)); line-height: 1.2; color: #fff; letter-spacing: -0.02em; }
.gc-dot { display: inline-block; margin: 0 calc(9 * var(--s)); }
.gc-grid { display: grid; grid-template-columns: repeat(3, calc(291 * var(--s))); gap: calc(60 * var(--s)); margin-top: calc(45 * var(--s)); }
.gc-tile {
  appearance: none; border: 0; padding: 0; margin: 0; text-align: left; font: inherit; color: #fff;
  display: flex; flex-direction: column; width: calc(291 * var(--s)); min-height: calc(400 * var(--s)); position: relative;
  border-radius: calc(12.19 * var(--s)); overflow: hidden; isolation: isolate;
  /* glass plate = Rectangle 240661923.svg: black→20% gradient @55% + black 35%, inner shadow 0 −3.4 4.5 25% */
  background: linear-gradient(219deg, rgba(0,0,0,0.11) 0%, rgba(0,0,0,0.11) 18%, rgba(0,0,0,0.55) 100%), rgba(0,0,0,0.35);
  box-shadow: inset 0 calc(-3.4 * var(--s)) calc(4.5 * var(--s)) rgba(0,0,0,0.25);
  -webkit-backdrop-filter: blur(calc(14 * var(--s))); backdrop-filter: blur(calc(14 * var(--s)));
}
.gc-tile.is-live { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.gc-tile.is-live:hover { transform: translateY(calc(-4 * var(--s))); box-shadow: inset 0 calc(-3.4 * var(--s)) calc(4.5 * var(--s)) rgba(0,0,0,0.25), 0 calc(14 * var(--s)) calc(34 * var(--s)) rgba(233,77,0,0.28); }
.gc-tile.is-live:active { transform: translateY(calc(-1 * var(--s))); }
.gc-tile.is-live:focus-visible { outline: calc(2 * var(--s)) solid #FF9719; outline-offset: calc(4 * var(--s)); }
.gc-cover { width: 100%; aspect-ratio: 291 / 290; display: block; overflow: hidden; border-radius: calc(12.19 * var(--s)) calc(12.19 * var(--s)) 0 0; background: #120804; flex: none; }
.gc-cover img { width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: auto; }
.gc-body { padding: calc(23 * var(--s)) calc(25 * var(--s)) calc(20 * var(--s)); display: flex; flex-direction: column; gap: calc(8 * var(--s)); flex: 1; }
.gc-name { margin: 0; font-family: "Muller", var(--font-body); font-weight: 700; font-size: calc(22 * var(--s)); line-height: 1.15; color: #fff; letter-spacing: -0.02em; }
.gc-tag { margin: 0; font-family: "Muller", var(--font-body); font-weight: 400; font-size: calc(15.4 * var(--s)); line-height: 1.05; color: rgba(255,255,255,0.92); letter-spacing: -0.02em; }
.gc-foot { display: none; }  /* best/«Играть» kept in DOM (QA, scores) but not shown: mockup has no footer */
@media (max-width: 760px) {
  .game-cat { top: 64px; bottom: 0; height: auto; padding: 34px 20px 40px; justify-content: flex-start; }
  .gc-title { font-size: 46px; white-space: normal; line-height: .98; }
  .gc-title-b { white-space: nowrap; }
  .gc-sub { font-size: 12.5px; margin-top: 8px; padding: 0; line-height: 1.35; white-space: nowrap; }
  .gc-dot { margin: 0 5px; }
  .gc-grid { grid-template-columns: minmax(0, 340px); gap: 22px; margin-top: 28px; width: 100%; justify-content: center; }
  .gc-tile { width: 100%; min-height: 0; border-radius: 14px; }
  .gc-cover { border-radius: 14px 14px 0 0; }
  .gc-body { padding: 16px 20px 20px; gap: 7px; }
  .gc-name { font-size: 20px; }
  .gc-tag { font-size: 14.5px; }
}
@media (max-width: 380px) { .gc-sub { white-space: normal; font-size: 12px; } .gc-title { font-size: 40px; } }
/* glow behind the catalog when WebGL lava is off (GL scene "game" already = gate glow) */
.app[data-view="game"] .lava-app .lb1 { --x: 104%; --y: 58%; --w: 80%; --h: 96%; --a: .5; }
.app[data-view="game"] .lava-app .lb2 { --x: 64%;  --y: 104%; --w: 60%; --h: 44%; --a: .55; --c: 233 77 0; }
.app[data-view="game"] .lava-app .lb3 { --x: 98%;  --y: 66%; --w: 22%; --h: 30%; --a: .5; --c: 255 228 200; }
.app[data-view="game"] .lava-app .lb4 { --x: 30%;  --y: 0%;  --w: 50%; --h: 30%; --a: .25; --c: 119 41 4; }
.app[data-view="game"] .lava-app .lb5 { --x: 86%;  --y: 92%; --w: 40%; --h: 40%; --a: .4; }

/* ===== babyfly: sky stage, ready hint, tile cover crop on mobile ===== */
.g-stage.g-bf, .g-stage.g-bf:has(.g-canvas) {
  place-items: end center; padding: 0;   /* canvas sits on the bottom edge: sky above it continues seamlessly, no dirt/black band */
  background: #61C6F4;
}
@media (min-width: 761px) {
  .g-stage.g-bf { background: #61C6F4; border-color: rgba(255,151,25,0.55); }
}
.g-overlay:has(.g-bf-ready) { place-items: end center; padding-bottom: 8%; }
.g-bf-ready { text-align: center; background: none; padding: 0; }
.g-bf-ready .g-start-hint { margin: 0; font-family: "EKRAN", var(--font-display); font-size: calc(22 * var(--s)); color: #fff; text-shadow: calc(3 * var(--s)) calc(3 * var(--s)) 0 #000, calc(-2 * var(--s)) calc(-2 * var(--s)) 0 #000, calc(2 * var(--s)) calc(-2 * var(--s)) 0 #000, calc(-2 * var(--s)) calc(2 * var(--s)) 0 #000; letter-spacing: .03em; }
.g-bf-ready .g-keys { color: #fff; filter: drop-shadow(2px 2px 0 #000); }
@media (max-width: 760px) {
  .g-overlay:has(.g-bf-ready) { place-items: end center; padding-bottom: 14%; }
  .g-bf-ready .g-start-hint { font-size: 15px; padding: 0 8px; }
}
.g-overlay.is-on:has(.g-bf-ready) { background: none; }

/* ===== Dragon Stack (smooth, non-pixel): hires canvas fills the stage; locked tile replaced by the live Stack tile ===== */
.g-stage.g-st, .g-stage.g-st:has(.g-canvas) { place-items: stretch; padding: 0; background: #120804; }
@media (min-width: 761px) { .g-stage.g-st { background: #120804; } }
.g-stage.g-st .g-canvas { image-rendering: auto; }
.g-overlay:has(.g-bf-ready) { place-items: end center; }

/* ===== Font card → modal panel (fontcard) ===== */
.font-backdrop {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.app.font-flyout-open .font-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .22s var(--ease), visibility 0s; }
.font-close {
  position: absolute; top: calc(14 * var(--s)); right: calc(14 * var(--s)); z-index: 4;
  width: calc(32 * var(--s)); height: calc(32 * var(--s)); padding: 0; display: grid; place-items: center;
  border-radius: calc(8 * var(--s)); border: calc(1 * var(--s)) solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.75);
  outline: none; cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.font-close svg { width: calc(14 * var(--s)); height: calc(14 * var(--s)); }
.font-close:hover, .font-close:focus-visible { border-color: rgba(255,151,25,0.6); color: #fff; }
.font-preview-big { font-size: calc(58 * var(--s)); line-height: calc(54 * var(--s)); }
@media (max-width: 760px) {
  .asset-chips { flex-wrap: wrap; }
  .asset-chip { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .app.menu-open .asset-chips { top: 482px !important; }
  .asset-menu { height: 342px; }
  .assets-results { top: 300px; }
  .font-flyout { left: 14px; right: 14px; width: auto; top: 300px; bottom: auto; padding: 20px 18px 18px; translate: 0 10px; transform-origin: 50% 0; }
  .font-flyout.is-open { translate: 0 0; }
  .font-close svg { width: 14px; height: 14px; }
  .font-close { top: 12px; right: 12px; width: 32px; height: 32px; }
  .font-preview-big { font-size: 40px; line-height: 38px; }
  .font-preview-abc { font-size: 14px; line-height: 18px; }
  .font-flyout-title { font-size: 19px; line-height: 23px; }
  .font-flyout-kicker { font-size: 11px; }
  .font-dl { height: 44px; font-size: 15px; padding: 0 18px; }
  .font-flyout-meta { font-size: 12px; }
}

/* ===== Edge fix (v=moscow1): WebGL lava canvases are composited on whole device pixels, so when the window
 * edge lands on a fractional pixel (e.g. 1366×768 → right = 1192.625px) the canvas stops short and the
 * shell's #000 base shows as a 1px dark line along the straight edges. Overscan the inner lava hosts by 2px;
 * the shell's overflow:hidden + radius clips them exactly at the frame edge. */
.shell .lava, .gate > .lava { inset: -2px; }

/* Dragon Stack ready hint: top % = share of stage HEIGHT — desktop: clear gap between held bundle and DRAGON STACK plinth; mobile: void below the plinth */
.g-stage.g-st .g-overlay:has(.g-bf-ready) > .g-bf-ready { position: absolute; left: 0; right: 0; top: 56%; transform: translateY(-50%); margin: 0; }
@media (max-width: 760px) { .g-stage.g-st .g-overlay:has(.g-bf-ready) > .g-bf-ready { top: 74%; } }

/* ===== hud1: shared in-game HUD (game/hud.mjs) — identical in Dragon Run / Baby Fly / Stack =====
 * SCORE card top-left · BEST card top-right · game extras (lives, floors, combo, wind) as chips under SCORE. */
.g-hud {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--hud-pad, 14px); opacity: 0; transition: opacity .15s ease;
  --hud-pad: 14px; --hud-val: 22px; --hud-lbl: 9px; --hud-chip: 24px;
}
.g-hud.is-on { opacity: 1; }
.g-overlay.is-on:not(:has(.g-bf-ready)) ~ .g-hud { opacity: 0; } /* game-over / TOP-5 / start panels own the screen */
.g-hud-left { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.g-hud-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; min-width: 64px; padding: 8px 9px 2px; /* +3px top: optical centring of the cap-height ink (EKRAN digits sit high in their line box) — pixel-checked by mv/hud-center.mjs */
  background: rgba(8,4,2,0.78); border: 1.5px solid rgba(255,151,25,0.6); border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
}
.g-hud-best { align-items: center; }
.g-hud-lbl, .g-hud-val, .g-hud-txt { display: block; }
.g-hud-chip:has(.g-hud-txt) { padding: 0 8px 0 4px; } /* icon art has transparent left margin: −2px optical shift */
.g-hud-chip.g-hud-combo { padding: 0 7px 0 5px; }
.g-hud-floors .g-hud-ico { margin-top: 2px; } /* floors art sits 1px high */
.g-hud-lbl { font-family: "Muller", var(--font-body, sans-serif); font-weight: 700; font-size: var(--hud-lbl); line-height: 1; letter-spacing: -0.02em; text-transform: uppercase; color: rgba(255,255,255,0.62); }
.g-hud-val { font-family: "EKRAN", var(--font-display); font-weight: 700; font-size: var(--hud-val); line-height: 1; letter-spacing: -0.02em; color: #fff; text-shadow: 2px 2px 0 #772904; font-variant-numeric: tabular-nums; }
.g-hud-best .g-hud-val { color: #FF9719; text-shadow: 2px 2px 0 #000; }
.g-hud-extras { display: flex; flex-wrap: wrap; gap: 4px; max-width: 70vw; }
.g-hud-extras:empty { display: none; }
.g-hud-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; height: var(--hud-chip); padding: 0 6px;
  background: rgba(8,4,2,0.78); border: 1.5px solid rgba(255,151,25,0.45); border-radius: 999px;
}
.g-hud-ico { width: calc(var(--hud-chip) - 6px); height: calc(var(--hud-chip) - 6px); display: block; image-rendering: auto; }
.g-hud-txt { font-family: "EKRAN", var(--font-display); font-weight: 700; font-size: calc(var(--hud-chip) * .5); line-height: 1; letter-spacing: -0.02em; color: #fff; margin-left: 2px; }
.g-hud-chip.is-hot { background: linear-gradient(180deg, #FF9719, #E94D00); border-color: #000; }
.g-hud-chip.is-hot .g-hud-txt { color: #2a0e03; }
.g-hud-wind .g-hud-txt { color: #FFE3B0; }
@media (max-width: 760px) {
  .g-hud { --hud-pad: 8px; --hud-val: 17px; --hud-lbl: 8px; --hud-chip: 22px; }
  .g-hud-card { min-width: 52px; padding: 6px 7px 2px; border-radius: 8px; }
  .g-hud-left { gap: 4px; }
}

/* ===== GLOW1: crisp rail icons — no scaling, no wide blur, integer-px tiles ===== */
.rail-btn {
  left: round(calc(27 * var(--s)), 1px); width: round(calc(60 * var(--s)), 1px); height: round(calc(60 * var(--s)), 1px);
  transform: none !important; animation: none !important; will-change: auto;
  transition: box-shadow .2s var(--ease);
}
.rail-home { top: round(calc(40 * var(--s)), 1px); }
.rail-search { top: round(calc(165 * var(--s)), 1px); }
.rail-guide { top: round(calc(249 * var(--s)), 1px); }
.rail-game { top: round(calc(333 * var(--s)), 1px); }
.rail-img { image-rendering: auto; shape-rendering: geometricPrecision; filter: none !important; transform: none !important; }
.rail-btn::before { display: none; }           /* soft radial sheen over the icon read as smear */
.rail-btn.is-active, .rail-btn.is-open { box-shadow: 0 0 8px rgba(255,151,25,0.25); }
.rail-btn:focus-visible { box-shadow: 0 0 0 1px rgba(255,151,25,0.8); }
@media (hover: hover) and (pointer: fine) {
  .rail-btn:hover { box-shadow: none; }
  .rail-btn.is-active:hover, .rail-btn.is-open:hover { box-shadow: 0 0 8px rgba(255,151,25,0.25); }
}
@media (max-width: 760px) { .rail-btn { left: auto; top: auto !important; width: 50px; height: 50px; } }

/* ===== corners1: robust rounded clipping (Chrome/Safari drop overflow+radius clip on
   composited children: WebGL canvas, backdrop-filter, transformed layers) ===== */
.gate, .shell {
  background-clip: padding-box;
  -webkit-clip-path: inset(0 round var(--fr)); clip-path: inset(0 round var(--fr));
}
.gate, .shell { overflow: clip; -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); }
.gc-tile {
  overflow: clip; background-clip: padding-box; transform: translateZ(0);
  -webkit-clip-path: inset(0 round calc(12.19 * var(--s))); clip-path: inset(0 round calc(12.19 * var(--s)));
}
.gc-tile.is-live:hover { transform: translateY(calc(-4 * var(--s))) translateZ(0); }
.gc-tile.is-live:active { transform: translateY(calc(-1 * var(--s))) translateZ(0); }
.gc-cover { -webkit-clip-path: inset(0 round calc(12.19 * var(--s)) calc(12.19 * var(--s)) 0 0); clip-path: inset(0 round calc(12.19 * var(--s)) calc(12.19 * var(--s)) 0 0); }
@media (max-width: 760px) {
  .gc-tile { -webkit-clip-path: inset(0 round 14px); clip-path: inset(0 round 14px); }
  .gc-cover { -webkit-clip-path: inset(0 round 14px 14px 0 0); clip-path: inset(0 round 14px 14px 0 0); }
}

/* ===== add1: Muller in the font card, short-logo replies, mascot grid, guidebook ===== */
.font-split { height: calc(1 * var(--s)); margin: calc(16 * var(--s)) 0 calc(14 * var(--s)); background: rgba(255,255,255,0.14); }
.font-preview-muller { font-family: "Muller", var(--font); }
.font-preview-muller-big {
  font-size: calc(34 * var(--s)); line-height: calc(38 * var(--s)); font-weight: 700; letter-spacing: -0.02em; color: #fff;
}
.font-cards { display: flex; flex-direction: column; gap: calc(10 * var(--s)); width: min(calc(520 * var(--s)), 100%); }
.font-cards .dl-card { width: 100%; }
.guide-jump-row { margin: calc(12 * var(--s)) 0 0; white-space: normal; }
.guide-jump {
  display: inline-flex; align-items: center; min-height: calc(40 * var(--s)); padding: 0 calc(14 * var(--s));
  border-radius: calc(8 * var(--s)); border: calc(1 * var(--s)) solid rgba(255,151,25,0.7);
  background: rgba(0,0,0,0.45); color: #fff;
  font-weight: 700; font-size: calc(14 * var(--s)); letter-spacing: -0.02em;
}
.guide-jump:hover { background: var(--grad); border-color: transparent; }
.mascot-grid-cap { margin: calc(12 * var(--s)) 0 calc(8 * var(--s)); white-space: normal; color: rgba(255,255,255,0.78); font-size: calc(13 * var(--s)); }
.mascot-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(8 * var(--s));
  width: min(calc(640 * var(--s)), 100%); white-space: normal;
}
.mascot-thumb {
  display: flex; flex-direction: column; gap: calc(4 * var(--s)); align-items: stretch;
  padding: calc(6 * var(--s)); border: 0; border-radius: calc(8 * var(--s));
  background: #1F1C22; color: #fff; text-align: left;
}
.mascot-thumb img { width: 100%; height: calc(72 * var(--s)); object-fit: contain; background: #141216; border-radius: calc(4 * var(--s)); }
.mascot-thumb span {
  font-size: calc(11 * var(--s)); line-height: calc(13 * var(--s)); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mascot-thumb:hover { box-shadow: inset 0 0 0 calc(2 * var(--s)) var(--orange); }
.mascot-lightbox {
  position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center;
}
.mascot-lightbox[hidden] { display: none !important; }
.mascot-lightbox-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,0.72); }
.mascot-lightbox-card {
  position: relative; z-index: 1; width: min(calc(860 * var(--s)), 92%);
  padding: calc(18 * var(--s)); border-radius: calc(14 * var(--s));
  background: #141216; border: calc(1 * var(--s)) solid rgba(255,255,255,0.16);
  display: flex; flex-direction: column; gap: calc(12 * var(--s)); align-items: center;
}
.mascot-lightbox-card img { max-width: 100%; max-height: 62vh; object-fit: contain; background: #1F1C22; border-radius: calc(8 * var(--s)); }
.mascot-lightbox-foot { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--s)); width: 100%; }
.mascot-lightbox-foot p { margin: 0; font-weight: 700; font-size: calc(14 * var(--s)); }
.mascot-lightbox-close { position: absolute; top: calc(10 * var(--s)); right: calc(10 * var(--s)); }

/* gb1: guidebook — no TOC, centered rounded slide, controls docked under it */
.guide-layout {
  position: absolute;
  left: calc(28 * var(--s)); right: calc(28 * var(--s));
  top: calc(var(--oy) + calc(96 * var(--s)));
  bottom: calc(100% - var(--oy) - calc(940 * var(--s)));
  z-index: 2; min-height: 0; min-width: 0;
  container-type: size;
}
.guide-toc { display: none !important; }
.guide-stage {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.guide-frame {
  --bar-h: calc(44 * var(--s)); --bar-gap: calc(14 * var(--s));
  width: min(100cqw, calc((100cqh - var(--bar-h) - var(--bar-gap)) * 16 / 9));
  display: flex; flex-direction: column; gap: var(--bar-gap);
}
.guide-page {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: calc(18 * var(--s)); overflow: hidden; isolation: isolate;
  background: #fff;
  border: 0;
  box-shadow: 0 0 0 calc(1 * var(--s)) rgba(255,255,255,0.08), 0 calc(18 * var(--s)) calc(48 * var(--s)) rgba(0,0,0,0.55);
  transform: translateZ(0);
}
.guide-page img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
}
.guide-bar {
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: calc(10 * var(--s));
  padding: 0;
}
.guide-prev { justify-self: start; }
.guide-actions { justify-self: end; display: flex; align-items: center; gap: calc(8 * var(--s)); }
.guide-caption {
  margin: 0; padding: 0 calc(14 * var(--s)); height: calc(32 * var(--s)); display: inline-flex; align-items: center;
  border-radius: 999px; border: calc(1 * var(--s)) solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.45);
  font-size: calc(13 * var(--s)); font-weight: 500; letter-spacing: -0.02em; color: rgba(255,255,255,0.78);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.guide-navbtn, .guide-dl {
  height: calc(40 * var(--s)); padding: 0 calc(16 * var(--s)); gap: calc(8 * var(--s)); border-radius: calc(10 * var(--s));
  border: calc(1 * var(--s)) solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.45); color: #fff; cursor: pointer;
  font-weight: 700; font-size: calc(14 * var(--s)); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, opacity .15s ease;
}
.guide-navbtn:hover:not(:disabled) { border-color: rgba(255,151,25,0.6); }
.guide-navbtn:focus-visible, .guide-dl:focus-visible { outline: 2px solid #FF9719; outline-offset: 2px; }
.guide-navbtn:disabled { opacity: 0.35; cursor: default; }
.guide-arr { font-weight: 400; opacity: 0.8; }
.guide-dl { background: linear-gradient(135deg, #FF9719 0%, #E94D00 100%); border-color: transparent; box-shadow: 0 calc(6 * var(--s)) calc(18 * var(--s)) rgba(233,77,0,0.35); }
.guide-dl:hover { transform: translateY(-1px); box-shadow: 0 calc(8 * var(--s)) calc(22 * var(--s)) rgba(233,77,0,0.5); }
@media (max-width: 760px) {
  .mascot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mascot-thumb img { height: 64px; }
  .guide-layout { left: 10px; right: 10px; top: 64px; bottom: 10px; }
  .guide-frame { --bar-h: 92px; --bar-gap: 12px; }
  .guide-page { border-radius: 14px; }
  .guide-bar { grid-template-columns: auto 1fr; grid-template-rows: auto auto; row-gap: 10px; }
  .guide-caption { grid-column: 1 / -1; grid-row: 1; justify-self: center; height: 30px; font-size: 13px; }
  .guide-prev { grid-row: 2; }
  .guide-actions { grid-row: 2; }
  .guide-navbtn, .guide-dl { height: 44px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
  .font-flyout { top: 70px; max-height: calc(100% - 150px); }
  .mascot-lightbox-card { width: calc(100% - 24px); padding: 14px; }
  .mascot-lightbox-foot { flex-direction: column; align-items: stretch; }
}

/* gb1: chip tooltip */
.chip-tip {
  position: fixed; z-index: 9999; left: 0; top: 0;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(12,10,9,0.72);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  font-family: "Muller", system-ui, sans-serif; font-weight: 500; font-size: 13px; line-height: 16px;
  letter-spacing: -0.02em; color: #fff; white-space: nowrap;
  opacity: 0; transform: translate(-50%, calc(-100% - 4px));
  transition: opacity .18s var(--ease, ease), transform .18s var(--ease, ease);
}
.chip-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px;
  background: rgba(12,10,9,0.9); border-right: 1px solid rgba(255,255,255,0.14); border-bottom: 1px solid rgba(255,255,255,0.14);
  transform: translateX(-50%) rotate(45deg);
}
.chip-tip span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 8px 1px 0; background: linear-gradient(135deg,#FF9719,#E94D00); vertical-align: middle; }
.chip-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); }
@media (hover: none) { .chip-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .chip-tip { transition: none; } }

/* gb3: "guideline" label as HTML overlay so it scales with the slide (was baked 14px/1920 into webp) */
.guide-page { container-type: inline-size; }
.guide-mark {
  position: absolute; z-index: 1; pointer-events: none;
  left: 6.4cqw; bottom: 1.1cqw;
  font-family: "Muller", sans-serif; font-weight: 400;
  font-size: clamp(14px, 2cqw, 22px); line-height: 1;
  letter-spacing: -0.02em; color: #A6A6A6;
}
@media (max-width: 760px) { .guide-mark { font-size: clamp(14px, 4cqw, 16px); left: 5cqw; bottom: 1.2cqw; } }
