/* DEDİKODU — akşamüstü mahalle: koyu çay rengi arayüz, kâğıt harita, kırmızı söylenti, mavi gerçek */

:root {
  --bg: #120d0a;
  --panel: #1f1712;
  --panel2: #2c2119;
  --line: #4a3a2c;
  --ink: #f4ebdc;
  --dim: #ab9a83;
  --gold: #e6bb5c;
  --red: #d9483b;
  --redHi: #ff8a7a;
  --blue: #2f86c9;
  --blueHi: #8cc8f5;
  --ok: #6cc28a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; background: var(--bg); color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
}
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: 12px; }

#game { position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(900px 560px at 50% -10%, #2e2017 0%, var(--bg) 62%); }

/* ---------- Üst çubuk ---------- */
#topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 7px 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 21px; }
.brand .bTitle { font-weight: 800; letter-spacing: 3px; font-size: 15px; color: var(--gold); }
.stats { display: flex; gap: 6px; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; }
.stat { min-width: 62px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(0,0,0,.3); text-align: center; line-height: 1.15; }
.stat.wide { min-width: 96px; }
.stat b { display: block; font-size: 9px; letter-spacing: 1.3px; color: var(--dim); font-weight: 700; }
.stat span { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.red span { color: var(--redHi); }
.stat span.ok { color: var(--ok); }
.stat span.bad { color: var(--redHi); }
.tools { display: flex; gap: 6px; }
.tools button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(0,0,0,.3); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }

/* ---------- Oyun alanı ---------- */
#play { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: row; }
#arena { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; touch-action: none; }
#cv { position: absolute; inset: 0; display: block; }
#phaseTag { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); pointer-events: none;
  padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: .5px;
  background: rgba(20,14,10,.78); border: 1px solid var(--line); white-space: nowrap; }
#phaseTag:empty { display: none; }

#panel { flex: 0 0 330px; display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel), #17110d); border-left: 1px solid var(--line); }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(0,0,0,.25); }
.lvTitle { font-weight: 800; color: var(--gold); font-size: 14px; margin-bottom: 6px; }
.storyLine { font-size: 12.5px; line-height: 1.5; margin-top: 4px; }
.storyLine b { display: inline-block; min-width: 0; margin-right: 4px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; }
.storyLine.soy b { background: rgba(217,72,59,.25); color: var(--redHi); }
.storyLine.ger b { background: rgba(47,134,201,.25); color: var(--blueHi); }
.storyLine.why b { background: rgba(230,187,92,.18); color: var(--gold); }
.tut { border-color: var(--gold); background: rgba(230,187,92,.08); font-size: 12.5px; line-height: 1.55; }
.tut b { color: var(--gold); }

.pHead { display: flex; align-items: baseline; gap: 8px; }
#pName { font-weight: 800; font-size: 16px; }
#pJob { color: var(--dim); font-size: 12px; }
.pStatus { margin-top: 3px; font-size: 12px; font-weight: 800; letter-spacing: .4px; }
.pStatus.s0 { color: var(--dim); } .pStatus.s1 { color: var(--redHi); } .pStatus.s2 { color: var(--blueHi); }
.traits { list-style: none; margin-top: 6px; font-size: 12px; line-height: 1.5; color: #d9cbb4; }
.traits li { margin-top: 2px; }
.votes { margin-top: 7px; font-size: 12px; }
.votes b.r { color: var(--redHi); } .votes b.g { color: var(--blueHi); }
.will { margin-top: 4px; font-size: 12.5px; font-weight: 800; }
.will.r { color: var(--redHi); } .will.g { color: var(--blueHi); } .will.n { color: var(--dim); }
.pActs { display: flex; gap: 8px; margin-top: 9px; }
.pActs button { flex: 1 1 0; padding: 10px 6px; font-size: 14px; }
#pActHelp { margin-top: 6px; line-height: 1.45; }

#actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: auto; }
#actions button { padding: 10px 6px; font-size: 13px; }
#actions #nightBtn { grid-column: 1 / -1; font-size: 15px; padding: 12px; }

/* ---------- Ekranlar ---------- */
.screen { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(700px 460px at 50% 30%, #3a2a1c 0%, #120d0a 70%); padding: 16px; overflow-y: auto; }
.tBox { text-align: center; max-width: 500px; width: 100%; margin: auto; }
.tLogo { font-size: 58px; }
.tBox h1 { margin-top: 2px; font-size: 44px; font-weight: 900; letter-spacing: 7px; color: var(--gold); }
.tSub { color: var(--redHi); letter-spacing: 3.5px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.tTag { margin-top: 12px; font-size: 15px; line-height: 1.5; }
.tClaim { margin-top: 12px; font-size: 12.5px; line-height: 1.65; color: var(--dim); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 13px; background: rgba(0,0,0,.25); }
.tClaim b { color: var(--ink); }
.tBtns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.tRow { display: flex; gap: 8px; } .tRow button { flex: 1 1 0; }
.tHint { margin-top: 14px; font-size: 13px; color: var(--gold); font-weight: 700; }

.mBox { width: min(760px, 100%); margin: auto; }
.mHead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mHead h2 { flex: 1 1 auto; font-size: 20px; color: var(--gold); }
.mHead button { padding: 8px 14px; }
#mStars { color: var(--gold); font-weight: 800; }
.chap { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: rgba(0,0,0,.25); }
.chap h4 { font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.chap .new { font-size: 12px; color: var(--dim); margin-top: 2px; }
.lvGrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 8px; }
.lvGrid button { padding: 8px 0 6px; font-size: 14px; line-height: 1.1; }
.lvGrid button .st { display: block; font-size: 10px; color: var(--gold); letter-spacing: -1px; margin-top: 2px; min-height: 11px; }
.lvGrid button.lock { opacity: .35; }
.lvGrid button.cur { border-color: var(--gold); }

/* ---------- Düğmeler ---------- */
button { font-family: inherit; font-size: 15px; font-weight: 700; padding: 12px 20px; border-radius: 11px;
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel2), var(--panel)); color: var(--ink);
  cursor: pointer; transition: filter .12s ease, transform .1s ease; }
button:hover { filter: brightness(1.18); }
button:active { transform: translateY(1px); }
button.primary { border-color: var(--gold); background: linear-gradient(180deg, #efcd76, #b88a26); color: #231804; font-weight: 800; }
button.ghost { background: transparent; color: var(--dim); }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: .38; cursor: default; transform: none; filter: none; }
#tellBtn:not(:disabled) { border-color: var(--blue); }
#stallBtn:not(:disabled) { border-color: #a07a3d; }
button.hintGlow { box-shadow: 0 0 0 3px rgba(140,200,245,.6); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(10,6,4,.82); backdrop-filter: blur(3px); padding: 16px; }
.modal { width: min(520px, 100%); max-height: 100%; overflow-y: auto; background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.65); }
.modal h3 { font-size: 19px; font-weight: 800; text-align: center; color: var(--gold); margin-bottom: 12px; }
#modalBody { font-size: 13.5px; line-height: 1.65; color: #e0d2bb; }
#modalBody p + p { margin-top: 8px; }
#modalBody b { color: var(--ink); }
#modalBody .center { text-align: center; }
#modalBody .bigStars { text-align: center; font-size: 42px; letter-spacing: 6px; color: var(--gold); }
#modalBody .bigStars .off { color: #4a3a2c; }
#modalBody .bad { color: var(--redHi); } #modalBody .good { color: var(--ok); }
#modalActions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ---------- Bildirimler ---------- */
#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; display: flex;
  flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { padding: 8px 16px; border-radius: 999px; text-align: center; background: rgba(24,17,12,.95);
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; animation: toastIn .22s ease-out; }
.toast.good { border-color: var(--ok); color: #c9f1d7; }
.toast.err { border-color: var(--red); color: #ffcfc7; }
.toast.info { border-color: var(--blue); color: #cfe7fa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Dik ekran: panel alta ---------- */
@media (max-aspect-ratio: 1/1) {
  #play { flex-direction: column; }
  #panel { flex: 0 0 auto; max-height: 46%; border-left: 0; border-top: 1px solid var(--line); padding: 8px; gap: 6px; }
  #story { display: none; }
  #story.open { display: block; }
  .stat { min-width: 48px; padding: 2px 6px; } .stat.wide { min-width: 0; }
  .stat span { font-size: 14px; }
  .brand .bTitle { display: none; }
  #actions { grid-template-columns: 1fr 1fr 1fr 1.6fr; } #actions #nightBtn { grid-column: auto; font-size: 13px; padding: 10px 4px; }
  .lvGrid { grid-template-columns: repeat(5, 1fr); }
  #toasts { bottom: auto; top: 64px; }
  #phaseTag { display: none; }          /* dik ekranda en üstteki komşuların adını kapatıyordu; gün üst göstergede */
}
/* ---------- Dar yatay (telefon yatay) ---------- */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  #topbar { padding: 4px 8px; } .tools button { width: 30px; height: 30px; }
  .stat { padding: 1px 7px; } .stat span { font-size: 13px; }
  #panel { flex-basis: 270px; padding: 6px; gap: 6px; }
  #story .storyLine.why { display: none; }
  .card { padding: 7px 9px; }
  .tLogo { font-size: 34px; } .tBox h1 { font-size: 30px; }
}
@media (max-width: 680px) { .brand .bTitle { display: none; } .tBox h1 { font-size: 34px; letter-spacing: 5px; } }
