/* AdCombats — базовий стиль. Темний «середньовічний» інтерфейс, зручний на телефоні. */
[hidden] { display: none !important; }
:root {
  --bg: #120d08;
  --panel: #1d150d;
  --panel-2: #261b10;
  --border: #5a3f1c;
  --gold: #d9a441;
  --gold-dim: #a9802f;
  --text: #e9dcc3;
  --muted: #a8977a;
  --red: #c0442f;
  --green: #5e9a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Georgia, "Times New Roman", serif; }
a { color: var(--gold); }
.wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.logo { font-size: clamp(40px, 9vw, 80px); margin: 0 0 8px; color: var(--gold); letter-spacing: .04em; text-shadow: 0 2px 0 #5a3410; text-decoration: none; }
.tagline { color: var(--muted); text-align: center; max-width: 560px; line-height: 1.5; margin: 0 0 28px; font-size: 18px; }
.panel { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.panel h1 { margin: 0 0 18px; font-size: 24px; color: var(--gold); text-align: center; }
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 12px; font-size: 16px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 4px; outline: none; font-family: inherit;
}
input:focus { border-color: var(--gold); }
.gender { display: flex; gap: 10px; }
.gender label { flex: 1; margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; color: var(--text); background: var(--panel-2); }
.gender input { accent-color: var(--gold); }
.btn { display: inline-block; width: 100%; margin-top: 20px; padding: 14px; font-size: 17px; font-family: inherit; font-weight: bold; color: #1b1208; background: linear-gradient(#e2b354, #b9862c); border: 1px solid #7a5a1c; border-radius: 4px; cursor: pointer; text-align: center; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--gold); border-color: var(--gold-dim); }
.btn-row { display: flex; gap: 12px; width: 100%; max-width: 420px; }
.btn-row .btn { margin-top: 0; }
.error { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--red); color: #f2b4a8; background: rgba(192,68,47,.12); border-radius: 4px; display: none; font-size: 15px; }
.error.show { display: block; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 15px; }
.cf-turnstile { margin-top: 16px; min-height: 0; }

/* Екран персонажа */
.game { width: 100%; max-width: 760px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.topbar .logo { font-size: 32px; margin: 0; }
.topbar .btn { width: auto; margin: 0; padding: 8px 14px; font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 680px) { .grid { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 18px; }
.card h2 { margin: 0 0 12px; font-size: 18px; color: var(--gold); }
.name { font-size: 22px; font-weight: bold; }
.name small { color: var(--muted); font-weight: normal; }
.hpbar { height: 14px; background: #3a1c14; border: 1px solid #6b2e20; border-radius: 3px; margin: 10px 0 4px; overflow: hidden; }
.hpbar > div { height: 100%; background: linear-gradient(#7fc04f, #4d8a2a); }
.row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #3a2a15; font-size: 16px; }
.row:last-child { border-bottom: 0; }
.row b { color: var(--gold); }
.muted { color: var(--muted); }

/* ---------- Ігрова сторінка (структура як у класичному БК) ---------- */
.gamebody { display: flex; flex-direction: column; min-height: 100vh; }
.hdr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 14px;
  background: linear-gradient(#2b1f12, #1a120a); border-bottom: 2px solid var(--border); }
.hdr-city { font-weight: bold; letter-spacing: .12em; color: var(--gold); font-size: 18px; text-shadow: 0 1px 0 #000; }
.hdr-menu { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.hdr-menu a { color: var(--text); text-decoration: none; font-weight: bold; }
.hdr-menu a:hover { color: var(--gold); }
.hdr-menu a.soon { color: var(--muted); cursor: default; font-weight: normal; }

.top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 10px 14px; align-items: start; }
/* На комп'ютері все вміщується в один екран, як у БК: локація не вища за ~48% екрана, чат займає решту. */
@media (min-width: 981px) {
  .gamebody { height: 100vh; overflow: hidden; }
  .scene { max-width: calc(48vh * 1695 / 928); margin-left: auto; }
  .exits { justify-content: flex-end; }
}
.char-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; }
.char-name { text-align: center; font-size: 19px; font-weight: bold; margin-bottom: 8px; }
.char-name small { color: var(--muted); font-weight: normal; }
.char-body { display: flex; gap: 14px; align-items: flex-start; }
.doll { display: grid; grid-template-columns: 62px 120px 62px; gap: 4px; padding: 4px; background: #0d0905; border: 1px solid var(--border); flex: none; }
.doll-col { display: flex; flex-direction: column; gap: 4px; }
.doll-center { display: flex; flex-direction: column; gap: 4px; }
.doll-row { display: flex; gap: 3px; }
.slot { height: 34px; border: 1px solid #3d2b14; background: linear-gradient(#22180d, #160f08); color: #6d5a3d; font-size: 10px;
  display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 2px; }
.slot.tall { height: 52px; }
.slot.sm { flex: 1; height: 30px; font-size: 9px; }
.slot.xs { flex: 1; height: 20px; font-size: 0; }
.hp { position: relative; height: 16px; background: #3a1c14; border: 1px solid #6b2e20; }
.hp-fill { height: 100%; background: linear-gradient(#7fc04f, #4d8a2a); width: 100%; }
.hp span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 15px; color: #fff; text-shadow: 0 1px 1px #000; font-family: Arial, sans-serif; }
.silhouette { width: 100%; height: 228px; background: #050302; fill: #6b6156; padding: 8px 0; }
.stats { font-size: 15px; line-height: 1.55; min-width: 150px; }
.stats b { color: var(--gold); font-weight: bold; }
.stats .gap { height: 10px; }

.loc-panel { min-width: 0; }
.scene { position: relative; width: 100%; border: 2px solid var(--border); background: #0b0805; user-select: none; overflow: hidden; }
.scene img { display: block; width: 100%; height: auto; }
.scene-empty { aspect-ratio: 1695 / 928; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at center, #2a1d10 0%, #0b0805 75%); color: var(--muted); font-size: 17px; }
.hotspots { position: absolute; inset: 0; }
.scene-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); color: var(--gold); font-weight: bold; letter-spacing: .06em; font-size: 14px; pointer-events: none; }
.hotspot { position: absolute; border: 2px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; padding: 0; transition: background .15s, border-color .15s, box-shadow .15s; }
.hotspot:hover, .hotspot:focus-visible { background: rgba(255, 220, 120, .14); border-color: rgba(255, 215, 110, .9); box-shadow: 0 0 24px rgba(255, 200, 80, .45); outline: none; }
.hotspot.decor { cursor: help; }
.hotspot.locked:hover { background: rgba(120, 30, 20, .25); border-color: rgba(220, 90, 70, .8); box-shadow: none; }
.hotspot .tag { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); white-space: nowrap; font-size: 13px; padding: 3px 8px; border-radius: 3px;
  background: rgba(18, 13, 8, .85); color: var(--gold); border: 1px solid var(--gold-dim); opacity: 0; transition: opacity .15s; pointer-events: none; }
.hotspot:hover .tag, .hotspot:focus-visible .tag { opacity: 1; }
@media (hover: none) { .hotspot:not(.decor) .tag { opacity: .92; font-size: 11px; padding: 2px 6px; } }
.scene-tip { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(18,13,8,.9); border: 1px solid var(--gold-dim); color: var(--text); padding: 6px 12px; border-radius: 4px; font-size: 14px; }
.scene.loading { opacity: .6; }
.exits { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; padding: 0 4px; }
.exit { font-family: inherit; font-size: 15px; font-weight: bold; padding: 2px 0; cursor: pointer; color: var(--text); background: none; border: 0; }
.exit::before { content: "➔ "; color: var(--gold-dim); }
.exit:hover { color: var(--gold); }
.exit.locked { color: var(--muted); font-weight: normal; }
.exit.locked::before { content: "🔒 "; }

.notice { margin: 0 14px; padding: 6px 4px; border-top: 1px solid var(--border); text-align: right; font-size: 13px; color: var(--muted); line-height: 1.45; }
.notice b { color: var(--text); }
.online { margin-top: 3px; font-size: 16px; font-style: italic; color: var(--text); }

.bottom { flex: 1 1 0; display: grid; grid-template-columns: 1fr 260px; gap: 0; margin: 6px 14px 0; min-height: 180px; border: 1px solid var(--border); background: var(--panel); }
.chat { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.chat-tabs { display: flex; gap: 4px; align-items: center; padding: 4px 6px 0; border-bottom: 1px solid var(--border); }
.tab { font-family: inherit; font-size: 14px; padding: 4px 14px; border: 1px solid var(--border); border-bottom: 0; border-radius: 4px 4px 0 0; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.tab.active { background: var(--bg); color: var(--gold); font-weight: bold; }
.conn { margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: #7a2a1e; }
.conn.on { background: #5e9a3a; }
.chat-log { flex: 1 1 0; overflow-y: auto; padding: 6px 10px; font-size: 15px; line-height: 1.45; min-height: 140px; background: var(--bg); }
.chat-log .m { word-wrap: break-word; }
.chat-log .t { color: #6f8a5a; font-family: "Courier New", monospace; font-size: 13px; margin-right: 4px; }
.chat-log .n { color: #8fb3e8; font-weight: bold; cursor: pointer; }
.chat-log .n:hover { text-decoration: underline; }
.chat-log .to { color: #79b46a; }
.chat-log .m.me-to { background: rgba(217,164,65,.08); }
.chat-log .m.priv .x { color: #c79bea; }
.chat-log .m.sys { color: var(--muted); font-style: italic; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who-title { padding: 8px 10px; color: #e07a5f; font-weight: bold; border-bottom: 1px solid var(--border); }
.who-list { flex: 1 1 0; padding: 6px 10px; overflow-y: auto; min-height: 100px; font-size: 15px; line-height: 1.6; }
.who-list .p { cursor: pointer; }
.who-list .p b { color: #8fb3e8; }
.who-list .p small { color: var(--muted); }
.chatbar { display: flex; gap: 6px; padding: 6px 14px 10px; background: var(--bg); position: sticky; bottom: 0; }
.chatbar input { flex: 1; padding: 9px 10px; font-size: 15px; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 3px; font-family: inherit; }
.chatbar input:focus { outline: none; border-color: var(--gold); }
.chatbar button { padding: 0 18px; font-family: inherit; font-weight: bold; font-size: 15px; color: #1b1208; background: linear-gradient(#e2b354, #b9862c); border: 1px solid #7a5a1c; border-radius: 3px; cursor: pointer; }

/* Планшети і телефони: усе в одну колонку, локація першою */
@media (max-width: 980px) {
  .top { grid-template-columns: 1fr; }
  .loc-panel { order: -1; }
  .char-body { justify-content: center; flex-wrap: wrap; }
  .bottom { grid-template-columns: 1fr; }
  .chat-log { flex: none; height: 46vh; }
  .who-list { flex: none; }
  .chat { border-right: 0; border-bottom: 1px solid var(--border); }
  .who-list { max-height: 160px; }
  .notice { text-align: left; }
}
@media (max-width: 480px) {
  .hdr { flex-direction: column; align-items: flex-start; }
  .top { padding: 8px; }
  .notice, .bottom { margin-left: 8px; margin-right: 8px; }
  .chatbar { padding: 6px 8px 8px; }
  .doll { transform: scale(.92); transform-origin: top center; }
}

/* Будівлі-кнопки по контуру */
.hotspots svg.spots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.spot { pointer-events: visiblePainted; fill: rgba(255, 236, 170, 0); stroke: transparent; stroke-width: 2.5; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s, stroke .15s; outline: none; }
.spot:hover, .spot:focus-visible { fill: rgba(255, 236, 170, .16); stroke: #ffe08a;
  filter: drop-shadow(0 0 3px rgba(255, 210, 90, .95)) drop-shadow(0 0 8px rgba(255, 190, 60, .7)); }
.spot.locked:hover, .spot.locked:focus-visible { fill: rgba(120, 30, 20, .2); stroke: #e0705a; filter: drop-shadow(0 0 4px rgba(220, 90, 70, .8)); }
.spot.decor { cursor: help; }
.spot-tag { position: absolute; transform: translate(-50%, calc(-100% - 4px)); white-space: nowrap; pointer-events: none; z-index: 2;
  font: bold 13px Verdana, sans-serif; color: #fff3d6; padding: 3px 9px; border-radius: 3px;
  background: rgba(24, 18, 10, .88); border: 1px solid #c9a24e; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.spot-tag.locked { border-color: #c0574a; }
.spot-tag.below { transform: translate(-50%, 6px); }

/* Підказка над будівлею — як у класичному БК: світло-жовта табличка з тонкою рамкою */
.spot-tag, .spot-tag.below, .spot-tag.locked { transform: none; display: flex; flex-direction: column; align-items: stretch; gap: 1px;
  padding: .25em .55em .3em; border-radius: 0; border: 1px solid #5a5a5a; background: #ffffe1; color: #000;
  font: clamp(12px, .8vw, 18px)/1.25 Verdana, Tahoma, Arial, sans-serif; text-shadow: none; box-shadow: 1px 1px 2px rgba(0,0,0,.35); }
.spot-tag b { text-align: right; font-weight: bold; font-size: 1.12em; }
.spot-tag span { white-space: nowrap; }
.spot-tag[hidden] { display: none; }
