/* VOICE work: a help desk players reach from the launcher's refusal window
   IDEA the "Подробнее" page of that window: same night ground, same red code
        labels, same monospaced codes, so the player sees what they just saw
   PICTURE home: the logo and a code lookup that jumps to the answer;
        codes: a strip of the seven families as a map of the whole table
   COLOUR ground #0f0c0d, ink #f3eeee, muted #a99da0, panel #191416,
          line #2e2528, logo red #fc171e (accents), soft red #ff8095 (code text)
   TYPE Segoe UI Variable / Segoe UI (what Windows players already have,
        no third-party fonts), Cascadia Mono / Consolas for codes
   LAYOUT header bar with mark and nav; content column up to 1120px;
          codes in a two-column grid of entries on wide screens, one on phones */

:root {
  --bg: #0f0c0d;
  --panel: #191416;
  --panel-2: #211a1d;
  --line: #2e2528;
  --ink: #f3eeee;
  --body: #e2d8da;
  --muted: #a99da0;
  --red: #fc171e;
  --red-soft: #ff8095;
  --red-deep: #b3122e;
  --ok: #7fd3a0;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  --gutter: max(5vw, 16px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--red-soft); outline-offset: 3px; border-radius: 4px; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
.mono { white-space: nowrap; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .38em; color: var(--ink); overflow-wrap: anywhere; }
kbd { background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; color: var(--ink); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 16px; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(15, 12, 13, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .in {
  max-width: 1120px; margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 17px/1 var(--display); letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; }
.brand span b { color: var(--red); font-weight: 700; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }

/* ---- layout ---- */
main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.page-head { padding: 44px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.kicker { color: var(--red-soft); font: 600 14px/1.3 var(--sans); margin: 0 0 10px; }
h1, h2, h3 { color: var(--ink); font-family: var(--display); letter-spacing: -.02em; }
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.06; margin: 0 0 14px; font-weight: 700; max-width: 22ch; }
h2 { font-size: clamp(24px, 3.2vw, 30px); line-height: 1.15; margin: 48px 0 14px; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; margin: 26px 0 8px; font-weight: 600; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--body); max-width: 66ch; margin: 0; }
p, li { max-width: 72ch; }
.muted { color: var(--muted); }
.note {
  border-left: 3px solid var(--red); background: var(--panel); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 18px 0; max-width: 78ch;
}
.note.calm { border-left-color: var(--muted); }
.note p { margin: 0; }
.note p + p { margin-top: 8px; }
ol, ul { padding-left: 1.3em; }
li + li { margin-top: 4px; }

.table-wrap { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 14px; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td.nowrap, th.nowrap { white-space: nowrap; }

/* ---- home ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 48px; align-items: center;
  padding: 48px 0 40px;
}
.hero h1 { max-width: 16ch; }
.hero .mark { justify-self: center; width: min(360px, 80%); filter: drop-shadow(0 18px 40px rgba(252, 23, 30, .18)); }
.lookup { margin-top: 26px; max-width: 520px; }
.lookup label { display: block; color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.lookup .row { display: flex; gap: 8px; }
.lookup input {
  flex: 1; min-width: 0;
  font: 600 18px/1 var(--mono); letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.lookup input::placeholder { color: #6f6366; text-transform: none; font-family: var(--sans); font-weight: 400; letter-spacing: 0; }
.lookup input:focus { border-color: var(--red-soft); outline: none; }
.btn {
  font: 600 16px/1 var(--sans); color: var(--bg); background: var(--ink); border: 0; border-radius: 10px; padding: 0 22px; cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #fff; color: var(--bg); }
.btn.ghost { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.lookup .msg { min-height: 1.6em; margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.lookup .msg.bad { color: var(--red-soft); }

.window {
  margin-top: 8px; background: #141012; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 520px;
}
.window .art { height: 56px; background: linear-gradient(180deg, #2a1418, #141012); display: flex; justify-content: flex-end; align-items: flex-start; padding: 12px; }
.window .badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.45); border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.window .badge i { width: 7px; height: 7px; border-radius: 50%; background: #ff4d6a; }
.window .body { padding: 14px 18px 16px; }
.window .code-line { font-size: 13px; font-weight: 600; color: var(--muted); }
.window .code-line b { color: var(--red-soft); }
.window .h { color: var(--ink); font-weight: 600; font-size: 17px; margin: 2px 0 6px; }
.window .foot { display: flex; align-items: end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.window .appeal { margin-right: auto; font-size: 12px; color: var(--muted); line-height: 1.3; }
.window .appeal b { display: block; color: var(--ink); font: 700 15px/1.3 var(--mono); }
.window .fake { font-size: 13px; font-weight: 600; border-radius: 7px; padding: 8px 14px; }
.window .fake.more { background: #231b1e; border: 1px solid #3a2f33; color: var(--ink); outline: 2px solid var(--red); outline-offset: 2px; }
.window .fake.close { background: var(--ink); color: #141012; }
.callout-label { font-size: 14px; color: var(--muted); margin: 12px 0 0; max-width: 520px; }
.callout-label b { color: var(--red-soft); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin: 10px 0 0; }
.card {
  display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 16px; min-width: 0;
}
.card:hover { border-color: #4a3c41; background: var(--panel-2); color: var(--body); }
.card .t { color: var(--ink); font: 600 18px/1.3 var(--display); display: flex; align-items: center; gap: 8px; }
.card .t::after { content: "→"; color: var(--red); margin-left: auto; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* ---- families ---- */
.families { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 8px 0 8px; }
.fam {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 10px; padding: 12px 12px 12px;
}
.fam:hover { background: var(--panel-2); color: var(--body); }
.fam .n { font: 700 13px/1.2 var(--mono); color: var(--red-soft); letter-spacing: .02em; overflow-wrap: anywhere; }
.fam .r { font: 600 12px/1.2 var(--mono); color: var(--muted); }
.fam .w { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.25; margin-top: 6px; }
.fam .m { color: var(--muted); font-size: 13px; line-height: 1.35; }

/* ---- codes ---- */
.filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 22px 0 6px; }
.filter input {
  flex: 1 1 260px; min-width: 0; font: 16px/1 var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.filter input:focus { border-color: var(--red-soft); outline: none; }
.filter .count { color: var(--muted); font-size: 14px; white-space: nowrap; }

.family { margin-top: 40px; }
.family > header { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.family > header h2 { margin: 0; }
.family > header .r { font: 600 14px/1 var(--mono); color: var(--red-soft); }
.family > header p { flex-basis: 100%; margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.entries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.entry {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; min-width: 0;
}
.entry:target { border-color: var(--red); box-shadow: 0 0 0 3px rgba(252, 23, 30, .25); }
.entry .head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.entry .code { font: 700 15px/1 var(--mono); color: var(--red-soft); text-decoration: none; letter-spacing: .02em; }
.entry .code:hover { text-decoration: underline; }
.chip { font-size: 12px; line-height: 1; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px; white-space: nowrap; }
.entry h3 { margin: 10px 0 6px; font-size: 18px; }
.entry p { margin: 0 0 8px; font-size: 15px; }
.entry ol, .entry ul { margin: 0 0 8px; font-size: 15px; }
.entry .more { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.entry[hidden] { display: none; }
.empty { color: var(--muted); padding: 20px 0; }

/* ---- steps ---- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 0 46px; margin: 0 0 18px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font: 700 15px/30px var(--display); text-align: center;
}
.steps > li > b:first-child { color: var(--ink); display: block; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 32px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.panel h3 { margin-top: 0; }
.template { font: 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0 0; color: var(--ink); }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.toc li { margin: 0; }
.toc a { display: inline-block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 14px; color: var(--body); }
.toc a:hover { border-color: #4a3c41; color: var(--ink); }

/* ---- footer ---- */
.foot-site { border-top: 1px solid var(--line); }
.foot-site .in { max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter) 32px; display: flex; gap: 10px 24px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; }
.foot-site img { width: 22px; height: 22px; }
.foot-site a { color: var(--muted); }
.foot-site .sp { margin-left: auto; }

@media (max-width: 980px) {
  /* 7 families: 4 + 3, the last one takes the spare cell */
  .families { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fam:last-child { grid-column: span 2; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .hero .mark { order: -1; width: 120px; justify-self: start; }
  .entries, .split { grid-template-columns: minmax(0, 1fr); }
  .families { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { margin-left: 0; width: 100%; }
  /* The wrapped header is tall on a phone: let it scroll away. */
  .top { position: static; }
  html { scroll-padding-top: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .entry:target { transition: box-shadow .3s; }
}
