/* Общие стили игр NVC. Без grid, flex-gap, clamp(), inset - ради встроенных браузеров ТВ. */
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/shared/fonts/manrope-cyrillic-500.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/shared/fonts/manrope-cyrillic-700.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/shared/fonts/manrope-cyrillic-800.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(/shared/fonts/manrope-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/shared/fonts/manrope-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/shared/fonts/manrope-latin-800.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }

:root {
  --brand: #8965FD;        /* МетаПетс; НВТ переопределяет на #875EF8 */
  --brand-deep: #5B3BD6;
  --brand-soft: #D6CEFD;
  --brand-tint: #EFEAFE;
  --ink: #18222C;
  --ink-2: #3A4350;
  --muted: #6B7380;
  --line: #E4E6E7;
  --bg: #F5F8FF;
  --card: #FFFFFF;
  --ok: #2E9E6A;
  --warn: #C2410C;
  --radius: 1.1rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { font-size: 20px; -webkit-text-size-adjust: 100%; }
body {
  font-family: Manrope, "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.35;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.kiosk { -webkit-user-select: none; user-select: none; }
body.kiosk input, body.kiosk textarea { -webkit-user-select: text; user-select: text; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--brand); }

/* ---------- экраны ---------- */
#app { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
.screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; -webkit-animation: scr-in .35s ease-out; animation: scr-in .35s ease-out; }
@-webkit-keyframes scr-in { from { opacity: 0; -webkit-transform: translateY(.6rem); } to { opacity: 1; -webkit-transform: none; } }
@keyframes scr-in { from { opacity: 0; transform: translateY(.6rem); } to { opacity: 1; transform: none; } }
.screen-inner { min-height: 100%; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; padding: 1.4rem 1.8rem; }
body.phone .screen-inner { padding: 1rem 1rem 1.4rem; }

.flex { display: -webkit-box; display: -webkit-flex; display: flex; }
.col { -webkit-flex-direction: column; flex-direction: column; }
.center { -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; }
.middle { -webkit-align-items: center; align-items: center; }
.between { -webkit-justify-content: space-between; justify-content: space-between; }
.grow { -webkit-flex: 1 1 auto; flex: 1 1 auto; min-height: 0; min-width: 0; }
.wrap { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.tc { text-align: center; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.brand { color: var(--brand); }

/* ---------- типографика ---------- */
.h-xl { font-size: 3.2rem; font-weight: 800; line-height: 1.02; letter-spacing: -.02em; margin: 0; }
.h-l { font-size: 2.1rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; margin: 0; }
.h-m { font-size: 1.45rem; font-weight: 800; line-height: 1.18; margin: 0; }
.h-s { font-size: 1.05rem; font-weight: 800; line-height: 1.25; margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.t-l { font-size: 1.2rem; line-height: 1.4; }
.t-m { font-size: 1rem; line-height: 1.45; }
.t-s { font-size: .8rem; line-height: 1.4; }
body.phone .h-xl { font-size: 2.4rem; }
body.phone .h-l { font-size: 1.75rem; }
body.phone .h-m { font-size: 1.3rem; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--brand); color: #fff;
  font-weight: 800; font-size: 1.05rem; letter-spacing: .03em; text-transform: uppercase;
  padding: .85rem 1.7rem; border-radius: 99rem; min-height: 3rem;
  -webkit-transition: -webkit-transform .12s, background .2s, box-shadow .2s; transition: transform .12s, background .2s, box-shadow .2s;
  box-shadow: 0 .35rem 1rem rgba(91, 59, 214, .28);
  text-decoration: none; text-align: center; line-height: 1.25;
}
.btn:active { -webkit-transform: scale(.97); transform: scale(.97); }
.btn:focus { outline: none; }
.btn:focus-visible { outline: .18rem solid var(--ink); outline-offset: .2rem; }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }
.btn-xl { font-size: 1.35rem; padding: 1.05rem 2.4rem; }
.btn-ghost { background: transparent; color: var(--ink); border: .14rem solid var(--ink); box-shadow: none; }
.btn-soft { background: var(--brand-tint); color: var(--brand-deep); box-shadow: none; }
.btn-white { background: #fff; color: var(--brand-deep); }
.btn-play:after { content: ""; display: inline-block; vertical-align: -.1em; margin-left: .7rem; border-left: .85em solid var(--brand); border-top: .55em solid transparent; border-bottom: .55em solid transparent; }
.btn-ghost.btn-play:after { border-left-color: var(--brand); }
.link-btn { background: none; border: 0; padding: .6rem; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.pulse { -webkit-animation: pulse 1.8s ease-in-out infinite; animation: pulse 1.8s ease-in-out infinite; }
@-webkit-keyframes pulse { 0%, 100% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.045); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ---------- чипы ---------- */
.chips { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: -.25rem; }
.chip {
  margin: .25rem; padding: .55rem 1rem; border-radius: 99rem; cursor: pointer;
  border: .12rem solid var(--ink); background: #fff; color: var(--ink);
  font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em;
  -webkit-transition: background .15s, color .15s, -webkit-transform .1s; transition: background .15s, color .15s, transform .1s;
}
.chip:active { -webkit-transform: scale(.96); transform: scale(.96); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.test { border-color: var(--brand); color: var(--brand-deep); }
.chip.test.on { color: #fff; }

/* ---------- карточки и бейджи ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 .5rem 1.6rem rgba(24, 34, 44, .08); }
.badge { display: inline-block; border: .1rem solid var(--brand); color: var(--brand); border-radius: 99rem; padding: .2rem .75rem; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge-fill { background: var(--brand); color: #fff; }
.art { -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, rgba(0,0,0,0) 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, rgba(0,0,0,0) 100%); }
.art img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- верхняя полоса ---------- */
.topbar { -webkit-flex: 0 0 auto; flex: 0 0 auto; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; margin-bottom: 1rem; }
.topbar .logo { height: 2rem; width: auto; }
.topbar .logo-nvt { height: 1.7rem; }
.topbar .right { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.topbar .right > * { margin-left: .8rem; }
.step { font-weight: 800; color: var(--brand); font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- форма ---------- */
.form { width: 100%; max-width: 34rem; margin: 0 auto; }
.form .field { margin-bottom: .75rem; }
.form label.lbl { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .3rem .2rem; }
.form input[type=text], .form input[type=tel], .form input[type=email], .form textarea {
  width: 100%; border: .12rem solid var(--line); background: #fff; border-radius: .8rem;
  padding: .8rem 1rem; font-size: 1.05rem; outline: none; min-height: 3rem;
  -webkit-appearance: none; appearance: none;
}
.form input:focus, .form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--brand-tint); }
.form .err { color: var(--warn); font-size: .78rem; margin: .25rem 0 0 .2rem; min-height: 0; }
.form .field.bad input { border-color: var(--warn); }
.form .hint { font-size: .8rem; margin: .3rem 0 0 .2rem; }
.form .hint button { background: none; border: 0; color: var(--brand-deep); text-decoration: underline; font-weight: 800; cursor: pointer; padding: 0; }
.consent { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: flex-start; align-items: flex-start; font-size: .78rem; color: var(--ink-2); line-height: 1.4; cursor: pointer; margin: .4rem 0 .9rem; }
.consent input { width: 1.5rem; height: 1.5rem; margin: 0 .7rem 0 0; -webkit-flex: 0 0 auto; flex: 0 0 auto; accent-color: var(--brand); }
.consent.bad { color: var(--warn); }
.form .actions { text-align: center; margin-top: .4rem; }
.form .actions .btn { width: 100%; }

/* ---------- код участника ---------- */
.code-box { text-align: center; background: #fff; border: .16rem dashed var(--brand); border-radius: var(--radius); padding: 1rem 1.2rem; }
.code-box .code { font-size: 2.6rem; font-weight: 800; letter-spacing: .06em; color: var(--brand-deep); white-space: nowrap; }
body.phone .code-box .code { font-size: 1.9rem; }
.code-box .code small { font-size: .55em; color: var(--muted); letter-spacing: .1em; }

/* ---------- QR ---------- */
.qr { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; background: #fff; border-radius: 1rem; padding: .6rem .9rem .6rem .6rem; box-shadow: 0 .3rem 1rem rgba(24, 34, 44, .1); }
.qr img { width: 5.2rem; height: 5.2rem; margin-right: .8rem; }
.qr .t-s { max-width: 9rem; font-weight: 700; color: var(--ink-2); }
body.phone .qr, body:not(.kiosk) .qr.kiosk-only { display: none; }

/* вертикальное центрирование без потери прокрутки (auto-поля вместо justify-content) */
.vc { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; }
.vc > :first-child { margin-top: auto; }
.vc > :last-child { margin-bottom: auto; }
body:not(.at-home) .fs-btn { display: none; }

/* форма на горизонтальном экране: телефон и почта в одну строку */
body.land .form { max-width: 46rem; }
body.land .form .row2 { display: -webkit-box; display: -webkit-flex; display: flex; }
body.land .form .row2 .field { -webkit-flex: 1 1 50%; flex: 1 1 50%; min-width: 0; }
body.land .form .row2 .field + .field { margin-left: .9rem; }
body.land .form .h-m + p { margin: .2rem 0 .7rem !important; }

/* ---------- оверлеи ---------- */
.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(24, 34, 44, .55); display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; z-index: 50; padding: 1rem; }
.overlay .card { padding: 1.6rem 2rem; max-width: 30rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; -webkit-transform: translateX(-50%); transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: .8rem; font-size: .85rem; z-index: 60; opacity: 0; -webkit-transition: opacity .3s; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
.fs-btn { position: fixed; bottom: .5rem; right: .5rem; z-index: 40; width: 2.2rem; height: 2.2rem; border-radius: .6rem; border: 0; background: rgba(255,255,255,.6); color: var(--ink-2); font-size: 1.1rem; cursor: pointer; opacity: .55; }
.net-dot { position: fixed; left: .5rem; bottom: .5rem; z-index: 40; font-size: .65rem; color: var(--muted); background: rgba(255,255,255,.75); border-radius: .5rem; padding: .15rem .5rem; }
.footer-note { font-size: .7rem; color: var(--muted); text-align: center; margin-top: .8rem; }

@media (prefers-reduced-motion: reduce) {
  .screen.active, .pulse { -webkit-animation: none; animation: none; }
}
