/* Заглавная страница quintaine.com (проход 65): двор ночью, сержант стражи у входа, ниже сведения об игре.
   Облик тот же, что у игры: кованая бронза и шифер из Blender (/ui/*.webp), шрифты Forum и Golos Text лежат у себя. */
@font-face { font-family: 'Forum'; font-style: normal; font-weight: 400; font-display: swap; src: url(/l/forum-latin-400-normal.21eb0ef1c5.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Forum'; font-style: normal; font-weight: 400; font-display: swap; src: url(/l/forum-cyrillic-400-normal.d3440e242c.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(/l/golos-text-latin-400-normal.c8246f55db.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400; font-display: swap; src: url(/l/golos-text-cyrillic-400-normal.15a5cbadfc.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(/l/golos-text-latin-600-normal.ecd56e7dae.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 600; font-display: swap; src: url(/l/golos-text-cyrillic-600-normal.1df9c46f33.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0d0d10;
  --ink: #e9dec8;
  --dim: #a99f8c;
  --faint: #7b7365;
  --bronze: #d9a24a;
  --gold: #ffe2a0;
  --ember: #ff8a3c;
  --err: #ff9a80;
  --f-display: 'Forum', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.q-body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-ui); overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
a { color: var(--gold); }
button, input { font: inherit; color: inherit; touch-action: manipulation; }
.q-skip { position: absolute; left: -9999px; }
.q-skip:focus { left: 12px; top: 12px; z-index: 50; background: #000; padding: 8px 12px; }

/* ---------------------------------------------------------------- кнопки и рамки */
.q-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 2px 14px; border: 9px solid transparent; border-image: url(/ui/btn_iron.webp) 30 40 fill / 9px 12px stretch; background: none; color: #efe4cc; font: 600 15px/1.2 var(--f-ui); text-decoration: none; cursor: pointer; text-align: center; }
.q-btn.q-main { border-image-source: url(/ui/btn_bronze.webp); color: #2a1704; text-shadow: 0 1px 0 rgba(255, 226, 170, 0.5); }
.q-btn:disabled { filter: grayscale(0.85) brightness(0.62); cursor: default; }
.q-btn:focus-visible, .q-pill:focus-visible, .q-formlink:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-pill { min-height: 44px; padding: 4px 12px; border: 8px solid transparent; border-image: url(/ui/thin_gold.webp) 32 / 8px stretch; background: rgba(9, 9, 12, 0.72); color: var(--gold); font: 600 14px var(--f-ui); cursor: pointer; }

/* ---------------------------------------------------------------- шапка */
.q-top { position: absolute; z-index: 20; top: calc(10px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.q-top > * { pointer-events: auto; }
.q-lang { position: relative; }
/* проход 74: кнопка музыки рядом с языками */
.q-tr { display: flex; gap: 8px; align-items: center; }
.q-music { width: 52px; min-height: 44px; display: grid; place-items: center; padding: 0; cursor: pointer; border: 8px solid transparent; border-image: url(/ui/thin_gold.webp) 32 / 8px stretch; background: rgba(9, 9, 12, 0.72); }
.q-music svg { width: 20px; height: 20px; fill: none; stroke: var(--bronze); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.q-music.on svg { stroke: var(--gold); }
.q-music .q-mute { opacity: 1; }
.q-music.on .q-mute { opacity: 0; }
.q-music:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-lang summary { list-style: none; display: flex; align-items: center; gap: 8px; min-width: 64px; min-height: 44px; padding: 0 10px; cursor: pointer; color: var(--gold); font: 600 13px var(--f-ui); letter-spacing: 0.08em; border: 8px solid transparent; border-image: url(/ui/thin_gold.webp) 32 / 8px stretch; background: rgba(9, 9, 12, 0.72); }
.q-lang summary::-webkit-details-marker { display: none; }
.q-lang summary i { width: 7px; height: 7px; border-right: 2px solid var(--bronze); border-bottom: 2px solid var(--bronze); transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.q-lang[open] summary i { transform: translateY(2px) rotate(225deg); }
.q-lang summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-lang-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 170px; display: grid; padding: 2px; border: 8px solid transparent; border-image: url(/ui/thin_gold.webp) 32 / 8px stretch; background: #121114; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.q-lang-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; color: #e2d6be; text-decoration: none; font: 15px var(--f-ui); }
.q-lang-list a b { width: 26px; color: var(--dim); font: 600 12px var(--f-ui); letter-spacing: 0.08em; }
.q-lang-list a:hover, .q-lang-list a:focus-visible { background: rgba(217, 162, 74, 0.12); outline: none; }
.q-lang-list a[aria-current] { color: var(--gold); }
.q-lang-list a[aria-current] b { color: var(--bronze); }

/* ---------------------------------------------------------------- двор */
.q-hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; }
.q-stage { position: absolute; inset: 0; z-index: -1; background: #07080c; }
.q-still img, .q-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
#q-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.8s ease; }
.q-live #q-scene { opacity: 1; }
.q-vignette { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(4, 4, 7, 0.65) 100%),
  linear-gradient(to bottom, rgba(5, 6, 10, 0.55) 0%, transparent 22%, transparent 55%, rgba(5, 5, 8, 0.75) 100%); }

.q-title { position: absolute; z-index: 2; top: calc(66px + var(--sat)); left: 0; right: 0; text-align: center; padding: 0 16px; pointer-events: none; }
.q-title h1 { margin: 0; line-height: 0; }
.q-title h1 img { width: min(80vw, 600px); height: auto; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.75)); }
.q-tag { margin: 10px auto 0; max-width: 34em; font: 19px/1.3 var(--f-display); color: #f0e2c2; text-shadow: 0 2px 10px #000, 0 0 2px #000; letter-spacing: 0.01em; }

.q-guard { position: absolute; z-index: 3; left: max(-30px, calc(var(--sal) - 30px)); bottom: 0; height: min(58svh, 520px); aspect-ratio: 333 / 900; pointer-events: none; transform-origin: 50% 100%; animation: q-breathe 5.5s ease-in-out infinite; }
.q-guard img { width: 100%; height: 100%; display: block; filter: brightness(0.82) contrast(1.05) drop-shadow(-6px 0 24px rgba(0, 0, 0, 0.6)); }
.q-lamp { position: absolute; left: 74%; top: 66%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 80, 0.55) 0%, rgba(255, 120, 40, 0.18) 35%, transparent 70%); mix-blend-mode: screen; animation: q-flicker 2.3s infinite; }
.q-talking .q-guard { animation: q-breathe 5.5s ease-in-out infinite, q-nod 0.9s ease-in-out infinite; }
@keyframes q-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.008); } }
@keyframes q-nod { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes q-flicker { 0%, 100% { opacity: 0.85; } 12% { opacity: 1; } 30% { opacity: 0.7; } 47% { opacity: 0.95; } 63% { opacity: 0.78; } 80% { opacity: 1; } }

.q-dialog { position: absolute; z-index: 4; left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); bottom: calc(10px + var(--sab)); padding: 10px 6px 4px; border: 22px solid transparent; border-image: url(/ui/frame_gold.webp) 96 / 22px stretch; background: linear-gradient(rgba(9, 9, 12, 0.86), rgba(9, 9, 12, 0.86)), url(/ui/slate.webp) 0 0 / 300px repeat; background-clip: padding-box; }
.q-plate { position: absolute; top: -36px; left: 6px; display: flex; gap: 8px; align-items: baseline; padding: 4px 12px; border: 8px solid transparent; border-image: url(/ui/thin_gold.webp) 32 / 8px stretch; background: #15130f; white-space: nowrap; }
.q-plate b { font: 20px/1 var(--f-display); color: var(--gold); font-weight: 400; }
.q-plate span { font-size: 12px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.q-line { margin: 4px 0 10px; min-height: 3em; font: 19px/1.4 var(--f-display); color: #f3e8d2; }
.q-line .q-caret { display: inline-block; width: 0.5em; color: var(--bronze); animation: q-blink 1s steps(2) infinite; }
@keyframes q-blink { 50% { opacity: 0; } }
.q-act { display: grid; gap: 8px; }
.q-act .q-btn { width: 100%; }
.q-act .q-choice { justify-content: flex-start; text-align: left; font-weight: 400; }
.q-act .q-choice::before { content: '›'; color: var(--bronze); font: 22px/1 var(--f-display); margin-right: 10px; }
.q-field { display: grid; gap: 4px; }
.q-field input { width: 100%; min-height: 46px; font-size: 16px; padding: 6px 10px; border: 8px solid transparent; border-image: url(/ui/thin.webp) 32 / 8px stretch; background: rgba(4, 4, 6, 0.9); color: #f6ecd8; }
.q-field input:focus { outline: none; border-image-source: url(/ui/thin_gold.webp); }
.q-hint { font-size: 12.5px; color: var(--faint); }
.q-err { margin: 0; font-size: 14px; color: var(--err); min-height: 0; }
.q-err:empty { display: none; }
.q-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-formlink { justify-self: end; display: block; margin: 6px 0 0 auto; min-height: 44px; padding: 0 6px; background: none; border: 0; color: var(--dim); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.q-down { position: absolute; z-index: 3; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 6px; color: var(--dim); text-decoration: none; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.q-down i { width: 14px; height: 14px; border-right: 2px solid var(--bronze); border-bottom: 2px solid var(--bronze); transform: rotate(45deg); animation: q-down 1.8s ease-in-out infinite; }
@keyframes q-down { 50% { translate: 0 5px; } }

/* телефон: сержант выглядывает из-за левого края окна разговора */
@media (max-width: 719px) {
  .q-guard { height: min(46svh, 420px); bottom: calc(150px + var(--sab)); left: -18px; }
  .q-dialog { padding-top: 14px; }
  .q-plate { left: 92px; }
  .q-title { top: calc(64px + var(--sat)); }
}
@media (max-width: 719px) and (max-height: 700px) {
  .q-guard { height: 36svh; }
  .q-tag { font-size: 16px; }
  .q-line { font-size: 17px; min-height: 2.8em; }
}
@media (min-width: 720px) {
  .q-guard { left: max(2vw, calc(50vw - 610px)); height: min(70svh, 640px); }
  .q-dialog { left: calc(max(2vw, 50vw - 610px) + min(70svh, 640px) * 0.3); right: auto; width: min(560px, 60vw); bottom: calc(68px + var(--sab)); }
  .q-down { display: flex; }
  .q-tag { font-size: 23px; }
  .q-act.q-two { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- сведения */
.q-info { position: relative; z-index: 1; background: linear-gradient(rgba(10, 10, 13, 0.9), rgba(10, 10, 13, 0.96)), url(/ui/slate.webp) 0 0 / 300px repeat; padding: 8px 0 24px; }
.q-sec { max-width: 1120px; margin: 0 auto; padding: 44px calc(18px + var(--sar)) 12px calc(18px + var(--sal)); }
.q-sec h2 { margin: 0 0 18px; font: 34px/1.1 var(--f-display); font-weight: 400; color: var(--gold); text-align: center; }
.q-sec h2::after { content: ''; display: block; width: 120px; height: 14px; margin: 10px auto 0; background: url(/ui/thin_gold.webp) center / 100% 100%; opacity: 0.7; mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.q-lead { text-align: center; color: var(--dim); max-width: 40em; margin: -4px auto 20px; }
.q-grid4, .q-grid3 { display: grid; gap: 14px; }
@media (min-width: 720px) { .q-grid4 { grid-template-columns: repeat(2, 1fr); } .q-grid3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .q-grid4 { grid-template-columns: repeat(4, 1fr); } }
.q-tile { padding: 8px 6px 6px; border: 18px solid transparent; border-image: url(/ui/frame.webp) 96 / 18px stretch; background: rgba(8, 8, 10, 0.55); background-clip: padding-box; }
.q-tile img { width: 56px; height: 56px; float: left; margin: 0 12px 4px 0; filter: drop-shadow(0 2px 6px #000); }
.q-tile h3 { margin: 2px 0 6px; font: 22px/1.15 var(--f-display); font-weight: 400; color: #f1dfb6; }
.q-tile p { margin: 0; color: #cfc4ae; font-size: 15px; clear: none; }

.q-cards { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 300px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; overscroll-behavior-x: contain; scrollbar-width: thin; }
@media (min-width: 1040px) { .q-cards { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } }
.q-people { scroll-snap-align: center; text-align: center; padding: 10px 6px 8px; border: 18px solid transparent; border-image: url(/ui/frame.webp) 96 / 18px stretch; background: radial-gradient(ellipse at 50% 18%, rgba(217, 162, 74, 0.13), transparent 60%), rgba(8, 8, 10, 0.6); background-clip: padding-box; }
.q-people img { width: 112px; height: 112px; filter: drop-shadow(0 6px 12px #000); }
.q-people h3 { margin: 8px 0 2px; font: 23px/1.1 var(--f-display); font-weight: 400; color: #f1dfb6; }
.q-people .q-village { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); }
.q-people p { margin: 0; font-size: 14.5px; color: #cfc4ae; }

.q-charter { display: grid; gap: 18px; align-items: center; }
@media (min-width: 860px) { .q-charter { grid-template-columns: 1.1fr 1fr; } .q-charter h2 { text-align: left; } .q-charter h2::after { margin-left: 0; } }
.q-charter-art { border: 18px solid transparent; border-image: url(/ui/frame_gold.webp) 96 / 18px stretch; line-height: 0; }
.q-charter-art img { width: 100%; height: auto; }
.q-charter-text p { margin: 0 0 12px; font: 19px/1.5 var(--f-display); color: #e6dac2; }

.q-fair .q-tile img { width: 48px; height: 48px; }
.q-alpha { text-align: center; padding-bottom: 32px; }
.q-alpha p { max-width: 36em; margin: 0 auto 18px; color: #d6cbb5; }
.q-alpha-act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.q-alpha-act .q-btn { min-width: 220px; }

.q-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 20px 16px calc(24px + var(--sab)); color: var(--faint); font-size: 13px; text-align: center; background: #08080a; }
.q-foot a { color: var(--dim); min-height: 44px; display: inline-flex; align-items: center; }
.q-credits { flex-basis: 100%; font-size: 11.5px; }

/* ---------------------------------------------------------------- окно с формой */
.q-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); background: rgba(4, 4, 6, 0.78); overflow: auto; }
.q-modal[hidden] { display: none; }
.q-box { width: min(400px, 100%); padding: 6px 4px 4px; border: 24px solid transparent; border-image: url(/ui/frame_gold.webp) 96 / 24px stretch; background: linear-gradient(rgba(10, 10, 13, 0.82), rgba(10, 10, 13, 0.82)), url(/ui/slate.webp) 0 0 / 300px repeat; background-clip: padding-box; }
.q-box h2 { margin: 0 0 12px; text-align: center; font: 26px/1.1 var(--f-display); font-weight: 400; color: var(--gold); }
.q-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.q-tabs button { min-height: 44px; border: 8px solid transparent; border-image: url(/ui/thin.webp) 32 / 8px stretch; background: rgba(9, 9, 12, 0.85); color: var(--dim); font-weight: 600; cursor: pointer; }
.q-tabs button.on { border-image-source: url(/ui/thin_gold.webp); color: var(--gold); background: rgba(217, 162, 74, 0.12); }
.q-form { display: grid; gap: 10px; }
.q-form label { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }
.q-form input { min-height: 46px; font-size: 16px; padding: 6px 10px; border: 8px solid transparent; border-image: url(/ui/thin.webp) 32 / 8px stretch; background: rgba(4, 4, 6, 0.9); color: #f6ecd8; }
.q-form input:focus { outline: none; border-image-source: url(/ui/thin_gold.webp); }
.q-form:not(.up) .q-up { display: none; }
.q-msg { margin: 0; min-height: 1.3em; color: var(--err); font-size: 14px; }
.q-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .q-guard, .q-lamp, .q-down i, .q-line .q-caret { animation: none !important; }
}
