/* Игровое меню (menyu.js): главный экран, кнопка ☰, окно паузы и настроек. Размеры — в cqw от ширины сцены. */

/* Кнопка меню — одна на все экраны, в правом верхнем углу. Звук, полный экран и итоги переехали в меню. */
.mn-knopka {
  position: absolute; z-index: 6; top: 1cqw; right: 1cqw; width: max(4.6cqw, 44px); height: max(4.6cqw, 44px);
  display: grid; place-items: center; padding: 0; border-radius: .9cqw; border: .2cqw solid var(--k);
  background: var(--y); color: var(--k); cursor: pointer; box-shadow: 0 .3cqw 0 var(--k);
}
.mn-knopka svg { width: 58%; height: 58%; }
.mn-knopka:hover { transform: translateY(-.1cqw); }
.mn-knopka:focus-visible, .mn-punkt:focus-visible, .mn-tumbler:focus-visible, .mn-glav__karta:focus-visible, .mn-sayt:focus-visible { outline: .3cqw dashed var(--n); outline-offset: .2cqw; }
.s-menyu .tablo { right: calc(max(4.6cqw, 44px) + 1.8cqw); }
.s-menyu .tablo__knopki, .s-menyu [data-k-ekran], .s-menyu [data-k-itogi] { display: none; }
/* Логотип в левом углу карты района: виден и на узком экране, где строка-заголовок пряталась. */
.s-menyu .rayon__shapka:has(.rayon__mt--logo) { align-items: center; top: .9cqw; }
.s-menyu .rayon__mt--logo { display: block; line-height: 0; }
.rayon__mt--logo img { display: block; height: max(5.2cqw, 34px); width: auto; }
.s-menyu .rayon__knopki { right: calc(max(4.6cqw, 44px) + 2.2cqw); top: 1.4cqw; }
/* Пока открыты главный экран или «Поделиться», кнопка меню не нужна. */
.s-menyu [data-podel]:not([hidden]) ~ .mn-knopka, .mn-glav:not([hidden]) ~ .mn-knopka { display: none; }

/* ---------- главный экран: слева меню, справа живой район ---------- */
.mn-glav { position: absolute; inset: 0; z-index: 7; display: flex; }
.mn-glav__panel {
  position: relative; z-index: 2; flex: none; width: 37cqw; height: 100%; background: #14213D; color: var(--p);
  padding: 2.4cqw 2.6cqw 1.8cqw 3cqw; display: flex; flex-direction: column; overflow: auto;
  box-shadow: 1.2cqw 0 0 rgba(20,33,61,.18);
}
.mn-glav__mt { margin: 0; color: var(--y); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: max(.95cqw, 9px); }
.mn-glav__logo { margin: 0 0 1cqw; line-height: 0; }
.mn-glav__logo img { display: block; width: min(100%, max(28cqw, 200px)); height: auto; }
.mn-glav__pod { margin: 0 0 1.1cqw; font-size: max(1.2cqw, 11px); line-height: 1.3; color: #C9CCD1; max-width: 27cqw; }
.mn-glav__zv { margin: 0 0 1.3cqw; display: flex; align-items: baseline; gap: .8cqw; font-size: max(1.2cqw, 11px); }
.mn-glav__zv span { background: var(--y); color: var(--k); border-radius: 2cqw; padding: .2cqw 1cqw; font-weight: 800; }
.mn-glav__zv b { color: var(--y); }

.mn-spisok { display: grid; gap: .7cqw; }
.mn-punkt {
  display: block; width: 100%; text-align: left; background: #fff; color: var(--k); border: .2cqw solid var(--k); border-radius: .8cqw;
  padding: .75cqw 1.3cqw; font: 700 max(1.3cqw, 12px) Onest, sans-serif; cursor: pointer;
}
.mn-punkt:hover { background: #FFF6CC; }
.mn-punkt--glav { background: var(--y); }
.mn-punkt--glav:hover { background: #FFDF6B; }
.mn-glav .mn-punkt { background: #1E2D52; color: var(--p); border-color: #2A3D6B; }
.mn-glav .mn-punkt:hover { background: #2A3D6B; border-color: var(--y); }
.mn-glav .mn-punkt--glav { background: var(--y); color: var(--k); border-color: var(--y); padding: 1cqw 1.3cqw; }
.mn-glav .mn-punkt--glav:hover { background: #FFDF6B; }
.mn-punkt--glav b { display: block; font-size: max(1.9cqw, 15px); font-weight: 900; }
.mn-punkt--glav b::before { content: '▶ '; font-size: .8em; }
.mn-punkt--glav span { display: block; font-weight: 600; font-size: max(1.05cqw, 10.5px); opacity: .8; }
.mn-punkt--smotr b { display: block; font-weight: 800; }
.mn-punkt--smotr b::before { content: '▶ '; font-size: .8em; color: var(--y); }
.mn-punkt--smotr span { display: block; font-weight: 600; font-size: max(1.05cqw, 10.5px); opacity: .8; }
/* «Проверка дня» на главном экране: две строки, как у «Играть», но в цвете пункта. */
.mn-punkt--den b { display: block; font-weight: 800; }
.mn-punkt--den span { display: block; font-weight: 500; font-size: max(1.05cqw, 10.5px); opacity: .8; }
.mn-punkt--den.mn-punkt--novaya b::after { content: ' •'; color: #FF4F1F; }
.mn-punkt--opasno { background: #fff; color: #B3260E; border-color: #B3260E; }
.mn-sayt { margin-top: auto; padding-top: 1.2cqw; color: #C9CCD1; font-size: max(1.05cqw, 10.5px); font-weight: 600; text-decoration: none; align-self: flex-start; }
.mn-sayt:hover { color: var(--y); text-decoration: underline; }

/* Правая часть — сам район под лёгкой вуалью; нажатие открывает его. */
.mn-glav__karta { flex: 1; position: relative; border: 0; padding: 0; cursor: pointer; background: linear-gradient(90deg, rgba(246,245,242,.55), rgba(246,245,242,.12) 45%, rgba(246,245,242,.3)); }
.mn-glav__karta span {
  position: absolute; right: 2cqw; bottom: 2cqw; background: #fff; border: .2cqw solid var(--k); border-radius: 2cqw;
  padding: .45cqw 1.4cqw; font: 800 max(1.2cqw, 11px) Onest, sans-serif; box-shadow: 0 .3cqw 0 var(--k);
}
.mn-glav__karta:hover span { background: var(--y); }
.mn-glav__insp { position: absolute; z-index: 3; left: 35cqw; bottom: 0; height: 46%; pointer-events: none; filter: drop-shadow(0 .4cqw 0 rgba(0,0,0,.18)); }
/* Под главным экраном район целиком (рисунок и подписи вместе) уменьшается и уходит вправо,
   чтобы ни одно здание не пряталось под панелью меню. */
.rayon { transition: transform .3s; }
.s-menyu:has(.mn-glav:not([hidden])) .rayon { transform: translateX(19cqw) scale(.64); }

/* ---------- окно ---------- */
.mn-okno { position: absolute; inset: 0; z-index: 9; background: rgba(22,24,27,.78); display: grid; place-items: center; padding: 2cqw; }
.mn-list {
  background: var(--p); border: .25cqw solid var(--k); border-radius: 1.4cqw; box-shadow: 0 .6cqw 0 var(--k);
  padding: 1.8cqw 2.4cqw 2cqw; width: min(max(40cqw, 340px), 100%); max-height: 100%; overflow: auto; font-size: max(1.2cqw, 12px);
}
.mn-list__mt { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--f); font-size: max(.95cqw, 9px); }
.mn-list h2 { margin: .1cqw 0 1.1cqw; font-size: max(2.4cqw, 18px); line-height: 1.1; }
.mn-list [data-mn-telo] { display: grid; gap: .6cqw; }
.mn-ryad { display: grid; grid-template-columns: 1fr 1fr; gap: .6cqw; margin-top: .5cqw; }
.mn-tumbler { background: #fff; border: .18cqw solid var(--k); border-radius: .8cqw; padding: .65cqw .8cqw; font: 600 max(1.1cqw, 11px) Onest, sans-serif; cursor: pointer; }
.mn-tumbler:hover { background: #FFF6CC; }
.mn-tumbler:disabled { opacity: .5; cursor: default; background: #fff; }
.mn-prim { margin: .3cqw 0; color: var(--g); font-size: max(1.05cqw, 11px); line-height: 1.3; }
.mn-sayt--okno { margin: .3cqw 0 0; padding: 0; color: var(--n); }
.mn-sayt--okno:hover { color: var(--n); }
.mn-pravila { margin: 0; padding-left: 1.8cqw; display: grid; gap: .45cqw; line-height: 1.3; }
.mn-rezhimy { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6cqw; margin: .5cqw 0; }
.mn-rezhimy p { margin: 0; background: #fff; border-left: .35cqw solid var(--y); padding: .5cqw .8cqw; font-size: max(1cqw, 10.5px); line-height: 1.25; }
.mn-rezhimy b { display: block; margin-bottom: .15cqw; }
.mn-okno:has(.mn-pravila) .mn-list { width: min(max(58cqw, 480px), 100%); }

/* ---------- рейтинг игроков (reyting.js) ---------- */
.mn-okno:has(.rt-vkladki) .mn-list { width: min(max(52cqw, 420px), 100%); }
.rt-vkladki { display: grid; grid-template-columns: 1fr 1fr; border: .18cqw solid var(--k); border-radius: .8cqw; overflow: hidden; }
.rt-vkl { background: #fff; border: 0; padding: .6cqw .8cqw; font: 700 max(1.1cqw, 12px) Onest, sans-serif; cursor: pointer; color: var(--k); }
.rt-vkl + .rt-vkl { border-left: .18cqw solid var(--k); }
.rt-vkl[aria-selected="true"] { background: var(--k); color: var(--y); }
.rt-vkl:focus-visible { outline: .3cqw dashed var(--n); outline-offset: -.4cqw; }
.rt-spisok { list-style: none; margin: 0; padding: 0; display: grid; gap: .3cqw; max-height: max(24cqw, 220px); overflow: auto; }
.rt-ryad { display: grid; grid-template-columns: max(2.6cqw, 26px) max(2.6cqw, 28px) 1fr auto; align-items: center; gap: .7cqw;
  background: #fff; border-radius: .7cqw; padding: .35cqw .8cqw; line-height: 1.15; }
.rt-ryad--1 .rt-m { background: var(--y); }
.rt-ryad--2 .rt-m { background: #DADDE2; }
.rt-ryad--3 .rt-m { background: #F3C9A6; }
.rt-ryad--moy { outline: .2cqw solid var(--n); }
.rt-ryad--mezhdu { background: none; display: block; text-align: center; color: var(--g); padding: 0; }
.rt-m { justify-self: center; min-width: max(2.2cqw, 22px); text-align: center; border-radius: 2cqw; font-weight: 900; font-variant-numeric: tabular-nums; padding: .1cqw .3cqw; }
.rt-kr { width: max(2.6cqw, 28px); height: max(2.6cqw, 28px); border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: #14213D; color: var(--y); font-weight: 800; font-size: max(1.1cqw, 12px); }
.rt-imya { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-imya em { font-style: normal; font-weight: 600; color: var(--n); font-size: .85em; }
.rt-schet { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-schet b { font-weight: 900; }
.rt-schet small { display: block; color: var(--g); font-size: .82em; }
.rt-pusto { margin: .4cqw 0; background: #fff; border-radius: .7cqw; padding: 1cqw; line-height: 1.3; }
.rt-blok { display: grid; gap: .5cqw; border-top: .15cqw solid var(--line); padding-top: .7cqw; }
.rt-blok p { margin: 0; line-height: 1.3; }
.rt-galka { display: flex; gap: .6cqw; align-items: center; cursor: pointer; }
.rt-galka input { width: max(1.4cqw, 16px); height: max(1.4cqw, 16px); accent-color: var(--k); }
a.rt-voyti { text-decoration: none; text-align: center; }

/* Телефон лёжа: панель шире, инспектор не заслоняет пункты. */
@container (max-width: 900px) {
  .mn-glav__panel { width: 44cqw; padding: 1.6cqw 2cqw 1.2cqw 2.4cqw; }
  .mn-glav__pod { display: none; }
  .mn-glav__insp { left: 41cqw; height: 38%; }
  .mn-spisok { gap: .5cqw; }
  .mn-rezhimy { grid-template-columns: 1fr; }
}
/* Под главным экраном шапка и кнопки карты не просвечивают. */
.s-menyu:has(.mn-glav:not([hidden])) :is(.rayon__knopki, .rayon__shapka) { display: none; }

/* ---------- Телефон в портрете: главный экран и окна меню во весь экран, поворот просим только перед сценой ---------- */
@media (orientation: portrait) and (max-width: 700px) {
  body:has(.mn-glav:not([hidden])) .povorot, body:has(.mn-okno:not([hidden])) .povorot { display: none; }
  .mn-glav:not([hidden]) { position: fixed; z-index: 30; }
  .mn-glav__panel { width: 100%; padding: 6vw 6vw 5vw; box-shadow: none; }
  .mn-glav__karta { display: none; }
  .mn-glav__insp { left: auto; right: 1vw; top: 3vw; bottom: auto; height: 38vw; }
  .mn-glav__mt { font-size: 3vw; }
  .mn-glav__logo { margin: 0 0 4vw; } .mn-glav__logo img { width: 64vw; }
  .mn-glav__pod { display: block; font-size: 4vw; max-width: 68vw; margin-bottom: 4vw; }
  .mn-glav__zv { font-size: 4vw; gap: 2vw; margin-bottom: 5vw; }
  .mn-glav__zv span { padding: .6vw 3vw; border-radius: 6vw; }
  .mn-glav .mn-spisok { gap: 2.4vw; }
  .mn-glav .mn-punkt, .mn-okno .mn-punkt { font-size: 4.4vw; padding: 3.2vw 4vw; border-radius: 2.4vw; border-width: 2px; min-height: 44px; }
  .mn-glav .mn-punkt--glav { padding: 3.4vw 4vw; }
  .mn-punkt--glav b { font-size: 6vw; }
  .mn-punkt--glav span, .mn-punkt--smotr span { font-size: 3.6vw; }
  .mn-sayt { font-size: 3.8vw; padding-top: 4vw; }
  .mn-okno:not([hidden]) { position: fixed; z-index: 31; padding: 4vw; }
  .mn-okno .mn-list, .mn-okno:has(.mn-pravila) .mn-list { width: 100%; padding: 5vw; border-width: 2px; border-radius: 4vw; font-size: 4vw; }
  .mn-list__mt { font-size: 3vw; }
  .mn-list h2 { font-size: 6.4vw; margin-bottom: 3vw; }
  .mn-list [data-mn-telo] { gap: 2.4vw; }
  .mn-ryad { gap: 2.4vw; }
  .mn-tumbler { font-size: 3.8vw; padding: 3vw; border-width: 2px; border-radius: 2.4vw; min-height: 44px; }
  .mn-prim { font-size: 3.6vw; }
  .mn-pravila { padding-left: 5vw; gap: 2vw; }
  .mn-rezhimy { grid-template-columns: 1fr; gap: 2vw; }
  .mn-rezhimy p { font-size: 3.6vw; padding: 2vw 3vw; }
}
