﻿:root {
  --bg: #0A0A0B;
  --bg-2: #0E0F12;
  --surface: #1C1F26;
  --text: #F2F3F5;
  --text-2: #A8ADB6;
  --text-3: #70757E;
  --accent: #9AD8FF;
  --accent-2: #9DB4FF;
  --ok: #A8E6B8;
  --warn: #F6D58E;
  --bad: #FFB4A2;
  --chrome-text: linear-gradient(#FFFFFF 0%, #B4BAC4 100%);
  --pearl: radial-gradient(circle at 32% 28%, #FFF 0%, #CFE0F2 20%, #59616E 62%, #121418 100%);
  --glass: linear-gradient(135deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 45%, rgba(255,255,255,.07) 100%);
  --glass-shadow: inset 2px 2px 1px -1px rgba(255,255,255,.42), inset -1px -1px 1px -1px rgba(255,255,255,.2),
    inset 0 0 32px rgba(255,255,255,.035), 0 24px 60px rgba(0,0,0,.45);
  --glow: 0 0 18px rgba(160,200,255,.45);
  --hair: rgba(255,255,255,.14);
  --ease: cubic-bezier(.2,.7,.2,1);
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(at 82% 0%, #1C1F26 0%, #0E0F12 52%, #0A0A0B 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 400 1rem/1.4 'Onest', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .eyebrow { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.muted { color: var(--text-2); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: var(--accent);
}
.eyebrow.dim { color: var(--text-2); font-weight: 400; }
.pearl { width: 9px; height: 9px; border-radius: 50%; background: var(--pearl); box-shadow: var(--glow); flex: none; }

.chrome {
  margin: 0; font-family: 'Unbounded', 'Onest', sans-serif; font-weight: 700; letter-spacing: -1px; line-height: 1.05;
  color: #E6E9EF;
  background: var(--chrome-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
h1.chrome { font-size: clamp(2rem, 7vw, 4.25rem); }
.h2 { font-size: clamp(1.4rem, 4vw, 2.2rem); letter-spacing: -.5px; }
.lead { color: var(--text-2); font-size: 1.05rem; max-width: 34em; margin: 18px 0 28px; }

.card { border-radius: 24px; }
.glass { background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--glass-shadow); }

.btn {
  min-height: 44px; padding: 0 22px; border-radius: 9999px; border: 1px solid var(--hair);
  font: 600 .95rem 'Onest', sans-serif; color: var(--text); background: rgba(255,255,255,.06); cursor: pointer;
  transition: transform .38s var(--ease), background .2s;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(#FFFFFF, #B4BAC4); color: #0A0A0B; border-color: transparent; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(#FFFFFF, #CFE0F2); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 0 16px; font-size: .85rem; }

.pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--hair); font-size: .85rem; font-weight: 500; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 9999px; border: 1px solid var(--hair); font: 600 .62rem 'JetBrains Mono', monospace; letter-spacing: 1.5px; text-transform: uppercase; color: var(--warn); }

input {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--hair);
  background: rgba(0,0,0,.35); color: var(--text); font: 400 1rem 'Onest', sans-serif;
}
input::placeholder { color: var(--text-3); }
input:focus-visible { outline-offset: 0; border-color: var(--accent); }
label { display: block; margin-bottom: 6px; font: 600 .72rem 'JetBrains Mono', monospace; letter-spacing: 2px; text-transform: uppercase; color: var(--text-2); }
small { display: block; margin-top: 6px; color: var(--text-3); font-size: .78rem; }
.err { margin: 12px 0 0; color: var(--bad); font-size: .9rem; }

/* ---------- Р»РѕР±Р±Рё ---------- */
.rooms-wrap { min-height: 208px; }
.sk-room { height: 64px; border-radius: 20px; }
.rooms-wrap .kit-sk-layer { display: grid; gap: 12px; align-content: start; }
.noscript { padding: 24px; color: var(--text); }
.foot { align-items: center; }
.foot-link { color: var(--text-2); }
.foot [data-kit-contacts] { --kit-contacts-border: var(--hair); --kit-contacts-fg: var(--text); --kit-contacts-focus: var(--accent); }
.top, .foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px var(--gutter); }
.foot { color: var(--text-3); font-size: .8rem; padding-top: 40px; padding-bottom: 28px; }
.lobby-grid { position: relative; isolation: isolate; display: grid; gap: 48px; padding: 24px var(--gutter) 220px; max-width: 1200px; margin: 0 auto; }
.lobby-hero, .lobby-rooms { position: relative; z-index: 1; }
.enter { padding: 22px; display: grid; gap: 18px; max-width: 460px; }
.enter .btn { width: 100%; }
.lobby-rooms .h2 { margin: 14px 0 20px; }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.room-card {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 16px 20px; border-radius: 20px;
  color: var(--text); text-decoration: none; min-height: 64px; transition: transform .38s var(--ease);
}
.room-card:hover { transform: translateY(-2px); }
.room-card .rn { font: 600 1.1rem 'Unbounded', sans-serif; letter-spacing: -.3px; overflow-wrap: anywhere; }
.room-card .meta { font-size: .72rem; letter-spacing: 1.5px; color: var(--text-2); text-transform: uppercase; }
.room-card .tag { grid-column: 1 / -1; justify-self: start; }

.blob { position: absolute; z-index: 0; right: -40px; bottom: -30px; width: 240px; height: 240px; pointer-events: none; opacity: .8; }
.blob span { position: absolute; border-radius: 50%; filter: blur(.5px); }
.blob span:nth-child(1) { inset: 0; background: conic-gradient(from 210deg at 50% 50%, #9AD8FF, #E7A8F0, #F6D58E, #9DB4FF, #8EE3E0, #9AD8FF); opacity: .35; filter: blur(34px); }
.blob span:nth-child(2) { inset: 30px; background: radial-gradient(circle at 32% 28%, #fff 0%, #CFE0F2 18%, #59616E 60%, #121418 100%); box-shadow: inset 6px 6px 18px rgba(255,255,255,.45), 0 30px 60px rgba(0,0,0,.5); animation: float 9s ease-in-out infinite; }
.blob span:nth-child(3) { width: 70px; height: 70px; right: 18px; bottom: 26px; background: radial-gradient(circle at 32% 28%, #fff, #9AD8FF 30%, #1C1F26 80%); animation: float 7s ease-in-out -3s infinite; }
@keyframes float { 50% { transform: translateY(-14px) rotate(4deg); } }

/* ---------- РєРѕРјРЅР°С‚Р° ---------- */
.room { display: flex; flex-direction: column; height: calc(100dvh - 66px); padding: 12px var(--gutter) 0; gap: 10px; max-width: 1400px; margin: 0 auto; }
.room-top { display: flex; align-items: center; gap: 12px; }
.back { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair); color: var(--text); text-decoration: none; font-size: 1.2rem; flex: none; }
.room-title { flex: 1; min-width: 0; }
.room-title h1 { font-size: clamp(1.4rem, 4vw, 2rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; padding-bottom: .1em; }
.status { color: var(--text-2); white-space: nowrap; flex: none; font-size: .78rem; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--warn); }
.status[data-state='open'] { color: var(--text); }
.status[data-state='open']::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status[data-state='retry']::before { background: var(--bad); }

.presence { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.presence .eyebrow { flex: none; }
.users { list-style: none; margin: 0; padding: 2px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.user { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 5px 12px; border-radius: 9999px; border: 1px solid var(--hair); font-size: .85rem; white-space: nowrap; }
.user i { width: 8px; height: 8px; border-radius: 50%; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 9999px; border: 1px solid var(--hair); }
.tabs button { min-height: 44px; border: 0; border-radius: 9999px; background: transparent; color: var(--text-2); font: 600 .95rem 'Onest', sans-serif; cursor: pointer; }
.tabs button[aria-selected='true'] { background: linear-gradient(#FFFFFF, #B4BAC4); color: #0A0A0B; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 9999px; background: var(--accent); color: #0A0A0B; font: 600 .75rem 'JetBrains Mono', monospace; }

.room-grid { flex: 1; min-height: 0; display: flex; padding-bottom: 12px; }
.pane { display: none; flex: 1; min-height: 0; min-width: 0; flex-direction: column; padding: 14px; }
.pane.active { display: flex; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.swatches, .sizes { display: flex; gap: 4px; }
.swatch { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; }
.swatch::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(255,255,255,.3); transition: transform .3s var(--ease); }
.swatch[aria-checked='true']::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); transform: scale(1.05); }
.size { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; }
.size[data-w='2'] { --s: 2px; }
.size[data-w='5'] { --s: 5px; }
.size[data-w='12'] { --s: 12px; }
.size i { width: var(--s); height: var(--s); border-radius: 50%; background: var(--text-2); }
.size[aria-checked='true'] { background: rgba(255,255,255,.12); }
.size[aria-checked='true'] i { background: var(--text); }
#clearBtn { margin-left: auto; }

.stage {
  position: relative; width: 100%; max-width: 100%; border-radius: 18px; overflow: hidden; flex: none;
  background-color: #0B0C0F;
  background-image: radial-gradient(rgba(255,255,255,.1) 1px, transparent 1.2px); background-size: 24px 24px;
  border: 1px solid var(--hair);
}
.stage canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.stage canvas.disabled { cursor: not-allowed; opacity: .7; }
.cursors { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cursor { position: absolute; left: 0; top: 0; transition: left .08s linear, top .08s linear, opacity .4s; }
.cursor.gone { opacity: 0; }
.cursor i { display: block; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.cursor.flip span { left: auto; right: 10px; }
.cursor span { position: absolute; left: 10px; top: 4px; padding: 1px 8px; border-radius: 9999px; background: rgba(10,10,11,.85); border: 1px solid var(--c); font-size: .72rem; white-space: nowrap; }
.hint { margin: 12px 2px 0; font-size: .8rem; }

.chat-pane { padding: 12px; }
.log { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 4px 4px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 92%; align-self: flex-start; padding: 8px 14px 10px; border-radius: 18px 18px 18px 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: rgba(154,216,255,.1); border-color: rgba(154,216,255,.25); }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.msg-head time { margin-left: auto; font-size: .68rem; color: var(--text-2); letter-spacing: 1px; }
.msg p { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.note { align-self: center; color: var(--text-2); font: 400 .72rem 'JetBrains Mono', monospace; letter-spacing: 1.2px; text-transform: uppercase; text-align: center; }
.note.bad { color: var(--bad); }
.typing { min-height: 22px; margin: 0; padding: 2px 6px; color: var(--text-2); font-size: .85rem; }
.chat-form { display: flex; gap: 8px; padding-top: 8px; }
.chat-form input { flex: 1; min-width: 0; }

@media (min-width: 600px) { :root { --gutter: 28px; } .blob { width: 320px; height: 320px; } }

@media (min-width: 900px) {
  :root { --gutter: 48px; }
  .tabs { display: none; }
  .lobby-grid { grid-template-columns: 1.15fr .85fr; gap: 80px; padding-top: 64px; padding-bottom: 0; }
  .blob { right: 0; bottom: 0; width: 400px; height: 400px; }
  .room { padding-top: 20px; gap: 14px; }
  .room-grid { gap: 20px; padding-bottom: 24px; }
  .pane { display: flex; }
  .board-pane { flex: 1 1 auto; overflow-y: auto; }
  .chat-pane { flex: 0 0 380px; }
  .stage { width: min(100%, calc((100dvh - 330px) * 4 / 3)); margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.lobby { overflow-x: clip; }

/* 404 page */
.nf, .nf-foot { --nf-surface: var(--surface); --nf-ink: var(--text); --nf-muted: var(--text-2); --nf-line: var(--hair); --nf-accent: var(--accent); --nf-on: #0A0A0B; --nf-link: var(--accent); --nf-display: "Unbounded", system-ui, sans-serif; --nf-mono: "JetBrains Mono", ui-monospace, monospace; }
.nf { max-width: 760px; margin: 0 auto; padding: clamp(104px, 18vw, 150px) 20px 32px; display: grid; gap: 14px; justify-items: start; color: var(--nf-ink); }
.nf-art { width: min(100%, 360px); color: var(--nf-link); margin-bottom: 6px; }
.nf-art svg { display: block; width: 100%; height: auto; }
.nf-art .l { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.nf-art .m { fill: none; stroke: var(--nf-line); stroke-width: 2.5; stroke-linecap: round; }
.nf-art .d { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-dasharray: 5 6; stroke-linecap: round; opacity: .8; }
.nf-art .f { fill: currentColor; }
.nf-eyebrow { margin: 0; font: 600 13px/1 var(--nf-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--nf-link); }
.nf h1 { margin: 0; font-family: var(--nf-display); font-size: clamp(2rem, 7.5vw, 3.4rem); line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
.nf h1 em { font-style: italic; color: var(--nf-link); }
.nf p:not(.nf-eyebrow) { margin: 0; max-width: 52ch; color: var(--nf-muted); font-size: 1.0625rem; line-height: 1.55; }
.nf-links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.nf-links a { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 9999px; border: 1px solid var(--nf-line); background: var(--nf-surface); color: var(--nf-ink); font-weight: 600; text-decoration: none; }
.nf-links a:hover { border-color: var(--nf-accent); }
.nf-links a.primary { background: var(--nf-accent); border-color: var(--nf-accent); color: var(--nf-on); }
.nf-links a:focus-visible, .nf-foot a:focus-visible { outline: 2px solid var(--nf-accent); outline-offset: 3px; }
.nf-foot { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; color: var(--nf-muted); --kit-contacts-fg: var(--nf-ink); --kit-contacts-border: var(--nf-line); }
.nf-foot > a { color: var(--nf-link); font-weight: 600; }
