/* style.css — радар issekai. Только дополнения к base.css; токены не дублируем. */

[hidden] { display: none !important; }

.wrap { max-width: 1480px; margin: 0 auto; padding: 18px 18px 36px; }

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 24px;
  padding: 6px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand h1 { font-size: clamp(28px, 4.4vw, 42px); letter-spacing: -.04em; }
.sub { margin: 3px 0 0; font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; }
.head-links { margin-left: auto; font-size: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }

.notice {
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: .01em;
}
.notice.bad { color: #ff8496; border-color: rgba(233,33,61,.4); background: var(--red-soft); }
.notice.warn { color: var(--amber); border-color: rgba(253,181,21,.35); background: var(--amber-soft); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
#map-card { grid-column: 1; grid-row: 1 / span 2; }
#player-card { grid-column: 2; grid-row: 1; }
#control-card { grid-column: 2; grid-row: 2; }
#events-card { grid-column: 1; grid-row: 3; }
#inventory-card { grid-column: 2; grid-row: 3; }
#entities-card { grid-column: 1 / -1; grid-row: 4; }

.card > .body { padding: 14px; }
.site-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .06em; }

/* ---------- карта ---------- */
.map-wrap { height: min(62vh, 560px); min-height: 300px; position: relative; }
#radar { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#radar:active { cursor: grabbing; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg .btn {
  min-height: 34px;
  padding: 5px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
}
.seg .btn:last-child { border-right: 0; }
.seg .btn.active { background: var(--amber-soft); color: var(--amber); }
.zoom-tools { display: inline-flex; align-items: center; gap: 6px; }
.zoom-tools .btn.sq { min-height: 34px; min-width: 34px; padding: 0; font-size: 18px; line-height: 1; }
.zoom-tools #zoom-val { min-width: 44px; text-align: center; font-size: 12px; }
.hint { font-size: 12px; }
.map-card .hint, #map-card > .hint { padding: 8px 14px 12px; margin: 0; }

/* ---------- игрок ---------- */
.player-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.player-title strong { font-family: var(--display); font-size: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-row { margin-top: 9px; }
.stat-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.kv > span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }

/* ---------- управление ---------- */
.ctl-status { display: grid; gap: 4px; font-size: 13.5px; }
.ctl-status > div { display: flex; justify-content: space-between; gap: 12px; }
.ctl-status .k { margin-right: auto; }
.ctl-block { margin-top: 12px; padding: 10px 12px; background: var(--base-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ctl-value { margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
#intent-form { margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.span2 { grid-column: 1 / -1; }
.field label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.field input, .field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  background: var(--base-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
}
.field select { font-family: var(--sans); }
.pair { display: flex; gap: 8px; align-items: end; }
.pair .field { flex: 1; }
.token-field .pair .btn { min-height: 38px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.form-actions .btn { flex: 1; min-width: 150px; }
.msg { margin: 10px 0 0; min-height: 1.2em; font-size: 13px; color: var(--jade); }
.msg.err { color: #ff8496; }

/* ---------- события ---------- */
.events { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; font-size: 13px; }
.events li {
  display: grid;
  grid-template-columns: 74px 116px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
}
.events li.empty { display: block; color: var(--dim); }
.ev-tick { color: var(--dim); font-size: 12px; }
.ev-type.ok { color: var(--jade); }
.ev-type.bad { color: #ff8496; }
.ev-type.mute { color: var(--dim); }
.ev-actors, .ev-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12px; text-transform: lowercase; }

/* ---------- инвентарь ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.slot {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.025);
  font: 10px/1 var(--mono);
  color: var(--faint);
}
.slot.filled { border-color: rgba(253,181,21,.45); background: var(--amber-soft); color: var(--amber); }
.slot-n { position: absolute; top: 2px; left: 3px; color: var(--dim); }
.slot-c { font-size: 11px; }
#inv-note { margin: 10px 0 0; font-size: 12px; }

/* ---------- таблица сущностей ---------- */
.table-wrap { overflow-x: auto; max-height: 380px; overflow-y: auto; }
#entities-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#entities-table th, #entities-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
#entities-table th { position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--dim); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
#entities-table td.nm, #entities-table td.st { overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
#entities-table tbody tr { cursor: pointer; }
#entities-table tbody tr:hover { background: rgba(255,255,255,.035); }
#entities-table tbody tr.selected { box-shadow: inset 3px 0 0 var(--amber); background: var(--amber-soft); }
.kind { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.kind.npc { color: var(--jade); }
.kind.mob { color: var(--red); }
.kind.player { color: var(--amber); }
.kind.item { color: var(--violet); }

@media (max-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  #map-card, #player-card, #control-card, #events-card, #inventory-card, #entities-card { grid-column: 1; grid-row: auto; }
  .head-links { margin-left: 0; }
  .events li { grid-template-columns: 66px 100px minmax(0, 1fr); }
  .ev-reason { grid-column: 2 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 12px 10px 28px; }
  .map-wrap { height: 62vh; min-height: 260px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.span2 { grid-column: 1; }
  .form-actions .btn { min-width: 0; }
  .inv-grid { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .meter > i { transition: none; }
}
