/* =========================================================
   ХПГ · Арена — оформление
   ========================================================= */

:root {
  --bg: #070b14;
  --line: rgba(126, 166, 255, 0.16);
  --line-strong: rgba(126, 166, 255, 0.34);
  --text: #e9eefc;
  --muted: #8ea0c2;
  --accent: #5eead4;
  --accent-2: #7c9cff;
  --danger: #ff8080;
  --font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 760px at 12% -8%, rgba(94, 234, 212, 0.13), transparent 60%),
    radial-gradient(1000px 720px at 96% 0%, rgba(124, 156, 255, 0.16), transparent 58%),
    radial-gradient(900px 900px at 50% 118%, rgba(124, 156, 255, 0.08), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: 34px; }
h2 { font-size: 20px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(94, 234, 212, 0.1);
  color: var(--accent);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 13px; margin-top: 4px; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='104' viewBox='0 0 120 104'%3E%3Cg fill='none' stroke='%237c9cff' stroke-opacity='0.07' stroke-width='1'%3E%3Cpath d='M30 1 60 18v34L30 69 0 52V18z'/%3E%3Cpath d='M90 1l30 17v34L90 69 60 52V18z'/%3E%3Cpath d='M60 69l30 17v34L60 137 30 120V86z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 208px;
  opacity: 0.55;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 78%);
}

.screen { position: relative; z-index: 1; }

/* ---------------------------- общие блоки ---------------------------- */

.panel {
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.9), rgba(11, 17, 29, 0.94));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #5eead4, #7c9cff);
  color: #05121d;
  box-shadow: 0 12px 26px rgba(94, 234, 212, 0.18);
}

.btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(94, 234, 212, 0.28);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-strong);
}

.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.ghost.armed {
  border-color: #ffcf6b;
  color: #ffcf6b;
  background: rgba(255, 207, 107, 0.12);
}
.btn.primary.armed {
  background: linear-gradient(135deg, #ffcf6b, #ff9f43);
  color: #221100;
  box-shadow: 0 12px 26px rgba(255, 159, 67, 0.3);
}

/* ---------------------------- экран входа ---------------------------- */

.login-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(26px, 7vh, 76px) 20px 46px;
  display: grid;
  gap: 20px;
}

.hero { display: flex; align-items: center; gap: 18px; }

.logo-hex {
  width: 64px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: none;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(150deg, #5eead4, #7c9cff 70%);
  color: #05121d;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  filter: drop-shadow(0 12px 26px rgba(94, 234, 212, 0.25));
}

.logo-hex.small { width: 36px; height: 40px; font-size: 11px; }

.hero-titles h1 { line-height: 1.05; }
.hero-titles p { font-size: 14px; }

.login-card { padding: 26px 26px 22px; display: grid; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.account-card:hover {
  transform: translateY(-2px);
  border-color: var(--c, var(--accent));
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.account-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.acc-hex {
  width: 34px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--c, var(--accent));
  color: #05121d;
  font-weight: 800;
  font-size: 14px;
}

.acc-meta { display: grid; line-height: 1.15; flex: 1; min-width: 0; }
.acc-meta strong { font-size: 14px; }
.acc-enter {
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}
.account-card:hover .acc-enter { opacity: 1; transform: translateX(0); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 4px 0;
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.field { display: grid; gap: 6px; }
.field span {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.75);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { resize: vertical; min-height: 74px; line-height: 1.45; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

.facts {
  list-style: none;
  margin: 6px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.facts li { display: grid; gap: 1px; font-size: 12px; color: var(--muted); }
.facts b { font-size: 15px; color: var(--text); font-weight: 700; }

.footer-note { text-align: center; max-width: 640px; margin: 0 auto; line-height: 1.6; }

/* ---------------------------- верхняя панель ---------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
}

.tb-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-meta { font-size: 11px; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cloud-status {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.3);
  background: rgba(94, 234, 212, 0.08);
  color: var(--accent);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cloud-status[data-kind="warn"] { color: #ffd43b; border-color: rgba(255, 212, 59, 0.3); background: rgba(255, 212, 59, 0.08); }
.cloud-status[data-kind="error"] { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.08); }

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.6);
}

.tab {
  padding: 7px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab.active { background: rgba(94, 234, 212, 0.16); color: var(--accent); }

.dev-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.dev-toggle .dev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.dev-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.dev-toggle.active {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(94, 234, 212, 0.12);
}
.dev-toggle.active .dev-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.switcher { display: flex; align-items: center; gap: 8px; }
.switcher select { width: auto; padding: 8px 10px; font-size: 13px; }
.switcher .small { white-space: nowrap; }

/* ---------------------------- арена: раскладка ---------------------------- */

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  max-width: 1780px;
  margin: 0 auto;
  padding: 18px 22px 30px;
}

.panel-left, .panel-right { padding: 16px; }
.panel-title { margin-bottom: 10px; }

.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.player-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.player-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--c, #fff);
  opacity: 0.45;
}

.player-row.mine {
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.35);
}
.player-row.mine::before { opacity: 1; box-shadow: 0 0 10px var(--c); }

/* таймер настоящего времени прохождения — отдельное окно под игроками */
.play-timer {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 18, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.play-timer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.play-timer-head .panel-title { margin-bottom: 0; font-size: 14px; }
.play-timer-info {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.play-timer #btnPlayTimer { width: 100%; justify-content: center; }
.cell-history-playtime { margin: 0; font-size: 11px; }

.hexchip {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--c, var(--accent));
  color: #05121d;
  font-size: 13px;
  font-weight: 800;
  flex: none;
}

/* мини-гекс уровня у аватарки */
.avatar-wrap { position: relative; display: inline-flex; flex: none; align-self: center; }
.lvl-hex {
  position: absolute;
  right: -7px;
  bottom: -5px;
  min-width: 17px;
  height: 19px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--accent);
  color: #05121d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(7, 11, 20, 0.95));
}
.lvl-hex.big {
  right: -9px;
  bottom: -7px;
  min-width: 22px;
  height: 25px;
  font-size: 13px;
}
.profile-item .avatar-wrap { margin-right: 2px; }
.profile-head .avatar-wrap { margin-right: 2px; }

/* статус действия игрока в таблице */
.pname-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pstatus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.pstatus.capture { color: var(--accent-2); border-color: rgba(124, 156, 255, 0.4); background: rgba(124, 156, 255, 0.12); }
.pstatus.pick { color: #ffd43b; border-color: rgba(255, 212, 59, 0.4); background: rgba(255, 212, 59, 0.1); }
.pstatus.scout { color: var(--accent); border-color: rgba(94, 234, 212, 0.4); background: rgba(94, 234, 212, 0.1); }

.pname { display: grid; gap: 3px; line-height: 1.15; font-size: 14px; min-width: 0; }
.pname .small { font-size: 10px; letter-spacing: 0.02em; }
.pname > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pname-status { min-width: 0; }
.pstatus {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.you-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.3);
}

.hint { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); line-height: 1.5; }

/* ---------------------------- арена: дев-панель ---------------------------- */

.dev-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(94, 234, 212, 0.35);
  display: grid;
  gap: 8px;
}
.dev-panel .panel-head { margin-bottom: 0; }
.dev-panel h3 { font-size: 11px; }
.dev-panel .muted { line-height: 1.45; }

/* ---------------------------- арена: поле ---------------------------- */

.board-col { display: grid; gap: 12px; min-width: 0; }

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(12, 19, 32, 0.72);
  font-size: 14px;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: livePulse 1.8s ease-in-out infinite;
}

.dot-idle { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

.board-shell {
  display: flex;
  justify-content: center;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 45%, rgba(94, 234, 212, 0.07), transparent 62%),
    linear-gradient(180deg, rgba(16, 24, 40, 0.72), rgba(9, 14, 24, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.38);
  padding: 6px;
  overflow: hidden;
  min-height: 240px;
}

#board { display: block; width: 100%; height: auto; max-height: 76vh; }

.cell {
  fill: rgba(76, 110, 175, 0.12);
  stroke: rgba(126, 166, 255, 0.22);
  stroke-width: 1.2;
  transition: fill 0.16s ease, stroke 0.16s ease, stroke-opacity 0.16s ease;
}

.cell.edge {
  fill: rgba(94, 234, 212, 0.05);
  stroke: rgba(94, 234, 212, 0.34);
}

.cell-group:hover .cell { fill: rgba(126, 166, 255, 0.2); }

.cell.own {
  fill: rgba(255, 255, 255, 0.09);
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 2;
}

.cell.has-cell { stroke: rgba(124, 156, 255, 0.6); }

.cell.captured {
  fill: rgba(124, 156, 255, 0.14);
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
}

.cell.editable { cursor: crosshair; }
.cell-group:hover .cell.editable { fill: rgba(124, 156, 255, 0.3); }

.cell.reachable {
  fill: rgba(94, 234, 212, 0.2);
  stroke: var(--accent);
  stroke-width: 2.4;
  cursor: pointer;
  animation: reachablePulse 1.9s ease-in-out infinite;
}

.cell-group:has(.cell.reachable) { cursor: pointer; }

.tokens-layer { pointer-events: none; }

.token { transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1); }
.token .body { stroke: rgba(4, 10, 20, 0.8); stroke-width: 3; }
.token .label {
  fill: #05121d;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  pointer-events: none;
}
.token .ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
  stroke-dasharray: 5 7;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.token.mine .ring { opacity: 1; animation: ringSpin 7s linear infinite; }

.cell-badge { pointer-events: none; }
.cell-badge circle { stroke: rgba(5, 12, 22, 0.9); stroke-width: 1.6; }
.cell-badge text {
  fill: #06131f;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 800;
}

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}
.board-legend span { display: inline-flex; align-items: center; gap: 7px; }

.dot { width: 11px; height: 11px; display: inline-block; flex: none; }
.dot.you {
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
.dot.move {
  border-radius: 3px;
  border: 1.5px dashed var(--accent);
}
.dot.cell {
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(124, 156, 255, 0.6);
}
.dot.captured {
  border-radius: 50%;
  background: #ffcf6b;
  box-shadow: 0 0 8px rgba(255, 207, 107, 0.55);
}
.dot.free {
  border-radius: 50%;
  border: 2px solid rgba(94, 234, 212, 0.6);
}
.dot.edge {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(94, 234, 212, 0.25);
  border: 1px solid rgba(94, 234, 212, 0.6);
}

/* ---------------------------- арена: правая панель ---------------------------- */

.player-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(11, 17, 29, 0.6);
}

.who { display: flex; align-items: center; gap: 10px; }
.who-text { display: grid; line-height: 1.15; flex: 1; min-width: 0; }
.who-text strong { font-size: 15px; }
.who-text .small { font-size: 11px; }

.fact { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.fact .small { font-size: 12px; }
.fact b { font-variant-numeric: tabular-nums; }

/* гекс опыта в карточке игрока: контур заполняется по мере опыта */
.xp-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 4px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.xp-hex { width: 62px; height: 62px; flex: none; overflow: visible; }
.xp-hex-track {
  fill: rgba(126, 166, 255, 0.06);
  stroke: rgba(126, 166, 255, 0.22);
  stroke-width: 5;
  stroke-linejoin: round;
}
.xp-hex-fill {
  fill: none;
  stroke: var(--c, var(--accent));
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px var(--c, var(--accent)));
  transition: stroke-dasharray 0.45s ease;
}
.xp-hex-level {
  fill: var(--text);
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.xp-text { display: grid; gap: 1px; line-height: 1.2; min-width: 0; }
.xp-text b { font-size: 14px; }
.xp-text .small { font-size: 11px; }

.cell-here {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 156, 255, 0.3);
  background: rgba(124, 156, 255, 0.08);
  font-size: 12px;
  line-height: 1.35;
}

.note {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  padding-left: 10px;
  line-height: 1.5;
}

.log-head { margin-top: 16px; }
.log-head .panel-title { margin-bottom: 8px; }

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.log li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
}

.log li.system { color: var(--muted); }
.log li.system .log-text { grid-column: 1 / -1; }
.log-name { font-weight: 700; white-space: nowrap; }
.log-text { overflow-wrap: anywhere; }

.rules {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}
.rules summary { cursor: pointer; color: var(--text); font-weight: 600; font-size: 12.5px; }
.rules summary::marker { color: var(--muted); }
.rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; line-height: 1.45; }

/* ---------------------------- колесо: раскладка ---------------------------- */

.wheel-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  max-width: 1700px;
  margin: 0 auto;
  padding: 18px 22px 30px;
}

.filters-panel {
  padding: 16px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
  display: grid;
  gap: 14px;
  align-content: start;
}

.dev-filters { display: grid; gap: 12px; }

.filter-fields { display: grid; gap: 14px; }

.filter-block { display: grid; gap: 7px; }
.filter-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips:empty { display: none; }

.filter-block .chips { max-height: 150px; overflow-y: auto; scrollbar-width: thin; padding: 1px; }

.chip {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.chip:hover { border-color: var(--line-strong); }
.chip.on {
  background: rgba(94, 234, 212, 0.16);
  border-color: rgba(94, 234, 212, 0.55);
  color: var(--accent);
}

.filter-search { padding: 7px 10px; font-size: 12px; border-radius: 9px; }

.range-row { display: flex; align-items: center; gap: 7px; }
.range-row input { width: 100%; padding: 8px 10px; font-size: 13px; }
.range-dash { color: var(--muted); flex: none; }

.filter-save {
  display: grid;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.filter-save input { font-size: 13px; }

.wheel-col { display: grid; gap: 14px; min-width: 0; }

.wheel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wheel-head strong { font-size: 16px; }

.wheel-stage {
  display: grid;
  place-items: center;
  padding: 6px;
}

.wheel-svg-wrap {
  position: relative;
  width: min(580px, 100%);
  aspect-ratio: 1 / 1;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 24px 50px rgba(0, 0, 0, 0.45));
}

.wheel-slice { pointer-events: none; }

.wheel-label {
  fill: #f2f6ff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(3, 7, 14, 0.7);
  stroke-width: 3;
  pointer-events: none;
}

.wheel-needle {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 22px solid var(--accent);
  filter: drop-shadow(0 4px 10px rgba(94, 234, 212, 0.5));
  z-index: 2;
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 25%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(126, 166, 255, 0.35);
  background: radial-gradient(circle at 50% 35%, rgba(22, 32, 52, 0.98), rgba(7, 11, 20, 0.98));
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2em;
  cursor: pointer;
  z-index: 3;
  display: grid;
  place-items: center;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 0 7px rgba(7, 11, 20, 0.55);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.wheel-hub span { transform: translateX(0.1em); }
.wheel-hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: var(--accent);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 0 7px rgba(7, 11, 20, 0.5), 0 0 26px rgba(94, 234, 212, 0.35);
}
.wheel-hub:disabled { opacity: 0.5; cursor: not-allowed; }
.wheel-hub:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.wheel-hub.loading span { animation: livePulse 0.9s ease-in-out infinite; }

/* ---------------------------- колесо: результат ---------------------------- */

.result { display: grid; gap: 10px; }
.result-empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.game-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(22, 32, 52, 0.92), rgba(11, 17, 29, 0.95));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.game-cover {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  min-height: 120px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.2), rgba(124, 156, 255, 0.25));
  display: grid;
  place-items: center;
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-cover.no-image::after { content: "нет обложки"; font-size: 11px; color: var(--muted); }
.game-year {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5, 10, 18, 0.8);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.game-info { display: grid; gap: 9px; align-content: start; min-width: 0; }
.game-info h3 { font-size: 19px; color: var(--text); text-transform: none; letter-spacing: 0; }
.game-info > p { font-size: 12.5px; }

.stat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.stat {
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  min-width: 86px;
}
.stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.game-meta { display: grid; gap: 3px; font-size: 12px; line-height: 1.4; }
.game-tags { margin-top: 2px; }
.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 156, 255, 0.1);
  border: 1px solid rgba(124, 156, 255, 0.22);
  font-size: 11px;
  color: var(--muted);
}

.game-links { display: flex; gap: 8px; flex-wrap: wrap; }

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.result-actions .btn { flex: 1; min-width: 140px; }

/* ---------------------------- колесо: клетка, настройки, шаблоны ---------------------------- */

.cell-info { display: grid; gap: 8px; }
.cell-info-name { font-size: 16px; font-weight: 700; }

.cell-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  line-height: 1.4;
}
.cell-status.busy { border-color: rgba(255, 207, 107, 0.4); background: rgba(255, 207, 107, 0.08); }
.cell-status.free { border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.07); }

.filter-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 12.5px;
}
.filter-summary li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}
.filter-summary-label {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.filter-summary li span:last-child { overflow-wrap: anywhere; }

.speed-block {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.speed-block .panel-title { margin-bottom: 0; }
.speed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.speed-input-wrap { display: flex; align-items: center; gap: 5px; }
.speed-input-wrap input { width: 64px; padding: 6px 8px; font-size: 13px; text-align: center; }

.side-panel { padding: 16px; display: grid; gap: 14px; align-content: start; }

.presets-block { display: grid; gap: 8px; }

.preset-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }

.preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.preset-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preset-actions { display: flex; gap: 5px; flex: none; }

/* ---------------------------- модалка: карточка клетки, редактор ---------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.cell-card {
  width: min(580px, 100%);
  padding: 0;
  gap: 0;
  max-height: calc(100vh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

@media (max-height: 780px) {
  .base-grid { width: min(250px, 100%); }
}

.cell-editor { width: min(520px, 100%); }

.cell-hero {
  position: relative;
  min-height: 168px;
  background-size: cover;
  background-position: center;
  background-color: #101a2c;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  isolation: isolate;
}
.cell-hero.no-bg {
  background-image:
    radial-gradient(600px 240px at 20% 0%, rgba(124, 156, 255, 0.35), transparent 70%),
    linear-gradient(140deg, #17223a, #0b1220);
}
.cell-hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 8, 16, 0.35) 0%, rgba(4, 8, 16, 0.55) 55%, rgba(4, 8, 16, 0.92) 100%);
}
.cell-hero-text { display: grid; gap: 3px; }
.cell-hero-text h2 { font-size: 25px; line-height: 1.15; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); }
.cell-hero-sub { font-size: 12px; color: rgba(233, 238, 252, 0.78); }

.cell-card-body { padding: 18px 20px 20px; display: grid; gap: 14px; }
.cell-lore { font-size: 13.5px; line-height: 1.6; white-space: pre-line; }

.cell-filter-block { display: grid; gap: 7px; }
.cell-block-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cell-game {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.08);
  font-size: 12.5px;
}

.cell-bg-preview {
  height: 96px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  background-color: rgba(6, 10, 18, 0.7);
  display: grid;
  place-items: center;
}
.cell-bg-preview.empty { border-style: dashed; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.modal-actions .btn { flex: none; }

.seg {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.6);
}

.seg-btn {
  flex: 1;
  padding: 8px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.seg-btn.on {
  background: rgba(94, 234, 212, 0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.4);
}

.field-block { display: grid; gap: 7px; }
.field-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translate(-50%, 14px);
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 24, 40, 0.96);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 20px;
  color: var(--danger);
}

/* ---------------------------- адаптив ---------------------------- */

@media (max-width: 1400px) {
  .layout { grid-template-columns: 310px minmax(0, 1fr) 300px; gap: 14px; }
  .wheel-layout { grid-template-columns: 310px minmax(0, 1fr) 270px; gap: 14px; }
  .game-card { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  .layout,
  .wheel-layout { grid-template-columns: minmax(0, 1fr); }
  .board-col { order: -1; }
  .filters-panel { max-height: none; }
  .player-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .log { max-height: 200px; }
  .side-panel { order: 3; }
  .wheel-col { order: -1; }
}

@media (max-width: 720px) {
  h1 { font-size: 28px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .tb-right { width: 100%; justify-content: space-between; }
  .switcher { flex: 1; }
  .switcher select { flex: 1; width: 100%; }
  .layout,
  .wheel-layout { padding: 12px 12px 24px; }
  .logo-hex { width: 52px; height: 58px; font-size: 15px; }
  .login-form { grid-template-columns: 1fr; }
  .login-form .btn { width: 100%; }
  .account-grid { grid-template-columns: 1fr; }
  .board-legend { gap: 10px; }
  .game-card { grid-template-columns: 1fr; }
  .game-cover { min-height: 150px; }
  .wheel-head { flex-direction: column; align-items: stretch; }
  .filter-summary li { grid-template-columns: 96px minmax(0, 1fr); }
  .cell-hero-text h2 { font-size: 21px; }
}

/* ---------------------------- анимации ---------------------------- */

@keyframes reachablePulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.5; }
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------- базы и зоны ---------------------------- */

.dot.base {
  border-radius: 50%;
  background: #ffcf6b;
  box-shadow: 0 0 8px rgba(255, 207, 107, 0.55);
}
.dot.zone {
  border-radius: 3px;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(124, 156, 255, 0.5);
}

.cell-status.base {
  border-color: rgba(255, 207, 107, 0.4);
  background: rgba(255, 207, 107, 0.08);
}

/* ---------------------------- оверлей выпавшей игры ---------------------------- */

.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: rgba(3, 6, 12, 0.82);
  backdrop-filter: blur(10px);
}

.result-overlay-scroll {
  width: min(780px, 100%);
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 2px;
  display: grid;
  gap: 10px;
}

.result-overlay-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.result-overlay-card .game-card {
  grid-template-columns: 230px minmax(0, 1fr);
  border: 1px solid var(--line);
  box-shadow: none;
}

.result-overlay-card .game-info h3 {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.result-overlay-card .game-info > p,
.result-overlay-card .game-meta p,
.result-overlay-card .muted.small {
  overflow-wrap: anywhere;
}

.overlay-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.overlay-actions .btn { flex: 1; min-width: 150px; }

/* ---------------------------- профили ---------------------------- */

.profiles-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 22px 30px;
}

.profiles-side { padding: 16px; }

.profile-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.profile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-item:hover { border-color: var(--c, var(--accent)); background: rgba(255, 255, 255, 0.06); }
.profile-item.active {
  border-color: var(--c, var(--accent));
  background: rgba(94, 234, 212, 0.08);
  box-shadow: inset 3px 0 0 var(--c, var(--accent));
}
.profile-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.profile-item-text { display: grid; line-height: 1.15; min-width: 0; }
.profile-item-text strong { font-size: 14px; }
.profile-item-text .small { font-size: 11px; }

.profile-main { padding: 18px; display: grid; gap: 16px; align-content: start; }

.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head h2 { font-size: 22px; }

.hexchip.big { width: 46px; height: 52px; font-size: 18px; }

.profile-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-stats .stat { min-width: 130px; }

.profile-section-title { margin-top: 2px; }

.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.review-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
}

.review-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.review-game { font-weight: 700; overflow-wrap: anywhere; }
.review-rating { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-text { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

/* ---------------------------- обзор: оценка ---------------------------- */

.rating-row { display: flex; align-items: center; gap: 12px; }
.rating-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 26px; }
.rating-row output {
  min-width: 2.2ch;
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------- адаптив: профили, оверлей ---------------------------- */

@media (max-width: 900px) {
  .profiles-layout { grid-template-columns: minmax(0, 1fr); }
  .result-overlay-card .game-card { grid-template-columns: 1fr; }
  .result-overlay-card .game-cover { min-height: 140px; }
  .profiles-side { padding: 14px; }
  .profile-main { padding: 14px; }
}

/* ---------------------------- сложности клеток ---------------------------- */

.dot.diff-easy { border-radius: 50%; background: #51cf66; box-shadow: 0 0 8px rgba(81, 207, 102, 0.5); }
.dot.diff-medium { border-radius: 50%; background: #ffd43b; box-shadow: 0 0 8px rgba(255, 212, 59, 0.5); }
.dot.diff-hard { border-radius: 50%; background: #ff6b6b; box-shadow: 0 0 8px rgba(255, 107, 107, 0.5); }
.dot.diff-hell { border-radius: 50%; background: #b197fc; box-shadow: 0 0 8px rgba(177, 151, 252, 0.55); }

.cell-difficulty-row { display: flex; flex-wrap: wrap; gap: 8px; }

.cell-diff {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.cell-diff .dot { width: 9px; height: 9px; box-shadow: none; }

.cell-xp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.08);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.cell-xp .dot { width: 9px; height: 9px; box-shadow: none; }

/* ---------------------------- шаблон клетки ---------------------------- */

.template-editor { width: min(560px, 100%); }

.template-filters {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 6px currentColor;
}

.preset-name {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow: visible;
}
.preset-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.preset-sub { font-size: 10.5px; color: var(--muted); }

/* подсветка клеток для хода (отдельный слой, чтобы не портить цвета клеток) */
.cell-highlight {
  fill: rgba(94, 234, 212, 0.16);
  stroke: var(--accent);
  stroke-width: 2.5;
  pointer-events: none;
  animation: reachablePulse 1.9s ease-in-out infinite;
}

.legend-note { color: var(--muted); opacity: 0.8; }

/* история игр на клетке */
.cell-history-block { display: grid; gap: 7px; }
.cell-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.cell-history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  padding: 8px 10px;
  margin: 0 0 6px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.cell-history li:last-child { margin-bottom: 0; }
.cell-history-game { font-weight: 600; overflow-wrap: anywhere; }
.cell-history-meta { color: var(--muted); white-space: normal; font-size: 11px; overflow-wrap: anywhere; }

/* строительство на базе */
.base-build-block { display: grid; gap: 8px; }

.base-grid-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.45);
}

.base-grid { display: block; width: min(340px, 100%); height: auto; }

.base-tile { stroke-width: 1.4; transition: fill 0.15s ease, stroke 0.15s ease; }
.base-tile.locked {
  fill: rgba(10, 16, 28, 0.9);
  stroke: rgba(126, 166, 255, 0.14);
  stroke-dasharray: 3 3;
  cursor: not-allowed;
}
.base-tile.unlocked {
  fill: rgba(94, 234, 212, 0.12);
  stroke: var(--accent);
  stroke-width: 2;
  cursor: pointer;
}
.base-tile.unlocked:hover { fill: rgba(94, 234, 212, 0.24); }
.base-tile.built {
  fill: rgba(255, 207, 107, 0.2);
  stroke: #ffcf6b;
  stroke-width: 2;
  cursor: pointer;
}

.base-tile-label {
  fill: #ffcf6b;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}
.base-tile-plus {
  fill: var(--accent);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
}

.construction-card { width: min(460px, 100%); }
.build-options { display: grid; gap: 8px; }

.build-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.build-option:hover { border-color: rgba(255, 207, 107, 0.6); background: rgba(255, 207, 107, 0.08); }

.build-icon {
  width: 36px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255, 207, 107, 0.18);
  color: #ffcf6b;
  font-weight: 800;
  font-size: 12px;
}

.build-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.build-cost { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* разведка клеток */
.recon-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(124, 156, 255, 0.35);
  background: rgba(124, 156, 255, 0.06);
}
.recon-points { font-size: 12.5px; color: var(--text); }
.recon-points b { color: var(--accent); font-size: 15px; }

/* инвентарь и снаряжение */
.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 22px 30px;
}

.equip-panel, .inventory-panel { padding: 16px; }

.equip-hex { display: block; width: 100%; max-width: 420px; height: auto; margin: 8px auto 0; }

.equip-slot { cursor: pointer; }
.equip-tile {
  fill: rgba(16, 26, 44, 0.9);
  stroke: rgba(126, 166, 255, 0.3);
  stroke-width: 1.6;
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.equip-slot:hover .equip-tile { stroke: var(--accent); }
.equip-item-icon { font-size: 24px; pointer-events: none; }
.equip-slot-plus { fill: rgba(94, 234, 212, 0.75); font-size: 24px; font-weight: 700; pointer-events: none; }
.equip-center-label {
  fill: #05121d;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  pointer-events: none;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.inv-slot {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.inv-slot:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  transform: translateY(-1px);
}
.inv-slot.empty { opacity: 0.4; cursor: default; }
.inv-icon { font-size: 24px; line-height: 1; }
.inv-name { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.inv-empty { color: var(--muted); }

.item-picker { width: min(480px, 100%); }
.item-picker-list { display: grid; gap: 7px; max-height: 50vh; overflow-y: auto; }
.item-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.item-pick:hover { border-color: var(--accent); background: rgba(94, 234, 212, 0.07); }
.item-pick-icon { font-size: 22px; }
.item-pick-text { display: grid; gap: 2px; }

@media (max-width: 900px) {
  .inventory-layout { grid-template-columns: minmax(0, 1fr); }
}

/* виджет предмета и снаряжение в профиле */
.item-widget { width: min(460px, 100%); }
.item-widget-head { display: flex; align-items: center; gap: 12px; }
.item-widget-icon {
  width: 46px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 24px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--line);
  background: rgba(255, 255, 255, 0.06);
  border: 0;
}
.item-widget-block { display: grid; gap: 4px; }
.item-widget-block p { font-size: 13px; line-height: 1.55; }

.profile-equip-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.45);
}
.profile-equip { display: block; width: min(360px, 100%); height: auto; }

.equip-slot.readonly { cursor: default; }
.equip-slot.readonly:hover .equip-tile { stroke: rgba(126, 166, 255, 0.3); }

/* перетаскивание предметов и редактор формы */
.inv-slot.filled {
  border-color: var(--rar, var(--ic, var(--accent-2)));
  background: var(--rar-bg, rgba(124, 156, 255, 0.07));
}
.inv-slot.filled:hover:not(:disabled) {
  border-color: var(--rar, var(--accent));
  background: var(--rar-bg-hover, rgba(94, 234, 212, 0.08));
}
.inv-icon.faint { opacity: 0.32; font-size: 18px; }

.drag-ghost {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
  font-size: 30px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.item-editor { width: min(540px, 100%); }

.item-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 6px;
  justify-content: center;
}

.pattern-cell {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pattern-cell.on {
  border-style: solid;
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.18);
}

.pattern-preview { display: grid; grid-template-columns: repeat(3, 18px); gap: 3px; }
.pattern-preview-cell { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); }
.pattern-preview-cell.on { background: rgba(124, 156, 255, 0.35); border-color: var(--accent-2); }

.custom-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.custom-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}
.custom-item-icon { font-size: 18px; }
.custom-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* без выделения текста при перетаскивании */
html, body {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
input, textarea, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
}
img, svg { -webkit-user-drag: none; }
.drag-ghost { pointer-events: none !important; user-select: none; }

/* гексовая форма предмета */
.item-pattern-editor { display: block; width: min(300px, 100%); margin: 0 auto; }
.pattern-hex {
  fill: rgba(16, 26, 44, 0.9);
  stroke: rgba(126, 166, 255, 0.3);
  stroke-width: 1.4;
  cursor: pointer;
}
.pattern-hex.on { fill: rgba(94, 234, 212, 0.22); stroke: var(--accent); }

.pattern-preview-svg { display: block; width: 170px; height: auto; margin-top: 4px; }
.pattern-hex-preview { fill: rgba(16, 26, 44, 0.9); stroke: rgba(126, 166, 255, 0.25); stroke-width: 1.2; }
.pattern-hex-preview.on { fill: rgba(124, 156, 255, 0.4); stroke: var(--accent-2); }

.equip-tile.locked {
  fill: rgba(10, 16, 28, 0.55);
  stroke: rgba(126, 166, 255, 0.14);
  stroke-dasharray: 3 4;
  cursor: default;
}
.equip-tile.empty { fill: rgba(16, 26, 44, 0.9); stroke: rgba(126, 166, 255, 0.3); }
.equip-lock-dot { fill: rgba(126, 166, 255, 0.35); font-size: 18px; pointer-events: none; }
.equip-item-icon.faint { font-size: 16px; opacity: 0.5; }
.custom-item-shape { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* окно снаряжения: зум и панорамирование */
.equip-viewport {
  position: relative;
  height: 430px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.45);
  cursor: grab;
  touch-action: none;
}
.equip-viewport.panning { cursor: grabbing; }
.equip-viewport .equip-hex { display: block; width: 100%; height: 100%; }

/* игрок как предмет в зоне снаряжения */
.equip-tile.player { stroke-width: 2.2; }
.equip-player-label {
  fill: #05121d;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

/* контур формы предмета и всплывающее описание */
.item-outline {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

/* подсветка предметов, которые окажутся в закрытой зоне при попытке убрать предмет */
@keyframes stranded-flash-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.stranded-flash-outline {
  fill: rgba(255, 128, 128, 0.22);
  stroke: var(--danger);
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(255, 128, 128, 0.85));
  animation: stranded-flash-pulse 0.25s ease-in-out 4 alternate;
}

.item-tooltip {
  position: fixed;
  z-index: 140;
  pointer-events: none;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 24, 0.97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.item-tooltip-head { display: flex; align-items: center; gap: 7px; }
.item-tooltip-icon { font-size: 17px; }
.item-tooltip-lore { color: var(--muted); font-size: 11.5px; }
.item-tooltip-prop { color: var(--accent-2); font-size: 11.5px; }
.item-tooltip-rarity { display: flex; }

/* редкости предметов */
.rarity-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--rarity, var(--line));
  background: rgba(255, 255, 255, 0.04);
  color: var(--rarity, var(--text));
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* окно торговца */
.merchant-card { width: min(560px, 100%); }
.merchant-offers { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.merchant-offer {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--rarity, var(--line));
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.merchant-offer:hover {
  border-color: var(--rarity, var(--accent));
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.merchant-offer-icon { font-size: 24px; line-height: 1; flex: none; }
.merchant-offer-text { display: grid; gap: 3px; min-width: 0; }
.merchant-offer-text strong { font-size: 14px; }
.merchant-offer-text .small { font-size: 11.5px; }

.merchant-ultimate { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.merchant-ultimate-list { display: grid; gap: 6px; max-height: 28vh; overflow-y: auto; padding-right: 2px; }
.merchant-ultimate-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--rarity, var(--line));
  transition: border-color 0.15s ease, background 0.15s ease;
}
.merchant-ultimate-item:hover { border-color: var(--rarity, var(--accent)); background: rgba(255, 255, 255, 0.06); }
.merchant-ultimate-item .rarity-chip { margin-left: auto; }

/* командный пункт */
.command-card { width: min(520px, 100%); }
.command-options { display: grid; gap: 8px; max-height: 48vh; overflow-y: auto; padding-right: 2px; }
.command-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.command-option:hover { border-color: var(--accent); background: rgba(94, 234, 212, 0.07); }
.command-slot {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.command-slot-label { font-size: 11px; color: var(--muted); }
.command-slot select { width: 100%; }

/* призрак занимаемых гексов при перетаскивании */
.drag-preview-cell {
  fill: rgba(81, 207, 102, 0.16);
  stroke: #51cf66;
  stroke-width: 2;
  stroke-dasharray: 4 3;
  pointer-events: none;
}
.drag-preview-cell.invalid {
  fill: rgba(255, 107, 107, 0.15);
  stroke: #ff6b6b;
}

.item-tooltip-shape { display: flex; justify-content: center; padding-top: 2px; }
.item-tooltip-shape .pattern-preview-svg { width: 120px; }

/* закрытые гексы не перехватывают мышь — окно удобно таскать */
.equip-slot.locked-cell { pointer-events: none; }

/* окно снаряжения в профиле: зум и панорамирование */
.profile-equip-viewport { height: 430px; margin-top: 8px; }
.profile-equip-viewport .profile-equip { width: 100%; height: 100%; margin: 0; }

/* дев-панель */
.dev-layout { max-width: 1100px; margin: 0 auto; padding: 18px 22px 30px; }
.dev-shell { padding: 16px; }
.dev-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dev-tab {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.dev-tab.on { color: var(--text); border-color: var(--accent-2); background: rgba(124, 156, 255, 0.12); }
.dev-content { display: grid; gap: 12px; }
.dev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.dev-row-icon { font-size: 18px; width: 24px; text-align: center; }
.dev-row-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.dev-row-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.btn.tiny { padding: 4px 9px; font-size: 11px; border-radius: 8px; }
.dev-account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dev-account-list .btn { justify-content: flex-start; width: 100%; }

/* дев-редактор опыта */
.dev-actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-dev-row .dev-row-text { min-width: 0; }
.xp-dev-row .dev-row-text .small { display: block; overflow: hidden; text-overflow: ellipsis; }
.xp-dev-input {
  width: 108px;
  flex: none;
  padding: 6px 9px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* выбор режима входа */
.login-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.mode-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.mode-btn:hover { border-color: var(--accent-2); color: var(--text); }
.mode-btn.on {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.12);
}
.login-mode-panel { display: grid; gap: 10px; }

/* выбранный шаблон в панели */
.preset-selected {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--accent-2);
  background: rgba(124, 156, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.preset-item.selected { border-color: var(--accent-2); background: rgba(124, 156, 255, 0.1); }

/* отдельная кнопка сохранения шаблона */
.preset-save { width: 100%; margin-bottom: 8px; }

/* места интереса */
.poi-block {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(177, 151, 252, 0.4);
  background: rgba(177, 151, 252, 0.07);
}
.poi-head { display: flex; align-items: baseline; gap: 4px; }
.poi-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cell-highlight.scan {
  stroke: #b197fc;
  fill: rgba(177, 151, 252, 0.14);
}

/* гекс ультимейта у места интереса */
.poi-head { align-items: center; flex-wrap: wrap; }
.poi-ultimate {
  width: 18px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(126, 166, 255, 0.16);
  color: var(--muted);
  font-size: 10px;
  margin-left: 4px;
}
.poi-ultimate.unlocked {
  background: rgba(177, 151, 252, 0.45);
  color: #0b1020;
}

/* размытая обложка и ссылки у названий игр */
.game-block {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(9, 14, 24, 0.45);
  border-radius: 10px;
}
.game-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--cover);
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  transform: scale(1.15);
  opacity: 0.5;
  z-index: 0;
}
.game-block::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 10, 18, 0.85), rgba(6, 10, 18, 0.55));
  z-index: 0;
}
.game-block > * { position: relative; z-index: 1; }

.game-links-inline {
  display: inline-flex;
  gap: 6px;
  margin-left: 6px;
  font-size: 11px;
  white-space: nowrap;
}
.game-links-inline a { color: var(--accent-2); text-decoration: none; }
.game-links-inline a:hover { text-decoration: underline; }

.cell-history li { row-gap: 3px; }
.review-game { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }


/* клик по названию игры копирует его */
.game-name-copy {
  all: unset;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: inherit;
  display: inline;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
  z-index: 2;
}
.game-name-copy:hover { text-decoration: underline; }
.game-card h3 .game-name-copy { font-size: inherit; }

/* выпавшая игра: светлее фон и перенос длинного названия */
.cell-game { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.cell-game.game-block { background: rgba(22, 32, 52, 0.55); }
.cell-game.game-block::before { opacity: 0.72; }
.cell-game.game-block::after {
  background: linear-gradient(90deg, rgba(6, 10, 18, 0.55), rgba(6, 10, 18, 0.18));
}

/* история: название не выходит за пределы блока */
.cell-history-game {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cell-history-game .game-name-copy { flex: 0 1 auto; min-width: 0; }
.game-links-inline { flex-wrap: wrap; }

/* микрообзор в истории клетки */
.cell-history-review {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* круглая кнопка закрытия карточки клетки */
.cell-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 70;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(9, 14, 24, 0.9);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cell-close:hover { border-color: var(--accent); color: var(--accent); }

/* условия клетки — сворачиваемая стрелочка */
.cell-filter-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
}
.cell-filter-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cell-filter-details summary::-webkit-details-marker { display: none; }
.cell-filter-details summary::before {
  content: '▸';
  display: inline-block;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.cell-filter-details[open] summary::before { transform: rotate(90deg); }
.cell-filter-body { margin-top: 6px; }

/* расширяющие предметы в редакторе */
.check-field { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.pattern-hex.unlock { fill: rgba(177, 151, 252, 0.25); stroke: #b197fc; }
.pattern-hex.on.unlock { fill: rgba(94, 234, 212, 0.28); stroke: #b197fc; stroke-width: 2; }

/* открываемые гексы в превью предмета */
.pattern-hex-preview.unlock {
  fill: rgba(177, 151, 252, 0.35);
  stroke: #b197fc;
}
.pattern-hex-preview.on.unlock {
  fill: rgba(124, 156, 255, 0.4);
  stroke: #b197fc;
  stroke-width: 1.6;
}
.item-tooltip-unlock { color: #b197fc; font-size: 11px; margin: 0; }

/* призрак открываемых гексов при перетаскивании */
.drag-preview-unlock {
  fill: rgba(177, 151, 252, 0.12);
  stroke: #b197fc;
  stroke-width: 2;
  stroke-dasharray: 5 3;
  pointer-events: none;
}
