/* Стили игры, часть «game-layout»: таймер хода, игроки за одним компьютером, портреты-модели, раскладка окна, карта, окно загрузки поля. Порядок подключения частей (index.html) важен: поздние правила перекрывают ранние. */
.turn-timer { color: var(--gold2); font-weight: 600; }
.turn-timer.low { color: #ff7a6a; }

.am-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.slot { display: inline-grid; place-items: center; font-size: 18px; }

.am-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.am-cats button { font-size: 12.5px; padding: 4px 10px; }

.shop-card { border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: var(--radius); padding: 8px 10px; background: rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 6px; }
.shop-card.locked { opacity: .5; }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-head b { display: block; font-size: 13.5px; }
.sc-head small { font-size: 11px; }
.sc-ic { width: 36px; text-align: center; flex: none; }
.sc-head .sc-ic, .inv-row .sc-ic { width: 44px; }
.sc-ic .item-ic { width: 44px; height: 44px; }
.sc-desc { font-size: 12.5px; color: var(--text); flex: 1; }
.sc-foot { display: flex; justify-content: flex-end; }
.sc-foot button { padding: 4px 12px; }
.lock { font-size: 12px; color: var(--muted); padding: 4px 0; }

.chip { width: 28px; height: 28px; border-radius: var(--radius); border: 2px solid var(--tc); display: inline-grid; place-items: center; font-size: 16px; background: rgba(0,0,0,.3); }
.chip:has(.item-ic) { border: none; background: none; width: 32px; height: 32px; }
.chip .item-ic { width: 32px; height: 32px; }

/* ───────── Игроки за одним компьютером ───────── */
.local-bar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.local-bar button { padding: 3px 9px; font-size: 13px; }
.member.guest { padding-left: 22px; }
.local-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.local-row input { flex: 1 1 140px; margin: 0; }
.local-row select { flex: 1 1 150px; margin: 0; }
.pcard.local { box-shadow: inset 0 0 0 1px rgba(240,192,96,.35); }

/* ── Портреты-модели героев и новые способности ── */
.face-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; grid-area: 1 / 1; pointer-events: none; }
.cc-icon, .big-icon, .pc-face, .init-face { overflow: hidden; }
.pc-face { overflow: visible; }
.pc-face .face-img { border-radius: 50%; }
.shop-card { position: relative; }
/* подвал карточки предмета: в узкой карточке содержимое переносится, а не вылезает за край */
.sc-foot { flex-wrap: wrap; }

/* ───────────── Раскладка: изменяемые и скрываемые панели ───────────── */
.side { position: relative; }
.side .chat-slot { min-height: 110px; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(0,0,0,.18); }
.chat-head button { padding: 1px 7px; font-size: 12px; }
.side-resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 6; }
.side-resizer::after { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.side-resizer:hover::after, body.resizing .side-resizer::after { background: var(--gold); }
.chat-resizer { flex: none; height: 7px; cursor: row-resize; position: relative; background: rgba(0,0,0,.25); border-top: 1px solid var(--line); }
.chat-resizer::after { content: ''; position: absolute; left: 50%; top: 2px; width: 40px; height: 3px; margin-left: -20px; border-radius: 2px; background: #5a4834; }
.chat-resizer:hover::after { background: var(--gold); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing #map { pointer-events: none; }
.side-tabs .side-x { flex: none; padding: 9px 10px; color: var(--muted); }
#btn-chat.active, #btn-panel.active { border-color: rgba(217,164,65,.55); color: var(--gold2); }

/* ───────────── Карта: прокрутка, масштаб, подготовка ───────────── */
.map-ctl { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: flex; gap: 4px; align-items: center; }
.map-ctl button { width: 30px; height: 30px; padding: 0; font-size: 15px; border-radius: var(--radius); background: rgba(30,22,15,.88); }
.map-hint { display: none; padding: 4px 8px; font-size: 11px; color: var(--muted); background: rgba(20,15,10,.85); border: 1px solid var(--line); border-radius: var(--radius); order: -1; }
.map-ctl:hover .map-hint { display: block; }
/* объёмный бой (public/js/r3d.js): WebGL-холст под #map, кнопки поворота камеры */
#map3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.r3d-ctl { display: flex; gap: 4px; }
/* объёмная карта на страницах без игры (public/js/map3d-host.js): админка и редактор сценариев */
.m3-box { position: relative; overflow: hidden; background: #0f0c09; }
.m3-box > #map3d, .m3-over { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m3-over { cursor: crosshair; }
.m3-ctl { position: absolute; right: 8px; bottom: 8px; z-index: 4; display: flex; gap: 4px; }
.m3-ctl button { width: 28px; height: 28px; padding: 0; font-size: 14px; border-radius: var(--radius); background: rgba(30,22,15,.88); }
.prep-banner {
  position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 6; pointer-events: none;
  display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 14px; max-width: min(560px, 90%);
  padding: 10px 18px; border-radius: var(--radius); text-align: left;
  background: linear-gradient(180deg, rgba(40,28,14,.95), rgba(20,14,8,.92)); border: 2px solid var(--gold2);
  box-shadow: 0 8px 30px rgba(0,0,0,.6), 0 0 22px rgba(240,192,96,.25); animation: pop .2s ease-out;
}
.prep-banner b { font-family: var(--font-display); font-size: 18px; color: var(--gold2); }
.prep-banner .pb-n { grid-row: span 2; font-family: var(--font-display); font-size: 40px; font-weight: 700; color: #fff3c0; text-shadow: 0 0 14px rgba(255,200,90,.8); }
.prep-banner small { color: var(--muted); font-size: 12px; }
.prep-banner .pb-skip { grid-column: 1 / -1; justify-self: start; margin-top: 6px; pointer-events: auto; }
.init-p.fogged .init-face { filter: grayscale(1); opacity: .7; }
/* окно загрузки поля (load-gate.js): закрывает карту целиком, пока модели не пришли и пока бой ждёт игроков */
.load-screen {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at center, #241a10 0%, #0f0c09 75%);
}
/* разговор (cine.js) лежит поверх всего экрана: окно загрузки закрывает и его */
body.talk-mode .load-screen { position: fixed; z-index: 21; }
/* начало кампании (load-gate.js): окно на весь экран поверх вступления — сначала всё загружено и прогрето, потом текст */
body .load-screen.full, body.talk-mode .load-screen.full { position: fixed; z-index: 46; }
.load-screen.off { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .4s ease, visibility 0s linear .4s; }
/* появление: сначала быстрое затемнение, потом окно с полоской */
.load-screen:not(.off) { animation: lg-in .15s ease-out; }
.load-screen:not(.off) .lg-box { animation: lg-in .3s ease-out .12s both; }
@keyframes lg-in { from { opacity: 0; } to { opacity: 1; } }
.lg-box {
  width: min(460px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(40,28,14,.95), rgba(20,14,8,.92)); border: 2px solid var(--gold2);
  box-shadow: 0 8px 30px rgba(0,0,0,.6), 0 0 22px rgba(240,192,96,.2);
}
.lg-title { font-family: var(--font-display); font-size: 18px; color: var(--gold2); text-align: center; }
.lg-bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; }
.lg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b07a2a, #f0c060); transition: width .3s ease; }
.lg-mine { font-size: 13px; color: var(--muted); text-align: center; }
.lg-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.lg-p { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); background: rgba(0,0,0,.28); font-size: 13px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-st { flex: none; font-size: 12px; }
.lg-p.ok .lg-st { color: #8fd890; }
.lg-p.wait .lg-st { color: #f0c060; animation: lg-pulse 1.2s ease-in-out infinite; }
.lg-p.off .lg-st { color: var(--muted); }
.lg-box small { text-align: center; font-size: 12px; }
@keyframes lg-pulse { 50% { opacity: .45; } }

/* Фоторежим (r3d/world/r3d-photo.js, клавиша P): кадр трассировки пути поверх всей игры и полоса с ходом и кнопками */
#photo-ov { position: fixed; inset: 0; z-index: 8990; background: #000; }
#photo-ov canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
#photo-ov .photo-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 16px; max-width: calc(100vw - 32px); }
#photo-ov .photo-info { min-width: 280px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { #photo-ov .photo-bar { flex-wrap: wrap; justify-content: center; } #photo-ov .photo-info { min-width: 0; width: 100%; text-align: center; } }
