/* Стили игры, часть «screens-room»: комната лобби, окна вместо alert, экран загрузки, настройки, панель окон справа внизу. Порядок подключения частей (index.html) важен: поздние правила перекрывают ранние. */
/* ── Комната лобби: как экран отряда в BG3 — слева отряд, в середине выбор героя, справа чат и «В путь» ── */
#screen-room { position: relative; background: #07080c; }
#screen-room > .camp-bg::after { background: rgba(4,4,6,.68); }
.room-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; }
.room-top > :first-child { justify-self: start; }
.room-title { text-align: center; min-width: 0; }
.room-title b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 23px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #fff7df 0%, #f0e2b8 45%, #c9ad74 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 1px 0 #000); }
.room-title small { display: block; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.room-top-r { justify-self: end; display: flex; gap: 8px; align-items: center; }
.room-wrap { position: relative; z-index: 1; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; padding: 22px 26px 22px; }
.room-main { overflow: auto; display: flex; flex-direction: column; gap: 20px; padding: 6px; }
.room-side { display: flex; flex-direction: column; min-height: 0; gap: 12px; padding: 18px 16px 16px; }
.room-panel { padding: 22px 22px 18px; }
.room-panel > h3, .room-side h3, #room-team h4 { font-size: 14.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); text-align: center; padding-bottom: 10px; margin-bottom: 12px;
  background: var(--bg3-gem) center bottom -8px / 16px no-repeat, linear-gradient(90deg, transparent, rgba(200,171,114,.5), transparent) center bottom / 100% 1px no-repeat; }
.member { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-bottom: 1px solid rgba(200,171,114,.1); }
.member:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; transform: rotate(45deg); background: #4a4034; flex: none; }
.dot.on { background: #8fdc7e; box-shadow: 0 0 6px #6fd36f; }
#room-role { margin-top: 10px; justify-content: center; }
#room-actions { display: flex; flex-direction: column; gap: 8px; }
#room-actions .primary { padding: 11px; font-size: 16px; }
#room-chat-slot { flex: 1; min-height: 0; display: flex; border: 1px solid #3a2e1e; border-radius: var(--radius); overflow: hidden; background: rgba(5,4,3,.55); box-shadow: inset 0 0 0 1px #000; }
.ai-note { padding: 10px 12px; border: 1px solid rgba(200,171,114,.25); border-radius: var(--radius); background: rgba(200,171,114,.06); font-size: 14px; line-height: 1.45; }
.char-name-row { display: flex; justify-content: center; margin-bottom: 14px; }
#char-name { max-width: 300px; text-align: center; font-family: var(--font-display); font-size: 18px; letter-spacing: .06em; }
.char-name-row label { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; text-transform: uppercase; letter-spacing: .14em; font-family: var(--font-display); font-size: 12px; }

/* выбор класса: ряд портретов-плиток, под ними — выбранный (или под мышью) герой: 3D, описание, способности */
.cls-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }
.cls-tile { position: relative; width: 92px; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; white-space: normal; background: none; border: 0; box-shadow: none; }
.cls-tile:hover:not(:disabled) { background: none; box-shadow: none; }
.cls-face { width: 76px; height: 76px; display: grid; place-items: center; overflow: hidden; font-size: 34px; background: var(--c, #222);
  border: 1px solid #000; box-shadow: 0 0 0 1px #6e5634, 0 0 0 3px #0d0b09, 0 6px 14px rgba(0,0,0,.6); transform: rotate(45deg); transition: box-shadow .15s, filter .15s; filter: saturate(.85) brightness(.92); }
.cls-face > * { transform: rotate(-45deg) scale(1.42); }
.cls-face .face-img { width: 100%; height: 100%; object-fit: cover; }
/* портрет героя кампании: голова целиком в ромбе */
.cls-face .face-img.portrait { object-position: 50% 10%; }
.cls-tile b { margin-top: 12px; font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: .06em; color: var(--muted); text-align: center; line-height: 1.15; }
.cls-tile:hover:not([aria-disabled]) .cls-face, .cls-tile.peek .cls-face { filter: none; box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px #0d0b09, 0 0 14px rgba(236,200,120,.35); }
.cls-tile:hover b, .cls-tile.peek b { color: var(--gold2); }
.cls-tile.on .cls-face { filter: none; box-shadow: 0 0 0 1px var(--gold2), 0 0 0 3px #0d0b09, 0 0 0 4px var(--gold), 0 0 22px rgba(236,200,120,.55); }
.cls-tile.on b { color: var(--gold2); }
.cls-tile[aria-disabled] { opacity: .4; cursor: not-allowed; }
.cls-detail { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; animation: bg3Fade .25s ease-out; }
.cls-3d { position: relative; height: 340px; border: 1px solid #3a2e1e; box-shadow: 0 0 0 1px #000; overflow: hidden;
  background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--c, #555) 26%, #2a2219) 0%, #0b0907 72%); }
.cls-3d > .hero-3d-cv { width: 100% !important; height: 100% !important; display: block; }
.cls-3d .cls-big { position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; }
.cls-3d .cls-big .face-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.cls-info h3 { font-size: 30px; letter-spacing: .08em; margin: 0 0 2px; text-transform: uppercase; }
.cls-role { color: #c4b89e; font-style: italic; margin-bottom: 12px; }
.cls-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cls-stats span { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 6px 8px; border: 1px solid transparent; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  background: linear-gradient(180deg, #1d1813, #0d0b09) padding-box, var(--bg3-metal) border-box; }
.cls-stats span b { font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: 0; color: var(--gold2); }
.cls-abs { display: flex; flex-direction: column; gap: 8px; }
.cls-ab { display: flex; gap: 10px; align-items: flex-start; }
.cls-ab .cc-ab { width: 40px; height: 40px; flex: none; border: 1px solid #000; box-shadow: 0 0 0 1px #6e5634; }
.cls-ab b { font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--gold2); letter-spacing: .04em; }
.cls-ab div div { font-size: 13.5px; line-height: 1.38; color: var(--text); }
.cls-trees { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.cls-pick { display: block; margin: 16px 0 0; }
.cc-ab { width: 30px; height: 30px; border-radius: 2px; border: 1px solid #000; flex: none; }
.cc-icon.mini { width: 26px; height: 26px; font-size: 15px; }
.rdy { width: 10px; height: 10px; flex: none; transform: rotate(45deg); border: 1px solid #6e5634; background: #0d0b09; margin-left: 6px; }
.rdy.on { border-color: #9be08a; background: #5fae4e; box-shadow: 0 0 8px rgba(120,220,100,.7); }

.cc-icon { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; font-size: 24px; flex: none; border: 1px solid #000; box-shadow: 0 0 0 1px #6e5634; }
.cc-icon .face-img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1000px) {
  .room-wrap { grid-template-columns: 1fr; overflow: auto; padding: 14px; }
  .cls-detail { grid-template-columns: 1fr; }
  .cls-3d { height: 260px; }
}

/* ── Окна вместо alert / confirm / prompt (modal.js), события, бросок, уведомления ── */
.modal { position: fixed; inset: 0; background: radial-gradient(ellipse at center, rgba(10,8,6,.55), rgba(3,2,2,.85)); display: grid; place-items: center; z-index: 50; padding: 16px; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.event-card { max-width: 460px; width: 100%; text-align: center; padding: 30px 26px 22px; animation: pop .25s ease-out; }
.event-card .ev-icon { font-size: 52px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.7)); }
.event-card h3 { font-size: 25px; letter-spacing: .08em; margin: 6px 0; }
.event-card ul { text-align: left; color: var(--muted); }
#check-box { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 20; padding: 16px 20px 14px; text-align: center; max-width: 92vw; animation: pop .2s ease-out; }
.ui-dlg { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(10,8,6,.5), rgba(3,2,2,.82)); }
.ui-dlg-box { width: min(460px, 100%); text-align: center; padding: 30px 28px 22px; animation: pop .2s ease-out; }
.ui-dlg-box.danger { border-color: #7a3328; }
.ui-dlg-icon { font-size: 34px; line-height: 1.1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); opacity: .9; }
.ui-dlg-box h3 { margin: 6px 0 8px; font-size: 22px; letter-spacing: .08em; text-transform: uppercase; }
.ui-dlg-text { color: var(--text); }
.ui-dlg-text p { margin: 6px 0; }
.ui-dlg-input { width: 100%; margin-top: 10px; }
.ui-dlg-btns { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.ui-dlg-btns button { min-width: 120px; }
.ui-dlg-btns .danger { background: linear-gradient(180deg, #6a241c, #3a110d); border-color: #c0584a; color: #fff; }
#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { position: relative; padding: 9px 26px 10px 34px; color: var(--bg3-text); font-size: 14.5px; border-radius: var(--radius); border: 1px solid #5a4528;
  background: var(--bg3-gem) 12px center / 13px no-repeat, var(--bg3-stone); box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0,0,0,.6); animation: pop .2s ease-out; }
.toast.error { border-color: #8a3a30; color: #ffc4b8; }
.toast.ok { border-color: #5f8a52; color: #cdeec4; }
#quest-notes { position: fixed; top: 64px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; max-width: min(340px, calc(100vw - 32px)); }
.quest-note { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 9px; border-radius: var(--radius); border: 1px solid #5a4528; border-left: 2px solid var(--gold);
  background: var(--bg3-stone); box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.5); font-size: 14px; animation: qnIn .35s ease-out; transition: opacity .6s, transform .6s; }
.quest-note b { font-family: var(--font-display); font-weight: 400; color: var(--gold); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.quest-note span { color: var(--bg3-text); line-height: 1.3; }
.quest-note.done { border-left-color: #7aa86a; } .quest-note.done b { color: #b6dcaa; }
.quest-note.fail { border-left-color: var(--red); } .quest-note.fail b { color: #ffb3a8; }
.quest-note.out { opacity: 0; transform: translateX(24px); }
@keyframes qnIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ── Экран загрузки моделей (public/js/loader.js): снимок привала, внизу — тонкая золотая полоса ── */
#boot { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-end; justify-content: flex-start; padding: 16px 6vw 9vh;
  background: linear-gradient(0deg, rgba(3,3,5,.9) 10%, rgba(3,3,5,.35) 45%, rgba(3,3,5,.55)), #07080c url(/img/menu/camp.jpg) center 40% / cover no-repeat; }
.boot-box { width: min(520px, 100%); text-align: left; animation: bg3Fade .6s ease-out; }
.boot-title { font-family: var(--font-display); font-size: 46px; letter-spacing: .06em; margin-bottom: 4px;
  background: linear-gradient(180deg, #fff7df 0%, #f0e2b8 45%, #b08a50 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 3px 10px rgba(0,0,0,.9)); }
.boot-text { color: #c4b89e; font-style: italic; margin-bottom: 14px; text-shadow: 0 1px 6px #000; }
.boot-bar { position: relative; height: 4px; background: rgba(10,8,6,.85); border: 1px solid #000; box-shadow: 0 0 0 1px #5a4528; overflow: visible; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6e5634, #ecdcb0); box-shadow: 0 0 10px rgba(236,220,176,.55); transition: width .15s linear; }
.boot-num { margin-top: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.boot-hint { margin-top: 10px; color: #8a7e68; font-size: 13px; }
.boot-skip { margin-top: 12px; background: none; border: none; box-shadow: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.boot-skip:hover:not(:disabled) { background: none; box-shadow: none; }

/* ── Настройки (settings.js): окно ⚙ поверх игры и меню (#set-win, как окна игры) и страница меню (.set-page) —
   слева разделы, справа строки «название и пояснение — переключатель»; переключатели — .set-sw ── */
.set-win { z-index: 120; }
.set-box { width: min(880px, 100%); height: min(620px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; }
.set-box .set-body { flex: 1; min-height: 0; }
.set-wrap { height: 100%; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; min-height: 0; }
.set-page .set-wrap { height: auto; }
.set-page { max-width: 820px; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding-right: 14px; border-right: 1px solid rgba(200,171,114,.18); overflow-y: auto; }
.set-nav-b { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 2px; font: 14.5px var(--bg3-serif, Georgia, serif); letter-spacing: .5px;
  color: var(--bg3-muted, #a8977b); background: transparent; border: 1px solid transparent; }
.set-nav-b span { width: 20px; text-align: center; font-size: 15px; }
.set-nav-b:hover { color: var(--bg3-text, #e8dcc0); background: rgba(200,171,114,.07); }
.set-nav-b.on { color: var(--bg3-gold-hi, #f0e2b8); border-color: #5a4528; background: radial-gradient(ellipse at 0% 50%, rgba(200,171,114,.2), rgba(13,11,9,.6) 80%); }
.set-sec { overflow-y: auto; padding-right: 8px; display: flex; flex-direction: column; }
.set-sec h4 { margin: 14px 0 4px; }
.set-sec h4:first-child { margin-top: 0; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 11px 4px; border-bottom: 1px solid rgba(200,171,114,.1); }
.set-row.wide { flex-direction: column; align-items: stretch; gap: 8px; }
.set-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-txt b { font-weight: 500; font-size: 14px; color: var(--bg3-text, #e8dcc0); }
.set-txt small { font-size: 12px; line-height: 1.4; color: var(--bg3-muted, #a8977b); }
.set-ctl { flex: none; display: flex; align-items: center; }
.set-row.wide .set-ctl input[type=range] { width: 100%; accent-color: var(--bg3-gold, #c8ab72); }
.set-ctl select { min-width: 200px; }
.set-body .set-val { float: right; font-weight: 600; color: var(--bg3-gold-hi, #f0e2b8); }
/* «сразу» у настроек графики, что меняются без перезагрузки (settings-gfx.js) */
.set-tag { margin-left: 6px; padding: 0 5px; border: 1px solid rgba(200,171,114,.35); border-radius: 3px; font-size: 10px; font-style: normal; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--bg3-gold, #c8ab72); vertical-align: 1px; }
.set-warn { padding: 8px 10px; border: 1px solid #7a3a2a; background: rgba(120,40,20,.2); }
.set-sw { position: relative; display: inline-block; width: 42px; height: 22px; margin: 0; cursor: var(--cur-hand, pointer); }
.set-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.set-sw i { position: absolute; inset: 0; border-radius: 11px; background: #15110d; border: 1px solid #5a4528; transition: background .15s, border-color .15s; pointer-events: none; }
.set-sw i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #6b5a40; transition: transform .15s, background .15s; }
.set-sw input:checked + i { background: linear-gradient(180deg, #5c4320, #3a2a12); border-color: var(--bg3-gold, #c8ab72); }
.set-sw input:checked + i::after { transform: translateX(20px); background: #f0e2b8; }
.set-sw input:disabled + i { opacity: .4; }
@media (max-width: 640px) {
  .set-wrap { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; padding-right: 0; }
}
.set-page h4 { font-family: var(--bg3-serif, Georgia, serif); font-weight: 400; font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: var(--bg3-gold, #c8ab72); padding-bottom: 6px; }

/* ── Панель окон справа внизу (#hud-menu, index.html): рамка камня, ряды по группам — герой (крупнее, с клавишами),
   окна игры, служебное (сохранить, студия, читы, ⚙) и выход отдельно; пустая группа (все кнопки скрыты) не видна ── */
.hud-menu .hm-row { display: grid; grid-template-columns: auto auto; grid-template-areas: "hero hero" "wins wins" "sys exit";
  justify-items: stretch; align-items: center; gap: 0; max-width: none; padding: 4px 6px; position: relative; }
.hud-menu .hm-row::before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(200,171,114,.14); pointer-events: none; }
.hm-grp { display: flex; justify-content: flex-end; gap: 7px; padding: 6px 4px; }
.hm-grp:not(:has(.hm-btn:not(.hidden))) { display: none; }
.hm-hero { grid-area: hero; }
.hm-wins { grid-area: wins; border-top: 1px solid rgba(200,171,114,.16); }
.hm-sys { grid-area: sys; border-top: 1px solid rgba(200,171,114,.16); }
.hm-exit { grid-area: exit; align-self: stretch; align-items: center; justify-content: center; margin-left: 6px; padding-left: 10px; border-top: 1px solid rgba(200,171,114,.16); border-left: 1px solid rgba(200,171,114,.16); }
.hm-hero:not(:has(.hm-btn:not(.hidden))) + .hm-wins { border-top: 0; }
.hud-menu .hm-btn { width: 32px; height: 32px; transition: box-shadow .15s, color .15s; }
.hud-menu .hm-hero .hm-btn { width: 40px; height: 40px; }
.hud-menu .hm-btn .hud-ic { width: 56%; height: 56%; }
.hud-menu .hm-btn[data-key]::after { content: attr(data-key); position: absolute; right: -4px; bottom: -4px; min-width: 13px; padding: 0 3px; border-radius: 2px;
  font: 600 9px/13px var(--bg3-serif, Georgia, serif); text-align: center; color: var(--bg3-gold, #c8ab72); background: #0b0907; box-shadow: 0 0 0 1px #4a3a24; pointer-events: none; }
.hud-menu #btn-game-leave { color: #d0836f; }
.hud-menu #btn-game-leave:hover { color: #ffb09a; box-shadow: 0 0 0 1px #000, 0 0 0 2px #c0604a, 0 0 0 3px #000, 0 0 10px rgba(220,110,80,.4); }
.hud-menu #btn-cheats { color: #c2a6e8; }
