/* zayablo board layer — one wall of cards, all topics mixed.
   Loaded next to styles.css: the shell (header, later screens, their buttons)
   lives there, everything below belongs to the wall itself. */

html { height: 100%; }
body[data-screen="wall"] {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
/* Off the wall screen the whole layer steps aside */
body:not([data-screen="wall"]) .board-ui { display: none !important; }
/* display below would otherwise beat the hidden attribute */
[hidden] { display: none !important; }

/* wall ------------------------------------------------------------------ */
#viewport {
  position: fixed; inset: 0; z-index: 0;
  cursor: grab; touch-action: none;
  background:
    radial-gradient(900px 700px at 20% 10%, #17171a 0%, transparent 70%),
    radial-gradient(800px 600px at 85% 80%, #191316 0%, transparent 70%),
    var(--ink);
}
#viewport.dragging { cursor: grabbing; }
#canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

/* Off-screen box used once to read exact card heights */
.measure-box { position: absolute; left: -99999px; top: 0; visibility: hidden; }

.card {
  position: absolute;
  padding: 11px 14px 12px;
  border-radius: 3px;
  background: var(--ink-2);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  transform: rotate(var(--tilt, 0deg));
  will-change: transform;
  transition: opacity .18s;
}
.card-text { margin: 0; font-size: 15px; line-height: 1.42; overflow-wrap: break-word; }
/* Type scales with how short the line is — see sizeClass() in board.js */
.card.sz-1 .card-text { font-size: 20px; line-height: 1.26; letter-spacing: -.02em; font-weight: 600; }
.card.sz-2 .card-text { font-size: 17px; line-height: 1.34; letter-spacing: -.01em; }
.card-cite { margin-top: 7px; font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: break-word; }
.card.tone-1 { background: #171519; }
.card.tone-2 { background: #14171a; }
.card.tone-3 { background: #191614; }

/* Topic tag — the wall has no zones, so every card says where it belongs */
.card-topic {
  display: inline-block; margin: 0 0 8px; padding: 2px 8px 3px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1.3;
  letter-spacing: .01em;
  color: var(--cl, var(--muted));
  background: color-mix(in srgb, var(--cl, #8f8c86) 18%, transparent);
}
.card-topic:hover { background: color-mix(in srgb, var(--cl, #8f8c86) 30%, transparent); }

.card.mine {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 10px 40px rgba(213,43,30,.4);
}
.card.mine .card-cite { color: rgba(255,255,255,.8); }
.card.mine .card-topic { background: rgba(255,255,255,.22); color: #fff; }

/* fixed chrome ---------------------------------------------------------- */
.ui { position: fixed; z-index: 20; }

/* One column under the topbar: wall counter, topic filter, poll. Stacking them
   in flow is what keeps the poll from ever landing on the counter */
.topstack {
  left: 0; right: 0; top: 54px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 12px; pointer-events: none;
}
.topstack > * { pointer-events: auto; }

.tally {
  padding: 7px 15px; border-radius: 999px;
  background: rgba(28,28,31,.94); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.tally strong { font-size: 16px; font-weight: 800; }

.filter-note {
  max-width: 70vw; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(28,28,31,.94); border: 1px solid rgba(255,255,255,.16);
  font-size: 13px; font-weight: 700;
}
.filter-x { margin-left: 9px; color: var(--muted); font-weight: 600; }

/* Above the dock, which is three buttons tall at its tallest (тема отмечена —
   появляется «корень один») */
.zoomer { right: 12px; bottom: 250px; display: flex; flex-direction: column; gap: 7px; }
.zoomer button {
  width: 42px; height: 42px; border-radius: 21px; cursor: pointer;
  background: rgba(28,28,31,.92); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2); color: var(--text);
  font-family: inherit; font-size: 18px; font-weight: 800;
}
.zoomer button#zoom-fit { font-size: 12px; letter-spacing: -.02em; }

.dock {
  left: 0; right: 0; bottom: 0; padding: 30px 12px 14px; pointer-events: none;
  background: linear-gradient(transparent, #0c0c0dcc 34%, #0c0c0df2 70%);
}
.dock > * { pointer-events: auto; }
.dock-btn {
  display: block; width: 100%; padding: 16px 20px; border: 0; border-radius: 3px;
  background: var(--red); color: #fff; cursor: pointer; text-align: center; text-decoration: none;
  font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: -.01em;
}
.dock-btn.next { background: var(--text); color: var(--ink); margin-top: 8px; }
/* Way into the deck. Light on a dark dock and red-lettered, so it reads as a
   second door rather than a second copy of the main button */
.dock-btn.deck { background: var(--text); color: var(--red); margin-top: 8px; }
.hint { margin: 8px 2px 0; font-size: 12px; color: var(--muted); text-align: center; }

.board-answer {
  left: 12px; right: 12px; bottom: 108px;
  padding: 13px 15px; border-radius: 3px;
  background: var(--ink-2); border: 1px solid rgba(255,255,255,.14); border-left: 3px solid var(--red);
}
.board-answer-h { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.board-answer-p { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* far view — cards are a smudge at this size, so the wall answers with a
   summary: every topic and how many people it holds */
.cloud {
  inset: 0; display: none; z-index: 10;
  align-content: center; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 8px 12px; padding: 96px 20px 150px;
  overflow: hidden; pointer-events: none;
  background: rgba(12,12,13,.86);
}
body.far .cloud { display: flex; }
.cloud-item {
  pointer-events: auto; cursor: pointer;
  border: 0; background: none; font-family: inherit; font-weight: 800;
  letter-spacing: -.02em; line-height: 1.05;
  color: var(--cl, var(--text));
}
.cloud-n { margin-left: 6px; font-size: .62em; font-weight: 700; color: var(--muted); }

/* sheet ----------------------------------------------------------------- */
#scrim {
  position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.sheet-open #scrim { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  max-height: 82vh; display: flex; flex-direction: column;
  background: #121214; border-top: 1px solid rgba(255,255,255,.14);
  border-radius: 14px 14px 0 0;
  transform: translateY(102%); transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
body.sheet-open .sheet { transform: none; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.sheet-h { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.sheet-close { background: none; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; font-family: inherit; }
.sheet-body { overflow-y: auto; padding: 6px 16px 22px; -webkit-overflow-scrolling: touch; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid rgba(255,255,255,.22); background: var(--ink-2); color: var(--text);
  border-radius: 999px; padding: 9px 14px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip.picked { background: var(--red); border-color: var(--red); color: #fff; }
.chip-n { opacity: .5; margin-left: 7px; font-size: .84em; font-variant-numeric: tabular-nums; }

/* Writing your own happens in the bot — the site only points there */
.to-bot { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.to-bot-h { margin: 0 0 4px; font-weight: 700; }
.to-bot-p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.to-bot-link {
  display: block; padding: 14px 18px; border-radius: 3px; text-align: center; text-decoration: none;
  border: 1px solid rgba(255,255,255,.3); color: var(--text); font-weight: 800; font-size: 16px;
}

@media (min-width: 800px) {
  .dock { left: auto; right: 0; bottom: 0; width: 380px; background: none; padding: 20px; }
  .board-answer { left: auto; right: 20px; bottom: 116px; width: 340px; }
  .zoomer { bottom: 24px; right: 400px; flex-direction: row; }
  .cloud { padding: 110px 40px 60px; gap: 10px 18px; }
}
