/* ============================================================================
   participant.css — светлый HUD-слой участницких страниц ПКГ РЕБУС.
   Зона Codex: визуал игровых страниц. Контрактные классы/хуки не переименовывать.
   ============================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Science+Gothic:wght@400;600;700;900&display=swap");

:root {
  color-scheme: light;

  --bg: oklch(0.965 0.002 250);
  --surface: oklch(0.995 0 0);
  --surface-2: oklch(0.945 0.003 250);
  --surface-3: oklch(0.925 0.004 250);
  --ink: oklch(0.20 0.01 250);
  --ink-2: oklch(0.31 0.011 250);
  --label: oklch(0.42 0.012 250);
  --muted: oklch(0.50 0.012 250);
  --faint: oklch(0.60 0.01 250);
  --line: oklch(0.20 0.01 250 / 0.16);
  --line-2: oklch(0.20 0.01 250 / 0.32);
  --border: var(--line);
  --border-input: oklch(0.20 0.01 250 / 0.26);
  --divider: oklch(0.20 0.01 250 / 0.11);

  --honey: oklch(0.80 0.15 82);
  --honey-hi: oklch(0.89 0.13 88);
  --honey-deep: oklch(0.70 0.16 72);
  --honey-ink: oklch(0.25 0.045 72);
  --jade: oklch(0.56 0.11 165);
  --ok: oklch(0.56 0.14 150);
  --danger: oklch(0.50 0.19 28);
  --st-draft: var(--muted);
  --st-live: var(--ok);
  --st-paused: var(--honey-deep);

  --disp: "Science Gothic", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  --r-sm: 0;
  --r-nav: 0;
  --r-ctl: 0;
  --r-row: 0;
  --r-card: 0;
  --chamfer: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  --chamfer-s: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  --shadow: 0 1px 0 var(--line), 0 26px 60px oklch(0.20 0.01 250 / 0.08);
  --shadow-soft: 0 14px 38px oklch(0.20 0.01 250 / 0.07);
  --ring: var(--honey-deep);
  --e-out: cubic-bezier(.22, 1, .36, 1);

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
  --space-5: 30px;
  --space-6: 42px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 9%, oklch(0.80 0.15 82 / .11), transparent 28vw),
    radial-gradient(circle at 7% 32%, oklch(1 0 0 / .86), transparent 34vw),
    linear-gradient(135deg, transparent 0 34%, oklch(0.20 0.01 250 / .055) 34.08% 34.16%, transparent 34.25%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='111' viewBox='0 0 96 111'%3E%3Cg fill='none' stroke='%23141411' stroke-opacity='.045' stroke-width='1'%3E%3Cpath d='M16 .3h32L64 28 48 55.7H16L0 28 16 .3Z'/%3E%3Cpath d='M64 27.8h32l16 27.7-16 27.7H64L48 55.5l16-27.7Z'/%3E%3Cpath d='M16 55.3h32L64 83l-16 27.7H16L0 83l16-27.7Z'/%3E%3C/g%3E%3C/svg%3E"),
    var(--bg);
  background-size: auto, auto, auto, 96px 111px, auto;
  overflow-x: hidden;
}
html, body { max-width: 100%; overflow-x: hidden; }
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    linear-gradient(90deg, oklch(0.20 0.01 250 / .045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, oklch(0.20 0.01 250 / .035) 1px, transparent 1px) 0 0 / 72px 72px;
  mask-image: linear-gradient(90deg, black, transparent 72%);
}
body::after {
  background:
    linear-gradient(90deg, oklch(0.965 0.002 250 / .84), transparent 14%, transparent 86%, oklch(0.965 0.002 250 / .86)),
    radial-gradient(circle at 50% 0, oklch(1 0 0 / .78), transparent 42%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hide { display: none !important; }
[hidden] { display: none !important; }

/* Focus-ring: отрицательный offset уводит обводку ВНУТРЬ элемента (в зону clip-path) —
   иначе на chamfer-кнопках/инпутах/карточках outset-обводка обрезается фаской и фокус не виден. */
:focus-visible {
  outline: 2px solid var(--ring) !important;
  outline-offset: -2px !important;
}
:focus:not(:focus-visible) { outline: none; }

.pt-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
  min-height: 76px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: oklch(0.965 0.002 250 / .90);
  backdrop-filter: blur(16px);
}
.pt-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  column-gap: 14px;
  min-width: 278px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  font-family: var(--disp);
  font-size: clamp(20px, 2vw, 31px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.pt-brand::before {
  content: "";
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  background: url("assets/LOGO.svg") center / contain no-repeat;
}
.pt-brand::after {
  content: "RB-01 / PLAYER NODE";
  grid-column: 2;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--muted);
}
.pt-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 0 clamp(8px, 1.5vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
}
.pt-nav::-webkit-scrollbar { display: none; }
.pt-nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 10px clamp(8px, .82vw, 14px);
  color: var(--label);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.pt-nav a::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-left: 1px solid transparent;
  border-top: 1px solid transparent;
}
.pt-nav a:hover { color: var(--ink); background: transparent; }
.pt-nav a[aria-current="page"] {
  color: var(--ink);
  background: transparent;
}
.pt-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  background: var(--honey);
}
.pt-nav a[aria-current="page"]::before {
  border-color: var(--honey-deep);
}
.pt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 14px;
  border-left: 1px solid var(--line);
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--line-2);
  clip-path: none;
}
.icon-btn:hover { background: transparent; color: var(--ink); }
.notify-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--honey);
  box-shadow: 0 0 0 3px oklch(0.80 0.15 82 / .20);
  display: none;
}
.pt-bell { position: relative; display: inline-flex; }
.pt-notif {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: 86vw;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  clip-path: var(--chamfer);
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 40;
}
.pt-notif-h {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  padding: 8px 10px 10px;
}
.pt-notif-empty { color: var(--muted); font-size: 13px; padding: 18px 10px 22px; text-align: center; }
.pt-notif-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; }
.pt-notif-row + .pt-notif-row { border-top: 1px solid var(--divider); }
.pt-notif-row.is-unread { background: oklch(0.80 0.15 82 / .10); }
.pt-notif-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.pt-notif-time { flex: none; font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; padding-top: 2px; }

.pt-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 0 6px 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  clip-path: none;
  cursor: pointer;
  user-select: none;
  align-self: stretch;
}
.pt-user:hover { background: transparent; }
.pt-ava {
  flex: none;
  width: 38px;
  height: 38px;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  border-radius: 0;
  background: linear-gradient(145deg, var(--surface-3), var(--surface));
  display: grid;
  place-items: center;
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.pt-ucopy { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.pt-uname { font-size: 13px; font-weight: 800; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-urole {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.pt-chev { margin-left: auto; font-size: 11px; color: var(--faint); transition: transform .12s var(--e-out); }
.pt-user[aria-expanded="true"] .pt-chev { transform: rotate(180deg); }
.pt-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 184px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  clip-path: var(--chamfer-s);
  box-shadow: var(--shadow-soft);
  padding: 7px;
  display: grid;
  gap: 2px;
  z-index: 40;
}
.pt-menu a,
.pt-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.pt-menu a:hover,
.pt-menu button:hover { background: var(--surface-2); }
.pt-menu .danger { color: var(--danger); }

.pt-main {
  position: relative;
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
  padding: clamp(40px, 5.2vw, 82px) 0 84px;
}
.pt-main::before {
  content: "//// RBUS.SYSTEM / PARTICIPANT HUD";
  display: block;
  margin-bottom: var(--space-4);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--honey-deep);
}
.pt-head {
  position: relative;
  margin: 0 0 clamp(30px, 4vw, 48px);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-2);
}
.pt-head::after,
.head-row::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  width: min(180px, 32vw);
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--ink) 26%, var(--honey) 26% 42%, var(--ink) 42% 46%, transparent 46%);
}
.pt-main h1 {
  margin: 0 0 8px;
  font-family: var(--disp);
  font-size: clamp(38px, 6vw, 82px);
  line-height: .88;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  overflow-wrap: normal;   /* не рвать слово по букве (напр. «КОЛЛЕКЦИЯ») */
  word-break: keep-all;
  hyphens: none;
}
.pt-sub { color: var(--label); margin: 0; max-width: 680px; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; }
h2.section-h,
h3.cat-h {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: 0;
}
h2.section-h {
  font-size: 22px;
  margin: var(--space-6) 0 var(--space-4);
  border-bottom: 1px solid var(--divider);
  padding-bottom: var(--space-2);
}
h3.cat-h { font-size: 15px; margin: var(--space-5) 0 var(--space-2); color: var(--ink-2); }

.pt-card,
.pt-row,
.stat,
.empty {
  position: relative;
  border: 1px solid var(--line);
  background: oklch(1 0 0 / .74);
  clip-path: var(--chamfer-s);
  box-shadow: var(--shadow-soft);
}
.pt-card { padding: clamp(22px, 3vw, 30px); }
.pt-card + .pt-card { margin-top: var(--space-5); }
.pt-row { display: flex; align-items: center; gap: var(--space-4); padding: 16px 18px; }
.pt-row + .pt-row { margin-top: var(--space-3); }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }
.stat { padding: 20px; }
.stat .v {
  font-family: var(--disp);
  font-size: 30px;
  font-weight: 900;
  line-height: .95;
}
.stat .k {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 17px;
  border: 1px solid var(--ink);
  background: linear-gradient(118deg, var(--honey-hi), var(--honey));
  color: var(--honey-ink);
  clip-path: var(--chamfer-s);
  box-shadow: 0 4px 0 var(--honey-deep);
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  transition: transform .12s var(--e-out), box-shadow .12s var(--e-out), background .12s var(--e-out);
}
.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: inset 0 -3px 0 var(--surface-3);
}
.btn.sm { min-height: 32px; padding: 6px 11px; font-family: var(--body); font-size: 12px; font-weight: 700; text-transform: none; }
.btn.block { width: 100%; }
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--honey-deep); }
  .btn.ghost:hover { box-shadow: inset 0 -3px 0 var(--honey); }
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--honey-deep); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

.seg,
.view-toggle,
.tabs {
  display: inline-flex;
  border: 1px solid var(--line-2);
  background: oklch(1 0 0 / .62);
  clip-path: var(--chamfer-s);
  overflow: hidden;
}
.seg button,
.view-toggle button,
.tabs button {
  border: 0;
  background: transparent;
  padding: 9px 16px;
  color: var(--label);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.seg button.is-active,
.seg button.on,
.view-toggle button.is-active,
.view-toggle button.on,
.tabs button.is-active,
.tabs button.on {
  background: var(--ink);
  color: var(--surface);
  box-shadow: inset 0 -3px 0 var(--honey);
}
select.inp,
.inp,
input,
textarea {
  border: 1px solid var(--border-input);
  background: oklch(1 0 0 / .82);
  color: var(--ink);
  clip-path: var(--chamfer-s);
}
select.inp,
.inp {
  min-height: 40px;
  padding: 9px 12px;
}
select.inp {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23141411' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
/* Состояние ошибки поля (валидация): класс .is-error ИЛИ aria-invalid — красная рамка + кольцо. */
input.is-error, textarea.is-error, .inp.is-error,
input[aria-invalid="true"], textarea[aria-invalid="true"], .inp[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.live { background: oklch(0.56 0.14 150 / .12); color: var(--ok); }
.chip.warn { background: oklch(0.80 0.15 82 / .16); color: var(--honey-ink); }

.empty {
  color: var(--muted);
  padding: 44px 22px;
  text-align: center;
  font-size: 15px;
}
/* Загрузка — отдельный паттерн (не путать с пустым). Точки-пульс на медовом акценте. */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  padding: 44px 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-2);
  border-top-color: var(--honey-deep);
  border-radius: 999px;
  animation: rb-spin .7s linear infinite;
}
@keyframes rb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }
.muted { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .pt-top {
    grid-template-columns: 1fr auto;
    min-height: 64px;
  }
  .pt-brand { min-width: 0; border-right: 0; padding: 12px 16px; }
  .pt-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--line);
  }
  .pt-actions { border-left: 1px solid var(--line); padding: 0 12px; }
  .pt-user { min-width: 0; padding-right: 8px; }
  .pt-ucopy, .pt-chev { display: none; }
  .pt-main { width: min(100% - 28px, 760px); padding-top: 28px; }
  .pt-main h1 { font-size: clamp(34px, 11vw, 58px); }
}

@media (max-width: 560px) {
  .pt-top { grid-template-columns: minmax(0, 1fr) auto; max-width: 100vw; overflow: hidden; }
  .pt-brand { grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; font-size: 21px; }
  .pt-brand::before { width: 30px; height: 30px; }
  .pt-brand::after { display: none; }
  .pt-nav { max-width: 100vw; scrollbar-width: none; }
  .pt-nav::-webkit-scrollbar { display: none; }
  .pt-nav a { font-size: 11px; padding: 10px 9px; }
  .pt-actions { gap: 8px; }
  .icon-btn { width: 38px; height: 38px; }
  .pt-main { width: min(100% - 24px, 520px); padding-bottom: 44px; }
  .pt-main h1 { font-size: clamp(26px, 8.5vw, 40px); }
  .seg button,
  .view-toggle button,
  .tabs button { padding: 9px 12px; }
}

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