:root {
  --bg: #07080d;
  --bg-soft: #0b0e18;
  --panel: rgba(19, 23, 37, 0.62);
  --panel-solid: #111522;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-soft: rgba(255, 255, 255, 0.055);
  --text: #eef0f8;
  --muted: #8d93a8;
  --muted-2: #676d82;
  --violet: #7c6cff;
  --violet-soft: rgba(124, 108, 255, 0.16);
  --blue: #5b8cff;
  --mint: #37e6c5;
  --gold: #ffcf6b;
  --danger: #ff6b81;
  --board-light: #e9e2d3;
  --board-dark: #29304d;
  --radius: 24px;
  --font: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible { outline: 2px solid rgba(124, 108, 255, 0.7); outline-offset: 2px; }
svg { display: block; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

/* ------------------------------------------------------------------ фон */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(124, 108, 255, 0.16) 0%, rgba(7, 8, 13, 0) 55%),
    linear-gradient(180deg, #080a12 0%, #07080d 55%, #090b13 100%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 22s ease-in-out infinite alternate;
}
.orb-a {
  width: 620px; height: 620px;
  background: radial-gradient(circle, #5340ff 0%, rgba(83, 64, 255, 0) 68%);
  top: -220px; left: -120px;
}
.orb-b {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #0f6f8f 0%, rgba(15, 111, 143, 0) 68%);
  top: 18%; right: -180px;
  animation-delay: -8s;
  opacity: 0.35;
}
.orb-c {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #241a63 0%, rgba(36, 26, 99, 0) 70%);
  bottom: -260px; left: 28%;
  animation-delay: -14s;
  opacity: 0.55;
}
.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 20%, #000 0%, transparent 78%);
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 60px, 0) scale(1.12); }
}

/* --------------------------------------------------------------- топбар */
.topbar {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px 30px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0;
  color: var(--text);
  text-align: left;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 6px;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px -12px rgba(124, 108, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.brand-mark span { border-radius: 3px; background: rgba(255, 255, 255, 0.14); }
.brand-mark span:nth-child(1) { background: linear-gradient(145deg, #b9aeff, #6f5cff); }
.brand-mark span:nth-child(4) { background: linear-gradient(145deg, #8ff5e1, #21bfa2); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 17px; letter-spacing: -0.02em; }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; margin-top: 3px; }
#appVersion { color: #9c90ff; font-weight: 700; letter-spacing: 0.04em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.conn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.conn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  transition: 0.3s;
}
.conn.online { color: #9fe9cf; border-color: rgba(55, 230, 197, 0.25); background: rgba(55, 230, 197, 0.06); }
.conn.online .conn-dot { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.conn.offline { color: #ffb0bd; border-color: rgba(255, 107, 129, 0.28); background: rgba(255, 107, 129, 0.06); }
.conn.offline .conn-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.conn.connecting .conn-dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.online-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.online-pill strong { color: #d9f8ef; font-size: 13px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px var(--mint); animation: blink 2.4s infinite; }
.online-pill.offline { opacity: 0.45; }
.online-pill.offline .online-dot { background: var(--muted-2); box-shadow: none; animation: none; }
@media (max-width: 620px) {
  .online-pill span:last-child { display: none; }
  .online-pill { padding: 0 10px; }
}

/* -------------------------------------------------------------- элементы */
.glass {
  position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.065) 0%, rgba(255, 255, 255, 0.018) 46%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 30px 80px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.panel { padding: 22px; }
.panel-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-2); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head-right { display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  background: rgba(124, 108, 255, 0.18);
  border: 1px solid rgba(124, 108, 255, 0.3);
  color: #c4bbff;
  font-size: 12px;
  font-weight: 700;
}
.badge.subtle { background: rgba(255, 255, 255, 0.04); border-color: var(--stroke-soft); color: var(--muted); font-weight: 600; }
.hint { margin: 12px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted-2); }
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 99px;
  border: 1px solid rgba(55, 230, 197, 0.22);
  background: rgba(55, 230, 197, 0.07);
  color: #8fe8d2; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: blink 2.4s infinite; }

.icon {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: 0.2s ease;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.icon-btn.small { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.small .icon { width: 15px; height: 15px; }
.icon-btn.tiny { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.tiny .icon { width: 13px; height: 13px; }
.icon-btn.send { width: 40px; height: 40px; border-radius: 12px; color: #d8d2ff; background: rgba(124, 108, 255, 0.16); border-color: rgba(124, 108, 255, 0.3); }
.icon-btn.send:hover { background: rgba(124, 108, 255, 0.3); }
.icon-btn.muted { color: var(--muted-2); }
.icon-btn.muted .wave { opacity: 0; }

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 52px;
  padding: 0 24px;
  border-radius: 15px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, #7c6cff 0%, #5a49f0 52%, #4a3af0 100%);
  box-shadow:
    0 18px 40px -16px rgba(105, 88, 255, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s;
  overflow: hidden;
}
.primary-btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -16px rgba(105, 88, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.primary-btn:hover::after { transform: translateX(120%); }
.primary-btn:active { transform: translateY(0) scale(0.985); }
.primary-btn .icon { width: 18px; height: 18px; }
.primary-btn.compact { height: 44px; padding: 0 18px; border-radius: 12px; font-size: 13.5px; }
.primary-btn.tiny { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 12.5px; }
.primary-btn[disabled], .ghost-btn[disabled], .danger-btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-spark {
  position: absolute; top: -20px; right: 18px;
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 65%);
  pointer-events: none;
}

.secondary-btn {
  height: 52px;
  padding: 0 24px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.03);
  color: #d7daef;
  font-size: 14.5px;
  font-weight: 650;
  transition: 0.2s;
}
.secondary-btn:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.secondary-btn.compact { height: 42px; padding: 0 18px; border-radius: 12px; font-size: 12.5px; }

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: #c3c7da;
  font-size: 13px; font-weight: 600;
  transition: 0.18s;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: rgba(255, 255, 255, 0.16); }
.ghost-btn.compact { height: 38px; padding: 0 14px; font-size: 12.5px; }
.ghost-btn.tiny { height: 34px; padding: 0 12px; font-size: 12px; }
.ghost-btn.quiet { color: var(--muted-2); background: transparent; border-color: transparent; }
.ghost-btn.quiet:hover { color: var(--danger); background: rgba(255, 107, 129, 0.08); }
.danger-btn {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 129, 0.25);
  background: rgba(255, 107, 129, 0.08);
  color: #ffa9b5;
  font-size: 13px; font-weight: 650;
  transition: 0.18s;
}
.danger-btn:hover { background: rgba(255, 107, 129, 0.16); border-color: rgba(255, 107, 129, 0.4); }

.link-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0; margin-top: 12px;
  color: #b3a9ff; font-size: 12.5px; font-weight: 600;
  transition: 0.18s;
}
.link-btn span { transition: transform 0.18s; }
.link-btn:hover { color: #d4ccff; }
.link-btn:hover span { transform: translateX(3px); }

/* ------------------------------------------------------------- главный экран */
.app {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 10px 30px 40px;
}
.screen { animation: screenIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.home {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, 0.84fr);
  gap: 22px;
  align-items: start;
}
.home-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  padding: 42px 42px 34px;
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(124, 108, 255, 0.18) 0%, transparent 55%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 58%);
}
.hero::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -120px; top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(55, 230, 197, 0.16), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 99px;
  border: 1px solid rgba(124, 108, 255, 0.28);
  background: rgba(124, 108, 255, 0.1);
  color: #c9c2ff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
}
.eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.hero h1 {
  margin: 18px 0 8px;
  font-size: clamp(58px, 6.6vw, 92px);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 0.96;
  background: linear-gradient(150deg, #ffffff 10%, #ddd8ff 48%, #9c8cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent-dot { -webkit-text-fill-color: var(--mint); }
.hero-lead {
  margin: 8px 0 26px;
  max-width: 440px;
  color: #a3a9c0;
  font-size: 14.5px;
  line-height: 1.65;
}
.game-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 430px;
  margin: 0 0 24px;
}
.game-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 13px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.025);
  color: #b9bfd4;
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  transition: 0.18s;
}
.game-pill:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); color: var(--text); }
.game-pill.active {
  border-color: rgba(124, 108, 255, 0.5);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.18), rgba(55, 230, 197, 0.05));
  color: #fff;
  box-shadow: 0 0 24px -10px rgba(124, 108, 255, 0.9);
}
.gp-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.2);
  color: #cfc8ff;
}
.game-pill[data-game="checkers"] .gp-icon { color: #efe7d6; }
.game-pill[data-game="chess"] .gp-icon { color: #d8d2ff; }
.game-pill[data-game^="backgammon"] .gp-icon { color: #8ff0d9; }
.game-pill.active .gp-icon { background: rgba(124, 108, 255, 0.22); border-color: rgba(124, 108, 255, 0.35); }
.gp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gp-text small { color: var(--muted-2); font-size: 9.5px; font-weight: 500; }
.game-pill.active .gp-text small { color: #a9a4cb; }
.rule-preview { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.rule-preview-item { display: flex; gap: 9px; color: #aab0c6; font-size: 11.5px; line-height: 1.5; }
.rule-preview-item::before { content: ""; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); margin-top: 6px; box-shadow: 0 0 8px rgba(55, 230, 197, 0.6); }
.rule-preview strong { color: #e0e3f0; font-weight: 650; }
.tips-panel .link-btn { margin-top: 0; font-size: 11px; }
.profile-stats-line { margin-top: 12px; font-size: 11px; color: var(--muted-2); }
.my-profile-link { display: inline-flex; }
.avatar.has-photo, .p-avatar.has-photo, .room-avatar.has-photo, .g-avatar.has-photo, .profile-avatar.has-photo {
  background-size: cover !important;
  background-position: center !important;
  color: transparent !important;
}
.general-chat-panel { padding: 22px; }
.general-chat-list {
  height: 230px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px -4px 12px;
  padding: 0 4px;
  overflow-y: auto;
}
.general-empty { margin: auto; color: var(--muted-2); font-size: 11.5px; text-align: center; }
.general-msg { display: flex; align-items: flex-start; gap: 9px; animation: chatIn 0.22s ease; }
.general-msg.mine { flex-direction: row-reverse; }
.g-avatar {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800;
  color: #10121d;
  background: linear-gradient(145deg, #c9c1ff, #7c6cff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.g-avatar:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 6px 14px -6px rgba(124, 108, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.g-name[data-chat-ts] { cursor: pointer; }
.g-name[data-chat-ts]:hover { color: #fff; }
.g-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 82%; }
.general-msg.mine .g-body { align-items: flex-end; }
.g-name { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); }
.g-text {
  padding: 7px 10px;
  border-radius: 11px 11px 11px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-soft);
  color: #d7daea;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.general-msg.mine .g-text { border-radius: 11px 11px 4px 11px; background: rgba(124, 108, 255, 0.18); border-color: rgba(124, 108, 255, 0.28); color: #e7e3ff; }
.profile-modal-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 3px; }
.profile-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-tag.creator-tag { border-color: transparent; }
.profile-tag.tag-you { color: #b9b0ff; border-color: rgba(124, 108, 255, 0.4); background: rgba(124, 108, 255, 0.12); }
.profile-tag.tag-muted { color: #ffd08a; border-color: rgba(255, 190, 61, 0.35); background: rgba(255, 190, 61, 0.1); }
.profile-tag.tag-banned { color: #ff9aa7; border-color: rgba(255, 107, 129, 0.4); background: rgba(255, 107, 129, 0.12); }
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 30px;
  background: linear-gradient(145deg, #c9c1ff, #7c6cff);
  color: #10121d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 30px -14px rgba(124, 108, 255, 0.9);
}
.profile-head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-head-text strong { font-size: 20px; letter-spacing: -0.02em; }
.profile-ip { font-family: "Cascadia Code", Consolas, monospace; font-size: 10.5px; color: var(--muted-2); }
.profile-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.profile-grid div { padding: 10px; border-radius: 12px; border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, 0.025); display: flex; flex-direction: column; gap: 2px; }
.profile-grid strong { font-size: 17px; }
.profile-grid span { font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.profile-table { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.profile-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px 38px 38px 38px 58px; gap: 6px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 11px; font-variant-numeric: tabular-nums; }
.profile-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
.profile-row.head { color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; background: transparent; }
.profile-row span:not(:first-child) { text-align: right; }
.profile-row .pr-win { color: #8ff0d9; }
.profile-row .pr-loss { color: #ff9aa7; }
.profile-row .pr-draw { color: #ffd08a; }
.profile-grid .pg-draw strong { color: #ffd08a; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 10px; }
.avatar-choice {
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 21px;
  transition: 0.15s;
}
.avatar-choice:hover { background: rgba(124, 108, 255, 0.16); border-color: rgba(124, 108, 255, 0.4); transform: translateY(-1px); }
.avatar-choice.active { background: rgba(124, 108, 255, 0.24); border-color: rgba(124, 108, 255, 0.6); }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.upload-row input[type="file"] { font-size: 11px; color: var(--muted); max-width: 100%; }
.upload-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.08), rgba(55, 230, 197, 0.03));
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.upload-drop:hover, .upload-drop.dragover {
  border-color: rgba(124, 108, 255, 0.62);
  background: linear-gradient(135deg, rgba(124, 108, 255, 0.16), rgba(55, 230, 197, 0.06));
  box-shadow: 0 0 28px -12px rgba(124, 108, 255, 0.85);
}
.upload-drop.dragover { border-style: solid; }
.upload-drop.loading { opacity: 0.55; pointer-events: none; }
.upload-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid rgba(124, 108, 255, 0.26);
  background: rgba(124, 108, 255, 0.14);
  color: #cfc8ff;
}
.upload-icon .icon { width: 19px; height: 19px; }
.upload-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upload-text strong { font-size: 12.5px; color: #e1e4f2; }
.upload-text small { font-size: 10px; line-height: 1.45; color: var(--muted-2); }
.upload-drop input[type="file"] { display: none; }
.profile-note { margin-top: 8px; font-size: 10.5px; color: var(--muted-2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.join-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  animation: screenIn 0.3s;
}
.code-input {
  width: 150px;
  height: 52px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
  transition: 0.2s;
}
.code-input::placeholder { color: var(--muted-2); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; }
.code-input:focus { outline: none; border-color: rgba(124, 108, 255, 0.65); background: rgba(124, 108, 255, 0.08); box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.12); }
.hero-stats { display: flex; gap: 34px; margin-top: auto; padding-top: 34px; }
.hero-stats div { display: flex; flex-direction: column; gap: 3px; }
.hero-stats strong { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats span { color: var(--muted-2); font-size: 11.5px; }

.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.preview-glow {
  position: absolute;
  width: 78%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 255, 0.35), transparent 62%);
  filter: blur(34px);
}
.preview-board {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.9),
    0 0 0 10px rgba(255, 255, 255, 0.035),
    0 0 70px -10px rgba(124, 108, 255, 0.55);
  transform: rotate(-4deg);
  background: #1c2238;
}
.preview-board .pv-sq { position: relative; }
.preview-board .pv-sq.light { background: linear-gradient(145deg, #efe9db, #ded5c2); }
.preview-board .pv-sq.dark { background: linear-gradient(145deg, #303856, #232a45); }
.preview-board .pv-piece {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}
.preview-board .pv-piece.w { background: radial-gradient(circle at 32% 26%, #fffdf6, #e9e1cf 58%, #b9af97); }
.preview-board .pv-piece.b { background: radial-gradient(circle at 32% 26%, #5c6688, #29314e 55%, #10141f); box-shadow: 0 5px 9px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(170, 190, 255, 0.4); }
.preview-board .pv-piece.king::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 40%; height: 28%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #ffedb8, #ffc44d 60%, #c98f14);
  clip-path: polygon(0 100%, 7% 20%, 31% 54%, 50% 0, 69% 54%, 93% 20%, 100% 100%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.preview-board .pv-piece::before {
  content: "";
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
}
.preview-board .pv-piece.b::before { border-color: rgba(160, 185, 255, 0.18); }
.pv-chess-piece {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Segoe UI Symbol", "DejaVu Sans", serif;
  font-size: 26px;
  line-height: 1;
}
.pv-chess-piece.w { color: #f8f2e3; -webkit-text-stroke: 0.8px rgba(28, 33, 52, 0.8); text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55); }
.pv-chess-piece.b { color: #1a2035; -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.4); text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55); }
.preview-board.preview-bg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  width: min(340px, 100%);
  aspect-ratio: 1.18 / 1;
  background: linear-gradient(145deg, #1e263c, #121726);
}
.pv-bg-half { flex: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; min-height: 0; }
.pv-bg-point {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 3px 0;
  background: rgba(124, 108, 255, 0.22);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.pv-bg-half.bottom .pv-bg-point { background: rgba(55, 230, 197, 0.18); clip-path: polygon(0 100%, 100% 100%, 50% 0); align-items: flex-end; }
.pv-bg-half.top .pv-bg-point:nth-child(even) { background: rgba(91, 140, 255, 0.16); }
.pv-bg-half.bottom .pv-bg-point:nth-child(even) { background: rgba(55, 230, 197, 0.1); }
.pv-bg-stack { display: flex; flex-direction: column; gap: 1px; align-items: center; }
.pv-bg-half.bottom .pv-bg-stack { flex-direction: column-reverse; }
.pv-bg-stack i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.6); }
.pv-bg-stack i.w { background: radial-gradient(circle at 32% 26%, #fffdf6, #e8dfcc 60%, #b9af97); }
.pv-bg-stack i.b { background: radial-gradient(circle at 32% 26%, #6b769c, #2b3452 60%, #10141f); }
.preview-board.preview-durak {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(340px, 100%);
  aspect-ratio: 1 / 0.9;
  padding: 20px;
  background:
    radial-gradient(70% 70% at 50% 0%, rgba(55, 230, 197, 0.14), transparent 60%),
    linear-gradient(150deg, #173027, #0d1814);
}
.pv-card {
  position: relative;
  width: 23%;
  aspect-ratio: 0.7;
  margin-left: -6%;
  border-radius: 8px;
  background: linear-gradient(145deg, #fffdf8, #eee5d3);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.85);
  color: #1b2130;
  transform-origin: bottom center;
}
.pv-card:first-child { margin-left: 0; transform: rotate(-13deg) translateY(8px); }
.pv-card:nth-child(2) { transform: rotate(-6deg) translateY(2px); }
.pv-card:nth-child(3) { transform: rotate(0deg); z-index: 2; }
.pv-card:nth-child(4) { transform: rotate(6deg) translateY(2px); }
.pv-card:nth-child(5) { transform: rotate(13deg) translateY(8px); }
.pv-card.red { color: #c22f4b; }
.pv-card.trump { box-shadow: 0 0 0 2px rgba(255, 207, 107, 0.8), 0 10px 22px -8px rgba(0, 0, 0, 0.85); }
.pv-rank { position: absolute; top: 6%; left: 9%; font-size: 15px; font-weight: 850; line-height: 1; }
.pv-suit { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font-size: 28px; opacity: 0.85; }

.float-card {
  position: absolute;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 16, 27, 0.72);
  backdrop-filter: blur(14px);
  font-size: 11.5px;
  font-weight: 600;
  color: #d5d8ea;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  animation: floaty 6s ease-in-out infinite;
}
.float-a { top: 8%; left: -2%; }
.float-b { bottom: 14%; right: -4%; animation-delay: -2.5s; }
.float-c { bottom: -4%; left: 8%; font-size: 10.5px; color: var(--muted); animation-delay: -4s; }
.status-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: blink 2s infinite; }
.crown-mini { width: 14px; height: 11px; background: linear-gradient(180deg, #ffe9ac, #ffc247); clip-path: polygon(0 100%, 8% 20%, 32% 55%, 50% 0, 68% 55%, 92% 20%, 100% 100%); }
@keyframes floaty { 50% { transform: translateY(-9px); } }

/* --------------------------------------------------------------- панели */
.rooms-panel { padding: 24px; }
.rooms-list { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; min-height: 96px; }
.room-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: 0.18s;
  animation: screenIn 0.3s;
}
.room-item:hover { background: rgba(124, 108, 255, 0.08); border-color: rgba(124, 108, 255, 0.3); transform: translateY(-1px); }
.room-avatar, .avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800;
  color: #0b0e18;
  background: linear-gradient(145deg, #f4efe2, #cfc5ae);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 14px -6px rgba(0, 0, 0, 0.6);
}
.room-avatar.black { background: linear-gradient(145deg, #7d88b3, #3a4468); color: #eef1ff; }
.room-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.room-main strong { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-main small { color: var(--muted-2); font-size: 11.5px; }
.room-join { color: #c1b8ff; font-size: 12px; font-weight: 700; white-space: nowrap; transition: 0.18s; }
.room-item:hover .room-join { color: #fff; transform: translateX(2px); }
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
}
.empty-state strong { color: #b9bfd4; font-size: 13px; }
.empty-icon { font-size: 22px; color: rgba(124, 108, 255, 0.6); }

.home-profile-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.avatar { width: 50px; height: 50px; border-radius: 16px; font-size: 19px; }
#myAvatar { cursor: pointer; }
.profile-input-wrap { position: relative; flex: 1; }
.name-input {
  width: 100%;
  height: 42px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.name-input::placeholder { color: var(--muted-2); font-weight: 500; }
.name-input:focus { outline: none; }
.input-underline {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: rgba(255, 255, 255, 0.12);
  transition: 0.25s;
}
.profile-input-wrap:focus-within .input-underline { background: linear-gradient(90deg, var(--violet), var(--mint)); box-shadow: 0 0 12px rgba(124, 108, 255, 0.5); }

.addr-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-soft);
  background: rgba(0, 0, 0, 0.22);
}
.addr-row code { flex: 1; font-family: "Cascadia Code", "Consolas", monospace; font-size: 12.5px; color: #b9c2e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tunnel-panel { padding: 22px; }
.badge.ready { color: #9fe9cf; background: rgba(55, 230, 197, 0.1); border-color: rgba(55, 230, 197, 0.28); }
.badge.starting { color: #ffdfa0; background: rgba(255, 207, 107, 0.1); border-color: rgba(255, 207, 107, 0.26); }
.badge.error { color: #ffb3bf; background: rgba(255, 107, 129, 0.1); border-color: rgba(255, 107, 129, 0.26); }
.share-tunnel { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.share-tunnel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.share-tunnel .hint { margin: 8px 0 10px; }
.share-tunnel .secondary-btn { width: 100%; }
.tunnel-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 8px 8px 12px;
  border-radius: 11px;
  border: 1px solid rgba(55, 230, 197, 0.2);
  background: rgba(55, 230, 197, 0.055);
}
.tunnel-link code {
  flex: 1;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
  color: #a9eee0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tunnel-link.hidden { display: none; }
.tunnel-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.tunnel-actions .link-btn { margin-top: 0; }
.tunnel-note { margin-top: 9px; font-size: 10.5px; }

.tips-panel .card-game {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.02);
}
.card-game.active { border-color: rgba(124, 108, 255, 0.25); background: linear-gradient(120deg, rgba(124, 108, 255, 0.1), rgba(55, 230, 197, 0.04)); }
.card-game.muted { opacity: 0.62; }
.mini-board-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; padding: 5px;
  border-radius: 10px;
  background: #1b2136;
  border: 1px solid var(--stroke);
  overflow: hidden;
}
.mini-board-icon i { background: rgba(255, 255, 255, 0.16); border-radius: 2px; }
.mini-board-icon i:nth-child(1) { background: linear-gradient(145deg, #b9aeff, #6f5cff); }
.mini-board-icon i:nth-child(4) { background: linear-gradient(145deg, #8ff5e1, #21bfa2); }
.mini-board-icon.soon i { background: rgba(255, 255, 255, 0.09); }
.card-game-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.card-game-text strong { font-size: 12.5px; }
.card-game-text small { color: var(--muted-2); font-size: 10.5px; }
.card-game-arrow { color: var(--muted-2); font-size: 14px; }

/* ------------------------------------------------------------------ игра */
.game { display: flex; flex-direction: column; gap: 16px; }
.game-top { display: flex; align-items: center; gap: 12px; }
.top-spacer { flex: 1; }
.room-chip {
  display: flex; align-items: center; gap: 9px;
  height: 38px;
  padding: 0 8px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px; color: var(--muted);
}
.room-chip strong { color: var(--text); font-size: 14px; letter-spacing: 0.16em; font-weight: 800; }
.game-chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(124, 108, 255, 0.24);
  background: rgba(124, 108, 255, 0.09);
  color: #c7beff;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.turn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px; font-weight: 600;
  transition: 0.25s;
}
.turn-pill.my-turn { color: #cdc7ff; border-color: rgba(124, 108, 255, 0.4); background: rgba(124, 108, 255, 0.12); box-shadow: 0 0 24px -8px rgba(124, 108, 255, 0.7); }
.turn-pill.win { color: #a4f0d8; border-color: rgba(55, 230, 197, 0.35); background: rgba(55, 230, 197, 0.08); }
.turn-pill .status-pulse { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.turn-pill.my-turn .status-pulse { background: var(--mint); box-shadow: 0 0 10px var(--mint); }

.game-grid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 300px;
  grid-template-areas: "left board right";
  gap: 20px;
  align-items: start;
}
.game-side.left { grid-area: left; display: flex; flex-direction: column; gap: 14px; }
.game-side.right { grid-area: right; display: flex; flex-direction: column; gap: 14px; }
.board-column {
  grid-area: board;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  width: 100%;
  max-width: clamp(340px, calc(100dvh - 300px), 680px);
  margin: 0 auto;
}

.player-slot { width: 100%; }
.player-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 9px 15px;
  border-radius: 17px;
  border: 1px solid var(--stroke-soft);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  transition: 0.3s;
}
.player-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--violet), var(--mint));
  opacity: 0;
  transition: 0.3s;
}
.player-card.active { border-color: rgba(124, 108, 255, 0.42); background: linear-gradient(150deg, rgba(124, 108, 255, 0.14), rgba(55, 230, 197, 0.03)); box-shadow: 0 0 32px -14px rgba(124, 108, 255, 0.9); }
.player-card.active::before { opacity: 1; }
.player-card[data-color] { cursor: pointer; }
.player-card[data-color]:hover { border-color: rgba(124, 108, 255, 0.35); }
.player-card.empty { border-style: dashed; }
.player-card.offline { opacity: 0.55; }
.p-avatar {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.8);
}
.p-avatar.w { background: linear-gradient(145deg, #fbf7ec, #d3c9b0); color: #4a412c; }
.p-avatar.b { background: linear-gradient(145deg, #6d789e, #2e3754); color: #e8ecff; }
.p-avatar.none { background: rgba(255, 255, 255, 0.045); border: 1px dashed rgba(255, 255, 255, 0.14); color: var(--muted-2); box-shadow: none; }
.p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.p-name { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #b9a9ff; padding: 2px 6px; border-radius: 99px; background: rgba(124, 108, 255, 0.16); }
.p-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted-2); }
.p-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.p-meta .online { color: #71d9be; }
.p-meta .offline { color: #ff8fa0; }
.p-turn { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); transition: 0.3s; }
.player-card.active .p-turn { background: var(--mint); box-shadow: 0 0 12px var(--mint); animation: blink 1.8s infinite; }

.info-card { padding: 9px 17px; }
.info-line {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px; color: var(--muted);
}
.info-line:last-of-type { border-bottom: 0; }
.info-line strong { color: #dfe2f0; font-size: 12.5px; font-weight: 700; }
.draw-meter { padding-top: 13px; }
.draw-meter-bar { height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.draw-meter-bar span { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--mint)); transition: width 0.4s; }
.draw-meter small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 10px; }

.game-actions { display: flex; flex-direction: column; gap: 8px; }
.game-actions .ghost-btn, .game-actions .danger-btn, .game-actions .primary-btn { width: 100%; }
.net-note {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 4px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.board-status {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 2px 4px;
  min-height: 22px;
}
.board-status-text { font-size: 13px; font-weight: 650; color: #cfd3e6; }
.board-status-sub { font-size: 11px; color: var(--muted-2); }

.game-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  animation: screenIn 0.3s ease;
}
.game-result.win { border-color: rgba(55, 230, 197, 0.35); background: linear-gradient(145deg, rgba(55, 230, 197, 0.13), rgba(124, 108, 255, 0.08)); }
.game-result.lose { border-color: rgba(255, 107, 129, 0.32); background: linear-gradient(145deg, rgba(255, 107, 129, 0.12), rgba(255, 255, 255, 0.02)); }
.game-result.draw { border-color: rgba(255, 207, 107, 0.32); background: linear-gradient(145deg, rgba(255, 207, 107, 0.12), rgba(255, 255, 255, 0.02)); }
.gr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gr-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 21px;
  background: rgba(255, 255, 255, 0.07);
}
.gr-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 210px; }
.gr-copy strong { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.gr-copy span { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.gr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.gr-actions .primary-btn, .gr-actions .ghost-btn { height: 32px; padding: 0 12px; font-size: 11px; }
@media (max-width: 620px) {
  .gr-actions { width: 100%; margin-left: 0; }
  .gr-actions button { flex: 1; }
}

.offer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px;
  border-radius: 13px;
  border: 1px solid rgba(255, 207, 107, 0.28);
  background: rgba(255, 207, 107, 0.07);
  color: #ffdfa2;
  font-size: 12px;
  animation: screenIn 0.3s;
}
.offer-actions { display: flex; gap: 7px; }

.board-shell {
  width: 100%;
  max-width: 660px;
  min-width: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 19px;
  grid-template-rows: 19px minmax(0, 1fr) 19px;
  grid-template-areas:
    ". files-top ."
    "ranks-left board ranks-right"
    ". files-bottom .";
  gap: 5px;
}
.files { display: grid; grid-template-columns: repeat(8, 1fr); align-items: center; }
.files.top { grid-area: files-top; }
.files.bottom { grid-area: files-bottom; }
.files span { text-align: center; font-size: 9px; font-weight: 700; color: rgba(255, 255, 255, 0.22); letter-spacing: 0.08em; }
.ranks { display: grid; grid-template-rows: repeat(8, 1fr); align-items: center; }
.ranks.left { grid-area: ranks-left; }
.ranks.right { grid-area: ranks-right; }
.ranks span { text-align: center; font-size: 9px; font-weight: 700; color: rgba(255, 255, 255, 0.22); }

.board {
  grid-area: board;
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
  background: #151a2b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 0 0 7px rgba(255, 255, 255, 0.025),
    0 40px 80px -34px rgba(0, 0, 0, 1),
    0 0 90px -30px rgba(124, 108, 255, 0.55);
  isolation: isolate;
}
.board::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 55%);
  z-index: 5;
}
.board-corner {
  position: absolute; width: 10px; height: 10px;
  border-color: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 6;
}
.board-corner.tl { top: 7px; left: 7px; border-top: 1px solid; border-left: 1px solid; }
.board-corner.br { bottom: 7px; right: 7px; border-bottom: 1px solid; border-right: 1px solid; }
.squares { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { position: relative; overflow: hidden; }
.sq.light { background: linear-gradient(150deg, #efe8d8 0%, #e4dcc9 100%); }
.sq.dark { background: linear-gradient(150deg, #2c3452 0%, #232a45 100%); }
.sq::before { content: ""; position: absolute; inset: 0; background: rgba(124, 108, 255, 0); transition: background 0.15s; }
.sq:hover::before { background: rgba(255, 255, 255, 0.06); }
.sq.last-from::before { background: rgba(255, 207, 107, 0.14); }
.sq.last-to::before { background: rgba(255, 207, 107, 0.22); }
.sq.selected::before { background: rgba(124, 108, 255, 0.38); box-shadow: inset 0 0 0 2px rgba(157, 143, 255, 0.85), inset 0 0 26px rgba(124, 108, 255, 0.5); }
.sq.drag-over::before { background: rgba(55, 230, 197, 0.26); box-shadow: inset 0 0 0 2px rgba(55, 230, 197, 0.9), inset 0 0 30px rgba(55, 230, 197, 0.4); }
.sq.target::after, .sq.target-capture::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
}
.sq.target::after {
  width: 26%; height: 26%;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(55, 230, 197, 0.9), 0 0 0 5px rgba(55, 230, 197, 0.12);
  animation: targetPulse 1.5s ease-in-out infinite;
}
.sq.target-capture::after {
  width: 72%; height: 72%;
  border-radius: 50%;
  border: 3px solid rgba(55, 230, 197, 0.9);
  box-shadow: 0 0 18px rgba(55, 230, 197, 0.45), inset 0 0 18px rgba(55, 230, 197, 0.25);
  animation: targetPulse 1.5s ease-in-out infinite;
}
@keyframes targetPulse { 50% { opacity: 0.55; } }

.hints, .pieces { position: absolute; inset: 0; pointer-events: none; }
.pieces { z-index: 3; }
.piece {
  position: absolute;
  left: 0; top: 0;
  width: 12.5%; height: 12.5%;
  transition: transform 0.26s cubic-bezier(0.22, 0.85, 0.28, 1);
  will-change: transform;
  z-index: 2;
}
.piece .token {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.25), box-shadow 0.2s, filter 0.2s;
}
.piece.w .token {
  background: radial-gradient(circle at 32% 26%, #fffdf7 0%, #f4eedf 38%, #dcd3bf 68%, #b3a88f 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 5px 9px rgba(0, 0, 0, 0.45),
    inset 0 2px 3px rgba(255, 255, 255, 0.95),
    inset 0 -5px 8px rgba(119, 104, 76, 0.32);
}
.piece.b .token {
  background: radial-gradient(circle at 32% 26%, #5f6a8f 0%, #353f60 38%, #1b2238 70%, #0b0f1b 100%);
  border: 1px solid rgba(150, 170, 230, 0.32);
  box-shadow:
    0 6px 11px rgba(0, 0, 0, 0.6),
    inset 0 2px 3px rgba(175, 195, 255, 0.32),
    inset 0 -6px 9px rgba(0, 0, 0, 0.55);
}
.piece .token::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 1.5px solid rgba(90, 76, 50, 0.16);
}
.piece.b .token::before { border-color: rgba(160, 185, 255, 0.18); }
.piece .crown {
  position: absolute;
  left: 50%; top: 50%;
  width: 38%; height: 27%;
  transform: translate(-50%, -50%) scale(0.2);
  background: linear-gradient(180deg, #ffeeb8 0%, #ffc94f 55%, #cf9314 100%);
  clip-path: polygon(0 100%, 7% 18%, 31% 54%, 50% 0, 69% 54%, 93% 18%, 100% 100%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 1.2, 0.4, 1), opacity 0.2s;
}
.piece.king .crown { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.piece.playable .token { box-shadow: 0 5px 9px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.9), inset 0 -5px 8px rgba(119, 104, 76, 0.3), 0 0 0 2px rgba(124, 108, 255, 0.45), 0 0 18px rgba(124, 108, 255, 0.35); }
.piece.b.playable .token { box-shadow: 0 6px 11px rgba(0, 0, 0, 0.6), inset 0 2px 3px rgba(175, 195, 255, 0.32), inset 0 -6px 9px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(124, 108, 255, 0.5), 0 0 18px rgba(124, 108, 255, 0.4); }
.piece.selected { z-index: 4; }
.piece.selected .token { transform: scale(1.07); box-shadow: 0 0 0 3px rgba(157, 143, 255, 0.95), 0 0 32px rgba(124, 108, 255, 0.75), 0 10px 20px -6px rgba(0, 0, 0, 0.7); }
.piece.spawn .token { animation: piecePop 0.26s cubic-bezier(0.2, 1.3, 0.4, 1); }
.piece.captured .token { animation: pieceDie 0.28s ease forwards; }
@keyframes piecePop { from { transform: scale(0.55); opacity: 0; } }
@keyframes pieceDie { to { transform: scale(0.2) rotate(22deg); opacity: 0; filter: blur(2px); } }

/* перетаскивание шашек и фигур */
.piece.dragging, .chess-piece.dragging { opacity: 0.25; }
.drag-ghost {
  position: fixed;
  left: 0; top: 0;
  z-index: 90;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.5));
}
.drag-ghost .drag-token {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: none;
  transform: scale(1.06);
}
.drag-ghost .drag-token.piece .token { inset: 6%; }
.drag-ghost .drag-token.chess-piece { display: grid; place-items: center; }

/* --------------------------------------------------------------- шахматы */
.chess-piece {
  position: absolute;
  left: 0; top: 0;
  width: 12.5%; height: 12.5%;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 3;
  transition: transform 0.18s ease;
}
.chess-piece span {
  font-family: "Segoe UI Symbol", "DejaVu Sans", "Arial Unicode MS", serif;
  font-size: clamp(21px, 5.4vh, 50px);
  line-height: 1;
  user-select: none;
}
.chess-piece.w span {
  color: #f8f2e3;
  -webkit-text-stroke: 1.1px rgba(28, 33, 52, 0.8);
  text-shadow: 0 3px 5px rgba(0, 0, 0, 0.55);
}
.chess-piece.b span {
  color: #1a2035;
  -webkit-text-stroke: 1.1px rgba(255, 255, 255, 0.42);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}
.chess-piece.selected span { filter: drop-shadow(0 0 10px rgba(124, 108, 255, 0.95)); }
.sq.check::before {
  background: rgba(255, 80, 100, 0.3);
  box-shadow: inset 0 0 0 2px rgba(255, 107, 129, 0.85), inset 0 0 30px rgba(255, 107, 129, 0.45);
}
.promotion-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.promotion-choice {
  height: 84px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: "Segoe UI Symbol", "DejaVu Sans", serif;
  font-size: 32px;
  color: #f8f2e3;
  -webkit-text-stroke: 1px rgba(28, 33, 52, 0.75);
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
  transition: 0.18s;
}
.promotion-choice:hover { background: rgba(124, 108, 255, 0.16); border-color: rgba(124, 108, 255, 0.45); transform: translateY(-2px); }
.promotion-choice small { font-family: var(--font); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; -webkit-text-stroke: 0; text-shadow: none; }

/* ------------------------------------------------------------------ нарды */
.bg-shell { width: 100%; max-width: 680px; margin: 0 auto; }
#bgBoard { width: 100%; }
.game.bg-mode .board-column { max-width: min(920px, 100%); }
.game.bg-mode .bg-shell { max-width: 100%; }
.bg-wrap { display: flex; align-items: stretch; gap: 10px; width: 100%; }
.bg-board {
  position: relative;
  flex: 1;
  min-width: 0;
  container-type: inline-size;
  display: grid;
  grid-template-columns: 6fr 1.05fr 6fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1.5 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(145deg, #1e263c 0%, #141a2b 55%, #0f1422 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 0 7px rgba(255, 255, 255, 0.02),
    0 36px 80px -36px rgba(0, 0, 0, 1),
    0 0 80px -30px rgba(124, 108, 255, 0.45);
}
.bg-quad { display: grid; grid-template-columns: repeat(6, 1fr); position: relative; z-index: 2; min-width: 0; }
.bg-top-left { grid-column: 1; grid-row: 1; }
.bg-top-right { grid-column: 3; grid-row: 1; }
.bg-bottom-left { grid-column: 1; grid-row: 2; }
.bg-bottom-right { grid-column: 3; grid-row: 2; }
.bg-point {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 2px;
  overflow: hidden;
  cursor: pointer;
  min-width: 0;
}
.bg-top-left .bg-point, .bg-top-right .bg-point { justify-content: flex-start; }
.bg-bottom-left .bg-point, .bg-bottom-right .bg-point { justify-content: flex-end; }
.bg-point::before {
  content: "";
  position: absolute;
  left: 7%; right: 7%; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(124, 108, 255, 0.34), rgba(124, 108, 255, 0.02));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 0;
  transition: 0.18s;
}
.bg-bottom-left .bg-point::before, .bg-bottom-right .bg-point::before {
  background: linear-gradient(0deg, rgba(55, 230, 197, 0.28), rgba(55, 230, 197, 0.02));
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
}
.bg-point:nth-child(even)::before { filter: brightness(0.62) saturate(1.3); }
.bg-point:hover::before { filter: brightness(1.25); }
.bg-point.selected::before { filter: brightness(1.55); }
.bg-point.selected { box-shadow: inset 0 0 0 2px rgba(157, 143, 255, 0.85), inset 0 0 24px rgba(124, 108, 255, 0.25); }
.bg-stack { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bg-checker {
  width: clamp(12px, 4.2cqw, 26px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.22);
}
.bg-checker.w { background: radial-gradient(circle at 32% 26%, #fffdf6, #eee6d3 55%, #c3b89f); }
.bg-checker.b { background: radial-gradient(circle at 32% 26%, #727ea6, #303a58 55%, #131827); border-color: rgba(160, 185, 255, 0.28); }
.bg-num {
  position: absolute;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  padding: 0 3px;
  border-radius: 99px;
  background: rgba(8, 11, 20, 0.45);
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}
.bg-top-left .bg-num, .bg-top-right .bg-num { bottom: 2px; }
.bg-bottom-left .bg-num, .bg-bottom-right .bg-num { top: 2px; }
.bg-count {
  position: relative;
  z-index: 3;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  color: #dfe3f2;
  font-size: 8.5px;
  font-weight: 800;
}
.bg-point.bg-fresh .bg-checker:last-child { animation: bgCheckerLand 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.bg-point.bg-source .bg-stack { animation: bgCheckerLift 0.28s ease; }
.bg-bar.bg-fresh .bg-checker:last-child { animation: bgCheckerLand 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.bg-tray.bg-fresh { animation: bgTrayPulse 0.45s ease; }
@keyframes bgCheckerLand {
  from { opacity: 0.15; transform: translateY(-22px) scale(0.7); }
}
@keyframes bgCheckerLift {
  from { opacity: 0.45; transform: scale(0.86); }
}
@keyframes bgTrayPulse {
  from { transform: scale(0.94); filter: brightness(1.6); }
}
.bg-point.legal-target::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 13px; height: 13px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 14px rgba(55, 230, 197, 0.9), 0 0 0 4px rgba(55, 230, 197, 0.12);
  z-index: 4;
  animation: targetPulse 1.5s ease-in-out infinite;
}
.bg-point.legal-hit::after {
  width: 30px; height: 30px;
  background: transparent;
  border: 2px solid rgba(255, 107, 129, 0.9);
  box-shadow: 0 0 16px rgba(255, 107, 129, 0.4);
}
.bg-bar {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 9px 2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(255, 255, 255, 0.03));
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}
.bg-bar.has-checkers { cursor: pointer; }
.bg-bar.legal-source { box-shadow: inset 0 0 0 2px rgba(124, 108, 255, 0.55); background: rgba(124, 108, 255, 0.14); }
.bg-bar-side { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bg-bar-side .bg-checker { width: clamp(11px, 3.4cqw, 22px); }
.bg-bar-label { font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.bg-trays { display: flex; flex-direction: column; gap: 8px; width: 64px; flex: 0 0 auto; }
.bg-tray {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--stroke-soft);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: 0.18s;
}
.bg-tray strong { font-size: 17px; color: #dfe3f2; letter-spacing: 0; text-transform: none; }
.bg-tray.black { border-color: rgba(124, 140, 190, 0.22); }
.bg-tray.white { border-color: rgba(230, 220, 200, 0.18); }
.bg-tray.legal-target { border-color: rgba(55, 230, 197, 0.55); background: rgba(55, 230, 197, 0.09); color: #9fe9cf; box-shadow: 0 0 22px -8px rgba(55, 230, 197, 0.8); cursor: pointer; }
.dice-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.die {
  width: 27px; height: 27px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  color: #1b2033;
  background: linear-gradient(145deg, #fbf6e9, #d3c9b6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 5px 10px -5px rgba(0, 0, 0, 0.75);
}
.dice-caption { font-size: 10px; color: var(--muted-2); }
.roll-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }

/* -------------------------------------------------------------- дурак */
.durak-shell { width: 100%; max-width: 920px; margin: 0 auto; }
.game.durak-mode .board-column { max-width: min(920px, 100%); }
.durak-board {
  --card-w: clamp(42px, 5.6vh, 66px);
  --card-h: calc(var(--card-w) * 1.42);
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(120, 255, 210, 0.14);
  background:
    radial-gradient(80% 90% at 50% 0%, rgba(55, 230, 197, 0.1), transparent 60%),
    radial-gradient(100% 100% at 50% 100%, rgba(124, 108, 255, 0.08), transparent 65%),
    linear-gradient(150deg, #14251f 0%, #0e1916 55%, #0b1311 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 0 7px rgba(255, 255, 255, 0.018),
    0 36px 80px -38px rgba(0, 0, 0, 1),
    0 0 80px -30px rgba(55, 230, 197, 0.25);
}
.durak-opponent { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: calc(var(--card-h) * 0.95); }
.durak-label { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(220, 240, 235, 0.45); }
.durak-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.durak-opponent .durak-hand { flex-wrap: nowrap; min-height: var(--card-h); }
.durak-opponent .d-card.back { margin-left: calc(var(--card-w) * -0.62); }
.durak-opponent .d-card.back:first-child { margin-left: 0; }
.durak-middle {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: calc(var(--card-h) * 1.3);
  padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.durak-deck-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.durak-slots { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 9px; min-height: calc(var(--card-h) * 1.22); }
.durak-self { display: flex; flex-direction: column; gap: 5px; padding-top: 3px; }
.durak-empty { margin: auto; color: rgba(220, 240, 235, 0.35); font-size: 11px; text-align: center; padding: 10px; }

.d-card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  flex: 0 0 auto;
  border-radius: 7px;
  border: 1px solid rgba(20, 25, 35, 0.25);
  background: linear-gradient(145deg, #fffdf8 0%, #f2ead9 62%, #ddd2bb 100%);
  color: #1b2130;
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  user-select: none;
  overflow: hidden;
}
.d-card.red { color: #c22f4b; }
.d-card .d-rank { position: absolute; top: 3%; left: 7%; font-size: calc(var(--card-w) * 0.31); font-weight: 850; line-height: 1; letter-spacing: -0.02em; }
.d-card .d-suit-small { position: absolute; top: calc(3% + var(--card-w) * 0.28); left: 8%; font-size: calc(var(--card-w) * 0.22); line-height: 1; }
.d-card .d-suit-big { position: absolute; inset: 10% 0 0; display: grid; place-items: center; font-size: calc(var(--card-w) * 0.52); opacity: 0.8; }
.d-card.back {
  border-color: rgba(160, 150, 255, 0.35);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 7px),
    linear-gradient(145deg, #4a3f99 0%, #302a68 55%, #201c4a 100%);
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.d-card.back::after {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.d-card.hand-card { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s; }
.d-card.hand-card:hover { transform: translateY(-7px); z-index: 3; box-shadow: 0 14px 22px -8px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
.d-card.playable { outline: 2px solid rgba(55, 230, 197, 0.9); outline-offset: 1px; box-shadow: 0 0 22px -4px rgba(55, 230, 197, 0.65), 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
.d-card.translate { outline: 2px solid rgba(183, 164, 255, 0.95); outline-offset: 1px; box-shadow: 0 0 22px -4px rgba(124, 108, 255, 0.7), 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
.d-card.selected { transform: translateY(-7px); outline: 2px solid var(--gold); }
.d-pair { position: relative; width: calc(var(--card-w) * 1.5); height: calc(var(--card-h) * 1.45); flex: 0 0 auto; }
.d-pair .d-card { position: absolute; }
.d-pair .d-attack,
.d-pair .d-defense { position: absolute; width: var(--card-w); height: var(--card-h); }
.d-pair .d-attack { left: 0; top: 0; }
.d-pair .d-defense { left: calc(var(--card-w) * 0.38); top: calc(var(--card-h) * 0.3); z-index: 2; }
.d-pair .d-defense:not(.empty) { transform: rotate(7deg); }
.d-pair .d-attack .d-card,
.d-pair .d-defense .d-card { left: 0; top: 0; }
.d-pair .d-defense.empty { background: rgba(255, 255, 255, 0.035); border: 1px dashed rgba(255, 255, 255, 0.28); box-shadow: none; }
.d-pair .d-defense.empty::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.22); }
.d-pair.beaten .d-attack { filter: brightness(0.72) saturate(0.85); }
.d-card.card-dealt { animation: durakCardDeal 0.34s cubic-bezier(0.2, 1, 0.3, 1.1) both; }
@keyframes durakCardDeal {
  from { opacity: 0; transform: translateY(18px) scale(0.82); }
}
.d-deck { position: relative; width: var(--card-w); height: var(--card-h); }
.d-deck .d-card { position: absolute; left: 0; top: 0; }
.d-deck .d-card:nth-child(2) { transform: translate(3px, -3px); }
.d-deck .d-card:nth-child(3) { transform: translate(6px, -6px); }
.d-deck-count { position: absolute; right: -8px; bottom: -8px; z-index: 3; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: #0d1310; border: 1px solid rgba(55, 230, 197, 0.35); color: #9fe9cf; font-size: 10px; font-weight: 800; }
.d-trump { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 5px; }
.d-trump .d-card { box-shadow: 0 0 0 2px rgba(255, 207, 107, 0.65), 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
.d-trump-suit { width: var(--card-w); height: var(--card-h); border-radius: 7px; display: grid; place-items: center; font-size: calc(var(--card-w) * 0.55); color: #ffcf6b; border: 1px dashed rgba(255, 207, 107, 0.45); background: rgba(255, 207, 107, 0.06); }
.durak-board .panel-label { color: rgba(220, 240, 235, 0.5); }

.board-foot { display: flex; justify-content: center; min-height: 20px; }
.chain-hint {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(255, 207, 107, 0.1);
  border: 1px solid rgba(255, 207, 107, 0.25);
  color: #ffdf9e;
  font-size: 11px; font-weight: 600;
  animation: screenIn 0.25s;
}
.chain-icon { font-size: 13px; }
.move-hint { color: var(--muted-2); font-size: 11px; }

.chat-card { display: flex; flex-direction: column; height: 430px; padding: 17px; }
.chat-list {
  flex: 1;
  display: flex; flex-direction: column; gap: 9px;
  margin: 14px -4px 12px;
  padding: 0 4px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.chat-empty { margin: auto; text-align: center; color: var(--muted-2); font-size: 11.5px; line-height: 1.5; padding: 20px; }
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 88%; animation: chatIn 0.22s ease; }
@keyframes chatIn { from { opacity: 0; transform: translateY(5px); } }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg .who { display: flex; align-items: center; gap: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); }
.chat-msg .who i { width: 6px; height: 6px; border-radius: 50%; background: #d9d1bd; }
.chat-msg.mine .who i { background: #8f84ff; }
.chat-avatar-mini {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  color: #10121d;
  background: linear-gradient(145deg, #c9c1ff, #7c6cff);
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0;
}
.chat-avatar-mini.has-photo { background-size: cover; background-position: center; }
.chat-avatar-mini:hover { transform: scale(1.12); box-shadow: 0 0 10px rgba(124, 108, 255, 0.65); }
.chat-msg .bubble {
  padding: 8px 11px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--stroke-soft);
  font-size: 12px;
  line-height: 1.45;
  color: #d7daea;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.mine .bubble { border-radius: 12px 12px 4px 12px; background: rgba(124, 108, 255, 0.18); border-color: rgba(124, 108, 255, 0.28); color: #e7e3ff; }
.chat-system {
  align-self: center;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
  max-width: 92%;
}
.chat-system .ts { opacity: 0.5; margin-left: 5px; font-size: 9px; }
.chat-form { display: flex; gap: 7px; }
.chat-form input {
  flex: 1;
  height: 40px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--stroke-soft);
  background: rgba(0, 0, 0, 0.22);
  font-size: 12.5px;
  color: var(--text);
  transition: 0.2s;
}
.chat-form input::placeholder { color: var(--muted-2); }
.chat-form input:focus { outline: none; border-color: rgba(124, 108, 255, 0.45); background: rgba(124, 108, 255, 0.06); }
.chat-hint { padding: 16px 18px; }
.chat-hint strong { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.chat-hint span { color: var(--muted-2); font-size: 11.5px; line-height: 1.55; }

/* --------------------------------------------------------------- тосты */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
  width: min(460px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 36, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.9);
  font-size: 12.5px;
  line-height: 1.4;
  color: #dde0ee;
  animation: toastIn 0.28s cubic-bezier(0.2, 1, 0.4, 1);
  pointer-events: auto;
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast .t-icon { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 0; }
.toast.info .t-icon { background: rgba(124, 108, 255, 0.22); color: #c8c0ff; }
.toast.error .t-icon { background: rgba(255, 107, 129, 0.2); color: #ffb3bf; }
.toast.success .t-icon { background: rgba(55, 230, 197, 0.18); color: #8ff0d9; }
.toast.warn .t-icon { background: rgba(255, 207, 107, 0.18); color: #ffdfa0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* --------------------------------------------------------------- модалки */
.modal-root { position: fixed; inset: 0; z-index: 90; display: none; }
.modal-root.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 5, 10, 0.66);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.22s ease;
}
.modal {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  padding: 30px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(124, 108, 255, 0.18), transparent 55%),
    linear-gradient(160deg, #141829, #0d101b);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalIn 0.3s cubic-bezier(0.2, 1, 0.35, 1);
}
.modal.wide { width: min(600px, calc(100vw - 32px)); }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%) scale(0.96); } }
@keyframes fadeIn { from { opacity: 0; } }
.modal h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.modal p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal-actions .primary-btn, .modal-actions .secondary-btn, .modal-actions .ghost-btn, .modal-actions .danger-btn { height: 44px; padding: 0 20px; border-radius: 12px; font-size: 13px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); border-color: var(--stroke); }
.modal-close .icon { width: 15px; height: 15px; }
.modal-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #b9afff; margin-bottom: 14px; }
.modal-icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(145deg, rgba(124, 108, 255, 0.25), rgba(55, 230, 197, 0.1));
  border: 1px solid rgba(124, 108, 255, 0.3);
  font-size: 28px;
}
.modal-icon.lose { background: linear-gradient(145deg, rgba(255, 107, 129, 0.2), rgba(255, 255, 255, 0.03)); border-color: rgba(255, 107, 129, 0.25); }
.modal-icon.draw { background: linear-gradient(145deg, rgba(255, 207, 107, 0.2), rgba(255, 255, 255, 0.03)); border-color: rgba(255, 207, 107, 0.25); }
.result-title { font-size: 34px; font-weight: 850; letter-spacing: -0.04em; }
.result-title.win { background: linear-gradient(120deg, #a4f5dd, #7c6cff 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-title.lose { color: #ffb2bd; }
.result-title.draw { color: var(--gold); }
.result-sub { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.result-stats { display: flex; gap: 22px; margin-top: 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, 0.02); }
.result-stats div { display: flex; flex-direction: column; gap: 2px; }
.result-stats strong { font-size: 16px; }
.result-stats span { font-size: 10.5px; color: var(--muted-2); }
.rematch-note { margin-top: 10px; font-size: 11.5px; color: var(--gold); }

.rules-body { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.rule-item { display: flex; gap: 12px; }
.rule-num {
  flex: 0 0 auto;
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(124, 108, 255, 0.14);
  border: 1px solid rgba(124, 108, 255, 0.25);
  color: #c4bbff; font-size: 11px; font-weight: 800;
}
.rule-item p { margin: 0; color: #aeb4c8; font-size: 12.5px; line-height: 1.55; }
.rule-item strong { color: #e2e4ef; }
.connect-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.connect-addr {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke-soft);
  background: rgba(0, 0, 0, 0.25);
}
.connect-addr code { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: #c2c9e8; }
.modal code.inline { padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; color: #cfc8ff; }

/* --------------------------------------------------------------- конфетти */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px; height: 13px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(0deg); }
  8% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift, 40px), 105vh, 0) rotate(var(--spin, 540deg)); }
}

/* --------------------------------------------------------------- адаптив */
@media (max-width: 1220px) {
  .game-grid { grid-template-columns: 224px minmax(0, 1fr) 268px; gap: 16px; }
  .game-side .ghost-btn, .game-side .danger-btn { font-size: 12px; padding: 0 10px; }
  .chat-card { height: 400px; }
  .hero { padding: 34px 32px 28px; }
}

@media (max-width: 1080px) {
  .home { grid-template-columns: 1fr; }
  .home-side { display: grid; grid-template-columns: 1fr 1fr; }
  .tips-panel { grid-column: 1 / -1; }
  .game-grid { grid-template-columns: 214px minmax(0, 1fr); grid-template-areas: "left board" "right board"; }
  .game-side.right { align-self: end; }
  .chat-card { height: 330px; }
  .board-column { max-width: clamp(320px, calc(100dvh - 300px), 640px); }
}

@media (max-width: 860px) {
  .topbar, .app { padding-left: 18px; padding-right: 18px; }
  .bg-trays { width: 52px; }
  .bg-checker { width: clamp(12px, 1.9vh, 20px); }
  .game-select { max-width: 100%; }
  .hero { grid-template-columns: 1fr; padding: 30px; }
  .hero-art { min-height: 280px; margin-top: 12px; }
  .preview-board { width: min(260px, 80%); }
  .hero-stats { padding-top: 26px; gap: 24px; }
  .home-side { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; grid-template-areas: "board" "left" "right"; gap: 14px; }
  .board-column { gap: 9px; max-width: 100%; }
  .board-shell { width: 100%; min-width: 0; }
  .game-side.left { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .game-side.left .info-card { order: 1; }
  .game-side.left .game-actions { order: 2; }
  .game-side.left .net-note { order: 3; grid-column: 1 / -1; }
  .game-side.right { display: grid; grid-template-columns: 1fr; }
  .chat-card { height: 320px; }
  .chat-hint { display: none; }
  .turn-pill { display: none; }
}

@media (max-width: 620px) {
  .durak-board { --card-w: clamp(38px, 5.2vh, 52px); padding: 11px; gap: 8px; }
  .durak-middle { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .durak-slots { gap: 6px; }
  .d-pair { width: calc(var(--card-w) * 1.18); height: calc(var(--card-h) * 1.18); }
  .durak-hand { gap: 3px; }
  .bg-wrap { gap: 6px; }
  .bg-trays { width: 44px; }
  .bg-tray strong { font-size: 14px; }
  .bg-tray span { font-size: 7px; }
  .bg-checker { width: clamp(10px, 1.8vh, 18px); }
  .game-pill { min-height: 44px; padding: 7px 9px; font-size: 10.5px; }
  .gp-icon { width: 24px; height: 24px; font-size: 14px; }
  .gp-text small { font-size: 8.5px; }
  .topbar { padding-top: 16px; gap: 10px; }
  .brand-text small, .conn span:last-child, #rulesBtn { display: none; }
  .top-actions { gap: 7px; }
  .conn { padding: 8px 10px; }
  .app { padding-bottom: 24px; }
  .hero { padding: 26px 22px 24px; border-radius: 22px; }
  .hero h1 { font-size: 58px; }
  .hero-lead { font-size: 13px; }
  .hero-actions { width: 100%; }
  .hero-actions .primary-btn, .hero-actions .secondary-btn { flex: 1; height: 48px; padding: 0 14px; font-size: 13px; }
  .join-form { width: 100%; }
  .code-input { flex: 1; width: auto; height: 48px; }
  .hero-stats { gap: 18px; flex-wrap: wrap; }
  .hero-stats strong { font-size: 17px; }
  .hero-stats span { font-size: 10.5px; }
  .float-card { display: none; }
  .home-side { display: flex; }
  .panel { padding: 18px; }
  .game-top { flex-wrap: wrap; gap: 8px; }
  .top-spacer { display: none; }
  .game-top .ghost-btn { margin-left: auto; }
  .board-shell { width: 100%; min-width: 0; gap: 4px; grid-template-columns: 16px minmax(0, 1fr) 16px; grid-template-rows: 16px minmax(0, 1fr) 16px; }
  .game-side.left { grid-template-columns: 1fr; }
  .game-side.left .game-actions { order: 2; display: grid; grid-template-columns: 1fr 1fr; }
  .game-side.left .game-actions .quiet { grid-column: 1 / -1; }
  .modal { padding: 24px; border-radius: 22px; }
  .result-title { font-size: 28px; }
  .files span, .ranks span { font-size: 8px; }
  .chat-list { max-height: 240px; }
}

@media (max-height: 720px) and (min-width: 861px) {
  .board-column { max-width: clamp(300px, calc(100dvh - 260px), 600px); }
  .chat-card { height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ------------------------------------------------------------ создатель и модерация */
.creator-name {
  color: #ffd76a !important;
  text-shadow: 0 0 16px rgba(255, 196, 64, 0.4);
}
.creator-tag {
  background: linear-gradient(135deg, #ffe9a6, #ffbe3d) !important;
  color: #2a1a00 !important;
  border-color: transparent !important;
}
.mod-btn {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 7px;
  border: 1px solid rgba(255, 215, 106, 0.35);
  background: rgba(255, 215, 106, 0.1);
  font-size: 11px;
  line-height: 1.4;
  vertical-align: middle;
}
.mod-btn:hover { background: rgba(255, 215, 106, 0.24); }
.moderation-title { margin: 6px 0 4px; font-size: 20px; }
.moderation-sub { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.moderation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.moderation-actions button { width: 100%; }
@media (max-width: 520px) {
  .moderation-actions { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-row { grid-template-columns: minmax(0, 1fr) 30px 30px 30px 30px 48px; font-size: 10px; }
}

/* ------------------------------------------------------------ четыре в ряд */
.c4-shell { width: 100%; max-width: 660px; margin: 0 auto; }
.game.c4-mode .board-column { max-width: min(820px, 100%); }
.c4-frame {
  width: 100%;
  padding: clamp(8px, 2vw, 16px);
  border-radius: 24px;
  background: linear-gradient(160deg, #26305a 0%, #1a2140 55%, #12172c 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 30px 70px -30px rgba(0, 0, 0, 0.95), 0 0 80px -30px rgba(124, 108, 255, 0.5);
}
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1vw, 9px); }
.c4-col {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vw, 9px);
  padding: clamp(2px, 0.6vw, 6px);
  border-radius: 16px;
  background: transparent;
}
.c4-col:disabled { cursor: default; }
.c4-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #0b0f1c, #070a12 70%);
  box-shadow: inset 0 5px 12px rgba(0, 0, 0, 0.85), inset 0 -2px 2px rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  transition: box-shadow 0.15s;
}
.c4-col:hover:not(:disabled) .c4-cell.landing {
  box-shadow: inset 0 0 0 3px rgba(55, 230, 197, 0.8), inset 0 5px 12px rgba(0, 0, 0, 0.85), 0 0 20px rgba(55, 230, 197, 0.35);
}
.c4-disc { width: 84%; height: 84%; border-radius: 50%; background: transparent; }
.c4-disc.w {
  background: radial-gradient(circle at 32% 28%, #ffb3bc 0%, #ff5a6e 48%, #c42440 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.55), inset 0 -4px 7px rgba(80, 0, 15, 0.55), 0 3px 8px rgba(0, 0, 0, 0.5);
}
.c4-disc.b {
  background: radial-gradient(circle at 32% 28%, #fff6b8 0%, #ffd24a 48%, #c9930d 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -4px 7px rgba(90, 55, 0, 0.5), 0 3px 8px rgba(0, 0, 0, 0.5);
}
.c4-cell.win { box-shadow: inset 0 0 0 3px rgba(55, 230, 197, 0.9), 0 0 22px rgba(55, 230, 197, 0.65); }
.c4-cell.win .c4-disc { animation: c4Win 0.9s ease-in-out infinite alternate; }
@keyframes c4Win { to { transform: scale(1.08); filter: brightness(1.25); } }
.c4-disc.drop { animation: c4Drop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
@keyframes c4Drop { from { transform: translateY(-320%); opacity: 0.35; } }

/* ------------------------------------------------------------ баррикады */
.bar-shell { width: 100%; max-width: 660px; margin: 0 auto; }
.game.bar-mode .board-column { max-width: min(860px, 100%); }
.bar-board { display: flex; flex-direction: column; gap: 10px; }
.bar-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
}
.bar-side { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.bar-side .dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.bar-side.w .dot { background: #37e6c5; color: #37e6c5; }
.bar-side.b .dot { background: #ff6b81; color: #ff6b81; }
.bar-actions { display: flex; gap: 6px; }
.bar-actions button:disabled { opacity: 0.45; }
.bar-actions button.active { border-color: rgba(55, 230, 197, 0.6); background: rgba(55, 230, 197, 0.14); color: #9fe9cf; }
.bar-arena {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #202849 0%, #11162a 62%, #0a0e1a 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), inset 0 20px 50px rgba(0, 0, 0, 0.45), 0 30px 70px -34px rgba(0, 0, 0, 1);
}
.bar-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); }
.bar-cell { position: relative; border: 0; background: transparent; padding: 0; cursor: default; }
.bar-cell.dark { background: rgba(255, 255, 255, 0.025); }
.bar-cell:hover { background: rgba(255, 255, 255, 0.05); }
.bar-cell.target { cursor: pointer; }
.bar-cell.target::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 30%; height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(55, 230, 197, 0.9), 0 0 0 4px rgba(55, 230, 197, 0.12);
  animation: targetPulse 1.5s ease-in-out infinite;
}
.bar-pawn {
  position: absolute;
  left: 50%; top: 50%;
  width: 58%; height: 58%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.bar-pawn.w { background: radial-gradient(circle at 32% 28%, #c9fff5, #37e6c5 48%, #0e8f76 100%); box-shadow: 0 0 18px rgba(55, 230, 197, 0.75), inset 0 2px 4px rgba(255, 255, 255, 0.7); }
.bar-pawn.b { background: radial-gradient(circle at 32% 28%, #ffd4da, #ff6b81 48%, #a81f36 100%); box-shadow: 0 0 18px rgba(255, 107, 129, 0.75), inset 0 2px 4px rgba(255, 255, 255, 0.7); }
.bar-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.bar-slots { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.bar-slots .bar-slot { pointer-events: auto; }
.bar-wall { position: absolute; border-radius: 999px; }
.bar-wall.fresh { animation: barWallIn 0.36s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes barWallIn {
  from { opacity: 0; transform: scale(0.7); filter: brightness(2.2); }
}
.bar-slot { animation: barSlotIn 0.18s ease; }
@keyframes barSlotIn { from { opacity: 0; } }
.bar-wall.w { background: linear-gradient(180deg, #9ff8e8, #37e6c5 55%, #129a80); box-shadow: 0 0 14px rgba(55, 230, 197, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.65); }
.bar-wall.b { background: linear-gradient(180deg, #ffbcc5, #ff6b81 55%, #b72540); box-shadow: 0 0 14px rgba(255, 107, 129, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.65); }
.bar-slot {
  position: absolute;
  z-index: 6;
  padding: 0;
  border-radius: 999px;
  border: 1px dashed rgba(55, 230, 197, 0.65);
  background: rgba(55, 230, 197, 0.16);
  cursor: pointer;
  opacity: 0.32;
  transition: opacity 0.15s, background 0.15s, box-shadow 0.15s;
}
.bar-slot.active { opacity: 1; }
.bar-slot:hover { opacity: 1; background: rgba(55, 230, 197, 0.42); border-style: solid; box-shadow: 0 0 16px rgba(55, 230, 197, 0.5); }
.bar-slot.h { transform: translateY(-50%); }
.bar-slot.v { transform: translateX(-50%); }

/* ------------------------------------------------------------ админ-меню */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.admin-tab {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.admin-tab:hover { color: #fff; border-color: rgba(124, 108, 255, 0.45); }
.admin-tab.active { color: #fff; border-color: rgba(124, 108, 255, 0.7); background: rgba(124, 108, 255, 0.18); }
.admin-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 2px; }
.admin-empty { padding: 18px; border-radius: 12px; border: 1px dashed var(--stroke); color: var(--muted); font-size: 12px; text-align: center; }
.admin-player {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 10px 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}
.admin-avatar {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  background: linear-gradient(145deg, #c9c1ff, #7c6cff);
  color: #10121d;
  background-size: cover; background-position: center;
}
.admin-player-main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-player-main strong { font-size: 13px; }
.admin-player-main small { color: var(--muted-2); font-size: 10px; }
.admin-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-tag {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--stroke);
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.04);
}
.admin-tag.online { color: #8ff0d9; border-color: rgba(55, 230, 197, 0.4); background: rgba(55, 230, 197, 0.1); }
.admin-tag.muted { color: #ffd08a; border-color: rgba(255, 190, 61, 0.4); background: rgba(255, 190, 61, 0.1); }
.admin-tag.banned { color: #ff9aa7; border-color: rgba(255, 107, 129, 0.4); background: rgba(255, 107, 129, 0.1); }
.admin-player-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  max-width: none;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
}
.admin-player-actions > button,
.admin-player-actions > .admin-self { flex: 0 0 auto; }
.admin-player-actions button { font-size: 10px; padding: 6px 9px; }
.admin-search { margin: 0 0 2px; }
.admin-search .admin-input { flex: 1 1 100%; height: 34px; font-size: 12px; }
.admin-self { font-size: 9px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.admin-room {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}
.admin-room-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-room-head strong { font-size: 12px; }
.admin-code { padding: 1px 6px; border-radius: 6px; background: rgba(124, 108, 255, 0.16); color: #c9c2ff; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.admin-badge { padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: var(--muted-2); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.admin-badge.live { background: rgba(55, 230, 197, 0.14); color: #8ff0d9; }
.admin-room-time { margin-left: auto; color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.admin-room-meta { margin: 5px 0 8px; color: var(--muted); font-size: 10.5px; }
.admin-room-meta span { color: var(--muted-2); }
.admin-room-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-room-actions button { font-size: 9.5px; padding: 5px 7px; }
.admin-server { display: flex; flex-direction: column; gap: 8px; }
.admin-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.03); font-size: 11px; }
.admin-line span { color: var(--muted-2); }
.admin-line strong { font-size: 11px; text-align: right; word-break: break-all; }
.admin-url { color: #9fe9cf; }
.admin-footer { margin-top: 14px; }
.admin-peek-hand { margin-bottom: 12px; }
.admin-peek-hand h4 { margin: 0 0 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.admin-peek-cards { display: flex; flex-wrap: wrap; gap: 6px; --card-w: clamp(38px, 5vw, 54px); --card-h: calc(var(--card-w) * 1.42); }
.admin-peek-cards .d-card { position: relative; }
.admin-json { max-height: 46vh; overflow: auto; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); color: #d7daea; font-size: 9.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* ------------------------------------------------------------ роли и журнал */
.moderator-name {
  color: #6ee7ff !important;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}
.moderator-tag {
  background: linear-gradient(135deg, #b6f2ff, #38bdf8) !important;
  color: #062a3a !important;
  border-color: transparent !important;
}
.p-tag.moderator-tag { color: #062a3a !important; }
.admin-tag.moderator-tag,
.profile-tag.moderator-tag {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #9fe9ff !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}
.admin-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px dashed var(--stroke);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
}
.admin-manual { margin-bottom: 10px; }
.admin-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.admin-input {
  flex: 1 1 180px;
  min-width: 140px;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: #e6e8f2;
  font-size: 11px;
  outline: none;
}
.admin-input:focus { border-color: rgba(56, 189, 248, 0.6); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 6px; margin-bottom: 14px; }
.admin-stat {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.admin-stat strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.admin-stat span { font-size: 8.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.admin-top { display: flex; flex-direction: column; gap: 4px; }
.admin-top-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.admin-top-row strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-top-place { color: var(--muted-2); font-weight: 800; text-align: center; }
.admin-audit-row {
  display: grid;
  grid-template-columns: 82px minmax(70px, 1fr) auto minmax(70px, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px;
}
.admin-audit-row:nth-child(odd) { background: rgba(255, 255, 255, 0.05); }
.admin-audit-time { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.admin-audit-who { color: #9fe9ff; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-audit-what { color: var(--muted); }
.admin-audit-target { color: #e7e9f4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ админ-эффекты */
.admin-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 14, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}
.admin-popup-card {
  width: min(340px, 100%);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(160deg, #1b2133, #0d101b);
  box-shadow: 0 30px 90px -30px #000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  animation: modalIn 0.25s;
}
.admin-popup-overlay.warn .admin-popup-card { border-color: rgba(255, 107, 129, 0.55); }
.admin-popup-eyebrow {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.admin-popup-card strong { font-size: 17px; line-height: 1.35; }
.admin-fx-bit {
  position: fixed;
  top: -24px;
  z-index: 9998;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--fx-color, #ffd76a);
  pointer-events: none;
  animation: fxFall linear forwards;
}
.admin-fx-bit.rain {
  width: auto;
  height: auto;
  background: transparent;
  font-size: 18px;
  border-radius: 0;
}
@keyframes fxFall {
  to { transform: translateY(106vh) rotate(620deg); opacity: 0.85; }
}
body.admin-shake .app { animation: adminShake 0.6s; }
@keyframes adminShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px) rotate(-0.4deg); }
  40% { transform: translate(7px, -4px) rotate(0.5deg); }
  60% { transform: translate(-5px, -2px); }
  80% { transform: translate(4px, 3px); }
}
body.admin-flash::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: #fff;
  animation: adminFlash 1.1s forwards;
}
@keyframes adminFlash { from { opacity: 0.95; } to { opacity: 0; } }
body.admin-invert { filter: invert(1) hue-rotate(180deg); }
body.admin-matrix::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 255, 120, 0.16) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(0, 40, 15, 0.35), rgba(0, 0, 0, 0.2));
  animation: matrixPulse 3.4s ease-in-out;
}
@keyframes matrixPulse { from { opacity: 0; } 20%, 80% { opacity: 1; } to { opacity: 0; } }

/* ------------------------------------------------------------ комнаты v0.7 */
.variant-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.variant-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.variant-pill {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.variant-pill:hover { color: #fff; border-color: rgba(124, 108, 255, 0.45); }
.variant-pill.active {
  color: #fff;
  border-color: rgba(124, 108, 255, 0.7);
  background: rgba(124, 108, 255, 0.18);
}

.room-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  align-items: center;
  margin-top: 10px;
}
.room-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}
.room-option input { accent-color: #7c6cff; width: 14px; height: 14px; }
.option-input {
  flex: 1 1 180px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: #e6e8f2;
  font-size: 11px;
  outline: none;
}
.option-input:focus { border-color: rgba(124, 108, 255, 0.6); }
.join-form .password-input { max-width: 120px; letter-spacing: 0.04em; }
.room-item.live { border-color: rgba(55, 230, 197, 0.28); background: rgba(55, 230, 197, 0.04); }
.room-live { display: inline-flex; align-items: center; gap: 5px; color: #8ff0d9; }
.room-live .live-dot { width: 6px; height: 6px; }
.room-timer { font-variant-numeric: tabular-nums; }
.room-lock { margin-left: 5px; font-size: 10px; }
.room-guest { color: var(--muted-2); }
.room-spec { color: #9fe9ff; white-space: nowrap; }
.ready-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 108, 255, 0.3);
  background: rgba(124, 108, 255, 0.08);
}
.ready-label { font-size: 11px; color: var(--muted); }

.spectator-admin {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 600;
  width: min(330px, calc(100vw - 32px));
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 106, 0.35);
  background: rgba(14, 17, 28, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px -20px #000;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sa-title { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: #ffd76a; text-transform: uppercase; }
.sa-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.sa-actions button {
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: #dfe2ee;
  font-size: 9px;
  font-weight: 700;
}
.sa-actions button:hover { border-color: rgba(255, 215, 106, 0.5); color: #fff; }

/* ------------------------------------------------------------ рулетка */
.roulette-shell { width: 100%; max-width: 560px; margin: 0 auto; }
.rr-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 107, 129, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}
.rr-status { font-size: 14px; font-weight: 700; text-align: center; min-height: 20px; }
.rr-cylinder {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 50% 50%, #232a3d, #0d1018 70%);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8);
  transform-origin: center;
}
.rr-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #101521;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8);
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s;
}
.rr-dot.spent { background: #2c3346; opacity: 0.55; }
.rr-dot.current { border-color: rgba(255, 215, 106, 0.8); box-shadow: 0 0 14px rgba(255, 215, 106, 0.5); animation: rrPulse 1.2s infinite; }
.rr-dot.hit { background: #ff4d63; border-color: #ff8a99; box-shadow: 0 0 24px rgba(255, 77, 99, 0.9); transform: scale(1.12); }
.rr-cylinder.spinning { animation: rrSpin 0.85s cubic-bezier(.3, .1, .2, 1); }
.rr-cylinder.clicked { animation: rrClick 0.3s; }
.rr-cylinder.fired { animation: rrRecoil 0.5s; border-color: rgba(255, 77, 99, 0.8); }
.rr-odds { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.rr-odds strong { color: #dfe3ef; font-variant-numeric: tabular-nums; }
.rr-odds .hot { color: #ff8a99; }
.rr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rr-log { width: 100%; display: flex; flex-direction: column; gap: 3px; max-height: 110px; overflow-y: auto; }
.rr-log-line { display: flex; gap: 7px; padding: 4px 8px; border-radius: 7px; background: rgba(255, 255, 255, 0.03); font-size: 10.5px; color: var(--muted); }
.rr-log-line.mine { background: rgba(124, 108, 255, 0.1); color: #dcd8ff; }
.rr-log-empty { text-align: center; color: var(--muted-2); font-size: 10.5px; }
@keyframes rrSpin { from { transform: rotate(0); } to { transform: rotate(720deg); } }
@keyframes rrClick { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes rrRecoil { 0% { transform: scale(1); } 25% { transform: scale(1.07) rotate(-2deg); } 60% { transform: scale(0.97) rotate(1.5deg); } 100% { transform: scale(1); } }
@keyframes rrPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ------------------------------------------------------------ гомоку */
.gomoku-shell { width: 100%; max-width: 620px; margin: 0 auto; }
.gomoku-board {
  display: grid;
  aspect-ratio: 1 / 1;
  padding: 8px;
  gap: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px calc(100% / 15)),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px calc(100% / 15)),
    linear-gradient(145deg, #d9b57a, #b98d4f);
  box-shadow: 0 30px 70px -30px #000, inset 0 0 40px rgba(90, 55, 20, 0.35);
}
.gomoku-cell {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: default;
}
.gomoku-cell.open { cursor: pointer; }
.gomoku-cell.open:hover::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: rgba(20, 25, 35, 0.18);
}
.gomoku-cell.w::after,
.gomoku-cell.b::after {
  content: '';
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  animation: stoneIn 0.16s ease-out;
}
.gomoku-cell.w::after {
  background: radial-gradient(circle at 35% 30%, #ffffff, #d8dbe4 70%);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.4);
}
.gomoku-cell.b::after {
  background: radial-gradient(circle at 35% 30%, #4a5568, #141821 70%);
  box-shadow: inset 0 -2px 4px rgba(255, 255, 255, 0.12), 0 2px 4px rgba(0, 0, 0, 0.5);
}
.gomoku-cell.last::after { box-shadow: 0 0 0 2px #ffd76a, 0 0 18px rgba(255, 215, 106, 0.6); }
@keyframes stoneIn { from { transform: scale(0.2); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }

/* ------------------------------------------------------------ мобильный адаптив */
@media (max-width: 900px) {
  .app { padding: 12px 12px 28px; }
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand-text small { display: none; }
  .home-main { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .game-grid { grid-template-columns: 1fr; }
  .game-side.left { order: 2; }
  .board-column { order: 1; max-width: 100%; }
  .game-top { flex-wrap: wrap; }
  .game-top .top-spacer { display: none; }
  .rooms-panel, .general-chat-panel { max-height: none; }
  .modal { max-height: 92vh; overflow-y: auto; }
  .modal.wide { width: calc(100vw - 20px); }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .admin-tab { flex: 0 0 auto; }
  .spectator-admin { left: 10px; right: 10px; bottom: 10px; width: auto; }
}

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { flex-wrap: wrap; gap: 5px; }
  .online-pill span:not(.online-dot) { display: none; }
  .conn #connLabel { display: none; }
  .hero-copy h1 { font-size: 30px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions button { width: 100%; }
  .join-form { flex-wrap: wrap; }
  .join-form .code-input { flex: 1 1 90px; }
  .join-form .password-input { flex: 1 1 130px; max-width: none; }
  .join-form button { flex: 1 1 100%; }
  .room-options { flex-direction: column; align-items: stretch; }
  .option-input { flex: 1 1 auto; width: 100%; }
  .game-select { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-top { gap: 6px; }
  .game-top .ghost-btn.compact { display: none; }
  .room-chip { order: 1; }
  .turn-pill { order: 2; margin-left: auto; }
  .game-chip { order: 3; }
  .modal { padding: 20px 16px; border-radius: 18px; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-row { grid-template-columns: minmax(0, 1fr) 30px 30px 30px 30px 46px; font-size: 10px; }
  .admin-player { flex-wrap: wrap; }
  .admin-player-actions { max-width: none; width: 100%; justify-content: flex-start; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-top-row { grid-template-columns: 20px minmax(0, 1fr) auto auto; }
  .admin-top-row span:last-child { display: none; }
  .admin-audit-row { grid-template-columns: 68px minmax(60px, 1fr) auto; font-size: 9px; }
  .admin-audit-target { display: none; }
  .rr-board { padding: 16px 12px; }
  .rr-dot { width: 20px; height: 20px; }
  .rr-cylinder { gap: 7px; padding: 12px 14px; }
  .gomoku-board { padding: 5px; }
  .d-card { --card-w: clamp(34px, 9vw, 52px); }
  .chat-list { max-height: 200px; }
  .general-chat-list { max-height: 220px; }
}

@media (max-width: 420px) {
  .app { padding: 8px 8px 20px; }
  .brand-text strong { font-size: 13px; }
  .hero-copy h1 { font-size: 26px; }
  .game-select { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-row { grid-template-columns: minmax(0, 1fr) 26px 26px 26px 26px 40px; gap: 4px; padding: 6px 5px; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .spectator-admin { padding: 8px; }
  .sa-actions button { flex: 1 1 45%; }
  .rr-dot { width: 16px; height: 16px; }
  .rr-cylinder { gap: 5px; padding: 10px; }
  .modal { padding: 16px 12px; }
  .ready-panel { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .admin-audit-row { grid-template-columns: 70px minmax(60px, 1fr) auto; }
  .admin-audit-target { display: none; }
}

/* ------------------------------------------------------------ монополия */
.players-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.ps-player {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10.5px;
}
.ps-player.active { border-color: rgba(55, 230, 197, 0.5); box-shadow: 0 0 18px rgba(55, 230, 197, 0.14); }
.ps-player.me { background: rgba(124, 108, 255, 0.12); }
.ps-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.ps-dot.w { background: #ffd76a; }
.ps-dot.b { background: #38bdf8; }
.ps-dot.g { background: #4ade80; }
.ps-dot.y { background: #facc15; }
.ps-name { font-weight: 700; }
.ps-money { color: #8ff0d9; font-variant-numeric: tabular-nums; }

.mono-shell { width: 100%; max-width: 900px; margin: 0 auto; }
.game.mono-mode .board-column { max-width: min(100%, 780px, calc(100dvh - 200px)); }
.mono-wrap { display: flex; flex-direction: column; gap: 10px; }
.mono-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0f1420;
  box-shadow: 0 26px 70px -30px #000;
  overflow: hidden;
}
.mono-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  width: 100%;
  height: 100%;
  gap: 2px;
  padding: 2px;
}
.mono-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1px;
  padding: 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #1a2030;
  overflow: hidden;
  font-size: clamp(8px, 0.95vw, 10.5px);
  line-height: 1.08;
}
.mono-tile.group-brown { --group-color: #8b5a2b; }
.mono-tile.group-cyan { --group-color: #56c7e0; }
.mono-tile.group-pink { --group-color: #d66ba0; }
.mono-tile.group-orange { --group-color: #e08a3c; }
.mono-tile.group-red { --group-color: #d9534f; }
.mono-tile.group-yellow { --group-color: #e0c341; }
.mono-tile.group-green { --group-color: #4caf50; }
.mono-tile.group-navy { --group-color: #3b5bdb; }
.mono-tile[class*="group-"] { padding-top: 9px; }
.mono-tile[class*="group-"]::before {
  content: "";
  position: absolute;
  z-index: 0;
  background: var(--group-color);
}
.mono-tile.side-bottom[class*="group-"]::before { inset: 0 0 auto 0; height: 5px; }
.mono-tile.side-top[class*="group-"] { padding-top: 4px; padding-bottom: 9px; }
.mono-tile.side-top[class*="group-"]::before { inset: auto 0 0 0; height: 5px; }
.mono-tile.side-left[class*="group-"] { padding-top: 4px; padding-right: 9px; }
.mono-tile.side-left[class*="group-"]::before { inset: 0 0 0 auto; width: 5px; }
.mono-tile.side-right[class*="group-"] { padding-top: 4px; padding-left: 9px; }
.mono-tile.side-right[class*="group-"]::before { inset: 0 auto 0 0; width: 5px; }
.mono-tile.owned-w { border-color: rgba(255, 215, 106, 0.65); background: #26251a; }
.mono-tile.owned-b { border-color: rgba(110, 231, 255, 0.65); background: #16232b; }
.mono-tile.pending { outline: 2px solid #ffd76a; outline-offset: -2px; animation: monoPulse 1s infinite; }
.mono-name { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; color: #dfe3ef; font-weight: 600; overflow: hidden; word-break: break-word; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55); }
.mono-price { position: relative; z-index: 1; flex: 0 0 auto; color: #ffd76a; font-weight: 800; font-size: clamp(7px, 0.8vw, 9px); }
.mono-center {
  position: absolute;
  inset: calc(100% / 11);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.mono-center-card {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 50% 20%, rgba(124, 108, 255, 0.14), transparent 60%),
    rgba(8, 10, 18, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
}
.mono-brand { font-size: clamp(9px, 1.4vw, 14px); letter-spacing: 0.24em; color: #8f97b3; font-weight: 800; }
.mono-dice-big { display: flex; gap: 8px; font-size: clamp(24px, 4.4vw, 48px); line-height: 1; color: #fff; }
.mono-center-event { font-size: clamp(8px, 1.2vw, 12px); color: var(--muted); max-width: 82%; }
.mono-tokens { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.mono-token {
  position: absolute;
  width: clamp(9px, 1.5vw, 15px);
  height: clamp(9px, 1.5vw, 15px);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0, 0, 0, 0.5);
  transition: left 0.12s linear, top 0.12s linear;
}
.mono-token.w { background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd76a 65%, #c9971d); box-shadow: 0 0 8px rgba(255, 215, 106, 0.7); margin: -3px 0 0 -3px; }
.mono-token.b { background: radial-gradient(circle at 35% 30%, #b8f4ff, #38bdf8 65%, #0b5f80); box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); margin: 3px 0 0 3px; }
.mono-token.g { background: radial-gradient(circle at 35% 30%, #b9ffd0, #4ade80 65%, #147a3d); box-shadow: 0 0 8px rgba(74, 222, 128, 0.7); margin: -3px 0 0 3px; }
.mono-token.y { background: radial-gradient(circle at 35% 30%, #fff8b0, #facc15 65%, #9c7703); box-shadow: 0 0 8px rgba(250, 204, 21, 0.7); margin: 3px 0 0 -3px; }
.mono-panel {
  display: grid;
  grid-template-areas:
    "money dice actions"
    "money event actions"
    "log log log";
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.95fr) minmax(0, 0.95fr);
  gap: 8px;
  align-items: start;
}
.mono-money { grid-area: money; display: flex; flex-direction: column; gap: 4px; }
.mono-money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  font-size: 11px;
}
.mono-money-row.me { border-color: rgba(255, 215, 106, 0.35); background: rgba(255, 215, 106, 0.07); }
.mono-money-row strong { font-variant-numeric: tabular-nums; font-size: 13px; }
.mono-dice { grid-area: dice; display: flex; justify-content: center; gap: 10px; font-size: 34px; line-height: 1; color: #fff; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.mono-die { display: inline-block; }
.mono-dice.rolling .mono-die { animation: monoDice 0.55s ease-in-out; }
.mono-event { grid-area: event; min-height: 30px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.03); font-size: 10.5px; color: var(--muted); }
.mono-actions { grid-area: actions; display: flex; flex-direction: column; gap: 5px; }
.mono-actions button { width: 100%; }
.mono-actions button:disabled { opacity: 0.35; cursor: default; }
.mono-log { grid-area: log; display: flex; flex-direction: column; gap: 3px; max-height: 120px; overflow-y: auto; }
.mono-log-line { display: flex; gap: 6px; padding: 4px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.03); font-size: 9.5px; color: var(--muted); }
.mono-log-line.mine { background: rgba(124, 108, 255, 0.1); color: #dcd8ff; }
.mono-log-empty { text-align: center; font-size: 10px; color: var(--muted-2); }
@keyframes monoDice {
  0% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-18deg) scale(1.18); }
  50% { transform: rotate(14deg) scale(0.94); }
  75% { transform: rotate(-8deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes monoPulse { 0%, 100% { outline-color: rgba(255, 215, 106, 0.85); } 50% { outline-color: rgba(255, 215, 106, 0.25); } }

@media (max-width: 900px) {
  .mono-panel { max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 720px) {
  .mono-panel {
    grid-template-areas: "money dice" "event actions" "log log";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .mono-tile { font-size: 7px; padding: 2px; border-radius: 2px; }
  .mono-price { font-size: 6.5px; }
  .mono-brand { letter-spacing: 0.12em; }
  .mono-dice { font-size: 26px; padding: 6px; }
  .mono-center-card { gap: 4px; padding: 4px; }
}

/* ------------------------------------------------------------ превью игр */
.preview-board.preview-c4 {
  display: grid;
  place-items: center;
  padding: 14px;
  background: linear-gradient(150deg, #182848, #0d1426);
}
.pv-c4-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
  aspect-ratio: 7 / 6;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.pv-c4-hole {
  border-radius: 50%;
  background: #0b0f19;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.8);
}
.pv-c4-hole.red { background: radial-gradient(circle at 32% 28%, #ff9aa7, #d9344f 62%, #7c1024); }
.pv-c4-hole.yellow { background: radial-gradient(circle at 32% 28%, #fff3a8, #f2c11c 62%, #9c7703); }

.preview-board.preview-bar {
  display: grid;
  place-items: center;
  padding: 14px;
  background: linear-gradient(150deg, #1d263c, #10151f);
}
.pv-bar-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  aspect-ratio: 1;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: #171d2c;
}
.pv-bar-cell {
  position: relative;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.035);
}
.pv-bar-cell:nth-child(even) { background: rgba(255, 255, 255, 0.06); }
.pv-bar-pawn {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  z-index: 2;
}
.pv-bar-pawn.w { background: radial-gradient(circle at 32% 28%, #fffdf6, #e9e1cf 60%, #b9af97); }
.pv-bar-pawn.b { background: radial-gradient(circle at 32% 28%, #5c6688, #29314e 55%, #10141f); }
.pv-bar-wall {
  position: absolute;
  z-index: 3;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffd76a, #c9971d);
  box-shadow: 0 0 8px rgba(255, 215, 106, 0.45);
}
.pv-bar-wall.b { background: linear-gradient(90deg, #6ee7ff, #147a9c); box-shadow: 0 0 8px rgba(56, 189, 248, 0.45); }

.preview-board.preview-roulette {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 77, 99, 0.2), transparent 60%),
    linear-gradient(160deg, #1c2033, #0a0c14);
}
.pv-rr-glow {
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 99, 0.22), transparent 65%);
  filter: blur(20px);
}
.pv-rr-cylinder {
  display: flex;
  gap: 10px;
  padding: 13px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle, #232a3d, #0d1018 72%);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.85);
  position: relative;
  z-index: 1;
}
.pv-rr-dot {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #0b0f18;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pv-rr-dot.bullet {
  background: radial-gradient(circle at 35% 30%, #ffd76a, #d38f12);
  box-shadow: 0 0 12px rgba(255, 215, 106, 0.8);
}
.pv-rr-gun { width: 124px; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.6)); }
.pv-rr-caption { font-size: 10px; letter-spacing: 0.15em; color: var(--muted-2); position: relative; z-index: 1; }

.preview-board.preview-gomoku {
  display: grid;
  place-items: center;
  padding: 12px;
  background: linear-gradient(145deg, #d9b57a, #b98d4f);
}
.pv-gomoku-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  width: 100%;
  aspect-ratio: 1;
  gap: 1px;
  background: rgba(90, 55, 20, 0.25);
}
.pv-gomoku-cell { position: relative; box-shadow: inset 0 0 0 0.5px rgba(78, 48, 14, 0.35); }
.pv-stone {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.pv-stone.w { background: radial-gradient(circle at 35% 30%, #fff, #d8dbe4 70%); }
.pv-stone.b { background: radial-gradient(circle at 35% 30%, #4a5568, #141821 70%); }

.preview-board.preview-monopoly {
  display: grid;
  place-items: center;
  padding: 10px;
  background: #0f1420;
}
.pv-mono-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  width: 100%;
  aspect-ratio: 1;
  gap: 2px;
}
.pv-mono-cell { border-radius: 2px; }
.pv-mono-cell.inner { background: rgba(255, 255, 255, 0.025); }
.pv-mono-cell.edge { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); opacity: 0.85; }
.pv-mono-logo {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #ffd76a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.pv-mono-logo strong { font-size: 16px; letter-spacing: 0.12em; }
.pv-mono-logo span { font-size: 8px; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }

/* ------------------------------------------------------------ морской бой */
.bs-shell { width: 100%; max-width: 760px; margin: 0 auto; }
.bs-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bs-block { display: flex; flex-direction: column; gap: 6px; }
.bs-label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.bs-grid {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: linear-gradient(160deg, #0b1a2c, #07111e);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
  aspect-ratio: 1;
}
.bs-cell {
  position: relative;
  border: 1px solid rgba(120, 180, 255, 0.1);
  border-radius: 3px;
  background: #102a44;
  padding: 0;
}
.bs-cell.open { cursor: crosshair; }
.bs-cell.open:hover { background: rgba(56, 189, 248, 0.35); }
.bs-cell.ship { background: linear-gradient(145deg, #9aa9bd, #64748b); box-shadow: inset 0 1px 1px rgba(255,255,255,.35); }
.bs-cell.hit { background: radial-gradient(circle at 40% 35%, #ff9b9b, #c81e1e 70%); animation: bsHit 0.35s ease-out; }
.bs-cell.miss::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(190, 220, 255, 0.55);
}
.bs-cell.fresh { outline: 2px solid #ffd76a; outline-offset: -2px; animation: bsPulse 0.9s; }
.bs-foot {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted);
}
.bs-status { display: flex; flex-wrap: wrap; gap: 14px; }
.bs-status strong { color: #dfe3ef; }
.bs-log { display: flex; flex-direction: column; gap: 2px; color: var(--muted-2); }
@keyframes bsHit { from { transform: scale(1.4); filter: brightness(2); } to { transform: scale(1); filter: none; } }
@keyframes bsPulse { 0%, 100% { outline-color: rgba(255, 215, 106, 0.9); } 50% { outline-color: rgba(255, 215, 106, 0.2); } }

/* ------------------------------------------------------------ клавогонки */
.tr-shell { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.tr-target {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: #5f6780;
}
.tr-char.ok { color: #8ff0d9; }
.tr-char.bad { color: #ff9aa7; background: rgba(255, 107, 129, 0.22); border-radius: 3px; }
.tr-char.current { border-bottom: 2px solid #ffd76a; }
.tr-bars { display: flex; flex-direction: column; gap: 6px; }
.tr-bar-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
}
.tr-bar-row.me .tr-bar-name { color: #ffd76a; }
.tr-bar-name { color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tr-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c6cff, #38bdf8); transition: width 0.2s linear; }
.tr-bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.tr-input {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(124, 108, 255, 0.35);
  background: rgba(10, 13, 22, 0.75);
  color: #e6e8f2;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}
.tr-input:focus { border-color: rgba(56, 189, 248, 0.7); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1); }
.tr-input:disabled { opacity: 0.45; }
.tr-hint { font-size: 10px; color: var(--muted-2); text-align: center; }

/* ------------------------------------------------------------ бункер */
.bunker-shell { width: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.bunker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bunker-role { font-size: 12px; font-weight: 700; color: #ffd76a; }
.bunker-round { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; }
.bunker-crisis {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 129, 0.3);
  background: radial-gradient(circle at 50% 0%, rgba(255, 77, 99, 0.12), transparent 70%), rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bunker-crisis-label { font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.bunker-crisis strong { font-size: 15px; }
.bunker-stats { display: flex; flex-direction: column; gap: 5px; }
.bunker-stat {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 30px 92px;
  gap: 8px;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
}
.bunker-stat strong { text-align: right; color: #dfe3ef; font-variant-numeric: tabular-nums; }
.bunker-stat small { color: var(--muted-2); font-size: 9px; text-align: right; }
.bunker-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bunker-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ffd76a, #ff8a5c); transition: width 0.25s; }
.bunker-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bunker-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: #e6e8f2;
  text-align: left;
}
.bunker-card:hover:not(:disabled) { border-color: rgba(255, 215, 106, 0.5); background: rgba(255, 215, 106, 0.08); }
.bunker-card:disabled { opacity: 0.4; cursor: default; }
.bunker-card-icon { font-size: 20px; }
.bunker-card strong { font-size: 12px; }
.bunker-card small { font-size: 9.5px; color: var(--muted-2); }
.bunker-foot {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted);
}
.bunker-points strong { color: #8ff0d9; }
.bunker-status { color: #ffd76a; }
.bunker-log { display: flex; flex-direction: column; gap: 2px; color: var(--muted-2); font-size: 9.5px; }
@media (max-width: 520px) {
  .bunker-cards { grid-template-columns: 1fr; }
  .bunker-stat { grid-template-columns: 46px minmax(0, 1fr) 26px; }
  .bunker-stat small { display: none; }
}

/* ------------------------------------------------------------ квиз */
.quiz-shell { width: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.quiz-head strong { color: #dfe3ef; }
.quiz-question {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.025);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: #e6e8f2;
  font-size: 12px;
  text-align: left;
}
.quiz-option:hover:not(:disabled) { border-color: rgba(56, 189, 248, 0.55); background: rgba(56, 189, 248, 0.09); }
.quiz-option:disabled { opacity: 0.4; cursor: default; }
.quiz-letter {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(124, 108, 255, 0.2);
  color: #c9c2ff;
  font-size: 10px;
  font-weight: 800;
  flex: 0 0 auto;
}
.quiz-foot {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 520px) {
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-question { font-size: 15px; }
}

/* ------------------------------------------------------------ репорты */
.report-msg {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.1);
  color: #ff9aa7;
  font-size: 10px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.general-msg:hover .report-msg,
.chat-msg:hover .report-msg,
.report-msg:focus { opacity: 1; }
.report-msg:hover { background: rgba(255, 107, 129, 0.25); }
.general-msg.reported .g-text,
.chat-msg.reported .bubble {
  outline: 2px solid #ffd76a;
  outline-offset: 2px;
  background: rgba(255, 215, 106, 0.14) !important;
  border-radius: 8px;
  animation: reportPulse 1.4s ease-in-out 2;
}
@keyframes reportPulse {
  0%, 100% { outline-color: rgba(255, 215, 106, 0.95); }
  50% { outline-color: rgba(255, 215, 106, 0.3); }
}
.report-snippet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
}
.report-snippet strong { color: #ff9aa7; font-size: 11px; }
.report-snippet span { color: #dfe3ef; font-size: 12px; line-height: 1.45; }
.report-reason { width: 100%; height: auto; min-height: 74px; resize: vertical; padding: 10px; line-height: 1.45; margin-bottom: 12px; }

.report-alert {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  width: min(330px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 129, 0.55);
  background: linear-gradient(160deg, #241622, #120c14);
  box-shadow: 0 24px 70px -20px #000, 0 0 30px -10px rgba(255, 77, 99, 0.5);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: reportIn 0.25s ease-out;
}
@keyframes reportIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ra-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #ff9aa7; }
.ra-head strong { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255, 107, 129, 0.2); color: #ffd0d6; font-size: 10px; }
.ra-body { display: flex; flex-direction: column; gap: 3px; }
.ra-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.ra-title strong { color: #fff; }
.ra-place { color: var(--muted-2); font-size: 9px; }
.ra-text { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.ra-reason { color: #ffd08a; font-size: 9.5px; }
.ra-actions { display: flex; gap: 6px; }
.ra-actions button {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: #e6e8f2;
  font-size: 10px;
  font-weight: 700;
}
.ra-actions button:first-child { border-color: rgba(255, 107, 129, 0.5); background: rgba(255, 107, 129, 0.16); color: #ffd0d6; }
.ra-actions button:hover { border-color: rgba(255, 215, 106, 0.5); color: #fff; }

.admin-report {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 129, 0.25);
  background: rgba(255, 107, 129, 0.045);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-report-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.admin-report-head strong { color: #fff; }
.admin-report-place { color: var(--muted-2); font-size: 9.5px; }
.admin-report-time { margin-left: auto; color: var(--muted-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.admin-report-text {
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid #ff6b81;
  background: rgba(0, 0, 0, 0.22);
  color: #e7e9f4;
  font-size: 11px;
  line-height: 1.45;
  word-break: break-word;
}
.admin-report-meta { font-size: 9.5px; color: var(--muted-2); }
.report-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.report-reasons button {
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.report-reasons button:hover { border-color: rgba(255, 107, 129, 0.5); color: #ffd0d6; background: rgba(255, 107, 129, 0.1); }
.report-context {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 190px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.report-context-line {
  display: flex;
  gap: 6px;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 9.5px;
  color: var(--muted);
}
.report-context-line strong { flex: 0 0 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fe9ff; }
.report-context-line.reported {
  background: rgba(255, 215, 106, 0.14);
  outline: 1px solid rgba(255, 215, 106, 0.5);
  color: #fff;
}
.report-snapshot { font-size: 9.5px; color: var(--muted-2); }

.sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sys-card {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}
.sys-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.06em; }
.sys-head strong { color: #dfe3ef; font-size: 11px; letter-spacing: 0; }
.sys-chart { width: 100%; height: 64px; display: block; margin-top: 6px; }
@media (max-width: 520px) {
  .sys-grid { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .report-msg { opacity: 0.65; }
}
@media (max-width: 520px) {
  .report-alert { left: 10px; right: 10px; bottom: 10px; width: auto; }
}

@media (max-width: 700px) {
  .bs-wrap { grid-template-columns: 1fr; }
  .tr-target { font-size: 14px; padding: 12px; }
  .tr-input { font-size: 13px; }
}

/* ------------------------------------------------------------ ранги */
.rank-iron { --rank: #9ca3af; }
.rank-bronze { --rank: #c47a45; }
.rank-silver { --rank: #c7d2e0; }
.rank-gold { --rank: #f2c14e; }
.rank-platinum { --rank: #7fe4d2; }
.rank-diamond { --rank: #6ec8ff; }
.rank-master { --rank: #b18cff; }
.rank-grandmaster { --rank: #ff8a5c; }
.rank-contender { --rank: #ff6bb5; }
.rank-absolute { --rank: #ff5a1f; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rank) 65%, transparent);
  background: color-mix(in srgb, var(--rank) 14%, transparent);
  color: var(--rank);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
.rank-badge > span { font-size: 9px; line-height: 1; }
.rank-frame {
  outline: 2px solid var(--rank, #9ca3af);
  outline-offset: 2px;
  animation: rankGlow 2.6s ease-in-out infinite;
}
@keyframes rankGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--rank), 0 0 7px color-mix(in srgb, var(--rank) 45%, transparent); }
  50% { box-shadow: 0 0 0 2px var(--rank), 0 0 18px color-mix(in srgb, var(--rank) 70%, transparent); }
}
.rank-absolute.rank-frame {
  outline-color: #ff5a1f;
  animation: absoluteGlow 1.1s ease-in-out infinite alternate;
}
@keyframes absoluteGlow {
  from { box-shadow: 0 0 0 1px #ff5a1f, 0 0 10px #ff3d00, 0 0 20px rgba(255, 179, 0, 0.55); }
  to { box-shadow: 0 0 0 2px #ffb300, 0 0 22px #ff3d00, 0 0 40px rgba(255, 90, 31, 0.85); }
}

.absolute-trail { position: relative; }
.absolute-trail::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 0, 0.65), rgba(255, 61, 0, 0.32) 45%, transparent 70%);
  filter: blur(4px);
  z-index: -1;
  pointer-events: none;
  animation: absoluteTrail 0.65s ease-in-out infinite alternate;
}
@keyframes absoluteTrail {
  from { transform: scale(0.85); opacity: 0.55; }
  to { transform: scale(1.18); opacity: 1; }
}
.absolute-hand .d-card {
  animation: cardFire 0.9s ease-in-out infinite alternate;
}
@keyframes cardFire {
  from { box-shadow: 0 0 6px rgba(255, 90, 31, 0.45), 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
  to { box-shadow: 0 0 18px rgba(255, 179, 0, 0.85), 0 6px 10px -4px rgba(0, 0, 0, 0.7); }
}

.admin-rank-line { color: #c9c2ff !important; }
.admin-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px dashed var(--stroke);
}
.admin-rating-value { font-size: 9.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.admin-rank-select {
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--stroke);
  background: #141826;
  color: #e6e8f2;
  font-size: 9.5px;
}
.admin-related { color: #9fe9ff !important; }

@media (prefers-reduced-motion: reduce) {
  .rank-frame, .rank-absolute.rank-frame, .absolute-trail::after, .absolute-hand .d-card { animation: none !important; }
}

