/* PAUQ — оформление. Чёрное поле, тонкие волосяные линии, моноширинный набор. */

:root{
  --ink:#f2f6ff;
  --dim:rgba(242,246,255,.52);
  --faint:rgba(242,246,255,.13);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
}

*{box-sizing:border-box}
[hidden]{display:none !important}

html,body{height:100%}
body{
  margin:0; background:#000; color:var(--ink);
  font-family:var(--mono);
  -webkit-font-smoothing:antialiased;
  overflow:hidden;
}

/* ───────────────────────────── стартовый экран ────────────────────────── */
#landing{position:fixed; inset:0; display:flex; overflow:hidden}

.hero{position:absolute; inset:0; z-index:0}
.hero img{
  width:100%; height:100%; object-fit:cover; object-position:58% 50%;
  opacity:.94;
  filter:saturate(1.02) contrast(1.02);
  animation:heroIn 1.4s ease both, heroZoom 26s ease-out both;
}
@keyframes heroIn{from{opacity:0} to{opacity:.94}}
@keyframes heroZoom{from{transform:scale(1.08)} to{transform:scale(1)}}
body.no-hero .hero img{display:none}
body.no-hero .hero{
  background:
    radial-gradient(120% 90% at 78% 32%, #6b4a2a 0%, #2a1c14 48%, #060505 100%),
    #000;
}
.hero-scrim{
  position:absolute; inset:0;
  background:
    linear-gradient(100deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.86) 26%, rgba(0,0,0,.42) 52%, rgba(0,0,0,.12) 78%),
    radial-gradient(130% 100% at 20% 100%, rgba(0,0,0,.75), transparent 60%);
}

.land-inner{
  position:relative; z-index:1;
  display:flex; flex-direction:column; justify-content:space-between;
  width:100%; padding:clamp(20px,3.4vw,52px);
}

.land-top{display:flex; justify-content:space-between; align-items:baseline;
  font-size:11px; letter-spacing:.26em; text-transform:uppercase; color:var(--dim)}
.land-top .mark{color:var(--ink)}

.land-mid{max-width:620px}
h1{
  margin:0; font-size:clamp(64px,11vw,148px); line-height:.86; font-weight:400;
  letter-spacing:.06em;
  text-shadow:0 0 54px rgba(180,215,255,.28);
}
.tag{
  margin:14px 0 0; font-size:clamp(12px,1.25vw,15px);
  letter-spacing:.34em; text-transform:uppercase; color:var(--dim);
}
.blurb{
  margin:26px 0 0; max-width:46ch;
  font-size:14px; line-height:1.72; color:rgba(242,246,255,.72);
}

.actions{display:flex; gap:12px; margin:34px 0 0; flex-wrap:wrap}
/* форму кнопкам рисует SVG-суперэллипс (src/ui.js) — CSS так не умеет */
.btn-shape{position:absolute; left:0; top:0; pointer-events:none; overflow:visible}
.btn-shape .fill,.btn-shape .line{transition:.22s ease}

.btn{
  position:relative; appearance:none; cursor:pointer; background:none; border:0;
  color:#05070c; font:inherit; font-size:12px; letter-spacing:.2em;
  text-transform:uppercase; padding:17px 30px;
  transition:.22s ease;
}
.btn > *:not(.btn-shape){position:relative}
.btn .fill{fill:rgba(242,246,255,.94)}
.btn .line{fill:none; stroke:rgba(5,7,12,.13); stroke-width:1}
.btn:hover .fill{fill:#fff}
.btn:hover{filter:drop-shadow(0 0 26px rgba(190,220,255,.45))}

.btn.ghost{color:var(--ink)}
.btn.ghost .fill{fill:rgba(242,246,255,.03); stroke:rgba(242,246,255,.4); stroke-width:1}
.btn.ghost .line{stroke:rgba(242,246,255,.1)}
.btn.ghost:hover .fill{fill:rgba(242,246,255,.1); stroke:var(--ink)}

.btn:active{transform:translateY(1px)}

.keys{list-style:none; margin:34px 0 0; padding:0; display:grid; gap:4px; max-width:660px}
.keys li{display:flex; gap:20px; align-items:center;
  font-size:12px; color:rgba(242,246,255,.56); border-top:1px solid var(--faint); padding-top:10px}
.keys i{flex:none; width:96px; display:flex; justify-content:flex-start; font-style:normal}

#hud #hud 
.land-bot{display:flex; align-items:center; gap:16px}
.loader{position:relative; flex:1; max-width:280px; height:1px; background:var(--faint)}
.loader i{position:absolute; inset:0 100% 0 0; background:var(--ink);
  animation:load 1.5s cubic-bezier(.3,.8,.3,1) .2s both}
@keyframes load{to{right:0}}
.status{font-size:10.5px; letter-spacing:.24em; text-transform:uppercase; color:var(--dim)}

/* ────────────────────────────────── игра ──────────────────────────────── */
#stage{
  position:fixed; inset:0; background:#000;
  display:flex; align-items:center; justify-content:center;
}
#frame{
  position:relative; background:#000;
  border:1px solid rgba(242,246,255,.16);
  box-shadow:0 0 90px rgba(120,170,255,.07);
}
body.fs #frame{border:0; box-shadow:none}
#view{display:block}

.vignette{position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(125% 105% at 50% 48%, transparent 62%, rgba(0,0,0,.55) 100%)}

#hud{position:absolute; inset:0; pointer-events:none;
  font-size:10.5px; letter-spacing:.2em; text-transform:uppercase; color:rgba(242,246,255,.46)}
.hud-row{position:absolute; display:flex; gap:20px; align-items:center}
.hud-tl{top:14px; left:16px}
.hud-tr{top:14px; right:16px}
#hud #hud #hud b{font-weight:400; color:rgba(242,246,255,.8)}

.meter{display:flex; align-items:center; gap:10px}
.meter .bar{width:116px; height:3px; border:1px solid rgba(242,246,255,.3); position:relative}
.meter .bar i{position:absolute; inset:0; background:rgba(242,246,255,.72)}

/* кнопка «меню» — последняя плашка левой колонки */
#hud .hud-menu{
  display:block; width:100%; height:46px; padding:0; border-radius:14px;
  pointer-events:auto; cursor:pointer;
  font:inherit; font-size:10.5px; letter-spacing:.24em; text-transform:uppercase;
  color:rgba(242,246,255,.62); transition:color .2s, border-color .2s, background-color .2s;
}
#hud .hud-menu:hover{color:#fff; border-color:rgba(242,246,255,.4); background-color:rgba(242,246,255,.05)}
#hud .hud-menu:active{transform:translateY(1px)}

@media (max-width:760px){
  .blurb{display:none}
  .keys{display:none}
}

/* ──────────────────── плашка развилки: мутное чёрное стекло ─────────────── */
/* общее стекло для всех панелей HUD: нити под ним просвечивают размытыми */
#hud .glass{
  position:relative;
  border-radius:16px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.012) 38%, rgba(255,255,255,0) 60%),
    rgba(10,12,18,.2);
  -webkit-backdrop-filter:blur(4px) saturate(1.3);
          backdrop-filter:blur(4px) saturate(1.3);
  border:1px solid rgba(242,246,255,.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    inset 0 0 0 1px rgba(0,0,0,.25),
    0 14px 34px rgba(0,0,0,.35);
}
#hud .glass::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  opacity:.14; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
#hud .glass > *{position:relative}

#hud .fork{
  --blue:120,186,255; --q:0; --c:226,234,252;
  position:relative; flex:none; z-index:3;
  width:196px; height:236px; padding:16px 17px 14px;
  display:flex; flex-direction:column;
  pointer-events:none; opacity:0; visibility:hidden;
  will-change:opacity;
  font-size:10.5px; letter-spacing:.2em; text-transform:uppercase;
  color:rgba(242,246,255,.46);
}

/* левая колонка: развилка и подсказки управления, всё в стекле */
.hud-left{position:absolute; left:16px; top:40px; width:196px;
  display:flex; flex-direction:column; gap:8px}
.hud-keys{display:flex; flex-direction:column; gap:8px}
#hud .hk{display:flex; align-items:center; gap:12px; min-height:46px;
  padding:8px 14px 8px 10px; border-radius:14px}
#hud .hk i{flex:none; width:62px; display:flex; justify-content:center; font-style:normal}
#hud .hk #hud .hk b{font-weight:400; font-size:10.5px; line-height:1.55; letter-spacing:.16em;
  color:rgba(242,246,255,.72)}

#hud .fork-top{display:flex; justify-content:space-between}
#hud .fork-n{color:rgba(242,246,255,.62)}

/* кольцо: цвет и свечение растут вместе с процентом (--q, --c из advisor.js) */
#hud .fork-ring{position:relative; width:128px; height:128px; margin:10px auto 0}
#hud .ring-svg{position:absolute; inset:0; width:100%; height:100%; overflow:visible}
#hud .ring-ticks line{stroke:rgba(242,246,255,.16); stroke-width:1}
#hud .ring-track{fill:none; stroke:rgba(242,246,255,.08); stroke-width:7}
#hud .ring-arc{fill:none; stroke:rgb(var(--c)); stroke-width:7; stroke-linecap:round}
#hud .ring-glow{fill:none; stroke:rgb(var(--c)); stroke-width:10; stroke-linecap:round;
  opacity:calc(.12 + var(--q) * .7); filter:blur(calc(2px + var(--q) * 7px))}
#hud .ring-tip{fill:#fff; opacity:calc(.35 + var(--q) * .65);
  filter:drop-shadow(0 0 calc(var(--q) * 6px) rgb(var(--c)))}
/* мягкое сияние в центре — появляется только у хорошего пути */
#hud .ring-bloom{position:absolute; inset:18%; border-radius:50%;
  background:radial-gradient(circle, rgba(var(--c),.45) 0%, rgba(var(--c),0) 70%);
  opacity:calc(var(--q) * var(--q) * .8); filter:blur(8px)}

#hud .ring-val{position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:3px}
#hud .fork-pct{display:flex; align-items:baseline; gap:1px; line-height:1;
  letter-spacing:0; text-transform:none}
#hud .fork-pct b{font-weight:300; font-size:32px; font-variant-numeric:tabular-nums;
  color:rgb(var(--c)); text-shadow:0 0 calc(var(--q) * 18px) rgba(var(--c), calc(var(--q) * .7))}
#hud .fork-pct i{font-style:normal; font-size:14px; color:rgba(242,246,255,.5)}
#hud .ring-lbl{font-size:8.5px; letter-spacing:.24em; color:rgba(242,246,255,.42)}

#hud .fork-cap{margin:12px 0 0; height:18px; display:flex; align-items:center; justify-content:center; gap:6px;
  color:rgba(242,246,255,.55)}
#hud .fork.is-best .fork-cap{color:rgb(120,186,255)}

#hud .fork-gain{margin-top:auto; padding-top:10px; display:flex; justify-content:space-between; align-items:baseline}
#hud .fork-gain b{font-weight:400; font-size:13px; letter-spacing:.04em; color:var(--ink);
  font-variant-numeric:tabular-nums}
#hud .fork.is-best .fork-gain b{color:rgb(120,186,255)}
#hud .fork-gain.neg b{color:rgba(255,190,150,.85)}

/* ───────────── клавиши: плоские серые квадратики, буква почти чёрная ────── */
.kf{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:24px; height:24px; padding:0 6px; border-radius:6px;
  background:rgba(206,212,222,.9); color:#0a0c11;
  font-family:var(--mono); font-size:11px; font-weight:600; font-style:normal;
  letter-spacing:0; text-transform:uppercase; line-height:1;
}
.kf.wide{padding:0 8px; font-size:10px; letter-spacing:.04em}
.kf-wasd{display:inline-grid; grid-template-columns:repeat(3, 20px); grid-auto-rows:20px; gap:3px}
.kf-wasd .kf{min-width:20px; height:20px; padding:0; font-size:10px; border-radius:5px}
.kf-wasd .kf:nth-child(1){grid-column:2; grid-row:1}
.kf-wasd .kf:nth-child(2){grid-column:1; grid-row:2}
.kf-wasd .kf:nth-child(3){grid-column:2; grid-row:2}
.kf-wasd .kf:nth-child(4){grid-column:3; grid-row:2}
#hud .fork-cap .kf{min-width:20px; height:20px; font-size:10px; border-radius:5px}
