* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #05070f;
  --panel: rgba(12, 16, 29, 0.88);
  --card: rgba(18, 24, 42, 0.92);
  --border: rgba(212, 175, 55, 0.22);
  --border-soft: rgba(148, 163, 184, 0.18);
  --text: #ece7d5;
  --muted: #9aa5b8;
  --crimson: #881337;
  --crimson-hi: #dc2626;
  --emerald: #064e3b;
  --emerald-hi: #10b981;
  --indigo: #312e81;
  --gold: #eab308;
  --toxic: #22c55e;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.screen {
  position: relative;
  z-index: 10;
  display: none;
  min-height: 100vh;
  padding: 20px;
}
.screen.active { display: flex; flex-direction: column; align-items: center; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.88rem; }

/* ANA MENÜ TIKLANABİLİR GİZLİ İPUÇLARI */
.menu-clues-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
}
.bg-clue {
  position: absolute;
  pointer-events: auto;
  background: rgba(10, 14, 26, 0.72);
  border: 1px solid rgba(255,255,255,0.2);
  color: #e2e8f0;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  
  transition: transform 0.15s, border-color 0.15s;
}
.bg-clue:hover { transform: scale(1.06); border-color: var(--gold); }
.clue-smoke { bottom: 26%; left: 5%; }
.clue-bomb { bottom: 18%; right: 6%; }
.clue-wall { top: 20%; left: 6%; }
.clue-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  animation: pulseDot 1.6s infinite;
}
.clue-pulse.green { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.clue-pulse.red { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.clue-pulse.gold { background: #eab308; box-shadow: 0 0 10px #eab308; }
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.55; }
}
.clue-toast {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--gold);
  color: #fef08a;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  text-align: center;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.25);
}

/* MENU */
.menu-shell { position: relative; z-index: 15; width: 100%; max-width: 720px; margin: auto; display: flex; flex-direction: column; gap: 15px; }
.brand-header { text-align: center; margin-bottom: 4px; }
.brand-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: rgba(153, 27, 27, 0.25); border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fde68a; font-size: 0.74rem; letter-spacing: 1.4px; font-weight: 800;
}
.brand-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.7rem; letter-spacing: 4px; margin: 10px 0 6px;
  color: #fef3c7; text-shadow: 0 0 24px rgba(220, 38, 38, 0.55), 0 4px 16px #000;
}
.brand-sub { color: var(--muted); font-size: 0.94rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  
}

.name-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.field-label { display: block; font-size: 0.76rem; font-weight: 800; color: var(--gold); letter-spacing: 1px; margin-bottom: 6px; }
input[type="text"], select {
  width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.3); background: #070b16; color: #fff; font-size: 0.95rem;
}
.field-hint { display: block; margin-top: 5px; font-size: 0.77rem; color: var(--muted); }

.menu-actions { display: flex; flex-direction: column; gap: 12px; }
.menu-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 18px; border-radius: 14px; border: 1px solid var(--border);
  color: #fff; cursor: pointer; text-align: left; transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
}
.menu-btn:hover { transform: translateY(-2px); filter: brightness(1.12); box-shadow: 0 8px 26px rgba(0,0,0,0.6); }
.btn-crimson { background: linear-gradient(135deg, #5c0f1b, #991b1b); border-color: rgba(248,113,113,0.5); }
.btn-emerald { background: linear-gradient(135deg, #063d2f, #047857); border-color: rgba(52,211,153,0.45); }
.btn-slate { background: linear-gradient(135deg, #101729, #1e293b); }
.btn-indigo { background: linear-gradient(135deg, #1b1745, #312e81); border-color: rgba(129,140,248,0.45); }
.btn-ghost { background: rgba(24, 33, 52, 0.85); border: 1px solid var(--border-soft); color: var(--text); }

.btn-icon {
  width: 44px; height: 44px; border-radius: 11px; background: rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-icon svg { width: 22px; height: 22px; }
.btn-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.btn-text strong { font-size: 0.98rem; letter-spacing: 0.5px; }
.btn-text small { color: rgba(255,255,255,0.78); font-size: 0.8rem; }
.btn-tag { font-weight: 800; font-size: 0.86rem; color: #fde047; }

.btn-sm {
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border);
  color: #fff; cursor: pointer; font-weight: 700; font-size: 0.85rem;
  transition: filter 0.12s, transform 0.1s;
}
.btn-sm:hover { filter: brightness(1.15); }
.btn-sm:active { transform: scale(0.98); }
.btn-sm:disabled { opacity: 0.42; cursor: not-allowed; }

/* LOBİ & TAKIM STEPPERLARI */
.panel-shell { width: 100%; max-width: 1160px; display: flex; flex-direction: column; gap: 13px; }
.panel-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
}
.faction-counts-bar { display: flex; flex-direction: column; gap: 10px; }
.faction-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.faction-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.stepper-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stepper-card {
  background: #0a0f1e; border: 1px solid var(--border-soft); border-radius: 11px;
  padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.stepper-card.locked { opacity: 0.45; }
.stepper-title { font-weight: 800; font-size: 0.82rem; letter-spacing: 0.5px; }
.stepper-controls { display: flex; align-items: center; gap: 12px; }
.step-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #1e293b; color: #fff; font-weight: 900; font-size: 1.05rem; cursor: pointer;
}
.step-btn:hover { background: #334155; }
.step-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.step-val { font-size: 1.3rem; font-weight: 900; min-width: 24px; text-align: center; color: #fef08a; }

.lobby-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--panel); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
}
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.inline-field select { width: auto; padding: 7px 10px; }

.tabs-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-btn {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 700; font-size: 0.86rem;
}
.tab-btn.active { background: #1e293b; border-color: var(--gold); color: var(--gold); }
.tab-btn.locked { opacity: 0.5; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.role-card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.role-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.role-card.selected { border-color: var(--emerald-hi); box-shadow: 0 0 0 1px rgba(16,185,129,0.45); }
.role-card.locked { opacity: 0.48; cursor: not-allowed; }
.role-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.badge-op { background: rgba(220,38,38,0.28); color: #fca5a5; border: 1px solid #ef4444; }
.badge-lock { background: rgba(234,179,8,0.18); color: #fde047; border: 1px solid rgba(234,179,8,0.4); }
.badge-on { background: rgba(16,185,129,0.24); color: #6ee7b7; border: 1px solid #10b981; }

/* ONLINE */
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.room-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.room-code { font-size: 2rem; font-weight: 900; letter-spacing: 6px; color: var(--gold); }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.online-room-body { display: grid; grid-template-columns: 320px 1fr; gap: 14px; margin-top: 14px; }
.simple-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.simple-list li { padding: 8px 10px; background: rgba(15,23,42,0.8); border-radius: 8px; border: 1px solid var(--border-soft); display: flex; justify-content: space-between; }
.mini-chat { height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; padding: 8px; background: #070b16; border-radius: 8px; }
.badge-online { padding: 4px 10px; border-radius: 999px; background: rgba(16,185,129,0.22); color: #6ee7b7; font-size: 0.8rem; font-weight: 700; }

/* CUSTOMIZER & GUIDE */
.customizer-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.char-svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto 12px; background: #070b16; border-radius: 12px; border: 1px solid var(--border); }
.forensic-box { background: rgba(10,15,30,0.9); padding: 10px; border-radius: 10px; font-size: 0.85rem; border: 1px solid var(--border-soft); }
.forensic-box ul { margin-left: 18px; margin-top: 6px; color: #cbd5e1; }
.opt-group { margin-bottom: 14px; }
.opt-group h4 { margin-bottom: 8px; font-size: 0.9rem; color: var(--gold); }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border-soft); background: #0f172a; color: #fff; cursor: pointer; font-size: 0.84rem; }
.opt-chip.active { border-color: var(--emerald-hi); background: rgba(16,185,129,0.22); }

.guide-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
.priority-list, .rules-list { margin-left: 18px; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 0.9rem; line-height: 1.45; }

/* GAME SCREEN & 2D KASABA HARİTASI */
#screen-game { padding: 12px; align-items: stretch; }
.game-topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: var(--panel); padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  margin-bottom: 12px;
}
.top-left, .top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase-pill { padding: 5px 12px; border-radius: 999px; background: #312e81; font-weight: 800; font-size: 0.85rem; }
.phase-pill.day { background: #b45309; }
.alive-pill { padding: 5px 10px; border-radius: 999px; background: rgba(148,163,184,0.16); font-size: 0.82rem; }
.spectator-pill { padding: 5px 10px; border-radius: 999px; background: rgba(234,179,8,0.25); color: #fde047; font-weight: 800; font-size: 0.8rem; border: 1px solid var(--gold); }
.top-center { font-weight: 800; color: #fef3c7; font-size: 0.96rem; }

.game-main { display: grid; grid-template-columns: 1fr 380px; gap: 12px; flex: 1; min-height: calc(100vh - 86px); }
.town-area {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.1s;
}
.town-area.shake { animation: screenShake 0.45s ease-in-out; }
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(8px, -4px); }
  60% { transform: translate(-5px, -3px); }
  80% { transform: translate(5px, 3px); }
}

.town-banner {
  padding: 10px 14px; border-radius: 10px; background: rgba(10, 14, 28, 0.92);
  border-left: 4px solid var(--gold); font-size: 0.9rem;
}

.town-map-stage {
  position: relative;
  flex: 1;
  min-height: 440px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #060913;
}
#townMapCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.houses-map-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.house-card.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 118px;
  background: linear-gradient(180deg, rgba(16, 23, 43, 0.94) 0%, rgba(9, 13, 26, 0.96) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.house-card.map-node:hover {
  transform: translate(-50%, -54%) scale(1.06);
  z-index: 12;
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.8);
}
.house-card.is-me { border-color: var(--gold); box-shadow: 0 0 14px rgba(234,179,8,0.32); }
.house-card.selected { border-color: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.65); z-index: 11; }
.house-card.dead { opacity: 0.65; }
.house-card.in-swamp { border-color: #22c55e; box-shadow: 0 0 16px rgba(34, 197, 94, 0.45); }
.house-card.burning { border-color: #f97316; box-shadow: 0 0 22px rgba(249,115,22,0.75); animation: fireGlow 0.9s infinite alternate; }
@keyframes fireGlow { from { box-shadow: 0 0 12px rgba(249,115,22,0.45); } to { box-shadow: 0 0 28px rgba(239,68,68,0.85); } }

.house-svg { width: 68px; height: 54px; overflow: visible; }
.smoke-puff { animation: riseSmoke 2.4s infinite ease-out; }
@keyframes riseSmoke {
  0% { transform: translateY(0) scale(0.8); opacity: 0.85; }
  100% { transform: translateY(-16px) scale(1.4); opacity: 0; }
}
.flame-flicker { animation: flicker 0.45s infinite alternate; transform-origin: center bottom; }
@keyframes flicker { from { transform: scaleY(0.92); } to { transform: scaleY(1.12); } }

.house-name { font-weight: 800; font-size: 0.8rem; text-align: center; line-height: 1.15; }
.house-role { font-size: 0.68rem; color: var(--muted); text-align: center; }
.house-role.revealed { color: #fde047; font-weight: 800; }
.house-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.clue-tag { font-size: 0.62rem; padding: 1px 5px; border-radius: 5px; font-weight: 700; }
.tag-smoke { background: rgba(34,197,94,0.25); color: #86efac; border: 1px solid #22c55e; }
.tag-swamp { background: rgba(20,83,45,0.65); color: #4ade80; border: 1px solid #22c55e; }
.tag-fire { background: rgba(249,115,22,0.32); color: #fdba74; border: 1px solid #f97316; }
.tag-honey { background: rgba(234,179,8,0.28); color: #fde047; border: 1px solid #eab308; }
.tag-gas { background: rgba(245,158,11,0.28); color: #fcd34d; border: 1px solid #f59e0b; }
.tag-acid { background: rgba(132,204,22,0.28); color: #bef264; border: 1px solid #84cc16; }
.tag-dragon { background: rgba(220,38,38,0.42); color: #fecaca; border: 1px solid #ef4444; }
.tag-water { background: rgba(56,189,248,0.25); color: #7dd3fc; border: 1px solid #38bdf8; }
.tag-corpse { background: rgba(168,85,247,0.28); color: #e9d5ff; border: 1px solid #a855f7; }

.action-bar {
  background: #070b16; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.action-info { font-size: 0.88rem; color: #fef3c7; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* SIDE PANEL */
.side-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
.side-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid var(--border); }
.side-tab {
  padding: 11px 6px; background: transparent; border: none; color: var(--muted);
  font-weight: 700; cursor: pointer; font-size: 0.82rem;
}
.side-tab.active { color: #fef3c7; background: rgba(234,179,8,0.08); border-bottom: 2px solid var(--gold); }
.side-content { display: none; flex-direction: column; flex: 1; padding: 10px; overflow: hidden; }
.side-content.active { display: flex; }

.chat-messages, .event-log, .vote-panel {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px;
}
.chat-msg {
  padding: 8px 10px; border-radius: 9px; background: rgba(15,23,42,0.85);
  border: 1px solid var(--border-soft); font-size: 0.84rem; line-height: 1.42;
}
.chat-msg.me { border-color: rgba(234,179,8,0.5); background: rgba(234,179,8,0.09); }
.chat-msg.sys { border-color: rgba(129,140,248,0.45); background: rgba(49,46,129,0.24); color: #c7d2fe; }
.chat-author { font-weight: 800; color: #fef3c7; margin-right: 6px; }
.ai-typing { font-size: 0.78rem; color: #fde047; padding: 4px 8px; font-style: italic; }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 6px; }
.quick-prompts button {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border-soft);
  background: #0f172a; color: #cbd5e1; font-size: 0.74rem; cursor: pointer;
}
.chat-input-row { display: flex; gap: 6px; }

.vote-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 9px; background: #0f172a; border: 1px solid var(--border-soft);
}

/* MODALS */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(2,6,23,0.82);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: #0d1324; border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.75);
}
.modal-lg { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.form-col { display: flex; flex-direction: column; gap: 8px; }

/* HOUSE ROOM (FLASHLIGHT) */
.house-room {
  position: relative; height: 290px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #1b1629 0%, #101524 64%, #281b16 64%, #18100d 100%);
  border: 1px solid var(--border); cursor: crosshair;
}
.room-window {
  position: absolute; top: 24px; left: 50px; width: 76px; height: 86px;
  background: radial-gradient(circle at 60% 30%, #fef9c3 0%, #1e293b 45%, #090d1a 100%);
  border: 4px solid #334155; border-radius: 6px; z-index: 1;
}
.flashlight-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(circle 105px at 50% 50%, rgba(255,248,220,0.08) 0%, rgba(2,6,23,0.92) 78%);
}
.furniture {
  position: absolute; z-index: 2; padding: 10px 16px; border-radius: 8px;
  background: #334155; border: 1px solid #64748b; color: #f8fafc; font-weight: 700; font-size: 0.82rem; cursor: pointer;
}
.sofa { bottom: 26px; left: 28px; width: 156px; height: 66px; background: #4c1d95; }
.shelf { top: 26px; left: 260px; width: 112px; height: 116px; background: #451a03; }
.table { bottom: 32px; right: 170px; width: 116px; height: 56px; background: #713f12; }
.closet { top: 24px; right: 24px; width: 108px; height: 154px; background: #1e293b; }
.bomb-hotspot {
  position: absolute; z-index: 5; bottom: 16px; left: 72px;
  padding: 6px 10px; border-radius: 8px; border: 2px solid #ef4444;
  background: rgba(153,27,27,0.95); color: #fff; font-weight: 800; font-size: 0.78rem;
  cursor: pointer; animation: blink 0.75s infinite;
}
@keyframes blink { 0%,100% { box-shadow: 0 0 6px #ef4444; } 50% { box-shadow: 0 0 22px #ef4444; } }
.inspect-msg { padding: 9px 12px; border-radius: 8px; background: #070b16; border: 1px solid var(--border-soft); font-size: 0.88rem; }
.defuse-box { padding: 12px; border-radius: 10px; background: rgba(127,29,29,0.28); border: 1px solid #ef4444; }
.defuse-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: #fca5a5; }
.wire-row { display: flex; gap: 10px; margin-top: 10px; }
.wire-btn { flex: 1; padding: 10px; border-radius: 8px; border: none; color: #fff; font-weight: 800; cursor: pointer; }

/* PATOLOG OTOPSİ SAHNESİ */
.autopsy-stage {
  background: linear-gradient(180deg, #0b1120 0%, #161e31 100%);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.autopsy-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.autopsy-report {
  background: #070b16; border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 12px; font-size: 0.9rem; line-height: 1.5;
}

.notebook-list, .gameover-roles { display: flex; flex-direction: column; gap: 8px; }
.nb-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: #070b16; border-radius: 8px; }
.nb-row select { width: 190px; padding: 6px; font-size: 0.82rem; }

@media (max-width: 960px) {
  .game-main, .online-grid, .online-room-body, .customizer-layout, .guide-grid, .menu-row-2, .name-grid {
    grid-template-columns: 1fr;
  }
  .stepper-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-clues-layer { display: none; }
  .town-map-stage { min-height: 520px; }
  .house-card.map-node { width: 96px; }
}


/* v2.3 GRAFİK & ATMOSFER GÜÇLENDİRMELERİ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #070b16; border-radius: 999px; }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(234, 179, 8, 0.65); }

.phase-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: bannerFade 1.7s ease-in-out forwards;
}
.phase-banner-overlay.night-tone {
  background: radial-gradient(circle, rgba(15, 23, 42, 0.72) 0%, rgba(2, 6, 23, 0.25) 100%);
}
.phase-banner-overlay.day-tone {
  background: radial-gradient(circle, rgba(180, 83, 9, 0.32) 0%, rgba(15, 23, 42, 0.15) 100%);
}
.phase-banner-box {
  background: rgba(7, 11, 22, 0.92);
  border: 1px solid rgba(234, 179, 8, 0.65);
  box-shadow: 0 0 38px rgba(234, 179, 8, 0.28), 0 12px 32px rgba(0, 0, 0, 0.75);
  border-radius: 16px;
  padding: 18px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  
}
.phase-banner-box span {
  font-size: 0.75rem;
  letter-spacing: 2.6px;
  color: #fde047;
  font-weight: 800;
}
.phase-banner-box strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  letter-spacing: 3px;
  color: #fef3c7;
  text-shadow: 0 0 18px rgba(234, 179, 8, 0.45);
}
@keyframes bannerFade {
  0% { opacity: 0; transform: scale(0.92); }
  18% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

.town-map-stage {
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.85), 0 10px 28px rgba(0, 0, 0, 0.45);
}
.house-card.map-node {
  
}
.house-card.is-me::after {
  content: '★';
  position: absolute;
  top: -8px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eab308;
  color: #05070f;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.8);
}

.house-room {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 34px),
    linear-gradient(180deg, #1b1629 0%, #101524 64%, #312018 64%, #1a100c 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.85);
}


/* ================= v3.2 YENİ TEMALAR, MENÜ DÜZENLEYİCİ, İÇ MEKAN & OTOPSİ ================= */

/* Tema Paletleri */
body.theme-crimson {
  --border: rgba(212, 175, 55, 0.25);
  --gold: #eab308;
}
body.theme-swamp {
  --bg: #030a07;
  --panel: rgba(8, 22, 16, 0.9);
  --card: rgba(11, 31, 23, 0.94);
  --border: rgba(52, 211, 153, 0.28);
  --gold: #4ade80;
}
body.theme-swamp .brand-title {
  color: #dcfce7;
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.55), 0 4px 16px #000;
}
body.theme-arcane {
  --bg: #070512;
  --panel: rgba(18, 12, 36, 0.9);
  --card: rgba(24, 17, 48, 0.94);
  --border: rgba(168, 85, 247, 0.32);
  --gold: #c084fc;
}
body.theme-arcane .brand-title {
  color: #f3e8ff;
  text-shadow: 0 0 26px rgba(168, 85, 247, 0.65), 0 4px 16px #000;
}
body.theme-gold {
  --bg: #0a0804;
  --panel: rgba(24, 18, 10, 0.9);
  --card: rgba(34, 26, 14, 0.94);
  --border: rgba(250, 204, 21, 0.38);
  --gold: #facc15;
}
body.theme-gold .brand-title {
  color: #fef9c3;
  text-shadow: 0 0 26px rgba(234, 179, 8, 0.65), 0 4px 16px #000;
}

/* Ana Menü Üst Düzenle Butonu & Kompakt Grid */
.menu-top-tools {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 25;
  display: flex;
  gap: 8px;
}
.menu-actions.layout-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.menu-actions.layout-compact .menu-row-2 {
  display: contents;
}
.menu-actions.layout-compact .menu-btn {
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  gap: 10px;
}
.menu-actions.layout-compact .btn-tag {
  align-self: flex-end;
}

.editor-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: #070b16;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

/* Görsel Odaklı Temiz Harita Ev Kartları (Altında kalabalık yazı yok) */
.house-card.map-node {
  width: 112px;
  padding: 6px 6px 7px;
  background: linear-gradient(180deg, rgba(13, 19, 36, 0.86) 0%, rgba(7, 11, 22, 0.92) 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  gap: 2px;
}
.house-svg {
  width: 82px;
  height: 68px;
  overflow: visible;
}
.house-name {
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 4px #000;
}
.house-role {
  font-size: 0.66rem;
}
.house-card.can-autopsy {
  border-color: rgba(168, 85, 247, 0.85);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.55);
}
@keyframes floatBadge {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}
.autopsy-crest {
  animation: floatBadge 1.8s ease-in-out infinite;
}
@keyframes acidBubble {
  0%, 100% { transform: translateY(0) scale(0.9); opacity: 0.7; }
  50% { transform: translateY(-4px) scale(1.2); opacity: 1; }
}
.acid-drop { animation: acidBubble 1.5s infinite ease-in-out; }
@keyframes honeyDrip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2.5px); }
}
.honey-drip { animation: honeyDrip 2.2s infinite ease-in-out; }
@keyframes waterShimmer {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
.water-dome { animation: waterShimmer 2s infinite ease-in-out; }

/* ================= YENİ 2D GOTİK EV İÇ MEKANI ================= */
.house-room {
  position: relative;
  height: 340px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: crosshair;
  background: #090d18;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
}
.room-art-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.house-room .flashlight-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle 125px at 50% 50%, rgba(255, 244, 200, 0.06) 0%, rgba(2, 6, 23, 0.86) 82%);
}
.room-hotspot {
  position: absolute;
  z-index: 5;
  background: rgba(15, 23, 42, 0.14);
  border: 1px dashed rgba(234, 179, 8, 0.0);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.14s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
}
.room-hotspot span {
  background: rgba(5, 7, 15, 0.82);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(234, 179, 8, 0.4);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s, transform 0.16s;
}
.room-hotspot:hover {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.65);
}
.room-hotspot:hover span {
  opacity: 1;
  transform: translateY(0);
}
.hs-sofa { left: 4%; bottom: 10%; width: 25%; height: 28%; }
.hs-fireplace { left: 32%; top: 26%; width: 20%; height: 42%; }
.hs-shelf { left: 54%; top: 14%; width: 17%; height: 50%; }
.hs-table { left: 43%; bottom: 7%; width: 22%; height: 26%; }
.hs-closet { right: 3%; top: 12%; width: 18%; height: 64%; }

.bomb-hotspot {
  position: absolute;
  z-index: 8;
  padding: 6px 11px;
  border-radius: 8px;
  border: 2px solid #ef4444;
  background: rgba(127, 29, 29, 0.94);
  color: #fff;
  font-weight: 800;
  font-size: 0.76rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: blink 0.7s infinite;
}
.bomb-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff2e2e;
  box-shadow: 0 0 10px #ff2e2e;
}

/* ================= PATOLOG İNTERAKTİF OLAY YERİ ODASI ================= */
.autopsy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #070b16;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
}
.tool-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: #11182c;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tool-btn.active-mag {
  background: linear-gradient(135deg, #064e3b, #059669);
  border-color: #34d399;
  color: #fff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
}
.tool-btn.active-twz {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}

.autopsy-scene {
  position: relative;
  height: 310px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #070a14;
  cursor: crosshair;
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.9);
}
.autopsy-spotlight {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle 115px at 50% 50%, rgba(224, 242, 254, 0.08) 0%, rgba(2, 6, 23, 0.86) 80%);
}
.crime-spot {
  position: absolute;
  z-index: 6;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.14);
  border: 2px dashed rgba(216, 180, 254, 0.55);
  color: #f3e8ff;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.crime-spot:hover {
  transform: scale(1.1);
  background: rgba(234, 179, 8, 0.25);
  border-color: #fde047;
  color: #fef08a;
}
.crime-spot.inspected {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.22);
}
.crime-spot.has-glint::after {
  content: '✦';
  position: absolute;
  top: -4px;
  right: -2px;
  color: #fde047;
  font-size: 0.85rem;
  text-shadow: 0 0 8px #fde047;
  animation: pulseDot 1.4s infinite;
}
.autopsy-findings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.finding-card {
  background: #070b16;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.finding-card.found {
  border-color: rgba(234, 179, 8, 0.55);
  background: rgba(234, 179, 8, 0.08);
}

@media (max-width: 720px) {
  .menu-actions.layout-compact, .autopsy-findings-grid, .editor-toggles {
    grid-template-columns: 1fr;
  }
}


/* ================= v3.2 MAÇ BAŞI ROL KARTI ================= */
.role-banner-btn {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, border-color 0.15s;
}
.role-banner-btn:hover {
  background: rgba(234, 179, 8, 0.18);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.rolecard-modal {
  max-width: 540px;
  padding: 22px 20px 18px;
  border-width: 2px;
  border-color: var(--rc-accent, var(--gold));
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 58%),
    linear-gradient(180deg, #10172b 0%, #080c18 100%);
  box-shadow: 0 0 42px rgba(0, 0, 0, 0.85), 0 0 28px var(--rc-glow, rgba(234, 179, 8, 0.25));
  animation: roleCardPop 0.28s ease-out;
}
@keyframes roleCardPop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.rolecard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rolecard-team-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--rc-accent, var(--gold));
  color: var(--rc-accent, var(--gold));
}
.rolecard-prio-pill {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}
.rolecard-hero {
  text-align: center;
  padding: 10px 6px 4px;
}
.rolecard-sub {
  font-size: 0.72rem;
  letter-spacing: 2.4px;
  color: var(--muted);
  font-weight: 800;
}
.rolecard-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.05rem;
  letter-spacing: 2px;
  margin: 6px 0 8px;
  color: #fef3c7;
  text-shadow: 0 0 18px var(--rc-glow, rgba(234, 179, 8, 0.4));
}
.rolecard-desc {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.48;
}
.rolecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rolecard-box {
  background: rgba(7, 11, 22, 0.88);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rolecard-box strong {
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  color: var(--rc-accent, var(--gold));
  text-transform: uppercase;
}
.rolecard-box p {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e2e8f0;
}
.rolecard-allies {
  background: rgba(153, 27, 27, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.85rem;
  color: #fecaca;
  text-align: center;
}
.rolecard-go-btn {
  padding: 10px 26px;
  font-size: 0.94rem;
}

@media (max-width: 600px) {
  .rolecard-grid { grid-template-columns: 1fr; }
}


/* ================= v3.2 KOSTÜM & GÖRÜNÜM STÜDYOSU + PORTRE SİSTEMİ ================= */
.studio-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  align-items: start;
}
.studio-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.studio-portrait-frame {
  width: 230px;
  height: 270px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #070b16;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), inset 0 0 24px rgba(0, 0, 0, 0.7);
}
.studio-portrait-frame .char-svg {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
}
.studio-name-tag {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fef3c7;
  letter-spacing: 1px;
}
.studio-summary {
  font-size: 0.8rem;
  line-height: 1.4;
}
.studio-preview-card .forensic-box {
  width: 100%;
  text-align: left;
}

.studio-controls-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 9px;
}
.preset-card {
  background: #090e1d;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: var(--text);
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.preset-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: #101932;
}
.preset-card.active {
  border-color: var(--emerald-hi);
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.preset-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  background: #070b16;
}
.preset-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.preset-meta strong {
  font-size: 0.8rem;
  color: #fef3c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preset-meta small {
  font-size: 0.68rem;
  color: var(--gold);
}

.studio-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.studio-tab-btn {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: #0a1020;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.14s;
}
.studio-tab-btn:hover { color: #fff; border-color: var(--gold); }
.studio-tab-btn.active {
  background: #1e293b;
  border-color: var(--gold);
  color: var(--gold);
}

.studio-options-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.skin-opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.skin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #0a1020;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s, background 0.14s, transform 0.1s;
}
.skin-chip:hover { border-color: var(--gold); background: #131c33; }
.skin-chip.active {
  border-color: var(--emerald-hi);
  background: rgba(16, 185, 129, 0.2);
  color: #fff;
}
.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

/* MİNİ AVATAR ROZETLERİ (HARİTA, SOHBET, OYLAMA, DIŞ İNCELEME) */
.mini-avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.house-avatar-badge {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #070b16;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
  z-index: 4;
}
.house-card.dead .house-avatar-badge {
  filter: grayscale(1) brightness(0.65);
  border-color: #475569;
}

.chat-msg.has-avatar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.chat-avatar-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  margin-top: 1px;
}
.chat-body-wrap {
  flex: 1;
  min-width: 0;
}

.vote-player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vote-avatar-wrap {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.inspect-profile-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: #070b16;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.inspect-portrait-box {
  width: 88px;
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.inspect-portrait-box .char-svg {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: none;
  border-radius: 0;
}

@media (max-width: 900px) {
  .studio-layout { grid-template-columns: 1fr; }
}

/* v3.2 PERFORMANS OPTİMİZASYONU */
.house-card.map-node {
  contain: layout style;
}
.town-map-stage {
  contain: strict;
}
