/* whodunsaid - Farben und Masse stammen direkt aus den Mockups */

:root {
  --bg:          #e7e2d8;
  --card:        #f4efe6;
  --ink:         #14120f;
  --ink-2:       #211f1c;
  --accent:      #ff5638;
  --accent-soft: #f5e6db;
  --line:        rgba(20, 18, 15, .13);
  --line-soft:   rgba(20, 18, 15, .07);
  --muted:       rgba(20, 18, 15, .55);
  --muted-2:     rgba(20, 18, 15, .38);

  --dc-bg:     #313338;
  --dc-head:   #2b2d31;
  --dc-foot:   #1e1f22;
  --dc-ghost:  #383a40;
  --dc-target: #443638;
  --dc-text:   #dbdee1;
  --dc-muted:  #949ba4;

  --ff-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --ff-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --wrap: 820px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 20px 64px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------- Bausteine */

.display {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.05;
  margin: 0;
  font-size: clamp(30px, 5.5vw, 44px);
}

.eyebrow,
.label {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.label-light { color: var(--dc-muted); }
.eyebrow-on-accent { color: rgba(20, 18, 15, .62); }

.lede {
  color: var(--muted);
  max-width: 46ch;
  margin: 12px 0 26px;
}

.hint { font-size: 13px; color: var(--muted-2); margin: 8px 0; }
.err  { font-size: 13px; color: var(--accent); font-weight: 600; margin: 10px 0 0; }

.card {
  background: var(--card);
  border-radius: var(--r-lg);
  max-width: var(--wrap);
  margin: 0 auto 20px;
  overflow: hidden;
}

.card-pad { padding: 26px 24px 28px; }

.card-dark {
  background: var(--ink);
  color: var(--card);
  padding: 22px 24px 24px;
}

.btn-dark,
.btn-ghost {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}

.btn-dark  { background: var(--ink); color: var(--card); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }

.btn-dark:hover,
.btn-ghost:hover { transform: translateY(-1px); }
.btn-dark:disabled { opacity: .4; cursor: default; transform: none; }

.linky {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 12px;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

input[type=text],
input[type=password] {
  font-family: var(--ff-body);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .6);
  color: var(--ink);
  width: 100%;
}

input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ Kopf */

.topbar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
}

.topnav { display: flex; align-items: center; gap: 4px; }

.navlink {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}

.navlink.is-active { background: var(--ink); color: var(--card); }

.lang-toggle {
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  margin-left: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

/* ----------------------------------------------------------- Discord-Teil */

.chat {
  max-width: var(--wrap);
  margin: 0 auto;
  background: var(--dc-bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  color: var(--dc-text);
}

.chat-head {
  background: var(--dc-head);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-head-left { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-head-right { display: flex; align-items: center; gap: 12px; }

.hash { color: var(--dc-muted); font-size: 18px; }
.chan { font-weight: 700; font-size: 15px; color: #fff; }
.srv  { color: var(--dc-muted); font-size: 13px; }

.daynum {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--dc-muted);
  text-transform: uppercase;
}

.streak-pill {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.chat-body { padding: 6px 0; }

.msg { display: flex; gap: 14px; padding: 12px 22px; }
.msg-ghost { opacity: .58; }
.msg-ghost .msg-text { font-size: 15px; }

.msg-target {
  background: var(--dc-target);
  border-left: 3px solid var(--accent);
  padding-left: 19px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.avatar-blank { background: rgba(255, 255, 255, .09); }
.avatar-q     { background: #4e5058; font-size: 18px; }
.avatar-lg    { width: 52px; height: 52px; flex-basis: 52px; font-size: 16px; }

.msg-main { min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 3px; flex-wrap: wrap; }
.msg-author { font-weight: 600; color: #f2f3f5; font-size: 15px; }
.msg-time   { font-size: 12px; color: var(--dc-muted); }
.msg-text   { color: var(--dc-text); overflow-wrap: anywhere; }

.msg-text-big {
  font-size: clamp(17px, 2.6vw, 21px);
  color: #fff;
  line-height: 1.35;
}

.redacted {
  background: rgba(255, 86, 56, .17);
  color: var(--accent);
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--r-sm);
}

.chat-foot { background: var(--dc-foot); padding: 20px 22px 22px; }

.foot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.foot-head .label { margin-bottom: 12px; }

.onceonly { font-size: 12px; color: var(--dc-muted); }

/* ------------------------------------------------------------ Verdächtige */

.suspect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.suspect {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--dc-bg);
  border: 1px solid transparent;
  color: #f2f3f5;
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: transform .12s ease, border-color .12s ease;
}

.suspect:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 255, 255, .18); }
.suspect:disabled { cursor: default; opacity: .45; }
.suspect.is-pending { border-color: var(--accent); }

.suspect .avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
.suspect span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Auf hellem Grund im Onboarding */
#ob-members .suspect { background: rgba(20, 18, 15, .05); color: var(--ink); }
#ob-members .suspect:hover:not(:disabled) { border-color: var(--line); }

/* ------------------------------------------------------------------ Clues */

.clues { margin-top: 22px; }
.clues .label { margin-bottom: 10px; }

.clue-row { display: flex; flex-wrap: wrap; gap: 8px; }

.clue {
  font-size: 13px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  background: var(--dc-bg);
  color: var(--dc-text);
  border: 0;
  font-family: var(--ff-body);
}

.clue-locked {
  color: var(--dc-muted);
  cursor: pointer;
  border: 1px dashed rgba(255, 255, 255, .16);
  background: transparent;
}

.clue-locked:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }

/* --------------------------------------------------------------- Ergebnis */

.reveal { background: var(--accent); padding: 22px 24px 26px; color: var(--ink); }

.reveal.is-wrong { background: var(--ink); color: var(--card); }
.reveal.is-wrong .eyebrow-on-accent,
.reveal.is-wrong .reveal-note { color: rgba(244, 239, 230, .7); }
.reveal.is-wrong .label { color: rgba(244, 239, 230, .55); }

.reveal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.reveal-top .eyebrow { margin-bottom: 16px; }

.reveal-streak { text-align: right; flex: 0 0 auto; }
.reveal-streak .label { display: block; margin: 0 0 2px; }
.reveal-streak b { font-family: var(--ff-display); font-size: 36px; font-weight: 400; line-height: 1; }

.reveal-main { display: flex; align-items: center; gap: 16px; }
.reveal-main .display { font-size: clamp(26px, 4.6vw, 38px); }

.reveal-note { margin: 6px 0 0; font-size: 14px; color: rgba(20, 18, 15, .68); }

.quote-block { padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }

.quote-block blockquote {
  font-family: var(--ff-display);
  font-size: clamp(17px, 2.7vw, 22px);
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.quote-meta {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-2);
  margin: 12px 0 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.quote-meta a { color: var(--muted); }

.dist { padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }

.dist-row { display: flex; align-items: center; gap: 14px; margin-bottom: 9px; font-size: 14px; }
.dist-name { flex: 0 0 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dist-bar {
  flex: 1;
  height: 17px;
  border-radius: 3px;
  background: rgba(20, 18, 15, .1);
  overflow: hidden;
}

.dist-fill { height: 100%; background: rgba(20, 18, 15, .3); border-radius: 3px; }
.dist-row.is-answer .dist-fill { background: var(--accent); }
.dist-pct { flex: 0 0 42px; text-align: right; font-family: var(--ff-mono); font-size: 12px; color: var(--muted); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 22px 24px 24px;
}

.week { display: flex; gap: 5px; margin-bottom: 10px; }

.week i {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  display: block;
}

.week i.hit  { background: var(--ink); }
.week i.miss { background: rgba(20, 18, 15, .16); }
.week i.none { background: transparent; border: 1px solid var(--line); }

.never-row {
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(20, 18, 15, .04);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.never-row .dot { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px; }
.never-row .pct { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted-2); font-family: var(--ff-mono); }

.next-round {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 24px 22px;
  margin: 0;
}

/* ----------------------------------------------------------- Leaderboard */

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.seg { display: flex; gap: 6px; }

.seg-btn {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 17px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn.is-active { background: var(--ink); color: var(--card); border-color: var(--ink); }

.tbl { width: 100%; border-collapse: collapse; }

.tbl th {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
}

.tbl th:first-child { text-align: left; width: 34px; }
.tbl th:nth-child(2) { text-align: left; }

.tbl td {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tbl td:first-child { text-align: left; font-family: var(--ff-mono); font-size: 13px; color: var(--muted); }
.tbl td:nth-child(2) { text-align: left; }

.tbl tr.is-you td { background: var(--accent-soft); }
.tbl tr.is-you td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.tbl tr.is-top td:first-child { color: var(--accent); font-weight: 700; }

.member-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.member-cell .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; }

.you-tag {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .1em;
  background: var(--ink);
  color: var(--card);
  padding: 3px 6px;
  border-radius: 3px;
}

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.tile { background: var(--ink-2); border-radius: var(--r-md); padding: 16px 17px 18px; }

.tile b {
  display: block;
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 12px;
}

.tile.is-plain b { color: var(--card); }
.tile strong { display: block; font-size: 14px; margin-bottom: 4px; }
.tile span { font-size: 12px; color: rgba(244, 239, 230, .55); line-height: 1.4; }

/* ------------------------------------------------------------- Onboarding */

.ob-manual { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ob-manual input { flex: 1; min-width: 180px; }
.ob-manual .btn-dark { flex: 0 0 auto; }

.restore { margin-top: 24px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.restore summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.restore-body { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.restore-body .hint { flex: 1 0 100%; margin: 0 0 4px; }
.restore-body input { flex: 1; min-width: 200px; font-family: var(--ff-mono); font-size: 13px; }

/* ------------------------------------------------------------------ Rest */

.empty-note {
  max-width: var(--wrap);
  margin: 20px auto;
  padding: 26px;
  background: var(--card);
  border-radius: var(--r-lg);
  color: var(--muted);
  text-align: center;
}

.foot {
  max-width: var(--wrap);
  margin: 26px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted-2);
}

.foot-link { color: var(--muted-2); text-decoration: none; }
.foot-link:hover { color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--card);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 50;
}

.setup-hint {
  max-width: var(--wrap);
  margin: 20px auto 0;
  padding: 13px 17px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
}

.setup-hint a { color: var(--ink); }

/* Passwortschleuse */
.gate { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.gate-card { background: var(--card); border-radius: var(--r-lg); padding: 34px 30px; max-width: 380px; width: 100%; }
.gate-card .display { margin: 6px 0 8px; }
.gate-hint { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
#gate-form { display: flex; gap: 10px; flex-wrap: wrap; }
#gate-form input { flex: 1; min-width: 150px; }

/* ------------------------------------------------------------ Schmale Sicht */

@media (max-width: 620px) {
  body { padding: 0 13px 48px; }
  .suspect-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: 1fr; gap: 24px; }
  .tiles { grid-template-columns: 1fr; }
  .msg { padding: 11px 15px; }
  .msg-target { padding-left: 12px; }
  .chat-head, .chat-foot { padding-left: 15px; padding-right: 15px; }
  .reveal, .quote-block, .dist, .result-grid, .card-pad { padding-left: 17px; padding-right: 17px; }
  .next-round { padding-left: 17px; padding-right: 17px; }
  .dist-name { flex-basis: 74px; font-size: 13px; }
  .tbl th:nth-child(3), .tbl td:nth-child(3) { display: none; }
  .avatar { width: 34px; height: 34px; flex-basis: 34px; }
}

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

/* ------------------------------------------------ Name nachtragen */

.join {
  margin-top: 22px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

.join-quiet {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.join-text {
  margin: 2px 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.join-quiet .join-text { margin: 0; }

.code-line {
  margin: 0;
  font-family: var(--ff-mono);
  font-size: 18px;
  letter-spacing: 0.08em;
}

.join-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.join-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  font: inherit;
  font-size: 15px;
  color: inherit;
}

.join-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.suspect-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.suspect-grid-sm .suspect {
  padding: 9px 11px;
  font-size: 14px;
}

.foot-link + .foot-link { margin-left: 14px; }

button.foot-link {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 520px) {
  .join-row { flex-wrap: wrap; }
  .join-row input { flex-basis: 100%; }
  .join-row .btn-dark { width: 100%; }
}
