/* «Открытый мир» (world.html) — интерфейс поверх 3D-сцены. Стиль — как в остальной игре (тёмные панели с оранжевой рамкой). */
.hidden { display: none !important; }
body.world-body { font-family: var(--f-ui, system-ui, -apple-system, "Segoe UI", sans-serif); color: #f3e6d2; user-select: none; -webkit-user-select: none; touch-action: none; }
#worldCanvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: linear-gradient(#9db3c6, #5d6b78); outline: none; }

.w-top { position: fixed; left: 14px; top: 12px; display: flex; gap: 10px; align-items: center; z-index: 5; }
.w-btn, .w-online {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 10px; box-sizing: border-box; text-decoration: none;
  background: rgba(12, 7, 5, 0.82); border: 1px solid rgba(255, 150, 70, 0.45); color: #fff; font-size: 14px; font-weight: 600;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer;
}
.w-btn:hover { background: rgba(60, 28, 12, 0.9); border-color: #ff9a4a; }
.w-online { cursor: default; color: #ffd9a0; }

.w-side { position: fixed; right: 14px; top: 12px; width: 190px; display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.w-minimap { padding: 8px; border-radius: 12px; background: rgba(12, 7, 5, 0.82); border: 1px solid rgba(255, 150, 70, 0.45); }
.w-minimap canvas { display: block; width: 172px; height: 172px; border-radius: 8px; }
.w-list { border-radius: 12px; background: rgba(12, 7, 5, 0.82); border: 1px solid rgba(255, 150, 70, 0.45); overflow: hidden; }
.w-list-head { padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb868; border-bottom: 1px solid rgba(255, 150, 70, 0.25); }
.w-list-body { max-height: 220px; overflow-y: auto; padding: 4px; scrollbar-width: thin; scrollbar-color: #e8641c transparent; }
.w-list-empty { padding: 8px; font-size: 13px; color: #b9ab9b; }
.w-prow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.w-prow:hover { background: rgba(255, 140, 50, 0.18); }
.w-prow b { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-prow i { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 8px; background: linear-gradient(180deg, #ffd24a, #e8841a); color: #2a1200; }

.w-chat { position: fixed; left: 14px; bottom: 14px; width: min(420px, calc(100vw - 28px)); z-index: 5; pointer-events: none; }
.w-chat-log { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.w-chat-line { align-self: flex-start; max-width: 100%; padding: 4px 10px; border-radius: 8px; background: rgba(12, 7, 5, 0.7); font-size: 14px; line-height: 1.3; word-break: break-word; transition: opacity 0.6s; }
.w-chat-line b { color: #ffb868; margin-right: 6px; }
.w-chat-line.old { opacity: 0; }
.w-chat-input { pointer-events: auto; width: 100%; box-sizing: border-box; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255, 150, 70, 0.7); background: rgba(12, 7, 5, 0.92); color: #fff; font: inherit; font-size: 14px; outline: none; user-select: text; -webkit-user-select: text; }

.w-prompt {
  position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 6; height: 46px; padding: 0 26px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, #ff7a2a, #cf2b0c); border: 1px solid #ffb06a; color: #fff; font: inherit; font-size: 16px; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 110, 40, 0.5); animation: wPrompt 1.6s ease-in-out infinite;
}
@keyframes wPrompt { 0%, 100% { filter: none; } 50% { filter: brightness(1.18); } }

.w-card {
  position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 7; min-width: 280px; padding: 14px 18px 16px; border-radius: 14px; text-align: center;
  background: rgba(12, 7, 5, 0.94); border: 1px solid rgba(255, 150, 70, 0.7); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
}
.w-card-name { font-size: 20px; font-weight: 800; color: #fff; }
.w-card-sub { margin: 4px 0 12px; font-size: 14px; color: #ffcf9a; }
.w-card-btns { display: flex; gap: 10px; justify-content: center; }
.w-card-fight, .w-card-close { height: 38px; padding: 0 16px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; color: #fff; }
.w-card-fight { border: 1px solid #ff8a5a; background: linear-gradient(180deg, #f2502a, #b3200c); }
.w-card-fight:disabled { opacity: 0.5; cursor: wait; }
.w-card-close { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }

.w-hint { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4; padding: 5px 14px; border-radius: 8px; background: rgba(12, 7, 5, 0.6); color: #cdbfae; font-size: 12px; line-height: 1.45; text-align: center; white-space: normal; width: max-content; max-width: 94vw; pointer-events: none; transition: opacity 1s; }
.w-hint.fade { opacity: 0; }

.w-stick { position: fixed; left: 26px; bottom: 90px; width: 124px; height: 124px; border-radius: 50%; z-index: 6; background: rgba(12, 7, 5, 0.45); border: 2px solid rgba(255, 150, 70, 0.5); touch-action: none; }
.w-stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 140, 50, 0.7); border: 2px solid #ffb06a; }

.w-overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(8, 5, 4, 0.92); transition: opacity 0.5s; }
.w-overlay.gone { opacity: 0; pointer-events: none; }
.w-overlay-box { text-align: center; font-size: 16px; color: #ffd9a0; max-width: 360px; padding: 0 20px; line-height: 1.5; }
.w-overlay-box a { color: #ffb06a; }
.w-spinner { width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid rgba(255, 150, 70, 0.25); border-top-color: #ff8a3a; animation: wSpin 0.9s linear infinite; }
.w-overlay.err .w-spinner { display: none; }
@keyframes wSpin { to { transform: rotate(360deg); } }

@media (max-width: 760px), (orientation: landscape) and (max-height: 520px) {
  .w-side { width: 140px; }
  .w-minimap canvas { width: 122px; height: 122px; }
  .w-list { display: none; }
  .w-hint { display: none; }
  .w-btn { padding: 0 10px; font-size: 13px; }
  .w-chat { bottom: 230px; }
}

/* ---- Окно выбора игры (public/modes.js) ---- */
.m-back { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; background: rgba(6, 3, 2, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); padding: 14px; box-sizing: border-box; }
.m-box { position: relative; width: min(760px, 100%); max-height: 100%; overflow-y: auto; padding: 22px 22px 20px; border-radius: 16px; box-sizing: border-box; background: rgba(14, 8, 5, 0.97); border: 1px solid rgba(255, 150, 70, 0.7); box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7); }
.m-x { position: absolute; right: 12px; top: 8px; width: 34px; height: 34px; border: 0; background: transparent; color: #cdbfae; font-size: 28px; cursor: pointer; }
.m-title { font-size: 22px; font-weight: 800; color: #fff; }
.m-sub { margin: 4px 0 14px; font-size: 13px; color: #b9ab9b; line-height: 1.4; }
.m-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.m-card { position: relative; text-align: left; padding: 12px 14px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: #fff; font: inherit; cursor: pointer; }
.m-card b { display: block; font-size: 16px; }
.m-card em { display: block; margin: 2px 0 6px; font-style: normal; font-size: 12px; font-weight: 700; color: #ffcf9a; }
.m-card span { display: block; font-size: 12.5px; color: #cdbfae; line-height: 1.35; }
.m-card.on { border-color: #ff9a4a; background: rgba(255, 130, 40, 0.14); box-shadow: 0 0 0 1px rgba(255, 154, 74, 0.5) inset; }
.m-card.off { cursor: default; opacity: 0.62; }
.m-card.off::after { content: "РЕМОНТ"; position: absolute; right: 10px; top: 10px; padding: 2px 8px; border-radius: 6px; background: #b3200c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; }
.m-status { min-height: 20px; margin: 14px 0 0; font-size: 14px; color: #ffd9a0; text-align: center; }
.m-btns { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.m-go, .m-cancel { height: 44px; padding: 0 28px; border-radius: 11px; font: inherit; font-size: 16px; font-weight: 800; color: #fff; cursor: pointer; }
.m-go { border: 1px solid #ffb06a; background: linear-gradient(180deg, #ff7a2a, #cf2b0c); }
.m-go:disabled { opacity: 0.5; cursor: default; }
.m-cancel { border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }
@media (max-width: 620px) { .m-grid { grid-template-columns: 1fr; } }

/* кнопка «Прыжок» на сенсорных экранах (справа внизу) */
.w-jump { position: fixed; right: 18px; bottom: 28px; z-index: 7; width: 76px; height: 76px; border-radius: 50%; border: 2px solid rgba(255, 190, 110, 0.85); background: rgba(20, 10, 6, 0.65); color: #ffe2b0; font-weight: 800; font-size: 13px; -webkit-tap-highlight-color: transparent; touch-action: none; }
.w-jump:active { background: rgba(255, 120, 40, 0.55); }

/* прицел при захваченной мыши */
.w-cross { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 8px rgba(255, 180, 90, 0.6); pointer-events: none; z-index: 6; display: none; }
body.w-locked .w-hint { opacity: 0.0; }

/* Обучающие подсказки на экране (31.10.2026) */
.w-tip { position: fixed; left: 50%; bottom: 78px; transform: translate(-50%, -8px); z-index: 6; max-width: min(92vw, 640px); padding: 9px 18px; border-radius: 12px; background: rgba(18, 10, 30, 0.82); border: 1px solid rgba(255, 140, 220, 0.5); box-shadow: 0 0 18px rgba(255, 80, 200, 0.25); color: #fff2fb; font-size: 14px; line-height: 1.35; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.35s, transform 0.35s; }
.w-tip.on { opacity: 1; transform: translate(-50%, 0); }
#wView { cursor: pointer; font: inherit; }

/* Голос поблизости (public/voice.js) */
.w-voice-btn.on { border-color: #6fe39a; color: #d9ffe8; }
.w-voice-btn.live { background: rgba(20, 90, 50, 0.9); border-color: #6fe39a; }
.w-voice { position: fixed; left: 14px; top: 58px; width: 280px; z-index: 8; padding: 12px 14px; border-radius: 12px; background: rgba(12, 7, 5, 0.92); border: 1px solid rgba(255, 150, 70, 0.55); color: #f3e6d2; font-size: 13px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.w-voice .wv-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb868; }
.w-voice .wv-note { margin: 4px 0 10px; color: #b9ab9b; font-size: 12px; }
.w-voice .wv-row { display: block; width: 100%; margin-bottom: 6px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255, 150, 70, 0.35); background: rgba(40, 22, 12, 0.8); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.w-voice .wv-row.on { border-color: #6fe39a; background: rgba(20, 90, 50, 0.7); }
.w-voice .wv-meter { height: 6px; margin: 2px 0 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.w-voice .wv-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fe39a, #ffd24a); transition: width 0.08s; }
.w-voice .wv-lab { display: block; margin: 8px 0 2px; color: #ffd9a0; }
.w-voice .wv-lab b { float: right; color: #fff; }
.w-voice input[type=range] { display: block; width: 100%; margin-top: 4px; accent-color: #ff9a4a; }
.w-voice .wv-seg { display: flex; gap: 6px; margin-top: 4px; }
.w-voice .wv-seg button { flex: 1; padding: 7px 4px; border-radius: 8px; border: 1px solid rgba(255, 150, 70, 0.35); background: rgba(40, 22, 12, 0.8); color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.w-voice .wv-seg button.on { border-color: #ff9a4a; background: rgba(120, 52, 16, 0.9); }
@media (max-width: 760px) { .w-voice { top: 56px; width: min(280px, calc(100vw - 28px)); } }

/* Засада из ящика: красная вспышка по краям экрана */
@keyframes w-hit { 0% { box-shadow: inset 0 0 0 0 rgba(255, 30, 30, 0); } 20% { box-shadow: inset 0 0 160px 40px rgba(255, 30, 30, 0.65); } 100% { box-shadow: inset 0 0 0 0 rgba(255, 30, 30, 0); } }
body.w-hit::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 30; animation: w-hit 0.7s ease-out; }

/* Жизнь и зелья слева вверху (03.11.2026), см. public/world-hud.js */
.w-vit { position: fixed; left: 14px; top: 62px; z-index: 5; width: max-content; min-width: 236px; max-width: calc(100vw - 28px); padding: 8px 10px; border-radius: 12px; box-sizing: border-box;
  background: rgba(12, 7, 5, 0.82); border: 1px solid rgba(255, 150, 70, 0.45); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 7px; }
.w-vit.hidden { display: none; }
.w-vit-row { display: flex; align-items: center; gap: 8px; }
.w-vit-lvl { flex: none; min-width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(180deg, #ffb347, #d8581a); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: #1a0d05; }
.w-vit-bar { position: relative; flex: 1; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.w-vit-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #3fcf6a; transition: width 0.4s, background 0.4s; }
.w-vit-bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.w-pot-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: linear-gradient(180deg, rgba(60, 200, 120, 0.22), rgba(20, 90, 50, 0.3)); border: 1px solid rgba(90, 230, 140, 0.5); }
.w-pot-pill svg { width: 28px; height: 28px; flex: none; }
.w-vit-cnt { font-weight: 700; font-size: 13px; white-space: nowrap; }
.w-vit-pot { flex-wrap: nowrap; }
.w-vit-btn kbd { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.35); font: 700 11px/16px system-ui, sans-serif; }
.w-vit-btn { flex: 1 0 auto; white-space: nowrap; padding: 0 12px; height: 28px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(180deg, #ff7a2e, #d8381a 60%, #a31510); }
.w-vit-btn:disabled { filter: grayscale(0.7) brightness(0.65); cursor: not-allowed; }
.w-vit-flash { animation: wVitFlash 0.8s ease-out; }
@keyframes wVitFlash { 0% { box-shadow: 0 0 0 0 rgba(63, 207, 106, 0.9); } 100% { box-shadow: 0 0 0 18px rgba(63, 207, 106, 0); } }
@media (max-height: 520px), (max-width: 700px) { .w-vit { top: 54px; min-width: 200px; padding: 6px 8px; gap: 5px; } }

/* Виртуальный курсор (мышь захвачена, а нужно нажимать кнопки — Tab или открытое окно) и постоянная подсказка про Tab (06.11.2026) */
.w-vcur { position: fixed; left: 0; top: 0; z-index: 2147483000; width: 22px; height: 28px; pointer-events: none; display: none; will-change: transform;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='28' viewBox='0 0 22 28'><path d='M2 1v21l5.2-4.6 3.6 8.4 3.4-1.5-3.6-8.2H18z' fill='white' stroke='black' stroke-width='1.6' stroke-linejoin='round'/></svg>") no-repeat; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }
.w-keyhint { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 9px; background: rgba(12, 7, 5, 0.72); border: 1px solid rgba(255, 255, 255, 0.22); color: #f4e6d0; font-size: 12px; line-height: 1.3; pointer-events: none; white-space: nowrap; }
@media (pointer: coarse) { .w-keyhint { display: none; } }

/* 06.11.2026: на арене подсказка про мышь/Tab — над нижними подсказками, а не в верхней строке (там табло матча) */
.w-keyhint.w-keyhint-low { position: fixed; left: 50%; bottom: 128px; transform: translateX(-50%); z-index: 5; }
/* в экшен-аренах внизу уже есть строка с клавишами (ЛКМ/J/F/ПКМ/Q/Пробел) — общая серая подсказка накладывалась на неё */
body.a-m-action .w-hint, body.a-m-clash .w-hint, body.a-m-aroyale .w-hint { display: none; }
