/* Gece köyü teması: gökyüzü arka planı body[data-time] ile değişir (dusk / night / day) */
:root {
  --sky1: #2a1f4f;
  --sky2: #c2577a;
  --panel: rgba(20, 18, 42, .82);
  --panel-solid: #191733;
  --line: rgba(255, 255, 255, .12);
  --ink: #f2eefc;
  --muted: #b5aed3;
  --blood: #d7263d;
  --blood-d: #a3172b;
  --moon: #f3c969;
  --moon-d: #d9a93f;
  --mint: #4fd1a5;
  --violet: #8f6cff;
  --wheat: #e7b24a;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --display: 'Grenze Gotisch', 'Palatino Linotype', Georgia, serif;
  --body: 'Nunito', system-ui, sans-serif;
  color-scheme: dark;
}
body[data-time='night'] { --sky1: #070a1c; --sky2: #1b2350; }
body[data-time='day'] { --sky1: #6ec3ff; --sky2: #ffe2a8; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--sky1);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--moon); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- Gökyüzü ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 140%); transition: background 2s ease; }
.stars {
  position: absolute; inset: 0; opacity: .8; transition: opacity 2s;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent 60%),
    radial-gradient(1px 1px at 25% 60%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 12%, #fff, transparent 60%),
    radial-gradient(1px 1px at 55% 40%, #fff, transparent 60%),
    radial-gradient(2px 2px at 70% 18%, #fff, transparent 60%),
    radial-gradient(1px 1px at 82% 55%, #fff, transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 28%, #fff, transparent 60%),
    radial-gradient(1px 1px at 5% 75%, #fff, transparent 60%),
    radial-gradient(1px 1px at 63% 70%, #fff, transparent 60%);
  background-size: 420px 420px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: .95; } }
.moon {
  position: absolute; top: 6vh; right: 8vw; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff8dc, var(--moon) 70%);
  box-shadow: 0 0 80px 20px rgba(243, 201, 105, .25);
  transition: transform 2s ease, background 2s;
}
.hills {
  position: absolute; left: -5%; right: -5%; bottom: -2px; height: 22vh;
  background:
    radial-gradient(ellipse 40% 100% at 20% 100%, #0d0b1f 70%, transparent 71%),
    radial-gradient(ellipse 50% 90% at 75% 100%, #12102a 70%, transparent 71%);
  transition: filter 2s;
}
body[data-time='day'] .stars { opacity: 0; animation: none; }
body[data-time='day'] .moon { background: radial-gradient(circle, #fff7c2, #ffc93c 70%); box-shadow: 0 0 90px 30px rgba(255, 201, 60, .45); }
body[data-time='day'] .hills { filter: brightness(3.2) saturate(.6) hue-rotate(60deg); }

/* ---------- İkonlar ---------- */
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
.art { width: 100%; height: 100%; display: block; overflow: visible; }
.mini-art { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -0.32em; flex: none; }
.with-ic { display: inline-flex; align-items: center; gap: .45em; }
.btn.with-ic, .link-btn.with-ic { justify-content: center; }
.btn.with-ic .ic { width: 1.15em; height: 1.15em; }
[data-icon] { display: inline-flex; }

/* ---------- Ortak ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.error { color: #ff8a98; font-weight: 800; margin: 0; text-align: center; }
.error:empty { display: none; }
.hint { color: var(--muted); font-size: .92rem; margin: 6px 0; }
.hint.center { text-align: center; }
.warn { color: var(--moon); font-weight: 700; font-size: .92rem; }
.field-label { font-weight: 800; font-size: .88rem; color: var(--muted); letter-spacing: .02em; }

.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 900; font-size: 1.1rem; color: #fff;
  background: #4a4570; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { font-size: 1.35rem; padding: 14px 18px; }
.btn-small { font-size: .95rem; padding: 8px 14px; }
.btn-blood { background: linear-gradient(180deg, var(--blood), var(--blood-d)); }
.btn-moon { background: linear-gradient(180deg, var(--moon), var(--moon-d)); color: #2a1f00; }
.link-btn { background: none; border: 0; color: var(--moon); font-weight: 800; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn .ic { width: 20px; height: 20px; }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(0, 0, 0, .25); }
.lang-btn { border: 0; background: none; padding: 6px 12px; font-weight: 900; font-size: .85rem; color: var(--muted); }
.lang-btn.active { background: var(--moon); color: #2a1f00; }
.home-top { align-self: flex-end; display: flex; align-items: center; gap: 8px; }

input[type='text'], #nameInput, #codeInput, .invite input, select {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: rgba(0, 0, 0, .3); font-weight: 700; outline: none; transition: border-color .15s;
}
#nameInput:focus, #codeInput:focus, select:focus { border-color: var(--moon); }
select option { background: var(--panel-solid); }

/* ---------- Giriş ---------- */
#home { max-width: 1000px; margin: 0 auto; padding: 18px 16px 48px; display: flex; flex-direction: column; align-items: center; }
.logo {
  font-family: var(--display); font-weight: 800; font-size: clamp(3.2rem, 12vw, 6rem); line-height: .95;
  margin: 6px 0 0; text-align: center; color: var(--moon);
  text-shadow: 0 0 30px rgba(243, 201, 105, .35), 0 4px 0 #3b0b14;
}
.tagline { font-weight: 800; font-size: 1.1rem; margin: 10px 0 22px; text-align: center; color: #f5e9ff; }
.home-card { width: 100%; max-width: 440px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }

.avatar-editor { display: flex; flex-direction: column; gap: 12px; }
.avatar-stage {
  position: relative; display: grid; place-items: center; padding: 10px 0 0;
  border-radius: 14px; background: radial-gradient(circle at 50% 45%, rgba(143, 108, 255, .28), transparent 65%);
}
.avatar-preview { width: 130px; height: 156px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.avatar-preview svg { width: 100%; height: 100%; display: block; }
.dice {
  position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08);
  border-radius: 10px; width: 40px; height: 40px; font-size: 1.2rem; transition: transform .2s;
}
.dice:hover { transform: rotate(20deg); background: rgba(255, 255, 255, .16); }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picker {
  display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 4px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; padding: 4px;
}
.picker span { text-align: center; font-weight: 800; font-size: .9rem; color: var(--muted); }
.picker button { position: relative; border: 0; border-radius: 9px; height: 34px; background: rgba(255, 255, 255, .08); }
.picker button:hover { background: var(--violet); }
/* Ok işareti CSS ile çizilir: yazı tipine göre bozulmaz */
.picker button::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px;
  border: solid currentColor; border-width: 0 3px 3px 0; border-radius: 1px;
  transform: translate(-30%, -50%) rotate(135deg);
}
.picker button[data-dir='1']::before { transform: translate(-70%, -50%) rotate(-45deg); }
.join-info { text-align: center; font-weight: 700; color: var(--muted); }
.join-info b { color: var(--moon); letter-spacing: .1em; }
.code-join { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#codeInput { text-transform: uppercase; letter-spacing: .15em; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; width: 100%; margin-top: 24px; }
.info { padding: 16px 18px; }
.info h3 { margin: 0 0 6px; font-size: 1.05rem; }
.info p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---------- Üst çubuk ---------- */
#game { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(8, 6, 22, .6); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-family: var(--display); font-size: 1.7rem; color: var(--moon); line-height: 1; }
.phase-label { flex: 1; text-align: center; font-weight: 900; letter-spacing: .04em; color: #f5e9ff; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.room-code .ic { width: 16px; height: 16px; }
.room-code { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); border-radius: 10px; height: 40px; padding: 0 12px; font-weight: 900; letter-spacing: .12em; color: var(--moon); }
.lang-switch.small .lang-btn { padding: 6px 9px; }

.stage { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 18px 16px 40px; }
h2 { margin: 0 0 10px; font-size: 1.3rem; }
.count { color: var(--muted); font-weight: 800; font-size: .95rem; }

/* ---------- Lobi ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0, 0, 0, .3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 9px; font-weight: 900; color: var(--muted); }
.seg button.active { background: var(--violet); color: #fff; }
.wolf-val { color: var(--blood); font-size: 1.4rem; }
#wolfRange { width: 100%; accent-color: var(--blood); height: 28px; }
.range-scale { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 800; color: var(--muted); }
.range-scale span:nth-child(2) { color: var(--moon); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--mint); }
.manual-count { font-weight: 900; margin: 4px 0; }

.players-panel { padding: 16px; min-width: 0; }
.players-head { display: flex; align-items: baseline; justify-content: space-between; }
.invite { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.invite input { font-size: .9rem; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 2px solid transparent;
  text-align: center; min-width: 0; transition: transform .15s, background .2s, border-color .2s;
}
.tile.clickable { cursor: pointer; user-select: none; }
.tile.clickable:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .12); }
.tile.me { border-color: var(--moon); }
.tile.mod { background: rgba(243, 201, 105, .12); }
.tile.offline { opacity: .45; }
.tile.spectator { opacity: .4; filter: grayscale(1); }
.tile .av { width: 64px; height: 72px; }
.grid.small .tile .av { width: 50px; height: 56px; }
.tile .nm { font-weight: 800; font-size: .92rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .nm small { color: var(--muted); font-weight: 700; }
.tile .off { font-size: .72rem; color: var(--muted); }
.tile.r-wolf { border-color: var(--blood); background: rgba(215, 38, 61, .14); }
.tile.r-doctor { border-color: var(--mint); background: rgba(79, 209, 165, .12); }
.tile.r-seer { border-color: var(--violet); background: rgba(143, 108, 255, .14); }
.badge { font-size: .74rem; font-weight: 900; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mod-badge { background: var(--moon); color: #2a1f00; }
.role-badge { background: rgba(255, 255, 255, .1); }
.role-badge.r-wolf { background: var(--blood); color: #fff; }
.role-badge.r-doctor { background: var(--mint); color: #062b1f; }
.role-badge.r-seer { background: var(--violet); color: #fff; }
.role-badge.r-villager { background: var(--wheat); color: #2a1f00; }
.kick {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .4); color: #fff; font-weight: 900; line-height: 1; opacity: 0; transition: opacity .15s;
}
.tile:hover .kick, .kick:focus-visible { opacity: 1; }
@media (hover: none) { .kick { opacity: .8; } }
.kick.kill { display: grid; place-items: center; padding: 0; background: var(--blood); opacity: .85; }
.kick.kill:hover, .kick.kill:focus-visible { opacity: 1; }
.kick.kill svg { width: 15px; height: 15px; }
.kill-row { display: flex; gap: 8px; align-items: center; }
.kill-row select { flex: 1; min-width: 0; }
.seen-dot { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 900; background: rgba(255, 255, 255, .12); }
.seen-dot.on { background: var(--mint); color: #062b1f; }

.player-lobby { display: grid; gap: 16px; }
.waiting { text-align: center; padding: 26px 16px 10px; }
.waiting h2 { font-family: var(--display); font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--moon); margin: 6px 0; }
.waiting p { color: #e9e2ff; max-width: 52ch; margin: 0 auto 14px; }
.waiting .invite { max-width: 460px; margin: 10px auto 0; }
.lantern { color: var(--moon); filter: drop-shadow(0 0 14px rgba(243, 201, 105, .5)); animation: sway 3s ease-in-out infinite; display: inline-block; transform-origin: top center; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- Rol kartı ---------- */
.card-view { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.card-hint { margin: 4px 0 0; font-weight: 800; color: #e9e2ff; }
.role-card { width: min(300px, 80vw); aspect-ratio: 5 / 7; border: 0; padding: 0; background: none; perspective: 1200px; }
.rc-inner { position: relative; width: 100%; height: 100%; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.role-card.flipped .rc-inner { transform: rotateY(180deg); }
.rc-back, .rc-front {
  position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5); border: 3px solid rgba(255, 255, 255, .18);
}
.rc-back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 20px),
    radial-gradient(circle at 50% 40%, #3a2b78, #120d2b 75%);
  display: grid; place-items: center;
}
.role-card:not(.flipped):hover .rc-inner { transform: rotateY(8deg) translateY(-4px); }
.rc-moon { position: absolute; top: 18%; width: 38%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 38% 36%, #fff8dc, var(--moon) 70%); box-shadow: 0 0 40px rgba(243, 201, 105, .4); }
.rc-q { font-family: var(--display); font-size: 5.5rem; color: var(--moon); margin-top: 45%; text-shadow: 0 4px 0 rgba(0, 0, 0, .4); }
.rc-front {
  transform: rotateY(180deg); padding: 22px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: radial-gradient(circle at 50% 30%, #4a4570, #1b1838);
}
.role-card.r-wolf .rc-front { background: radial-gradient(circle at 50% 30%, #8d1426, #2a0610); }
.role-card.r-doctor .rc-front { background: radial-gradient(circle at 50% 30%, #1d8a68, #062b1f); }
.role-card.r-seer .rc-front { background: radial-gradient(circle at 50% 30%, #6a4bd6, #1c0f4a); }
.role-card.r-villager .rc-front { background: radial-gradient(circle at 50% 30%, #b07a1c, #3a2506); }
.rc-label { font-size: .78rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.rc-icon { width: 120px; height: 120px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.rc-name { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: #fff; }
.rc-desc { margin: 4px 0; font-weight: 700; font-size: .95rem; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.rc-secret { font-size: .8rem; font-weight: 800; opacity: .75; margin-top: auto; }

.allies { background: rgba(215, 38, 61, .16); border: 2px solid var(--blood); border-radius: 16px; padding: 12px 16px; text-align: center; max-width: 520px; width: 100%; }
.allies h3 { margin: 0 0 8px; }
.allies p { margin: 0; }
.ally-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ally { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .3); border-radius: 999px; padding: 3px 12px 3px 4px; font-weight: 800; }
.ally .av { width: 28px; height: 32px; }
.card-view .players-panel { width: 100%; }

/* ---------- Moderatör: kartlar ---------- */
.mod-panel { padding: 18px; position: sticky; top: 76px; }
.seen-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 10px; }
#seenFill { height: 100%; background: var(--mint); transition: width .4s; }
.seen-text { font-weight: 800; margin: 6px 0 12px; }
.role-columns { display: grid; gap: 10px; }
.role-col { border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--wheat); }
.role-col.r-wolf { border-left-color: var(--blood); }
.role-col.r-doctor { border-left-color: var(--mint); }
.role-col.r-seer { border-left-color: var(--violet); }
.role-col h3 { margin: 0 0 6px; font-size: 1rem; }
.role-col ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 700; font-size: .92rem; }
.role-col li.offline { opacity: .5; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Ölü / seçilen kutular ---------- */
.tile.dead { filter: grayscale(1); opacity: .55; }
.tile.dead .av { position: relative; }
.tile.dead .av::after, .death .cross, .verdict-av .cross {
  content: ''; position: absolute; left: -6%; right: -6%; top: 48%; height: 5px; border-radius: 3px;
  background: var(--blood); transform: rotate(-24deg); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}
.tile.dead .nm { text-decoration: line-through; text-decoration-color: var(--blood); text-decoration-thickness: 2px; }
.tile.picked { border-color: var(--moon); background: rgba(243, 201, 105, .18); transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(243, 201, 105, .25); }
.tile.disabled { opacity: .4; cursor: not-allowed; }
.votes { display: inline-flex; align-items: center; gap: 2px; background: var(--blood); border-radius: 999px; padding: 2px 8px 2px 3px; }
.votes .mini { width: 18px; height: 20px; display: inline-block; }
.votes b { font-size: .8rem; margin-left: 3px; }

.btn-violet { background: linear-gradient(180deg, var(--violet), #6a4bd6); }
.btn-night { background: linear-gradient(180deg, #3b3f9e, #1d1f5e); border: 1px solid rgba(255, 255, 255, .15); }
.btn-day { background: linear-gradient(180deg, #ffb347, #e9842a); color: #2a1300; }
.btn.wide { width: 100%; margin-top: 14px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-weight: 900; font-size: .85rem; }
.timer { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; color: var(--moon); }
.timer.low { background: var(--blood); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.closing { text-align: center; font-weight: 900; color: var(--moon); margin: 6px 0; animation: pulse 1.2s infinite; }

details.night-settings { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
details.night-settings[open] { display: flex; }
details.night-settings summary { font-weight: 900; cursor: pointer; }
details.night-settings > *:not(summary) { margin-top: 10px; }

/* ---------- Gece: moderatör ---------- */
.host-night { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.night-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
.night-side .mod-panel { position: static; display: flex; flex-direction: column; gap: 10px; }
.night-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.night-title h2 { font-family: var(--display); font-size: 1.9rem; color: var(--moon); margin: 0; }
.status-list { display: grid; gap: 6px; }
.st-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; font-size: .9rem; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--wheat); }
.st-row > span { font-weight: 900; }
.st-row.r-wolf { border-left-color: var(--blood); }
.st-row.r-doctor { border-left-color: var(--mint); }
.st-row.r-seer { border-left-color: var(--violet); }
.night-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.shared-q { padding: 14px 16px; }
.shared-q h3 { margin: 0 0 8px; font-size: 1rem; }
.q-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.qcard { padding: 14px 16px; border-top: 4px solid var(--wheat); min-width: 0; }
.qcard.r-wolf { border-top-color: var(--blood); }
.qcard.r-doctor { border-top-color: var(--mint); }
.qcard.r-seer { border-top-color: var(--violet); }
.qc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.qc-head h3 { margin: 0; font-size: 1.1rem; }
.qc-stat { font-weight: 800; color: var(--muted); font-size: .85rem; }
.qc-cur { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.qc-cur p { margin: 0; }
.qc-q { font-weight: 800; }
.qc-key { font-size: .85rem; color: var(--mint); margin-top: 4px !important; }
.qc-none { color: var(--muted); font-size: .9rem; }
.qform { display: grid; gap: 6px; }
.qform input { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(0, 0, 0, .3); font-weight: 700; outline: none; font-size: .92rem; }
.qform input:focus { border-color: var(--moon); }
.qform-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.shared-q .qform { grid-template-columns: 2fr 1.3fr auto; }
.qc-answers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.qc-answers li { display: grid; grid-template-columns: minmax(90px, 1fr) 1.4fr auto; gap: 8px; align-items: center; font-size: .9rem; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.an-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-text { overflow-wrap: anywhere; color: #e9e2ff; }
.marks { display: inline-flex; gap: 4px; }
.marks button { width: 28px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-weight: 900; font-size: .8rem; }
.marks button[data-mark='ok'].on { background: var(--mint); color: #062b1f; }
.marks button[data-mark='no'].on { background: var(--blood); color: #fff; }
.ok-yes { color: var(--mint); font-weight: 900; }
.ok-no { color: #ff7a8a; font-weight: 900; }
.ok-wait { color: var(--muted); }

.chat-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--blood); min-width: 0; }
.chat-panel h3 { margin: 0; font-size: 1rem; }
.chat-log { height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, .3); }
.msg { font-size: .92rem; line-height: 1.35; padding: 4px 8px; border-radius: 8px; overflow-wrap: anywhere; }
.msg b { color: #ff9aa6; }
.msg.host { background: rgba(243, 201, 105, .14); }
.msg.host b { color: var(--moon); }
.msg.mine { background: rgba(215, 38, 61, .18); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.chat-form input { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(0, 0, 0, .3); font-weight: 700; outline: none; }
.chat-form input:focus { border-color: var(--blood); }

/* ---------- Gece: oyuncu ---------- */
.night-view { display: flex; flex-direction: column; gap: 12px; }
.night-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.night-head h2 { font-family: var(--display); font-size: clamp(2rem, 6vw, 3rem); color: var(--moon); margin: 0; text-shadow: 0 0 24px rgba(243, 201, 105, .3); }
.night-cols { display: grid; grid-template-columns: 1fr minmax(260px, 360px); gap: 16px; align-items: start; }
.night-cols:has(> .chat-panel.hidden) { grid-template-columns: minmax(0, 760px); justify-content: center; }
.night-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.note-panel {
  padding: 18px 20px; position: relative;
  background: linear-gradient(180deg, rgba(243, 201, 105, .16), rgba(20, 18, 42, .85)); border: 1px solid rgba(243, 201, 105, .35);
}
.note-label { font-weight: 900; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--moon); }
.note-q { font-size: 1.35rem; font-weight: 900; margin: 8px 0 12px; line-height: 1.35; overflow-wrap: anywhere; }
.note-q.waiting-q { color: var(--muted); font-size: 1.05rem; font-style: italic; animation: pulse 2s infinite; }
.answer-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.answer-form input { width: 100%; border: 2px solid var(--moon); border-radius: 12px; padding: 11px 13px; background: rgba(0, 0, 0, .35); font-weight: 800; font-size: 1.05rem; outline: none; }
.answer-result { margin: 8px 0 0; font-weight: 900; font-size: 1.15rem; display: flex; flex-direction: column; gap: 2px; }
.answer-result:empty { display: none; }
.answer-result small { font-size: .85rem; color: var(--muted); font-weight: 700; }
.answer-result.yes { color: var(--mint); }
.answer-result.no { color: #ff7a8a; }
.answer-result.wait { color: var(--moon); }
.act-panel { padding: 16px; }
.act-panel h3 { margin: 0 0 4px; }
.seer-log { padding: 14px 16px; border-top: 4px solid var(--violet); }
.seer-log h3 { margin: 0 0 6px; font-size: 1rem; }
.seer-log ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.sleep { padding-top: 12vh; }
.zzz { color: var(--moon); filter: drop-shadow(0 0 18px rgba(243, 201, 105, .5)); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- Sabah ---------- */
body[data-time='day'] { --panel: rgba(255, 251, 240, .9); --panel-solid: #fffaf0; --ink: #2b2140; --muted: #6d6187; --line: rgba(43, 33, 64, .14); color-scheme: light; }
body[data-time='day'] .topbar { background: rgba(255, 255, 255, .55); }
body[data-time='day'] .brand, body[data-time='day'] .room-code { color: #b5651d; }
body[data-time='day'] .phase-label { color: #2b2140; }
body[data-time='day'] .tile { background: rgba(43, 33, 64, .06); }
body[data-time='day'] .icon-btn, body[data-time='day'] .room-code { background: rgba(255, 255, 255, .6); }
.morning-view, .end-view { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.morning-view .players-panel, .end-view .players-panel { width: 100%; }
.sun-head { text-align: center; }
.sun-icon { color: #fff; filter: drop-shadow(0 0 16px rgba(255, 201, 60, .9)); animation: rise 1.2s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sun-head h2 { font-family: var(--display); font-size: clamp(2.2rem, 7vw, 3.4rem); color: #fff; text-shadow: 0 3px 0 rgba(181, 101, 29, .6); margin: 4px 0; }
.sun-head p { font-weight: 900; font-size: 1.2rem; color: #3a2006; margin: 0; }
.deaths { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.death { background: var(--panel); border-radius: 16px; padding: 14px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow); animation: pop .5s ease-out both; }
.death .av { position: relative; width: 90px; height: 100px; filter: grayscale(1); }
.death .nm { font-weight: 900; text-decoration: line-through; text-decoration-color: var(--blood); text-decoration-thickness: 3px; font-size: 1.1rem; }
.host-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.host-bar .hint { color: #3a2006; }

/* ---------- Oyun sonu ---------- */
.winner { text-align: center; padding: 20px 28px; border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); animation: pop .6s cubic-bezier(.3, 1.4, .5, 1); }
.winner .w-icon { width: 110px; height: 110px; margin: 0 auto; }
.winner h2 { font-family: var(--display); font-size: clamp(2.4rem, 8vw, 4rem); margin: 6px 0; }
.winner.wolves h2 { color: var(--blood); }
.winner.villagers h2 { color: #b5651d; }
.winner p { font-weight: 900; font-size: 1.1rem; margin: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: translateX(40px) rotate(720deg); } }

/* ---------- Soru listesi ---------- */
.bank-box { width: min(720px, 100%); text-align: left; }
.bank-box h2 { text-align: center; }
.bank-tabs { margin: 10px 0; }
#bankText { width: 100%; min-height: 260px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(0, 0, 0, .3); font: 600 .95rem/1.6 ui-monospace, Menlo, monospace; outline: none; resize: vertical; }
#bankText:focus { border-color: var(--moon); }

/* ---------- Bildirimler ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(92vw, 420px); }
.toast { background: var(--panel-solid); border: 1px solid var(--line); border-left: 4px solid var(--violet); border-radius: 12px; padding: 10px 14px; font-weight: 800; box-shadow: var(--shadow); animation: tin .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.join, .toast.ok { border-left-color: var(--mint); }
.toast.leave { border-left-color: var(--muted); }
.toast.warn { border-left-color: var(--moon); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Onay kutusu ---------- */
/* Kutular gündüz temasında da koyu kalır */
.modal { --panel-solid: #191733; --ink: #f2eefc; --muted: #b5aed3; --line: rgba(255, 255, 255, .12); color: var(--ink); color-scheme: dark; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 14, .7); backdrop-filter: blur(4px); animation: fadein .2s ease-out; }
.modal-box { width: min(400px, 100%); padding: 24px 22px 20px; text-align: center; background: var(--panel-solid); animation: pop .25s cubic-bezier(.3, 1.4, .5, 1); }
.modal-icon { font-size: 2.6rem; line-height: 1; }
.modal-icon:empty { display: none; }
.modal-box h2 { font-family: var(--display); font-size: 1.9rem; color: var(--moon); margin: 8px 0 6px; }
.modal-box p { color: #e9e2ff; margin: 0 0 18px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: center; gap: 10px; }
.modal-actions .btn { min-width: 120px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }

/* ---------- Mobil ---------- */
/* Dar ekranda ay başlığın arkasına girmesin: sol üst köşeye, yarısı dışarıda */
@media (max-width: 900px) {
  .moon { top: -34px; right: auto; left: -34px; width: 110px; height: 110px; }
}
@media (max-width: 820px) {
  .host-lobby, .host-cards, .host-night, .night-cols { grid-template-columns: 1fr; }
  .settings, .mod-panel, .night-side { position: static; }
  .shared-q .qform { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .phase-label { order: 3; flex-basis: 100%; }
  .brand { font-size: 1.4rem; flex: 1; }
  .grid.small { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.lantern .ic, .zzz .ic, .sun-icon .ic { width: 56px; height: 56px; }
.zzz .ic, .sun-icon .ic { width: 72px; height: 72px; }
.seen-dot .ic { width: 13px; height: 13px; }
.marks button { display: inline-grid; place-items: center; padding: 0; }
.marks button .ic { width: 15px; height: 15px; }
.badge .ic, .badge .mini-art { width: 1.2em; height: 1.2em; }
.badge { display: inline-flex; align-items: center; gap: 4px; }
.timer { display: inline-flex; align-items: center; gap: 5px; }
.timer .ic { width: 15px; height: 15px; }
.modal-icon { display: grid; place-items: center; color: var(--moon); }
.modal-icon .ic { width: 46px; height: 46px; }
.modal-icon .art { width: 88px; height: 88px; }
.qc-q .ic, .qc-key .ic { width: 15px; height: 15px; }
.msg b .ic { width: 14px; height: 14px; margin-right: 3px; color: var(--moon); }
.answer-result .ic { width: 1.1em; height: 1.1em; }
.ok-yes .ic, .ok-no .ic, .ok-wait .ic { width: 15px; height: 15px; }
.role-col li .ic { width: 13px; height: 13px; }
.info h3 .mini-art, .info h3 .ic { width: 26px; height: 26px; color: var(--moon); }
.check .mini-art { width: 22px; height: 22px; }
.night-head h2 .ic, .night-title h2 .ic { color: var(--moon); }

/* ---------- Ses paneli ---------- */
.audio-panel { position: fixed; z-index: 55; width: min(260px, calc(100vw - 16px)); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-solid); --ink: #f2eefc; --muted: #b5aed3; color: var(--ink); color-scheme: dark; }
.audio-panel h3 { margin: 0 0 2px; font-size: 1rem; }
.ap-row { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; }
.ap-row .ic { width: 18px; height: 18px; color: var(--moon); }
.ap-row b { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.audio-panel input[type='range'] { width: 100%; accent-color: var(--moon); }
.audio-panel.muted input[type='range'] { opacity: .4; }
.audio-panel .hint { margin: 0; font-size: .8rem; }
#muteAll { margin-top: 4px; }
.dice { display: grid; place-items: center; padding: 0; }
.dice .ic { width: 22px; height: 22px; }

/* ---------- Gündüz: sabah, oylama, hüküm ---------- */
.day-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.day-view.with-chat { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.day-main { display: flex; flex-direction: column; gap: 16px; align-items: center; min-width: 0; }
.day-main .players-panel { width: 100%; }
.day-block { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.day-hint { margin: 0; font-weight: 800; color: #3a2006; text-align: center; max-width: 60ch; }
.host-bar.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.vote-head { text-align: center; }
.vote-head h2 { font-family: var(--display); font-size: clamp(2rem, 6vw, 3rem); color: #fff; text-shadow: 0 3px 0 rgba(163, 23, 43, .55); margin: 0 0 4px; justify-content: center; }
.vote-head h2 .ic { width: .8em; height: .8em; }
body[data-time='day'] .closing { color: #a3172b; }
.tie-box { background: var(--panel); border-radius: 16px; padding: 14px 18px; text-align: center; box-shadow: var(--shadow); border: 2px solid var(--moon-d); }
.tie-box h3 { margin: 0 0 4px; justify-content: center; color: #b5651d; }
.tie-box p { margin: 0 0 10px; font-weight: 700; }
.day-view .tile.clickable:hover { background: rgba(215, 38, 61, .12); }
.day-view .tile.picked { border-color: var(--blood); background: rgba(215, 38, 61, .14); box-shadow: 0 0 0 3px rgba(215, 38, 61, .2); }

.verdict { text-align: center; background: var(--panel); border-radius: 24px; padding: 20px 28px; box-shadow: var(--shadow); animation: pop .5s cubic-bezier(.3, 1.4, .5, 1); max-width: 520px; }
.verdict h2 { font-family: var(--display); font-size: clamp(1.9rem, 6vw, 2.8rem); margin: 8px 0 4px; color: var(--ink); }
.verdict p { margin: 0; font-weight: 900; font-size: 1.15rem; }
.verdict-av { display: flex; justify-content: center; align-items: center; gap: 14px; }
.verdict-av .av { position: relative; width: 100px; height: 112px; filter: grayscale(1); }
.verdict-art { width: 96px; height: 96px; animation: pop .6s .4s cubic-bezier(.3, 1.4, .5, 1) both; }
.verdict-role.r-wolf { color: var(--blood); }
.verdict-role { color: #6d6187; }
.verdict-icon .ic { width: 64px; height: 64px; color: #b5651d; }
.tally { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 4px; min-width: 240px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); }
.tally:empty { display: none; }
.tally li { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; }
.tally .tally-title { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Gündüz sohbeti açık zeminde */
body[data-time='day'] .chat-panel { border-top-color: var(--moon-d); }
body[data-time='day'] .chat-log { background: rgba(43, 33, 64, .06); }
body[data-time='day'] .msg b { color: #a3172b; }
body[data-time='day'] .msg.host { background: rgba(243, 201, 105, .3); }
body[data-time='day'] .msg.host b { color: #8a5a12; }
body[data-time='day'] .msg.mine { background: rgba(143, 108, 255, .14); }
body[data-time='day'] .chat-form input { background: #fff; }
body[data-time='day'] .chat-form input:focus { border-color: var(--moon-d); }
.day-chat { position: sticky; top: 76px; }
.day-chat .chat-log { height: min(52vh, 460px); }

@media (max-width: 820px) {
  .day-view.with-chat { grid-template-columns: 1fr; }
  .day-chat { position: static; }
}
.closing.with-ic { display: flex; justify-content: center; }
.closing.with-ic.hidden { display: none; }

/* ---------- Moderatör lobisi: ayarlar geniş alanda, oyuncular yan sütunda ---------- */
.host-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 16px; align-items: start; }
.lobby-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lobby-head { padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.lh-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lh-text h2 { margin: 0; }
.lh-text .invite { margin: 0; }
.lh-deal { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex: 0 1 260px; }
.lh-deal .hint { margin: 0; text-align: center; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.set-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.set-card h3 { margin: 0; font-size: 1.05rem; }
.set-card h3 .ic { color: var(--moon); }
.set-stack { display: flex; flex-direction: column; gap: 12px; }
.set-card #bankBtn { align-self: flex-start; }

.players-side { padding: 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.players-side .players-head h2 { margin: 0; }
.players-side .hint { margin: 0; }
.player-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.player-list .empty { padding: 20px 0; }
.player-list .tile { flex-direction: row; align-items: center; gap: 10px; padding: 6px 36px 6px 8px; text-align: left; }
.player-list .tile .av { width: 34px; height: 38px; flex: none; }
.player-list .tile .nm { flex: 1; font-size: .95rem; }
.player-list .tile .badge { flex: none; }
.player-list .tile .off { position: absolute; right: 36px; bottom: 2px; font-size: .65rem; }
.player-list .tile.clickable:hover { transform: translateX(2px); }
.player-list .kick { top: 50%; right: 6px; transform: translateY(-50%); opacity: .5; }
.player-list .tile:hover .kick { opacity: 1; }

@media (max-width: 900px) {
  .host-lobby { grid-template-columns: 1fr; }
  .players-side { position: static; max-height: none; }
  .player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Kart ekranı (moderatör) */
.host-cards .lh-text { gap: 6px; }
.host-cards .lh-text .hint { margin: 0; }
.host-cards .seen-text { margin: 0; }
.lh-row { display: flex; gap: 8px; }
.lh-row .btn { flex: 1; }
.host-cards .role-columns { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.host-cards .role-col { background: var(--panel); border: 1px solid var(--line); border-left-width: 4px; padding: 12px 14px; }
.host-cards .role-col ul { flex-direction: column; gap: 4px; }
.player-list .seen-dot { position: static; order: 3; flex: none; }
.player-list .tile .badge .mini-art { width: 1.1em; height: 1.1em; }
/* İç içe görünen düğmeler: dikey yığınlarda boşluk */
.night-side .mod-actions, .host-bar { gap: 10px; }
.set-card .check { align-items: flex-start; line-height: 1.35; }
.set-card .check input { margin-top: 1px; }
.set-card .seg button { line-height: 1.2; padding: 9px 8px; }
.lh-deal { flex-basis: 300px; }
.lh-row { flex-wrap: wrap; }
.lh-row .btn { white-space: nowrap; }
