:root {
  --ink: #15120f;
  --ink-2: #1e1a16;
  --ink-3: #2a241e;
  --line: #3a322a;
  --paper: #efe5cf;
  --paper-2: #e4d7b9;
  --paper-ink: #2b231b;
  --brass: #c8a24a;
  --red: #b4442f;
  --text: #ece4d6;
  --muted: #a89c8a;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, serif;
  --type: "Special Elite", "Courier New", monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #2b231b 0%, var(--ink) 60%) fixed;
  color: var(--text);
  font: 15px/1.55 var(--sans);
  min-height: 100vh;
}

.top {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: rgba(21, 18, 15, .92); backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.logo { font-family: var(--type); font-size: 22px; letter-spacing: .18em; color: var(--brass); }
.tag { color: var(--muted); font-size: 13px; }
.case-sel {
  background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font: inherit; font-size: 13px; max-width: 240px;
}
.case-sel option { background: var(--ink); color: var(--text); }
.meter { font-size: 13px; color: var(--muted); white-space: nowrap; }
.meter b { color: var(--text); font-weight: 600; }

.btn {
  font: 600 14px var(--sans); cursor: pointer;
  border: 1px solid var(--brass); background: var(--brass); color: var(--ink);
  padding: 9px 16px; border-radius: 8px; transition: filter .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }

.layout {
  display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 24px;
}

/* Dava dosyası */
.paper {
  position: relative; background: var(--paper); color: var(--paper-ink);
  border-radius: 4px; padding: 26px 24px 22px;
  box-shadow: 0 1px 0 #fff6 inset, 0 12px 30px #0008;
  background-image: repeating-linear-gradient(transparent 0 27px, #0000000a 27px 28px);
}
.stamp {
  position: absolute; top: 18px; right: 16px; transform: rotate(8deg);
  font-family: var(--type); color: var(--red); border: 2px solid var(--red);
  padding: 2px 10px; letter-spacing: .2em; opacity: .75; font-size: 14px;
}
.case-no { font-family: var(--type); margin: 0 0 4px; color: #7a6a55; font-size: 13px; }
.paper h1 { font-family: var(--serif); font-size: 28px; line-height: 1.15; margin: 0 0 14px; }
.intro { font-family: var(--serif); font-size: 15.5px; margin: 0 0 16px; }
.victim { border-top: 1px dashed #0003; padding-top: 12px; }
.victim h2, .board h2 {
  font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 6px;
}
.victim p { margin: 0; font-family: var(--serif); }

.board {
  margin-top: 20px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.board-head { display: flex; justify-content: space-between; align-items: baseline; }
.board h2 { color: var(--brass); }
#clueCount { color: var(--muted); font-size: 13px; }
.clues { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.clue {
  background: var(--paper-2); color: var(--paper-ink); border-radius: 4px;
  padding: 10px 12px; position: relative; box-shadow: 0 4px 10px #0006;
}
.clue::before {
  content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px;
  border-radius: 50%; background: var(--red); box-shadow: 0 1px 2px #0008; transform: translateX(-50%);
}
.clue strong { display: block; font-family: var(--type); font-weight: 400; font-size: 14px; margin-bottom: 2px; }
.clue p { margin: 0; font-family: var(--serif); font-size: 14px; }
.clue.fresh { animation: pop .6s ease; outline: 2px solid var(--brass); }
.clue.locked {
  background: transparent; border: 1px dashed var(--line); color: var(--muted);
  box-shadow: none; font-size: 13px; padding: 8px 12px;
}
.clue.locked::before { display: none; }
@keyframes pop { 0% { transform: scale(.96); opacity: .3; } 100% { transform: none; opacity: 1; } }

/* Sorgu odası */
.room { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.suspects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.suspect {
  text-align: left; cursor: pointer; color: var(--text); font: inherit;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; gap: 12px; align-items: center; transition: border-color .15s, background .15s;
}
.suspect:hover { border-color: var(--muted); }
.suspect[aria-selected="true"] { border-color: var(--brass); background: var(--ink-3); }
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 600 16px var(--sans); color: var(--ink);
}
.suspect .name { font-weight: 600; display: block; }
.suspect .job { color: var(--muted); font-size: 12.5px; display: block; }

.chat {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 420px; height: 58vh;
}
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head h3 { margin: 0; font-family: var(--serif); font-size: 18px; }
.chat-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); margin: 0; }
.log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 12px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--brass); color: var(--ink); border-bottom-right-radius: 3px; }
.msg.model {
  align-self: flex-start; background: var(--ink-3); border: 1px solid var(--line);
  border-bottom-left-radius: 3px; font-family: var(--serif); font-size: 15.5px;
}
.msg.system { align-self: center; color: var(--muted); font-size: 13px; background: none; padding: 2px; }
.msg.typing { color: var(--muted); font-style: italic; }
.empty { margin: auto; color: var(--muted); text-align: center; max-width: 320px; font-size: 14px; }

.ask { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ask input {
  flex: 1; min-width: 0; font: 15px var(--sans); color: var(--text);
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.ask input:focus { outline: 2px solid var(--brass); outline-offset: -1px; }

.accuse-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid #b4442f66; background: #b4442f14; border-radius: var(--radius); padding: 12px 16px;
}
.accuse-bar p { margin: 0; color: var(--muted); font-size: 14px; }

/* Diyaloglar */
dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  background: var(--ink-2); color: var(--text); max-width: 520px; width: calc(100% - 32px);
}
dialog::backdrop { background: #000a; }
.dlg { padding: 22px; }
.dlg h2 { font-family: var(--serif); margin: 0 0 6px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.pick { display: grid; gap: 10px; }
.pick .suspect { width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.end p { font-family: var(--serif); font-size: 15.5px; }
.verdict { font-family: var(--type) !important; letter-spacing: .15em; margin: 0; }
.verdict.win { color: var(--brass); }
.verdict.lose { color: var(--red); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--paper); color: var(--paper-ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; box-shadow: 0 10px 30px #000a; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .suspects { grid-template-columns: 1fr; }
  .chat { height: 70vh; }
  .tag { display: none; }
  .top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .case-sel { order: 5; flex: 1 1 100%; max-width: none; }
  .accuse-bar { flex-direction: column; align-items: stretch; text-align: center; }
}
