/* GeniusGamers: общие токены, типографика и базовые элементы.
   Мир: карта владений из шестиугольных сот. Плоская заливка, жёсткая грань,
   без градиентов, теней и размытия. */

:root {
  --black: #0A0A0A;
  --orange: #FF6600;
  --white: #FFFFFF;
  --tile: #1B1B1F;      /* закрашенная, но не активная сота */
  --line: #2B2B30;      /* контур свободной соты */
  --mute: #C4C4CC;      /* вторичный текст на чёрном */
  --dim: #92929C;       /* третичный текст и рамки полей на чёрном */

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 4.5vw, 4rem);
  --row: clamp(4.5rem, 10vw, 9rem);       /* вертикальный шаг секций = шаг ряда сот */
  --measure: 62ch;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--orange) var(--black);
  background: var(--black);
}

body {
  margin: 0;
  font: 400 1.0625rem/1.55 var(--font-body);
  color: var(--white);
  background: var(--black);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--orange);
  overflow-x: clip;
}

::selection { background: var(--orange); color: var(--black); }
.field--orange ::selection { background: var(--black); color: var(--orange); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--orange); }

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, iframe { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.75rem, 3.7vw, 3.25rem); line-height: 1.16; }
h3 { font: 600 1.1875rem/1.25 var(--font-display); }

p { max-width: var(--measure); text-wrap: pretty; }
.lead { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.5; }

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: var(--accent, var(--orange)); }

:focus-visible { outline: 2px solid var(--fg, var(--white)); outline-offset: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 20;
  padding: 0.75rem 1rem; background: var(--white); color: var(--black); font-weight: 600;
}
.skip:focus { top: 1rem; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------
   Цветовые поля. Цвет владеет целой секцией.
   ------------------------------------------------------------------ */
.field { background: var(--bg); color: var(--fg); }
.field--black {
  --bg: var(--black); --fg: var(--white); --fg-2: var(--mute); --fg-3: var(--dim);
  --accent: var(--orange); --on-accent: var(--black);
  --hot: var(--white); --on-hot: var(--black);
  --rule: var(--line); --field-line: var(--dim);
}
.field--orange {
  --bg: var(--orange); --fg: var(--black); --fg-2: #3B1700; --fg-3: #4A1D00;
  --accent: var(--black); --on-accent: var(--white);
  --hot: var(--white); --on-hot: var(--black);
  --rule: #B34700; --field-line: var(--black);
}
.field--white {
  --bg: var(--white); --fg: var(--black); --fg-2: #46464E; --fg-3: #63636C;
  --accent: var(--orange); --on-accent: var(--black);
  --hot: var(--black); --on-hot: var(--white);
  --rule: #D9D9DE; --field-line: #63636C;
}

/* ------------------------------------------------------------------
   Кнопка с гексагональными торцами. Форма лежит в ::before,
   чтобы контур фокуса не обрезался.
   ------------------------------------------------------------------ */
.btn {
  --h: 3.75rem;
  --cut: calc(var(--h) * 0.2887);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  min-height: var(--h); padding: 0 calc(var(--h) * 0.62);
  font: 800 1rem/1.1 var(--font-display); letter-spacing: 0.01em; text-align: center;
  color: var(--on-accent); text-decoration: none; white-space: nowrap;
  border: 0; background: none; cursor: pointer;
  transition: color 0.2s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  transition: background-color 0.2s var(--ease);
}
.btn:hover, .btn:focus-visible { color: var(--on-hot); }
.btn:hover::before, .btn:focus-visible::before { background: var(--hot); }
.btn:active { translate: 0 1px; }
.btn--sm { --h: 2.75rem; font-size: 0.8125rem; }
.btn[disabled], .btn[aria-disabled="true"] { pointer-events: none; color: var(--fg-3); }
.btn[disabled]::before, .btn[aria-disabled="true"]::before { background: var(--rule); }
/* Самые узкие телефоны (до 352px, например 320px): кнопка компактнее, текст всё равно
   не заходит на скошенные торцы. Подпись, которой и так не хватает места,
   переносится на вторую строку внутри кнопки, а не вылезает за край экрана. */
@media (max-width: 22rem) {
  .btn { padding: 0 calc(var(--h) * 0.45); font-size: 0.875rem; white-space: normal; text-wrap: balance; }
  .btn--sm { font-size: 0.8125rem; }
}

/* Текстовая кнопка-ссылка */
.textbtn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 1rem/1.2 var(--font-body); color: var(--fg);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em;
}
.textbtn:hover { text-decoration-color: var(--accent); }
.textbtn svg { flex: none; }

/* ------------------------------------------------------------------
   Поле адреса: geniusgamers.ru/ник
   ------------------------------------------------------------------ */
.nick { display: block; }
.nick__label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.5rem; }
.nick__field {
  --h: 3.75rem;
  --cut: calc(var(--h) * 0.2887);
  position: relative; isolation: isolate;
  display: flex; align-items: center; min-height: var(--h);
  padding: 0 calc(var(--cut) + 0.75rem);
}
.nick__field::before,
.nick__field::after {
  content: ""; position: absolute; z-index: -1;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
}
.nick__field::before { inset: 0; background: var(--field-line); transition: background-color 0.2s var(--ease); }
.nick__field::after { inset: 2px; --cut: calc((var(--h) - 4px) * 0.2887); background: var(--bg); }
.nick__field:focus-within::before { background: var(--hot); }
.field--orange .nick__field::after,
.field--orange .nick__prefix,
.field--orange .nick__input { background: var(--white); }
.nick__prefix { flex: none; font-weight: 500; color: var(--fg-2); }
.nick__input {
  flex: 1; min-width: 0; height: calc(var(--h) - 8px); padding: 0;
  border: 0; background: none; outline: none;
  font-weight: 600; color: var(--fg);
}
.nick__input::placeholder { color: var(--fg-3); opacity: 1; font-weight: 400; }
.field--orange .nick__input::placeholder { color: #7A3A0F; }
.nick__hint { margin-top: 0.5rem; font-size: 0.875rem; color: var(--fg-2); min-height: 1.4em; }
.nick__hint[data-state="error"] { color: var(--fg); font-weight: 600; }

/* ------------------------------------------------------------------
   Соты (SVG рисует assets/js/hexkit.js)
   ------------------------------------------------------------------ */
.hexmap { position: relative; }
.hexmap svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.t { transition: fill 0.2s var(--ease); }
.t--free { fill: none; stroke: var(--line); stroke-width: 2; }
.t--dark { fill: var(--tile); }
.t--own { fill: var(--orange); }
.t--live { fill: var(--white); }
.t--ink { fill: var(--black); }
.t__label {
  font-family: var(--font-display); font-weight: 800; fill: var(--black);
  text-anchor: middle; dominant-baseline: central; pointer-events: none; text-transform: uppercase;
}
.t__label--light { fill: var(--white); }
.t__label--raw { text-transform: none; }
.t__label--dim { fill: var(--mute); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
