/* escaperoom.cosmicwalrus.ru — замысел и токены в server/DESIGN.md.
   Комната ночью: ореховое дерево, тёплая лампа, латунный кодовый замок. Анимация одна — колёсики замка. */

@font-face { font-family: "Rubik Mono One"; src: url(fonts/rubik-mono-one-latin.woff2) format("woff2");
  font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Onest"; src: url(fonts/onest-latin.woff2) format("woff2"); font-weight: 100 900;
  font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; src: url(fonts/onest-cyrillic.woff2) format("woff2"); font-weight: 100 900;
  font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --walnut: #2a1d16;   /* фон */
  --board: #3a2a20;    /* доска: подложки, рамки */
  --lamp: #ffd98a;     /* акцент: ссылки, фокус */
  --brass: #c79a4a;    /* колёсики замка, числа */
  --dust: #b7a593;     /* второстепенный текст */
  --note: #efe6d3;     /* лист документа */
  --text: #f1e7d8;
  --ink: #2a1d16;
  --gutter: clamp(16px, 4vw, 40px);
  --wide: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--walnut); color: var(--text);
  font: 400 17px/1.6 Onest, system-ui, sans-serif;
  /* свет лампы сверху: единственный «декор» фона */
  background-image: radial-gradient(ellipse 80% 520px at 30% -120px, rgba(255, 217, 138, .13), transparent 70%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}
a { color: var(--lamp); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; }

/* ---------- шапка ---------- */
.bar {
  max-width: var(--wide); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.game { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.game img { border-radius: 9px; }
.bar nav { display: flex; align-items: center; gap: 20px; }
.bar nav a { color: var(--text); text-decoration: none; }
.bar nav a:hover { color: var(--lamp); }
.lang { display: flex; border: 1px solid var(--board); border-radius: 999px; padding: 2px; }
.lang a { padding: 2px 10px; border-radius: 999px; font-size: 14px; color: var(--dust) !important; }
.lang a[aria-current] { background: var(--board); color: var(--text) !important; }

/* ---------- главная: секции ---------- */
.is-home main > section { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
h2 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; font-weight: 700; margin: 0 0 20px; letter-spacing: -.01em; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 650; margin: 0 0 6px; }

/* ---------- замок ---------- */
.lock-hero { padding-top: clamp(28px, 7vw, 72px); }
.lock {
  --h: 1.2em;   /* высота одной буквы на колёсике */
  font: 400 clamp(30px, 11.6vw, 96px)/1 "Rubik Mono One", Onest, sans-serif;
  margin: 0; display: grid; gap: .14em; justify-items: start;
}
.word { display: flex; gap: .07em; }
.wheel {
  position: relative; display: block; width: 1.06em; height: var(--h); overflow: hidden;
  border-radius: .1em; color: #33220f;
  /* латунный цилиндр: тень сверху и снизу, блик посередине */
  background: linear-gradient(#6d4d1f, #b48638 18%, #e2bd72 48%, #c79a4a 62%, #8a6426 88%, #5b3f17);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 .04em 0 rgba(0, 0, 0, .45);
}
.wheel::after {   /* затенение краёв поверх букв — буква «уходит» за изгиб */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(42, 29, 22, .55), transparent 26%, transparent 74%, rgba(42, 29, 22, .55));
}
.strip { display: block; transform: translateY(calc(var(--n) * var(--h) * -1)); }
.strip span { display: block; height: var(--h); line-height: var(--h); text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .strip { animation: spin calc(900ms + var(--i) * 85ms) cubic-bezier(.2, .75, .25, 1.06) 250ms both; }
}
@keyframes spin {
  from { transform: translateY(0); }
  to { transform: translateY(calc(var(--n) * var(--h) * -1)); }
}

.tagline { max-width: 34em; font-size: clamp(18px, 2.2vw, 21px); margin: clamp(24px, 4vw, 40px) 0 8px; }
.get { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }
.store {   /* латунная табличка, как колёсики замка */
  display: inline-flex; flex-direction: column; justify-content: center; min-width: 150px; min-height: 56px;
  padding: 8px 20px; border-radius: 12px; text-decoration: none; color: #33220f;
  font-size: 20px; font-weight: 700; line-height: 1.1;
  background: linear-gradient(#e2bd72, #c79a4a 60%, #a97d33);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 3px 0 #5b3f17;
}
.store small { font-size: 12px; font-weight: 500; }
.store:hover { background: linear-gradient(#ecca85, #d3a656 60%, #b4893d); }
.store:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 0 #5b3f17; }
.soon { color: var(--dust); margin: 0; }

/* ---------- скриншоты: лента во всю ширину ---------- */
.is-home main > .shots { max-width: none; padding-inline: 0; margin-top: clamp(40px, 7vw, 80px); }
.strip-x {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter))) 18px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter)));
  scrollbar-color: var(--board) transparent;
}
.strip-x img {
  flex: none; height: clamp(380px, 62vh, 560px); width: auto; aspect-ratio: 414 / 900;
  border-radius: 16px; scroll-snap-align: start; background: var(--board);
  box-shadow: 0 0 0 1px rgba(255, 217, 138, .08);
}

/* ---------- как устроена комната ---------- */
.how { margin-top: clamp(56px, 9vw, 112px); }
.how-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px clamp(24px, 4vw, 56px); }
.how-cols > div { border-top: 2px solid var(--brass); padding-top: 14px; }
.how-cols p { margin: 0; color: var(--dust); }

/* ---------- комнаты ---------- */
.rooms { margin-top: clamp(56px, 9vw, 112px); }
.rooms h2 { margin-bottom: 8px; }
.lead { color: var(--dust); margin: 0 0 28px; }
/* только сложности, без списка комнат: их будет много */
.room-cols {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px clamp(24px, 4vw, 48px);
  background: var(--board); border-radius: 14px; padding: clamp(20px, 3vw, 32px);
}
.room-col > p { margin: 0; color: var(--dust); font-size: 16px; line-height: 1.5; }

/* ---------- подсказки ---------- */
.hints { margin-top: clamp(56px, 9vw, 112px); }
.hints p { max-width: 38em; margin: 0; }

/* ---------- документы: лист-записка ---------- */
main.note {
  max-width: 760px; margin: clamp(8px, 3vw, 32px) auto 0; padding: clamp(24px, 5vw, 56px);
  background: var(--note); color: var(--ink); border-radius: 6px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .7);
  font-size: 16px; line-height: 1.65;
}
@media (max-width: 800px) { main.note { margin-inline: 12px; } }
main.note h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 6px; }
main.note h2 { font-size: 20px; margin: 32px 0 8px; }
main.note a { color: #7a4a12; }
main.note .muted { color: #6f5d4c; margin-top: 0; }
main.note ul { padding-left: 1.2em; }
main.note table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
main.note th, main.note td { text-align: left; border-bottom: 1px solid #d6c9b1; padding: 6px 10px 6px 0; vertical-align: top; }

/* ---------- подвал ---------- */
.foot {
  max-width: var(--wide); margin: clamp(64px, 10vw, 120px) auto 0; padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--board); color: var(--dust); font-size: 14px;
}
.foot p { margin: 0 0 6px; }
.foot p:first-child a { margin-right: 18px; }
.foot .owner { font-size: 13px; opacity: .8; }

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  .how-cols { grid-template-columns: 1fr; }
  .room-cols { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hide-s { display: none; }
  .bar nav { gap: 12px; } .bar { gap: 10px; }
  .game { font-size: 15px; }
  .game img { width: 34px; height: 34px; }
}
@media (max-width: 420px) {
  .game .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
