/* Oyunlar: sekmedeki liste (#games: odada birlikte oynananlar, Kovan, Uzun Yol) ve odadaki oyunun ekranı (#party;
   Tabu .tb-*). Takım renkleri: Mavi --n2, Kırmızı --err (temaya göre tonları değişir). */

.games,
.party { --t0: var(--n2); --t1: var(--err); }

/* ---------- Oyunlar ---------- */

.games {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 20px;
  container: games / inline-size;
}
/* Geniş ekranda tek ortalı sütun; çocuklar yatay margin vermesin (hizası kayar) */
.games > * { width: 100%; max-width: 880px; margin-inline: auto; }
/* Başlık: sade; altında tek satırda nerede oynayacağın */
.gm-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px 12px; border-bottom: 1px solid var(--line); }
.gm-head-icon { flex: none; width: 34px; height: 34px; }
.gm-head-text { min-width: 0; }
.gm-head h2 { font-size: 17px; font-weight: 800; }
.gm-where { margin-top: 2px; color: var(--muted); font-size: 12px; }
.gm-where.away { color: var(--warn); }
/* Yatay boşluk yok: sütunla aynı hizada kalsın (.games > * ortalar; margin kısaltması onu ezerdi) */
.gm-label { margin-block: 6px -4px; padding-inline: 2px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; }

.gm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@container games (max-width: 560px) {
  .gm-grid { grid-template-columns: minmax(0, 1fr); }
}
.gm-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Birlikte oynananlar: solda ikon, yanında ad / açıklama / etiketler, altta düğme; aynı sıradakiler eşit boy */
.gm-party .gm-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 12px 14px; padding: 16px; }
.gm-party .gm-icon { width: 44px; height: 44px; }
.gm-party .gm-foot { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.gm-card:not(.soon):hover { border-color: var(--faint); }
.gm-card.open { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); box-shadow: 0 0 22px -10px var(--ok); }
.gm-icon { flex: none; width: 42px; height: 42px; }
.gm-text h4,
.gm-name { font-size: 15px; font-weight: 700; }
.gm-text p,
.gm-name + span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.gm-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; list-style: none; }
.gm-meta li { padding: 2px 8px; border-radius: 999px; background: var(--raise); color: var(--muted); font-size: 11px; }
.gm-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; }
.gm-foot small { flex: 1 1 120px; min-width: 0; color: var(--faint); font-size: 11px; line-height: 1.4; }
.gm-foot small:empty { visibility: hidden; }

.gm-btn {
  flex: none; height: 30px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise);
  color: var(--fg); font-size: 12px; font-weight: 600; transition: border-color 0.15s, filter 0.15s;
}
.gm-btn:hover:not(:disabled) { border-color: var(--accent); }
.gm-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.gm-btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.gm-btn:disabled { background: var(--raise); border-color: var(--line); color: var(--faint); cursor: not-allowed; }

/* Kovan, Uzun Yol: tek satır, tıklayınca açılır */
.gm-solo { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.gm-solo .gm-icon { width: 34px; height: 34px; }
.gm-solo .gm-text { flex: 1; min-width: 0; }
.gm-go { color: var(--faint); font-size: 18px; transition: transform 0.15s, color 0.15s; }
.gm-solo:hover .gm-go { color: var(--accent); transform: translateX(2px); }

/* Açık oyunlar: hangi odada ne oynanıyor */
.gm-live { display: grid; gap: 6px; }
.gm-live-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--panel));
}
.gm-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: nt-pulse 1.4s ease-in-out infinite; }
.gm-live-icon { flex: none; width: 22px; height: 22px; }
.gm-live-text { flex: 1; min-width: 0; display: grid; gap: 2px; color: var(--muted); font-size: 12px; }
.gm-live-text b { color: var(--fg); }
.gm-live-text > span, .gm-live-text > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-live-text > small { color: var(--faint); font-size: 10px; }
.gm-error,
.pt-error { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); font-size: 12px; }

/* ---------- Oyun ekranı ---------- */

.party { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pt-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.pt-back { flex: none; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); font-size: 22px; line-height: 1; }
.pt-back:hover { background: var(--raise); color: var(--fg); }
.pt-icon { flex: none; width: 28px; height: 28px; }
.pt-titles { flex: 1; min-width: 0; display: grid; }
.pt-titles b { font-size: 14px; }
.pt-titles small { color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-error { flex: none; margin: 10px 16px 0; }
.pt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 20px; container: party / inline-size; }
.pt-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.pt-empty img { width: 52px; height: 52px; opacity: 0.85; }

/* Son olay ("✓ elma", "✕ TABU!"): ortada kısa süre belirip kaybolur */
.pt-flash {
  position: absolute; left: 50%; top: 42%; z-index: 5; padding: 10px 22px; border-radius: 999px; pointer-events: none;
  font-size: 20px; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap;
  background: var(--raise); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  animation: pt-flash 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.pt-flash.good { background: var(--ok); border-color: var(--ok); color: #04150c; }
.pt-flash.bad { background: var(--err); border-color: var(--err); color: #fff; }
@keyframes pt-flash {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.85); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  24% { transform: translate(-50%, 0) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -18px); }
}

/* ---------- Tabu ---------- */

.tb { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.pt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nick, var(--fg)); font-weight: 600; }

/* Skor tabelası */
.tb-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
.tb-side {
  --c: var(--t0); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel); transition: border-color 0.2s, background 0.2s;
}
.tb-side.t1 { --c: var(--t1); flex-direction: row-reverse; }
.tb-side-name { min-width: 0; color: var(--c); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-side.mine .tb-side-name::after { content: " · sen"; color: var(--faint); font-weight: 500; }
.tb-side-score { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-side.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--panel)); box-shadow: 0 0 24px -10px var(--c); }
.tb-round { display: grid; place-content: center; justify-items: center; padding: 0 8px; color: var(--faint); font-size: 10px; }
.tb-round b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }

/* Lobi: iki takım, ayarlar, başlat */
.tb-lobby { display: flex; flex-direction: column; gap: 12px; }
.tb-teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tb-col {
  --c: var(--t0); display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--c); background: var(--panel);
}
.tb-col.t1 { --c: var(--t1); }
.tb-col.mine { background: color-mix(in srgb, var(--c) 6%, var(--panel)); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.tb-col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 2px 0; }
.tb-col-head b { color: var(--c); font-size: 15px; }
.tb-col-head small { color: var(--faint); font-size: 11px; }
.tb-people { display: grid; align-content: start; gap: 2px; min-height: 66px; list-style: none; }
.pt-person { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px; font-size: 13px; }
.pt-avatar {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: color-mix(in srgb, var(--c, var(--faint)) 22%, var(--raise)); color: var(--fg); font-size: 11px; font-style: normal; font-weight: 700;
}
.pt-tag { flex: none; padding: 1px 6px; border-radius: 999px; background: var(--raise); color: var(--faint); font-size: 10px; }
.pt-tag.me { color: var(--accent); }
.pt-none { padding: 6px 4px; color: var(--faint); font-size: 12px; list-style: none; }
.tb-join {
  --c: inherit; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px dashed color-mix(in srgb, var(--c) 55%, var(--line));
  color: var(--c); font-size: 12px; font-weight: 600; transition: background 0.15s;
}
.tb-col .tb-join { margin-top: auto; }
.tb-join.t0 { --c: var(--t0); }
.tb-join.t1 { --c: var(--t1); }
.tb-join:hover { background: color-mix(in srgb, var(--c) 10%, transparent); border-style: solid; }

.pt-setup {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
}
.pt-seg { display: flex; align-items: center; gap: 8px; }
.pt-seg-label { color: var(--faint); font-size: 12px; }
.pt-seg-btns { display: flex; gap: 2px; padding: 3px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); }
.pt-seg-btns button { height: 26px; padding: 0 10px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-seg-btns button:hover:not(:disabled) { color: var(--fg); }
.pt-seg-btns button.on { background: var(--raise); color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent); }
.pt-seg-btns button:disabled { cursor: default; }
.pt-seg-btns button:disabled:not(.on) { opacity: 0.45; }
.pt-ghost { margin-left: auto; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pt-ghost:hover { color: var(--fg); border-color: var(--faint); }

.pt-start { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pt-primary {
  min-width: 180px; height: 40px; padding: 0 22px; border-radius: 10px; background: var(--accent); color: var(--accent-fg);
  font-size: 14px; font-weight: 800; letter-spacing: 0.03em; transition: transform 0.08s, filter 0.15s;
}
.pt-primary:hover:not(:disabled) { filter: brightness(1.08); }
.pt-primary:active:not(:disabled) { transform: scale(0.97); }
.pt-primary:disabled { background: var(--raise); color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); cursor: not-allowed; }
.pt-hint { color: var(--faint); font-size: 12px; }
.pt-rules { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pt-rules summary { cursor: pointer; color: var(--fg); font-weight: 600; }
.pt-rules ol { display: grid; gap: 6px; margin: 8px 0 0 18px; line-height: 1.55; }
.tb-watching,
.tb-spectate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; color: var(--faint); font-size: 12px; }
.tb-watching { justify-content: flex-start; }

/* Hazırlık, tur özeti, sonuç: ortada bir kart */
.pt-stage {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; text-align: center;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
}
.pt-kicker { --c: var(--accent); color: var(--c); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; }
.pt-kicker.t0 { --c: var(--t0); }
.pt-kicker.t1 { --c: var(--t1); }
.pt-who { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 7px; font-size: 22px; font-weight: 800; }
.pt-who.t0 { color: var(--t0); }
.pt-who.t1 { color: var(--t1); }
.pt-note { max-width: 440px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pt-note .pt-name { display: inline; }
.tb-go { min-width: 220px; height: 48px; margin-top: 4px; font-size: 16px; }

/* Süre: çubuk kalan süre boyunca düz akar (party.js), son 5 saniye kırmızı */
.pt-timer { position: relative; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pt-track,
.pt-bar { display: block; width: 100%; height: 6px; border-radius: 999px; }
.pt-track { background: var(--raise); }
.pt-bar { position: absolute; top: 0; left: 0; background: var(--accent); transform-origin: left; }
.pt-time { display: flex; align-items: baseline; gap: 5px; color: var(--faint); font-size: 12px; }
.pt-secs { display: inline-block; color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }
.pt-timer.big { max-width: 460px; }
.pt-timer.big :is(.pt-track, .pt-bar) { height: 8px; }
.pt-timer.big .pt-secs { font-size: 30px; font-weight: 800; }
.pt-timer.hurry .pt-bar { background: var(--err); }
.pt-timer.hurry .pt-secs { color: var(--err); animation: tb-hurry 1s ease-in-out infinite; }
@keyframes tb-hurry { 50% { transform: scale(1.12); } }

/* Tur: kart (kelime ve yasaklar) ya da "tahmin et", anlatıcının düğmeleri, karşı takımın TABU'su */
.tb-turn { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tb-card {
  width: min(100%, 340px); overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 18px 40px -20px rgb(0 0 0 / 0.65);
}
.tb-card.fresh { animation: tb-card 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes tb-card { from { opacity: 0; transform: translateY(12px) rotate(-1.5deg) scale(0.96); } }
.tb-word {
  padding: 22px 14px; background: var(--accent); color: var(--accent-fg); text-align: center;
  font-size: 28px; font-weight: 800; letter-spacing: 0.05em; overflow-wrap: anywhere;
}
.tb-taboo { display: grid; list-style: none; }
.tb-taboo li { padding: 9px 14px; border-top: 1px solid var(--line); text-align: center; font-size: 15px; font-weight: 600; }
.tb-taboo li:first-child { border-top: 0; }
.tb-taboo li::before { content: "✕"; margin-right: 8px; color: var(--err); font-size: 11px; vertical-align: 1px; }

.tb-guess {
  width: min(100%, 340px); display: grid; justify-items: center; gap: 4px; padding: 34px 16px; border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); text-align: center;
}
.tb-guess strong { color: var(--accent); font-size: 30px; font-weight: 800; }
.tb-guess .pt-who { font-size: 15px; font-weight: 600; color: var(--muted); }
.tb-turn-score { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }

.tb-actions { width: min(100%, 440px); display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.tb-act {
  height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); color: var(--fg);
  font-size: 15px; font-weight: 800; transition: transform 0.08s, filter 0.15s;
}
.tb-act:hover:not(:disabled) { filter: brightness(1.1); }
.tb-act:active:not(:disabled) { transform: scale(0.96); }
.tb-act.good { background: var(--ok); border-color: var(--ok); color: #04150c; }
.tb-act.bad { background: color-mix(in srgb, var(--err) 15%, var(--raise)); border-color: color-mix(in srgb, var(--err) 50%, var(--line)); color: var(--err); }
.tb-act:disabled { opacity: 0.4; cursor: not-allowed; }
.tb-buzz {
  width: min(100%, 340px); height: 64px; border-radius: 14px; background: var(--err); color: #fff;
  font-size: 24px; font-weight: 900; letter-spacing: 0.08em; box-shadow: 0 12px 28px -12px var(--err); transition: transform 0.08s, filter 0.15s;
}
.tb-buzz:hover { filter: brightness(1.08); }
.tb-buzz:active { transform: scale(0.96); }

.tb-tally { width: min(100%, 460px); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; }
.tb-tally li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--raise); color: var(--muted); font-size: 12px; }
:is(.tb-tally, .tb-words) i { font-style: normal; font-weight: 800; }
.r-ok i { color: var(--ok); }
.r-tabu i { color: var(--err); }
:is(.r-pass, .r-time, .r-left) i { color: var(--faint); }

/* Tur özeti */
.tb-words { width: min(100%, 400px); display: grid; gap: 4px; list-style: none; text-align: left; }
.tb-words li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--raise); font-size: 13px; }
.tb-words small { color: var(--faint); font-size: 11px; }
.tb-review .pt-start { margin-top: 4px; }

/* Sonuç */
.pt-trophy { width: 68px; height: 68px; animation: pt-trophy 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.4); }
@keyframes pt-trophy { from { opacity: 0; transform: scale(0.4) rotate(-12deg); } }
.tb-final { display: flex; align-items: baseline; gap: 12px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-final .t0 { color: var(--t0); }
.tb-final .t1 { color: var(--t1); }
.tb-final i { color: var(--faint); font-style: normal; }
.tb-history { width: min(100%, 400px); display: grid; gap: 4px; list-style: none; counter-reset: turn; }
.tb-history li {
  --c: var(--t0); display: grid; grid-template-columns: 24px 64px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; background: var(--raise); font-size: 12px; text-align: left; counter-increment: turn;
}
.tb-history li::before { content: counter(turn) "."; color: var(--faint); }
.tb-history li.t1 { --c: var(--t1); }
.tb-history li > span { color: var(--c); font-weight: 700; }
.tb-history li > b { font-variant-numeric: tabular-nums; }

/* ---------- Çiz Bil ---------- */

.dw {
  max-width: 1080px; margin: 0 auto; display: grid; gap: 10px;
  grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "top top" "board side";
}
.dw[data-phase="lobby"],
.dw[data-phase="over"] { display: block; max-width: 720px; }

/* Lobi */
.dw-lobby { display: flex; flex-direction: column; gap: 12px; }
.dw-people { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.dw-people-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.dw-people-head b { font-size: 15px; }
.dw-people-head small { color: var(--faint); font-size: 11px; }
.dw-people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; list-style: none; }

/* Üst şerit: tur, kelime / harf yerleri, süre */
.dw-top {
  grid-area: top; display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; align-items: center; gap: 14px;
  padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.dw-round { display: grid; justify-items: center; color: var(--faint); font-size: 10px; }
.dw-round b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }
.dw-word { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 5px; min-height: 32px; }
.dw-word i { font-style: normal; }
.dw-word .blank { width: 18px; height: 26px; border-bottom: 3px solid var(--fg); }
.dw-word .hint { width: 18px; height: 26px; border-bottom: 3px solid var(--accent); color: var(--accent); font-size: 20px; font-weight: 800; text-align: center; line-height: 24px; }
.dw-word .gap { width: 12px; }
.dw-word small { align-self: center; margin-left: 8px; color: var(--faint); font-size: 11px; }
.dw-full { font-size: 22px; font-weight: 800; letter-spacing: 0.12em; }
.dw-wait { color: var(--muted); font-size: 14px; align-self: center; }
.dw-top .pt-timer { max-width: none; }

/* Tuval */
.dw-board { grid-area: board; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dw-stage {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; box-shadow: 0 14px 34px -22px rgb(0 0 0 / 0.7);
}
.dw-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.dw-canvas[data-tool="fill"] { cursor: cell; }
.dw-canvas.off { cursor: default; touch-action: auto; }
.dw-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; text-align: center; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(4px);
}
.dw-cover.enter { animation: dw-cover 0.2s ease-out; }
.dw-cover.soft { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.dw-cover .pt-ghost { margin-left: 0; }
@keyframes dw-cover { from { opacity: 0; } }
.dw-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dw-choice {
  min-width: 130px; height: 46px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--accent-fg);
  font-size: 15px; font-weight: 800; transition: transform 0.08s, filter 0.15s;
}
.dw-choice:hover { filter: brightness(1.08); }
.dw-choice:active { transform: scale(0.96); }
.dw-reveal { font-size: 30px; font-weight: 800; letter-spacing: 0.1em; }
.dw-gains { display: grid; gap: 4px; min-width: 200px; list-style: none; }
.dw-gains li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; border-radius: 8px; background: var(--raise); font-size: 13px; }
.dw-gains b:last-child { color: var(--ok); }

/* Araçlar (çizen) */
.dw-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
}
.dw-colors { display: grid; grid-template-columns: repeat(12, 22px); gap: 4px; }
.dw-color { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.22); }
.dw-color.on { box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.22), 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.dw-sizes,
.dw-kinds,
.dw-acts { display: flex; gap: 4px; }
.dw-size { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--raise); }
.dw-size i { border-radius: 50%; background: var(--fg); }
.dw-size.on,
.dw-tool.on { box-shadow: inset 0 0 0 1px var(--accent); color: var(--fg); }
.dw-tool { height: 30px; padding: 0 10px; border-radius: 8px; background: var(--raise); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dw-tool:hover { color: var(--fg); }
.dw-tool.danger:hover { color: var(--err); }
.dw-acts { margin-left: auto; }

/* Yan: puanlar, tahmin akışı, tahmin kutusu */
.dw-side { grid-area: side; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.dw-players { display: grid; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); list-style: none; }
.dw-player { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 8px; font-size: 13px; }
.dw-player.drawing { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dw-player.guessed { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.dw-rank { color: var(--faint); font-size: 11px; text-align: center; }
.dw-badge { color: var(--accent); font-size: 12px; }
.dw-player.guessed .dw-badge { color: var(--ok); }
.dw-score { font-variant-numeric: tabular-nums; }
.dw-feed {
  flex: 1; min-height: 150px; max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; line-height: 1.45;
}
.dw-msg { overflow-wrap: anywhere; color: var(--fg); }
.dw-msg .pt-name { display: inline; }
.dw-msg.correct { color: var(--ok); font-weight: 700; }
.dw-msg.close { color: var(--warn); }
.dw-msg:is(.turn, .word) { color: var(--faint); }
.dw-form { display: flex; gap: 6px; }
.dw-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font-size: 13px;
}
.dw-input:focus { border-color: var(--accent); outline: none; }
.dw-input:disabled { opacity: 0.6; }
.dw-send { width: 36px; height: 36px; border-radius: 10px; background: var(--raise); color: var(--muted); }
.dw-send:hover { color: var(--fg); }

/* Sonuç */
.dw-ranking { width: min(100%, 360px); display: grid; gap: 4px; list-style: none; }
.dw-ranking li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--raise); font-size: 13px; text-align: left; }
.dw-ranking li.top1 { background: color-mix(in srgb, var(--accent) 16%, var(--raise)); }
.dw-medal { width: 24px; height: 24px; }

@container party (max-width: 720px) {
  .dw { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "board" "side"; }
  .dw-top { grid-template-columns: auto minmax(0, 1fr); }
  .dw-top .pt-timer { grid-column: 1 / -1; }
  .dw-colors { grid-template-columns: repeat(6, 24px); }
  .dw-color { width: 24px; height: 24px; }
  .dw-acts { margin-left: 0; }
  .dw-feed { max-height: 220px; }
}

/* ---------- Vampir Köylü ---------- */

.vk { max-width: 760px; margin: 0 auto; }
.vk[data-phase="lobby"] { max-width: 720px; }
.vk-stage {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 18px; text-align: center;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
}
/* Gece: lacivert gökyüzü, birkaç yıldız (temadan bağımsız koyu; renkler siyah temanın) */
.vk.dark .vk-stage {
  border-color: #27305c;
  background:
    radial-gradient(1px 1px at 12% 18%, #ffffff90 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #ffffff70 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 7%, #ffffff80 50%, transparent 51%), radial-gradient(1px 1px at 88% 34%, #ffffff60 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 52%, #ffffff50 50%, transparent 51%), linear-gradient(180deg, #0a1030, #151b3d);
}
.vk.dark .pt-kicker { color: #9db2ff; }
.vk.dark .pt-note { color: #aab3d8; }

.vk-role {
  display: grid; justify-items: center; gap: 6px; width: min(100%, 360px); padding: 22px 18px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--raise); --c: var(--warn);
  border-color: color-mix(in srgb, var(--c) 50%, var(--line)); box-shadow: 0 0 34px -14px var(--c);
}
.vk-role.enter { animation: vk-flip 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes vk-flip { from { opacity: 0; transform: perspective(600px) rotateY(70deg) scale(0.92); } }
.vk-role.r-vampire { --c: var(--err); }
.vk-role.r-doctor { --c: var(--ok); }
.vk-role.r-seer { --c: var(--n3); }
.vk-role-icon { width: 76px; height: 76px; }
.vk-role-name { color: var(--c); font-size: 26px; font-weight: 800; letter-spacing: 0.06em; }
.vk-mates { color: var(--err); font-size: 13px; font-weight: 700; }
.vk-mine { padding: 3px 10px; border-radius: 999px; background: var(--raise); color: var(--muted); font-size: 12px; }

/* Oyuncular: seçilebilir kartlar; ölü soluk ve üstü çizili, bilinen rol rozeti, oy sayısı */
.vk-people { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.vk-person {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 12px 8px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--raise); text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
button.vk-person:hover { border-color: var(--faint); }
button.vk-person:active { transform: scale(0.97); }
.vk-person .pt-avatar { width: 34px; height: 34px; font-size: 14px; }
.vk-person .pt-name { max-width: 100%; }
.vk-person.me { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.vk-person.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--raise)); }
.vk-person.dead { opacity: 0.5; }
.vk-person.dead .pt-name { text-decoration: line-through; }
.vk-person.off:not(.dead) { opacity: 0.45; }
.vk-badge { padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 10px; font-weight: 700; }
.vk-badge.r-vampire { color: var(--err); }
.vk-badge.r-doctor { color: var(--ok); }
.vk-badge.r-seer { color: var(--n3); }
.vk-badge.r-villager { color: var(--warn); }
.vk-badge.dead { color: var(--faint); }
.vk-votes {
  position: absolute; top: 6px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px;
}
.vk-tag { max-width: 100%; color: var(--faint); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vampirlerin gece yazışması */
.vk-chat {
  width: min(100%, 460px); min-height: 80px; max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px;
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 12px; text-align: left;
}
.vk-form { width: min(100%, 460px); display: flex; gap: 6px; }
.vk-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg); font-size: 13px;
}
.vk-input:focus { border-color: var(--accent); outline: none; }

/* Gözcünün baktıkları */
.vk-seen { width: min(100%, 360px); display: grid; gap: 4px; list-style: none; }
.vk-seen li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--raise); font-size: 12px; text-align: left; }
.vk-seen small { color: var(--faint); }
.vk-seen li.bad b { color: var(--err); }
.vk-seen li.good b { color: var(--ok); }

.vk-moon,
.vk-sun { width: 64px; height: 64px; animation: vk-float 3s ease-in-out infinite; }
@keyframes vk-float { 50% { transform: translateY(-5px); } }
.vk-verdict { font-size: 18px; font-weight: 800; }
.vk-verdict.bad,
.pt-who.bad { color: var(--err); }
.vk-verdict.good,
.pt-who.good { color: var(--ok); }
.pt-ghost.on { color: var(--fg); border-color: var(--accent); }
.vk-log { width: min(100%, 420px); display: grid; gap: 4px; list-style: none; color: var(--muted); font-size: 12px; text-align: left; }
.vk-log li { padding: 5px 10px; border-radius: 8px; background: var(--raise); }

@media (max-width: 760px) {
  .games { padding: 12px; }
  .gm-hero { padding: 14px 16px; }
  .pt-head { padding: 10px 12px; }
  .pt-error { margin: 8px 12px 0; }
  .pt-body { padding: 12px 12px 18px; }
  .tb-side { padding: 8px 10px; }
  .tb-side-score { font-size: 22px; }
  .tb-word { padding: 18px 12px; font-size: 24px; }
  .pt-stage { padding: 20px 14px; }
}

/* ---------- v6, adım 7: Oyunlar listesi tek yazı ölçeğinde (modern görünüm) ----------
   Punto 12 / 14 / 16 / 20, ağırlık 400 / 500 / 600, köşe 4 / 8 / 999; parıltılı gölge yok. Yalnızca liste (#games);
   oyunların kendi ekranları (.pt-, .tb-, .dw-, .vk-) olduğu gibi kalır. */
[data-look="modern"] #games .gm-head h2 { font-size: 20px; font-weight: 600; }
[data-look="modern"] #games .gm-name { font-size: 14px; font-weight: 600; }
[data-look="modern"] #games :is(.gm-label, .gm-foot small, .gm-live-text > small) { font-size: 12px; }
[data-look="modern"] #games .gm-go { font-size: 16px; }
[data-look="modern"] #games .gm-card { border-radius: 8px; }
[data-look="modern"] #games .gm-card.open { box-shadow: none; }
[data-look="modern"] #games :is(.gm-btn, .gm-live-row) { border-radius: 4px; }
[data-look="modern"] #games .gm-btn { font-weight: 500; }
[data-look="modern"] #games :is(.gm-text h4, .gm-name) { font-size: 14px; font-weight: 600; }
