:root {
  --bg: #0b0f17;
  --bg2: #121824;
  --panel: rgba(18, 24, 36, 0.88);
  --panel-solid: #151c2a;
  --border: rgba(244, 232, 206, 0.14);
  --brass: #e8b85b;
  --brass-dim: rgba(232, 184, 91, 0.18);
  --crimson: #d8434a;
  --crimson-dim: rgba(216, 67, 74, 0.2);
  --emerald: #26a67a;
  --emerald-dim: rgba(38, 166, 122, 0.2);
  --ivory: #f6eedb;
  --paper: #f7f0de;
  --ink: #171512;
  --muted: rgba(246, 238, 219, 0.68);
  --font:
    "Cairo",
    "Geeza Pro",
    "Segoe UI",
    system-ui,
    sans-serif;
  --mono:
    ui-monospace,
    "SFMono-Regular",
    Menlo,
    Consolas,
    monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      #192235 0%,
      var(--bg) 68%);
  color: var(--ivory);
  font-family: var(--font);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
.hidden {
  display: none !important;
}
.cb-chip {
  display: inline-flex;
  align-items: center;
  grid-gap:8px;gap:8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 246, 224, 0.07);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--ivory);
  transition:
    border-color 0.2s,
    background 0.2s,
    opacity 0.2s;
}
.cb-chip.done {
  border-color: var(--emerald);
  background: var(--emerald-dim);
}
.cb-chip.off {
  opacity: 0.45;
}
.cb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-gap:8px;gap:8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  font-family: var(--font);
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  background: var(--brass);
  color: #16120b;
  box-shadow: 0 8px 24px rgba(232, 184, 91, 0.28);
  transition: transform 0.12s, opacity 0.15s;
}
.cb-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.cb-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.cb-btn.ghost {
  background: rgba(255, 246, 224, 0.08);
  color: var(--ivory);
  border: 1px solid var(--border);
  box-shadow: none;
}
.cb-btn.danger {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 8px 24px rgba(216, 67, 74, 0.3);
}
.cb-btn.small {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 9px;
}
.cb-seg {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  grid-gap:3px;gap:3px;
  flex-wrap: wrap;
}
.cb-seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.cb-seg button.on {
  background: var(--brass);
  color: #16120b;
}
.cb-tv {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(232, 184, 91, 0.08),
      transparent 42%),
    radial-gradient(
      circle at 80% 90%,
      rgba(216, 67, 74, 0.07),
      transparent 45%),
    var(--bg);
}
.cb-topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:16px;gap:16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 13, 21, 0.78);
  backdrop-filter: blur(12px);
}
.cb-brand-wrap {
  display: flex;
  align-items: center;
  grid-gap:12px;gap:12px;
  min-width: 0;
}
.cb-badge-enamel {
  background:
    linear-gradient(
      180deg,
      #1b58a8,
      #113a73);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.cb-top-title {
  font-weight: 900;
  font-size: 18px;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-top-meta {
  display: flex;
  align-items: center;
  grid-gap:10px;gap:10px;
  flex-wrap: wrap;
}
.cb-pill {
  display: inline-flex;
  align-items: center;
  grid-gap:6px;gap:6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 246, 224, 0.08);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
}
.cb-pill.brass {
  border-color: rgba(232, 184, 91, 0.5);
  color: var(--brass);
}
.cb-pill.crimson {
  border-color: rgba(216, 67, 74, 0.55);
  color: #ff8a8f;
}
.cb-clock {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
  min-width: 48px;
  text-align: center;
  color: var(--brass);
}
.cb-clock.low {
  color: var(--crimson);
  animation: cbPulse 0.7s infinite;
}
@keyframes cbPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}
.cb-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
}
.cb-lobby-wrap {
  margin: auto;
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  grid-gap:20px;gap:20px;
}
.cb-hero {
  text-align: center;
}
.cb-hero h1 {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 58px);
  font-weight: 900;
  color: var(--ivory);
  letter-spacing: -0.5px;
}
.cb-hero p {
  margin: 6px 0 0;
  font-size: clamp(14px, 1.5vw, 20px);
  color: var(--brass);
  font-weight: 700;
}
.cb-lobby-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  grid-gap:20px;gap:20px;
  align-items: stretch;
}
.cb-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}
.cb-joinbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  grid-gap:8px;gap:8px;
}
.cb-url {
  color: var(--brass);
  font-weight: 800;
  font-size: 16px;
  direction: ltr;
}
.cb-code {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #fff;
  direction: ltr;
  line-height: 1.05;
}
#qr {
  background: var(--paper);
  padding: 10px;
  border-radius: 12px;
  margin-top: 4px;
}
.cb-roster {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  grid-gap:16px;gap:16px;
}
.cb-roster h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--brass);
  font-weight: 800;
}
.cb-chips {
  display: flex;
  flex-wrap: wrap;
  grid-gap:8px;gap:8px;
}
.cb-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  grid-gap:12px 18px;gap:12px 18px;
}
.cb-ctl-group {
  display: inline-flex;
  align-items: center;
  grid-gap:8px;gap:8px;
  flex-wrap: wrap;
}
.cb-ctl-lbl {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.cb-board-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  grid-gap:10px;gap:10px;
}
.cb-scene-strip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:16px;gap:16px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(247, 240, 222, 0.96);
  color: var(--ink);
  border-inline-start: 6px solid var(--crimson);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.cb-scene-text {
  font-size: clamp(13px, 1.35vw, 18px);
  font-weight: 800;
  line-height: 1.35;
}
.cb-scene-tag {
  font-size: 12px;
  font-weight: 900;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.cb-audit-bar {
  display: flex;
  grid-gap:8px;gap:8px;
  flex-wrap: wrap;
}
.cb-audit-chip {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(216, 67, 74, 0.14);
  border: 1px solid rgba(216, 67, 74, 0.45);
  color: #8f1d22;
  white-space: nowrap;
}
.cb-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 118px repeat(4, minmax(0, 1fr));
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
  grid-gap:8px;gap:8px;
}
.cb-col-head {
  background: rgba(20, 27, 41, 0.92);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brass);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  grid-gap:10px;gap:10px;
}
.cb-sus-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brass-dim);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}
.cb-sus-name {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.15;
}
.cb-sus-role {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.cb-row-head {
  background: rgba(15, 20, 31, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--brass);
  line-height: 1.3;
}
.cb-cell {
  background: rgba(255, 246, 224, 0.035);
  border: 1px dashed rgba(255, 246, 224, 0.12);
  border-radius: 10px;
  padding: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  grid-gap:6px;gap:6px;
}
.cb-clue-tile {
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 800;
  line-height: 1.32;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border-inline-start: 4px solid var(--brass);
  position: relative;
}
.cb-clue-tile.src-shredder {
  border-inline-start-color: var(--crimson);
  background: #fff0f0;
}
.cb-clue-tile.src-interrogation {
  border-inline-start-color: #2c7be5;
  background: #edf5ff;
}
.cb-clue-tile.fresh {
  animation: pinDrop 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  box-shadow: 0 0 0 2px var(--brass), 0 8px 20px rgba(0, 0, 0, 0.45);
}
@keyframes pinDrop {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.cb-clue-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:6px;gap:6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #5c5142;
  margin-bottom: 3px;
}
.cb-board-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:14px;gap:14px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(15, 21, 33, 0.92);
  border: 1px solid var(--border);
}
.cb-banner-msg {
  font-weight: 900;
  font-size: clamp(14px, 1.4vw, 19px);
  color: var(--brass);
}
.cb-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cb-modal {
  width: 100%;
  max-width: 880px;
  background: var(--panel-solid);
  border: 1px solid rgba(232, 184, 91, 0.35);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-gap:16px;gap:16px;
}
.cb-modal h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  color: var(--brass);
}
.cb-suspect-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap:12px;gap:12px;
  width: 100%;
}
.cb-suspect-card {
  background: rgba(255, 246, 224, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-gap:6px;gap:6px;
}
.cb-suspect-card.culprit {
  border-color: var(--crimson);
  background: var(--crimson-dim);
}
.cb-burn-card {
  width: 100%;
  max-width: 620px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  padding: 24px 28px;
  position: relative;
  border-top: 6px solid var(--crimson);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: burnFlip 0.45s cubic-bezier(0.2, 1.25, 0.4, 1) both;
}
@keyframes burnFlip {
  0% {
    opacity: 0;
    transform: perspective(700px) rotateX(-38deg) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: perspective(700px) rotateX(0deg) scale(1);
  }
}
.cb-stamp {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 10px;
}
.cb-stamp.smoking_gun {
  background: var(--crimson);
  color: #fff;
}
.cb-stamp.alibi {
  background: #1d64c4;
  color: #fff;
}
.cb-stamp.red_herring,
.cb-stamp.noise {
  background: #4a453b;
  color: #f6eedb;
}
.cb-end-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap:12px;gap:12px;
  width: 100%;
}
.cb-stat-box {
  background: rgba(255, 246, 224, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.cb-stat-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.cb-stat-val {
  font-size: 22px;
  font-weight: 900;
  margin-top: 4px;
  color: var(--ivory);
}
.cb-phone {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.cb-p-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:10px;gap:10px;
  padding: 12px 16px;
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.cb-p-brand {
  font-weight: 900;
  font-size: 16px;
  color: var(--brass);
}
.cb-p-me {
  display: inline-flex;
  align-items: center;
  grid-gap:7px;gap:7px;
  font-weight: 800;
  font-size: 13px;
}
.cb-p-main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  grid-gap:14px;gap:14px;
}
.cb-input {
  width: 100%;
  background: rgba(255, 246, 224, 0.07);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--ivory);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
}
.cb-input.code {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
  direction: ltr;
}
.cb-lbl {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.cb-err {
  background: var(--crimson-dim);
  border: 1px solid var(--crimson);
  color: #ffb0b3;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.cb-peek-box {
  border-radius: 14px;
  border: 1.5px dashed rgba(232, 184, 91, 0.55);
  background: rgba(232, 184, 91, 0.08);
  padding: 14px;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: pointer;
}
.cb-peek-box.peeking {
  border-style: solid;
  background: rgba(15, 22, 34, 0.98);
  border-color: var(--brass);
}
.cb-peek-box.peeking.mole {
  border-color: var(--crimson);
  background: rgba(65, 14, 18, 0.92);
}
.cb-hand-card {
  width: 100%;
  text-align: start;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  grid-gap:8px;gap:8px;
  transition:
    transform 0.12s,
    border-color 0.15s,
    opacity 0.15s;
}
.cb-hand-card.pin-sel {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px var(--emerald), 0 10px 24px rgba(38, 166, 122, 0.25);
  transform: translateY(-2px);
}
.cb-hand-card.burn-sel {
  border-color: var(--crimson);
  opacity: 0.78;
}
.cb-hand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap:8px;gap:8px;
  font-size: 12px;
  font-weight: 800;
  color: #5b4f3d;
}
.cb-hand-text {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
}
.cb-hand-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
  align-self: flex-start;
}
.cb-hand-badge.pin {
  background: var(--emerald);
  color: #fff;
}
.cb-hand-badge.burn {
  background: var(--crimson);
  color: #fff;
}
.cb-hand-badge.threat {
  background: #2b1012;
  color: #ff8a8f;
  border: 1px solid var(--crimson);
}
.cb-opt {
  width: 100%;
  text-align: start;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(255, 246, 224, 0.06);
  border: 1.5px solid var(--border);
  color: var(--ivory);
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  grid-gap:3px;gap:3px;
}
.cb-opt.on {
  border-color: var(--brass);
  background: var(--brass-dim);
}
.cb-opt small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
}
.cb-sus-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap:8px;gap:8px;
}
.cb-timer-pill {
  align-self: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 900;
  color: var(--brass);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 246, 224, 0.07);
  border: 1px solid var(--border);
}
.cb-vipbar {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.cb-flash {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--crimson);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
@media (max-width: 900px) {
  .cb-lobby-grid {
    grid-template-columns: 1fr;
  }
  .cb-suspect-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[dir=rtl] .cb-scene-strip{border-right:6px solid var(--crimson)}
[dir=ltr] .cb-scene-strip{border-left:6px solid var(--crimson)}
[dir=rtl] .cb-clue-tile{border-right:4px solid var(--brass)}
[dir=ltr] .cb-clue-tile{border-left:4px solid var(--brass)}