/* base.css — общая основа issekai.rhiz.ru.
 * Токены, шрифты, сброс и мелкие общие элементы (кнопки, пилюли, полосы).
 * Страницы: index.html (радар) и docs.html (документация API).
 * Палитра — продолжение rhiz: уголь и янтарь, плюс нефритовый акцент для
 * данных мира и киноварь для тревог. Никаких внешних CDN. */

:root {
  color-scheme: dark;
  --base: #0b0c10;
  --base-2: #101218;
  --panel: #14171f;
  --panel-2: #191d27;
  --ink: #e8e6df;
  --dim: #8f939c;
  --faint: #5f646f;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --jade: #46c2a0;
  --jade-soft: rgba(70, 194, 160, .14);
  --amber: #fdb515;
  --amber-soft: rgba(253, 181, 21, .14);
  --red: #e9213d;
  --red-soft: rgba(233, 33, 61, .15);
  --violet: #9b8cff;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: "Roboto Condensed", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Roboto Condensed", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.52;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 78% -18%, rgba(70, 194, 160, .10), transparent 60%),
    radial-gradient(760px 420px at 4% 0%, rgba(155, 140, 255, .07), transparent 62%),
    linear-gradient(180deg, #101218 0%, var(--base) 100%);
  background-attachment: fixed;
}

a { color: var(--jade); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #6fd6b9; }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { font-weight: 500; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-family: var(--display); font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(20px, 2.4vw, 26px); }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }

code, pre, kbd, samp { font-family: var(--mono); font-size: .88em; }
code {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .08em .34em;
  overflow-wrap: anywhere;
}
kbd {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .05em .34em;
  font-size: .8em;
}

/* ---------- мелкие общие элементы ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--dim);
  font: 500 12px/1.3 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 600; }
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.pill.plain::before { display: none; }
.pill.ok { color: var(--jade); border-color: rgba(70, 194, 160, .35); background: var(--jade-soft); }
.pill.warn { color: var(--amber); border-color: rgba(253, 181, 21, .35); background: var(--amber-soft); }
.pill.bad { color: var(--red); border-color: rgba(233, 33, 61, .38); background: var(--red-soft); }
.pill.mute { color: var(--faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { border-color: rgba(255, 255, 255, .28); background: #1d2230; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  color: #10130f;
  background: var(--jade);
  border-color: transparent;
  font-weight: 600;
}
.btn.primary:hover { background: #5ad4b2; }
.btn.danger {
  color: #fff;
  /* темнее --red: белый текст на #e9213d не дотягивает до 4.5:1 */
  background: #c81a31;
  border-color: transparent;
  font-weight: 600;
}
.btn.danger:hover { background: #dc1f3a; }
.btn.ghost { background: transparent; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.card > header h2,
.card > header h3 { font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); font-weight: 600; }

.meter {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--jade);
  transition: width .25s ease;
}
.meter.hp > i { background: linear-gradient(90deg, #d43a4f, #f0705a); }
.meter.mp > i { background: linear-gradient(90deg, #3a7bd4, #59b6f0); }
.meter.exp > i { background: linear-gradient(90deg, #8f7bff, #b9a6ff); }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--amber);
  color: #14130c;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
