/* Gece Köyü oyun ekranları. Renkler stil.css'teki tema değişkenlerinden; burada sabit renk yok. */
html, body.oyun-sayfasi { height: 100%; overflow: hidden; }

/* ─── Ekranlar ─── */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, visibility .3s;
}
.screen.active { opacity: 1; visibility: visible; pointer-events: auto; }
.ekran-ikincil { background: var(--night2); }
#player-game { background: var(--night); }
.scroll { flex: 1; overflow-y: auto; padding: 1rem; -webkit-overflow-scrolling: touch; }

/* ─── Ana ekran (altbilgi aşağıda, kaydırılır) ─── */
#home { overflow-y: auto; background: radial-gradient(ellipse at 50% 30%, var(--ana-zemin-ust), var(--night) 70%); }
.home-ic { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2.5rem 1rem 2rem; min-height: 78vh; text-align: center; }
.home-logo { font-family: 'Cinzel', serif; font-size: 2.4rem; font-weight: 400; color: var(--gold); letter-spacing: 2px; }
.home-sub { font-size: .8rem; color: var(--muted); letter-spacing: 4px; text-transform: uppercase; margin-bottom: 1rem; }
.home-not { margin-top: 1.5rem; color: var(--muted); font-size: .85rem; line-height: 1.6; }
#ws-status.bagli { color: var(--green); }
.soluk-yazi { margin-left: .5rem; opacity: .75; }
.blood-anim { font-size: 3.5rem; animation: hbeat 2s infinite; }
@keyframes hbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ─── Üst çubuk ─── */
.topbar { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; min-height: 52px; }
.topbar-title { font-family: 'Cinzel', serif; font-size: .8rem; color: var(--gold); flex: 1; }
#gm-phase-title { text-align: center; }

/* ─── Düğmeler ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: .7rem 1.4rem; border: 1px solid var(--gold);
  background: transparent; color: var(--gold); font-family: 'Cinzel', serif; font-size: .85rem; letter-spacing: .5px;
  cursor: pointer; border-radius: 2px; transition: background .15s, transform .15s; touch-action: manipulation; min-height: 44px;
}
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--dugme-ust); }
.btn.full { width: 100%; display: flex; }
.btn.primary { background: var(--dolgu-kirmizi); border-color: var(--dolgu-kirmizi); color: var(--dolgu-yazi); }
.btn.primary:hover { background: var(--dolgu-kirmizi-ust); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.muted { border-color: var(--muted); color: var(--muted); }
.btn.sm { padding: .4rem .8rem; font-size: .75rem; min-height: 40px; }
.btn.green { border-color: var(--green); color: var(--green); }
.btn.red { border-color: var(--dolgu-kirmizi); background: var(--dolgu-kirmizi); color: var(--dolgu-yazi); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.home-ic .btn { max-width: 260px; }
.dugme-satiri { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }

/* ─── Girdiler ─── */
input[type=text], input[type=number], textarea, select {
  width: 100%; padding: .65rem .8rem; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-family: 'Crimson Text', serif; font-size: 1rem; border-radius: 2px;
  transition: border-color .15s; -webkit-appearance: none;
}
input[type=text]:focus, input[type=number]:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { resize: none; }

/* ─── Katıl ─── */
.katil-ic { display: flex; flex-direction: column; gap: .75rem; padding-top: 2rem; align-items: center; }
.katil-alan { width: 100%; max-width: 300px; }
.katil-ic > .btn { max-width: 300px; }
.kod-girdi { text-transform: uppercase; letter-spacing: 4px; font-family: 'Cinzel', serif; font-size: 1.3rem; text-align: center; }
.hata-yazi { color: var(--red); font-size: .9rem; text-align: center; }

/* ─── Panel ─── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1rem; margin-bottom: .75rem; }
.panel-title { display: block; font-family: 'Cinzel', serif; font-size: .8rem; color: var(--gold); letter-spacing: .5px; margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.oda-satir { display: flex; align-items: center; justify-content: space-between; }
.oda-kodu { text-transform: uppercase; font-family: 'Cinzel', serif; font-size: 2rem; color: var(--gold2); letter-spacing: 5px; }
.oyuncu-sayisi { font-size: 1.4rem; }
.sure-izgara { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.bos-yazi { color: var(--muted); font-style: italic; font-size: .95rem; }
.altin-yazi { color: var(--gold); }
.kirmizi-yazi { color: var(--red); }
.soluk-kucuk { color: var(--muted); font-size: .8rem; }
.soluk-orta { color: var(--muted); font-size: .9rem; }
.soluk-ad { opacity: .6; }
.satir-sag { display: flex; align-items: center; gap: .4rem; }
.onay-isareti { font-size: .85rem; color: var(--green); }
.vampir-arkadas { margin-top: .75rem; color: var(--muted); font-size: .9rem; }
.vampir-arkadas span { color: var(--gold); }

/* ─── Sekmeler ─── */
.tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; padding: 0 1rem; }
.tab {
  flex: 1; padding: .55rem .2rem; min-height: 44px; text-align: center; font-family: 'Cinzel', serif; font-size: .7rem; letter-spacing: .3px;
  cursor: pointer; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; touch-action: manipulation;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ─── Oyuncu satırı ─── */
.prow {
  display: flex; align-items: center; gap: .5rem; width: 100%; padding: .55rem .5rem; border: 0; border-bottom: 1px solid var(--cizgi-ince);
  font: inherit; font-size: .95rem; min-height: 44px; touch-action: manipulation; background: none; color: inherit; text-align: left;
}
.prow:last-child { border-bottom: none; }
.prow.dead { opacity: .45; text-decoration: line-through; }
.prow.clickable { cursor: pointer; }
.prow.clickable:active { background: var(--surface2); }
.prow.selected { background: var(--secili); }
.prow.voted { background: var(--oylu); }
.ml { margin-left: auto; }
.role-chip { font-size: .7rem; padding: .15rem .4rem; border-radius: 2px; font-family: 'Cinzel', serif; white-space: nowrap; }
.chip-vampir { background: var(--cip-vampir-z); color: var(--cip-vampir-y); }
.chip-koylu { background: var(--cip-koylu-z); color: var(--cip-koylu-y); }
.chip-doktor { background: var(--cip-doktor-z); color: var(--cip-doktor-y); }
.chip-dedektif { background: var(--cip-dedektif-z); color: var(--cip-dedektif-y); }
.chip-avci { background: var(--cip-avci-z); color: var(--cip-avci-y); }
.chip-cadi { background: var(--cip-cadi-z); color: var(--cip-cadi-y); }
.chip-joker { background: var(--cip-joker-z); color: var(--cip-joker-y); }
.chip-kahin { background: var(--cip-kahin-z); color: var(--cip-kahin-y); }
.chip-koruyucu { background: var(--cip-koruyucu-z); color: var(--cip-koruyucu-y); }
.vote-bubble { background: var(--dolgu-kirmizi); color: var(--dolgu-yazi); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-family: 'Cinzel', serif; flex-shrink: 0; }

/* ─── Süre ve faz rozeti ─── */
.timer { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold2); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.timer.urgent { color: var(--red); animation: tblink .5s infinite; }
@keyframes tblink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.badge { padding: .2rem .6rem; border-radius: 2px; font-family: 'Cinzel', serif; font-size: .72rem; letter-spacing: .5px; white-space: nowrap; }
.b-night { background: var(--faz-gece-z); color: var(--faz-gece-y); }
.b-day { background: var(--faz-gunduz-z); color: var(--faz-gunduz-y); }
.b-morning { background: var(--faz-sabah-z); color: var(--faz-sabah-y); }
.b-defense { background: var(--faz-savunma-z); color: var(--faz-savunma-y); }
.b-vote2 { background: var(--faz-oylama-z); color: var(--faz-oylama-y); }
.b-lobby { background: var(--surface2); color: var(--yer-tutucu); }

/* ─── Bildirim ─── */
#notif { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 999; pointer-events: none; }
.notif-item { background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: 4px; padding: .7rem 1rem; margin-top: .4rem; font-size: .95rem; animation: slideUp .3s ease, fadeOut .4s ease 3.6s forwards; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }

/* ─── Son sözler ─── */
.last-words-card { background: linear-gradient(135deg, var(--son-soz-1), var(--son-soz-2)); border: 1px solid var(--blood2); border-radius: 4px; padding: 1rem; margin: .75rem 0; animation: fadeIn .5s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.lw-name { font-family: 'Cinzel', serif; color: var(--gold2); margin-bottom: .3rem; font-size: .9rem; }
.lw-words { font-style: italic; color: var(--son-soz-yazi); line-height: 1.6; }

/* ─── Oyun sonu ─── */
#game-over-overlay { position: fixed; inset: 0; background: var(--perde); z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; text-align: center; padding: 2rem; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s, visibility .5s; }
#game-over-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.go-icon { font-size: 5rem; }
.go-title { font-family: 'Cinzel', serif; font-size: 1.8rem; color: var(--gold); }
.go-msg { color: var(--text); font-size: 1rem; max-width: 300px; line-height: 1.6; }
.go-dugmeler { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* ─── Rol ─── */
.role-reveal { text-align: center; padding: 1.5rem 1rem; }
.role-icon-big { font-size: 4rem; margin-bottom: .75rem; }
.role-name-big { font-family: 'Cinzel', serif; font-size: 1.7rem; color: var(--gold); margin-bottom: .4rem; }
.role-desc-text { color: var(--muted); font-style: italic; line-height: 1.6; font-size: 1rem; }

/* ─── Anahtar ve sayaç ─── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--cizgi-ince); min-height: 44px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: .95rem; }
.toggle-sub { font-size: .85rem; color: var(--muted); }
.sw { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw-track { position: absolute; inset: 0; background: var(--anahtar-iz); border-radius: 13px; transition: .2s; }
.sw-track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--anahtar-top); border-radius: 50%; transition: .2s; }
.sw input:checked + .sw-track { background: var(--dolgu-kirmizi); }
.sw input:checked + .sw-track::before { transform: translateX(18px); background: var(--anahtar-top-acik); }
.sw input:focus-visible + .sw-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.count-ctrl { display: flex; align-items: center; gap: .5rem; }
.cnt-btn { width: 40px; height: 40px; border: 1px solid var(--sayac-kenar); background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem; border-radius: 2px; touch-action: manipulation; }
.cnt-btn:active { background: var(--surface2); }
.cnt-val { min-width: 18px; text-align: center; font-family: 'Cinzel', serif; }

/* ─── Sohbet ─── */
.chat-box { height: 180px; overflow-y: auto; background: var(--night); border: 1px solid var(--border); border-radius: 2px; padding: .75rem; display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.chat-msg { font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; }
.chat-sender { color: var(--gold); font-weight: 600; margin-right: .3rem; }
.chat-time { color: var(--muted); font-size: .8rem; }
.chat-row { display: flex; gap: .5rem; }
.chat-input { flex: 1; padding: .4rem .7rem; background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-family: 'Crimson Text', serif; font-size: 1rem; border-radius: 2px; }
.chat-input:focus { border-color: var(--gold); }

/* ─── Etiket ─── */
.lbl { display: block; font-size: .78rem; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: .3rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }

/* Cinzel büyük harf kuralı (stil.css'teki not). */
.topbar-title, .btn, .panel-title, .tab, .role-chip, .vote-bubble, .timer, .badge, .lw-name, .go-title, .role-name-big, .home-logo, .cnt-val { text-transform: uppercase; }
