@font-face { font-family: "Kurale"; src: url("fonts/Kurale.ttf"); font-display: swap; }
html, body { margin: 0; height: 100%; font-family: -apple-system, system-ui, sans-serif; }
#map { position: absolute; inset: 0; }

#top {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1000;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
#top > * { pointer-events: auto; }
#me {
  background: rgba(255, 255, 255, .92); border-radius: 10px; padding: 6px 10px;
  font-size: 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
#btn-locate {
  width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 22px;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

#panel {
  position: absolute; left: 10px; right: 10px; bottom: 16px; z-index: 1000;
  background: rgba(255, 255, 255, .95); border-radius: 14px; padding: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
#status { font-size: 15px; margin-bottom: 8px; }
#stats { display: flex; gap: 12px; font-size: 13px; color: #444; margin-bottom: 10px; flex-wrap: wrap; }
#stats[hidden] { display: none; }
.buttons { display: flex; gap: 8px; }
.buttons button {
  flex: 1; padding: 12px; border-radius: 10px; border: 0; font-size: 16px; font-weight: 600;
  background: #e8e8e8; color: #222;
}
.buttons button.primary { background: #2481cc; color: #fff; }
.buttons button[hidden] { display: none; }
.live { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.live.on { color: #1a8f3a; }
.live.off { color: #c25d00; }
.buttons + .buttons { margin-top: 8px; }
.buttons button.secondary { background: #fff4e5; color: #8a4b00; font-size: 14px; padding: 9px; }

/* Шапка с аватаркой */
#me { display: flex; align-items: center; gap: 8px; }
.me-ava { width: 30px; height: 30px; border-radius: 50%; border: 2px solid; }

/* Список игроков справа */
#players-box {
  position: absolute; right: 10px; top: 64px; bottom: 230px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; pointer-events: none;
}
#players-box > * { pointer-events: auto; }
#players-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 20px;
  background: #f3e6c4; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); margin-bottom: 6px;
}
#players {
  list-style: none; margin: 0; padding: 4px; overflow-y: auto; max-height: 100%;
  background: rgba(243, 230, 196, .92); border-radius: 12px; box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
  font-family: 'Kurale', Georgia, serif;
}
#players:empty { display: none; }
#players li { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 10px; cursor: pointer; }
#players li.active { background: rgba(201, 162, 90, .45); }
#players img { width: 40px; height: 40px; border-radius: 50%; border: 3px solid; flex: none; background: #2a1a0c; }
#players .pl-info { display: none; flex-direction: column; min-width: 0; color: #3b2814; }
#players .pl-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
#players .pl-info small { font-size: 12px; }
#players-box.open .pl-info { display: flex; }
#onland { font-size: 13px; font-weight: 600; color: #8a2f1c; margin-bottom: 4px; }
#onland[hidden] { display: none; }

/* Модалки зон */
.modal { position: absolute; inset: 0; z-index: 2000; background: rgba(30, 18, 8, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { background: #f3e6c4; border-radius: 14px; padding: 16px; width: 100%; max-width: 380px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4); color: #3b2814; font-family: 'Kurale', Georgia, serif; }
.modal-card h3 { margin: 0 0 6px; }
.modal-card .hint { font-size: 13px; opacity: .8; margin: 0 0 10px; }
.modal-card textarea { width: 100%; box-sizing: border-box; border-radius: 10px; border: 1px solid #b08a50;
  padding: 8px; font: inherit; font-size: 15px; background: #fffaf0; resize: vertical; }
.modal-card .radius { display: block; margin: 10px 0; font-size: 14px; }
.modal-card .radius input { width: 100%; }
.modal-card.alert #zone-alert-text { font-size: 20px; margin-bottom: 8px; white-space: pre-wrap; }
.popup-del { margin-top: 6px; border: 0; border-radius: 8px; padding: 6px 10px; background: #8a2f1c; color: #fff; }
.zone-popup { font-family: 'Kurale', Georgia, serif; color: #3b2814; }
.zone-popup p { margin: 6px 0; font-size: 15px; }
