/* PERPLEXED 2.0 — one stylesheet for the team portal and the organiser console.
   Monochrome scanline UI; the only colour is the holographic sheen (badge backs, new evidence). */

@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #ebebe8;
  --paper-2: #f5f5f2;
  --paper-3: #dededa;
  --ink: #0e0e0e;
  --ink-2: #474745;
  --muted: #8b8b87;
  --line: rgba(14, 14, 14, 0.14);
  --line-2: rgba(14, 14, 14, 0.32);
  --holo: linear-gradient(
    115deg,
    #f2d9ff 0%,
    #cfe4ff 28%,
    #d6fbef 52%,
    #fff1c9 76%,
    #f9d5e5 100%
  );
  --scan: repeating-linear-gradient(
    to bottom,
    rgba(14, 14, 14, 0.055) 0 1px,
    transparent 1px 4px
  );
  /* three voices: the pixel face is an accent (logo, clocks, numbers, the login hero),
     the grotesk carries reading and headings, the mono carries labels and records */
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --sans: "Instrument Sans", "Helvetica Neue", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --lav: #8d84c6;
  --r: 4px;
  --shadow:
    0 1px 0 rgba(14, 14, 14, 0.08), 0 12px 32px -18px rgba(14, 14, 14, 0.45);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::after {
  /* faint scanlines over everything, like pin 1 */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: var(--scan);
  opacity: 0.55;
  mix-blend-mode: multiply;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}
a {
  color: inherit;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}
.pixel {
  font-family: var(--pixel);
  letter-spacing: 0;
  line-height: 1.3;
}
.strong {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mono {
  font-family: var(--mono);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.tiny {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.right {
  margin-left: auto;
}
.hidden {
  display: none !important;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  transition:
    transform 0.08s ease,
    background 0.15s ease,
    opacity 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn.ghost:hover {
  border-color: var(--ink);
}
.btn.link {
  background: none;
  border: 0;
  color: var(--ink);
  padding: 4px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.small {
  padding: 4px 10px;
  font-size: 12px;
}
.btn.danger {
  background: transparent;
  color: #a3261b;
  border-color: #a3261b55;
}
.input,
.textarea,
.select {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 9px 11px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(14, 14, 14, 0.08);
}
.textarea {
  resize: vertical;
  min-height: 64px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chip.holo {
  background: var(--holo);
  border-color: transparent;
  color: var(--ink);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.blink {
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- app shell ---------- */
.shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 28px;
  background: rgba(235, 235, 232, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 11px;
  text-decoration: none;
  padding-top: 2px;
}
.logo-mark {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
}
.logo-mark i {
  background: var(--ink);
}
.logo-mark i:nth-child(2),
.logo-mark i:nth-child(4),
.logo-mark i:nth-child(6),
.logo-mark i:nth-child(8) {
  background: transparent;
}
.nav {
  display: flex;
  gap: 4px;
}
.nav a {
  text-decoration: none;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 2px;
  position: relative;
  color: var(--ink-2);
}
.nav a:hover {
  color: var(--ink);
}
.nav a.on {
  color: var(--ink);
}
.nav a.on::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--ink);
}
.nav a .badge {
  position: absolute;
  top: 2px;
  right: 0;
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
}
.clock {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.clock .t {
  font-family: var(--pixel);
  font-size: 17px;
}
.clock .t.low {
  animation: blink 1s steps(2) infinite;
}
.teamtag {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.teamtag b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 28px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.ticker .lbl {
  font-family: var(--pixel);
  font-size: 9px;
  flex: none;
}
.ticker .msg {
  overflow: hidden;
  text-overflow: ellipsis;
}
.page {
  flex: 1;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}
.page.wide {
  max-width: none;
  padding: 0;
  display: flex;
}

.hero-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(32px, 4.4vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero-title .sub {
  display: block;
  color: var(--lav);
}
.hero-title.px {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: center;
}
.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--ink);
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.panel-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-h .strong {
  font-size: 15px;
}
.panel-b {
  padding: 16px;
}
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty .strong {
  display: block;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
.login-art {
  position: relative;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.login-art {
  justify-content: flex-start;
  gap: 28px;
}
.login-art .login-copy {
  margin-top: clamp(16px, 9vh, 120px);
}
.login-art canvas {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
.login-art > .small {
  position: absolute;
  left: 42px;
  bottom: 40px;
  z-index: 1;
  background: var(--paper);
  padding: 2px 6px;
}
.login-art .hero-title {
  font-size: clamp(34px, 5vw, 70px);
  position: relative;
  z-index: 1;
}
.login-art p {
  max-width: 420px;
  position: relative;
  z-index: 1;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.login-form form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.code-input {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 14px;
  text-transform: uppercase;
}
.error {
  color: #a3261b;
  font-size: 13px;
}
@media (max-width: 860px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    min-height: 340px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .login-art canvas,
  .login-art > .small {
    position: static;
    transform: none;
    align-self: center;
  }
  .login-art > .small {
    align-self: flex-start;
  }
}

/* ---------- people: badges on a wire ---------- */
.people-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 26px;
}
.people-head p {
  max-width: 340px;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}
.wire-wrap {
  position: relative;
  padding-top: 34px;
}
.wire {
  position: absolute;
  left: -6px;
  right: -6px;
  top: 18px;
  height: 1px;
  background: var(--ink-2);
  transform: rotate(-0.35deg);
}
.wire::before,
.wire::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}
.wire::before {
  left: 0;
}
.wire::after {
  right: 0;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 34px 30px;
  justify-content: center;
}
.badge-hang {
  position: relative;
  width: 232px;
  transform-origin: 50% -26px;
  animation:
    drop 0.5s cubic-bezier(0.3, 1.4, 0.6, 1) both,
    settle 2.4s ease-out 0.45s both;
}
@keyframes drop {
  from {
    transform: translateY(-60px);
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.badge-hang:nth-child(2n) {
  animation-duration: 2.9s;
}
.badge-hang:nth-child(3n) {
  animation-duration: 2.2s;
}
.badge-hang::before {
  /* lanyard */
  content: "";
  position: absolute;
  left: 50%;
  top: -30px;
  width: 1px;
  height: 32px;
  background: var(--ink-2);
}
.badge-hang:hover {
  animation: sway 1.6s ease-in-out infinite;
}
@keyframes settle {
  0% {
    transform: rotate(5deg);
  }
  25% {
    transform: rotate(-3.2deg);
  }
  50% {
    transform: rotate(1.8deg);
  }
  75% {
    transform: rotate(-0.7deg);
  }
  100% {
    transform: rotate(0);
  }
}
@keyframes sway {
  0%,
  100% {
    transform: rotate(-1.6deg);
  }
  50% {
    transform: rotate(1.6deg);
  }
}
.badge {
  perspective: 1000px;
  width: 232px;
  height: 372px;
  cursor: pointer;
}
.badge-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}
.badge.flipped .badge-inner {
  transform: rotateY(180deg);
}
/* a second guard on the flip: whatever a browser does with 3D, only the face that should be
   showing is visible past the halfway point. Nothing inside a badge may use mix-blend-mode,
   filter or isolation: Firefox then flattens the 3D and shows a face back to front. */
.badge-face {
  transition: visibility 0s linear 0.14s;
}
.badge.flipped .badge-face:not(.badge-back),
.badge:not(.flipped) .badge-back {
  visibility: hidden;
}
.badge-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 22px 16px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.badge-face::before {
  /* the clip hole */
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 34px;
  height: 6px;
  margin-left: -17px;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.badge-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
}
.portrait svg {
  width: 100%;
  height: 100%;
  display: block;
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.05) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
}
.portrait .eyes {
  transform-box: fill-box;
  transform-origin: center;
}
.badge-hang:hover .portrait .eyes {
  animation: eyeblink 3.2s infinite;
}
@keyframes eyeblink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
.badge-name {
  margin-top: 12px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.badge-role {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}
.badge-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}
.meter {
  display: flex;
  gap: 2px;
}
.meter i {
  width: 6px;
  height: 10px;
  background: var(--ink);
}
.meter i.off {
  background: var(--paper-3);
}
.badge-back {
  transform: rotateY(180deg);
  background: var(--holo);
  border-color: transparent;
}
.badge-back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scan);
  opacity: 0.7;
  pointer-events: none;
}
.badge-back .qr {
  width: 64px;
  height: 64px;
  margin-top: auto;
}
.badge-back dl {
  margin: 10px 0 0;
  font-size: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
}
.badge-back dt {
  color: var(--ink-2);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding-top: 2px;
}
.badge-back dd {
  margin: 0;
}
.badge-back .actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
}
.badge.locked .portrait::after {
  background: rgba(240, 238, 233, 0.6);
} /* at HR: washed out, no filter (see the flip note) */
.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  z-index: 2;
  border: 2px solid var(--ink);
  padding: 8px 12px;
  font-family: var(--pixel);
  font-size: 10px;
  background: var(--paper-2);
  text-align: center;
  line-height: 1.2;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- interview room ---------- */
.room {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 340px;
  height: calc(100vh - 61px);
}
.room.has-ticker {
  height: calc(100vh - 61px - 32px);
}
.room-side {
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.room-side .portrait {
  max-width: 180px;
}
.room-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.thread {
  flex: 1;
  overflow-y: auto;
  padding: 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 78%;
  animation: rise 0.35s ease-out both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.msg .who {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.msg .bubble {
  padding: 12px 15px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15.5px;
  line-height: 1.55;
}
.msg.q {
  align-self: flex-end;
}
.msg.q .bubble {
  background: var(--ink);
  color: var(--paper);
}
.msg.q .who {
  text-align: right;
}
.msg.a .bubble {
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.msg.n {
  align-self: stretch;
  max-width: none;
}
.msg.n .bubble {
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(
    135deg,
    var(--paper-2) 0 10px,
    var(--paper) 10px 20px
  );
  font-weight: 500;
}
.msg .cites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
}
.thinking .bars {
  display: flex;
  gap: 3px;
}
.thinking .bars i {
  width: 4px;
  height: 12px;
  background: var(--ink);
  animation: bar 1s ease-in-out infinite;
}
.thinking .bars i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking .bars i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes bar {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}
.composer {
  border-top: 1px solid var(--line);
  padding: 14px 24px 18px;
  background: var(--paper);
}
.composer .textarea {
  min-height: 54px;
  max-height: 180px;
  background: var(--paper-2);
}
.composer .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.closed-note {
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
}
.room-evidence {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pinbtn {
  position: fixed;
  z-index: 80;
}

/* ---------- evidence cards ---------- */
.ev {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 13px;
  animation: rise 0.35s ease-out both;
}
.ev.new {
  border-color: transparent;
  background:
    linear-gradient(var(--paper-2), var(--paper-2)) padding-box,
    var(--holo) border-box;
  border: 2px solid transparent;
}
.ev-h {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.ev-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.ev-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.ev-x {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.ev-x mark {
  background: var(--ink);
  color: var(--paper);
  padding: 0 3px;
}
.ev-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.rec-p {
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.ev-h + .rec-p {
  border-top: 0;
}
.rec-p .btn {
  margin-top: 6px;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* ---------- board ---------- */
.board-wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100vh - 61px);
  width: 100%;
}
.board-wrap.has-ticker {
  height: calc(100vh - 61px - 32px);
}
.board-side {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.board-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  background: var(--paper);
}
.board-area {
  position: relative;
  overflow: auto;
  background-color: var(--paper);
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 24px 24px;
}
.board-surface {
  position: relative;
  width: 3200px;
  height: 2200px;
}
.board-surface svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.board-surface svg line {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.board-surface svg line.hit {
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
  pointer-events: stroke;
}
.board-surface svg line.sel {
  stroke-dasharray: 5 4;
}
.board-surface svg text {
  font: 500 11px var(--mono);
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
}
.bcard {
  position: absolute;
  width: 240px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: grab;
  user-select: none;
  font-size: 13px;
}
.bcard.dragging {
  cursor: grabbing;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.45);
  z-index: 5;
}
.bcard.linking {
  outline: 2px dashed var(--ink);
  outline-offset: 3px;
}
.bcard.note {
  background: #f7f5e8;
}
.bcard.quote {
  border-left: 4px solid var(--ink);
}
.bcard .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.bcard .k button {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0 2px;
}
.bcard .k button:hover {
  color: var(--ink);
}
.bcard .body {
  margin-top: 4px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}
.bcard textarea {
  width: 100%;
  border: 0;
  background: transparent;
  resize: vertical;
  min-height: 60px;
  outline: none;
}
.savestate {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- documents, brief, rounds ---------- */
.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.doc {
  position: relative;
  padding: 18px 16px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.doc:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.doc .fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--paper-3) 50%);
}
.doc .title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.md {
  max-width: 760px;
}
.md {
  font-size: 15.5px;
  line-height: 1.65;
}
.md h1,
.md h2,
.md h3 {
  font-weight: 600;
  margin: 1.2em 0 0.45em;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.md h1 {
  font-size: 28px;
}
.md h2 {
  font-size: 21px;
}
.md h3 {
  font-size: 17px;
}
.md > :first-child {
  margin-top: 0;
}
.md p,
.md ul,
.md ol {
  margin: 0 0 0.9em;
}
.md code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--paper-3);
  padding: 1px 5px;
  border-radius: 2px;
}
.md pre {
  background: var(--ink);
  color: var(--paper);
  padding: 12px;
  overflow: auto;
}
.md blockquote {
  margin: 0 0 1em;
  padding-left: 14px;
  border-left: 3px solid var(--ink);
  color: var(--ink-2);
}
.md hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 1.4em 0;
}
.md table {
  border-collapse: collapse;
  margin-bottom: 1em;
}
.md td,
.md th {
  border: 1px solid var(--line-2);
  padding: 4px 8px;
}
.brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
@media (max-width: 960px) {
  .brief-grid {
    grid-template-columns: 1fr;
  }
}
.rounds {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0 10px;
}
.round {
  position: relative;
  flex: 1 0 170px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  margin-right: -1px;
  background: var(--paper-2);
}
.round .n {
  font-family: var(--pixel);
  font-size: 18px;
  color: var(--paper-3);
  line-height: 1;
}
.round.now {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.round.now .n {
  color: #555;
}
.round.done {
  color: var(--muted);
}
.round .name {
  font-weight: 600;
  font-size: 17px;
  margin-top: 12px;
  letter-spacing: -0.01em;
}
.round .st {
  margin-top: 10px;
}
.result-card {
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 6px 6px 0 var(--ink);
}

/* ---------- modal, toast ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 14, 0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade 0.2s ease-out;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: min(780px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
}
.modal-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper-2);
}
.modal-b {
  padding: 20px 22px;
}
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease-out;
}
.toast.err {
  background: #a3261b;
}
.toast.holo {
  background: var(--holo);
  color: var(--ink);
}

/* ---------- console (organisers) ---------- */
.console {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
.console-nav {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.console-nav a {
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
}
.console-nav a.on {
  background: var(--ink);
  color: var(--paper);
}
.console-main {
  padding: 26px 30px 60px;
  min-width: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.stat {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.stat .v {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 24px;
}
.stat .l {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--paper-2);
}
table.t th {
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  padding: 8px;
  position: sticky;
  top: 0;
  background: var(--paper-2);
}
table.t td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  vertical-align: top;
}
table.t tr:hover td {
  background: var(--paper);
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1000px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}
.codes {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
}
.alert {
  padding: 10px 12px;
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
  font-size: 13px;
}
.alert .q {
  margin-top: 4px;
  white-space: pre-wrap;
}

/* ---------- projector ---------- */
.display {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 40px;
  text-align: center;
}
.display .big {
  font-family: var(--pixel);
  font-size: clamp(56px, 11vw, 170px);
  line-height: 1;
}
.display .ann {
  font-size: clamp(20px, 2.4vw, 34px);
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 1200px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
