/* =========================================================================
   Dost Meclisi — tasarım sistemi
   Tema: [data-theme="dark|light"] · Vurgu: [data-accent="..."] (html elemanında)
   ========================================================================= */

:root,
[data-theme="dark"] {
  --bg: #0d0f13;
  --bg-elev: #12151a;
  --surface: #181b21;
  --surface-2: #1f232a;
  --surface-3: #272c35;
  --border: rgba(255, 255, 255, .065);
  --border-strong: rgba(255, 255, 255, .12);
  --text: #eceef3;
  --text-2: #b9bdc9;
  --muted: #868c9c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .5);
  --ok: #34c77b;
  --warn: #f5b84b;
  --gold: #f2c14e;
  --alim-a: #ffe39a;
  --alim-b: #d9a21f;
  --danger: #ef4d56;
  --info: #8ea1ff;
  --c-strength: 100%;
  --scrim: rgba(5, 6, 9, .6);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef0f5;
  --bg-elev: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --surface-3: #e6e8ee;
  --border: rgba(17, 20, 28, .08);
  --border-strong: rgba(17, 20, 28, .15);
  --text: #12141a;
  --text-2: #3b404d;
  --muted: #6a7080;
  --shadow-sm: 0 1px 2px rgba(17, 20, 28, .06);
  --shadow: 0 12px 32px rgba(23, 28, 48, .09);
  --shadow-lg: 0 24px 64px rgba(23, 28, 48, .16);
  --ok: #18a35c;
  --warn: #c98a12;
  --gold: #946300;
  --alim-a: #b07a00;
  --alim-b: #6e4700;
  --danger: #dc3640;
  --info: #4f62e8;
  --c-strength: 70%;
  --scrim: rgba(17, 20, 28, .35);
  color-scheme: light;
}

/* Vurgu rengi: html[data-accent]. Varsayılanı :root'ta değil burada tanımlanır, yoksa seçilen rengi ezer. */
html:not([data-accent]), [data-accent="indigo"] { --accent: #7c6cff; }
[data-accent="blue"] { --accent: #3b82f6; }
[data-accent="green"] { --accent: #10b981; }
[data-accent="orange"] { --accent: #f97316; }
[data-accent="pink"] { --accent: #ec4899; }
[data-accent="red"] { --accent: #ef4444; }

:root {
  --accent-hover: color-mix(in oklab, var(--accent) 86%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-softer: color-mix(in oklab, var(--accent) 9%, transparent);
  --on-accent: #fff;
  --ink: #10131a;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --gap: 12px;
  --side-w: 272px;
  --chat-w: 344px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Temel ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 550; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; }
.btn .icon { width: 17px; height: 17px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.small .icon { width: 15px; height: 15px; }
.btn.lg { height: 46px; font-size: 15.5px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 30%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
/* Genel .btn:hover kırmızıyı griye çevirmesin (dokunmatikte basınca takılı kalan hover da): tehlikeli düğme kırmızı kalır. */
.btn.danger:hover:not(:disabled) { background: color-mix(in oklab, var(--danger) 86%, #000); }
.btn.danger.soft { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger); }
.btn.danger.soft:hover:not(:disabled) { background: color-mix(in oklab, var(--danger) 22%, transparent); }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn.primary { background: var(--accent); color: var(--on-accent); }
.icon-btn.primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.icon-btn.off { color: var(--danger); }
.icon-btn.off:hover { background: color-mix(in oklab, var(--danger) 14%, transparent); color: var(--danger); }

.pill, .badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
  background: var(--surface-2); color: var(--muted);
}
.pill.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.status[data-state="ok"] { color: var(--ok); }
.pill.status[data-state="warn"], .pill.warn { color: var(--warn); }
.badge { min-width: 18px; height: 18px; padding: 0 6px; justify-content: center; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 7px;
  border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  background: var(--surface-2); font: 600 12px var(--mono); color: var(--text-2);
}

/* ---------- Formlar ---------- */
.field { display: grid; gap: 7px; }
.field.grow { flex: 1; min-width: 0; }
.field > span { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.field output { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
input:not([type="range"]):not([type="checkbox"]), select, textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input:not([type="range"]):not([type="checkbox"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0; height: 22px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); transition: background .18s var(--ease); }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-error { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in oklab, var(--danger) 13%, transparent); color: var(--danger); font-size: 14px; font-weight: 500; }

/* ---------- Avatar ve marka ---------- */
.avatar {
  --size: 36px;
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--c, #8a93a6); color: var(--ink);
  font-weight: 750; font-size: calc(var(--size) * .38); letter-spacing: -.02em; user-select: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.avatar.xs { --size: 22px; font-size: 10px; }
.avatar.sm { --size: 28px; }
.avatar.lg { --size: 48px; }
.avatar.xl { --size: 76px; }
.avatar.neutral { background: var(--surface-3); color: var(--muted); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.has-img { background: var(--surface-3); box-shadow: none; }
.avatar.has-img::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--c, var(--border-strong)) 85%, transparent); pointer-events: none; }
.avatar.has-emoji { background: color-mix(in oklab, var(--c, var(--surface-3)) 32%, var(--surface-2)); }
.avatar-emoji { font-size: calc(var(--size) * .56); line-height: 1; font-weight: 400; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.avatar.neutral.has-emoji, .avatar.neutral.has-img { background: var(--surface-3); }

/* ChessMaster (en yüksek Meclis ELO): avatarın sağ üstünde küçük taç, isminin önünde [ChessMaster]. Bkz. ui/people.js. */
.avatar.is-cm::before {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  top: calc(var(--size) * -.24); right: calc(var(--size) * -.2);
  width: max(11px, calc(var(--size) * .46)); aspect-ratio: 24 / 20;
  transform: rotate(24deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M2.5 5.5l5 4.2L12 2l4.5 7.7 5-4.2-1.9 10H4.4z' fill='%23ffd34d' stroke='%238a5a00' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M4.4 15.5h15.2v2.6H4.4z' fill='%23f0b429' stroke='%238a5a00' stroke-width='1.4' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='2.2' r='1.5' fill='%23fff3b0' stroke='%238a5a00' stroke-width='1'/%3E%3Ccircle cx='2.5' cy='5.5' r='1.3' fill='%23fff3b0' stroke='%238a5a00' stroke-width='1'/%3E%3Ccircle cx='21.5' cy='5.5' r='1.3' fill='%23fff3b0' stroke='%238a5a00' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .45));
}
.is-cm:not(.avatar)::before { content: "[ChessMaster]\00a0"; color: var(--gold); font-weight: 750; }
/* Alîm (en yüksek Din puanı, bkz. ui/people.js setAlim): unvanların en prestijlisi. Avatarda tacın yerine sarık
   (beyaz kıvrımlı sarık, zümrüt kavuk, altın şerit ve zümrüt taş; hafif altın hare), isminin önünde altın [Alîm].
   Aynı kişi ChessMaster da ise avatarda sarık görünür, önekte ikisi birlikte yazar. */
.avatar.is-alim::before {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  top: calc(var(--size) * -.25); right: calc(var(--size) * -.25);
  width: max(16px, calc(var(--size) * .6)); aspect-ratio: 32 / 26;
  transform: rotate(14deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 26'%3E %3Cdefs%3E %3ClinearGradient id='w' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.6' stop-color='%23f6f1e4'/%3E%3Cstop offset='1' stop-color='%23e2d7bb'/%3E%3C/linearGradient%3E %3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%232fae76'/%3E%3Cstop offset='1' stop-color='%230a5636'/%3E%3C/linearGradient%3E %3ClinearGradient id='au' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23b8860b'/%3E%3Cstop offset='.5' stop-color='%23ffe08a'/%3E%3Cstop offset='1' stop-color='%23b8860b'/%3E%3C/linearGradient%3E %3C/defs%3E %3Cpath d='M10.6 10 C10.6 5.2 13 2.6 16 2.6 C19 2.6 21.4 5.2 21.4 10 Z' fill='url%28%23g%29' stroke='%234a3206' stroke-width='.9'/%3E %3Cpath d='M14.2 4.4 C15 3.7 16.6 3.6 17.6 4.3' fill='none' stroke='%238fe0b6' stroke-width='.7' stroke-linecap='round' opacity='.8'/%3E %3Ccircle cx='16' cy='2.5' r='1.35' fill='%23ffd75e' stroke='%237a5200' stroke-width='.7'/%3E %3Cpath d='M2.4 16.8 C2 11.2 8.3 7.6 16 7.6 C23.7 7.6 30 11.2 29.6 16.8 C29.3 21.4 23.5 23.9 16 23.9 C8.5 23.9 2.7 21.4 2.4 16.8 Z' fill='url%28%23w%29' stroke='%235c4a26' stroke-width='1'/%3E %3Cpath d='M8.2 10.2 C12.6 12.8 20.4 13 25.8 9.8' fill='none' stroke='%23cdbf9c' stroke-width='1' stroke-linecap='round'/%3E %3Cpath d='M4.4 13.4 C9.6 16.8 19 17.8 28 12.6' fill='none' stroke='%23c7b892' stroke-width='1.05' stroke-linecap='round'/%3E %3Cpath d='M6.6 21.3 C12.4 17.6 18.6 13 24.8 9.2' fill='none' stroke='%23d6caab' stroke-width='.95' stroke-linecap='round'/%3E %3Cpath d='M3.3 18.3 C8.6 22 23.4 22 28.7 18.3' fill='none' stroke='url%28%23au%29' stroke-width='1.5' stroke-linecap='round'/%3E %3Cellipse cx='16' cy='15.6' rx='2.05' ry='2.45' fill='url%28%23g%29' stroke='url%28%23au%29' stroke-width='1.2'/%3E %3Ccircle cx='15.3' cy='14.7' r='.55' fill='%23e9fff4' opacity='.9'/%3E %3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, .5)) drop-shadow(0 0 3px color-mix(in oklab, var(--gold) 60%, transparent));
}
.is-alim:not(.avatar)::before {
  content: "[Alîm]\00a0"; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(100deg, var(--alim-b), var(--alim-a) 45%, var(--alim-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.is-alim.is-cm:not(.avatar)::before { content: "[Alîm]\00a0[ChessMaster]\00a0"; }
/* Kartlarda ve dar yerlerde (kendi kartın, satranç oyuncu şeridi) önek ismin üstünde küçük ayrı satırdır: ismi kesmesin. */
.tile-name :is(.is-cm, .is-alim)::before, .me-info :is(.is-cm, .is-alim)::before, .cb-name :is(.is-cm, .is-alim)::before { display: block; font-size: 10.5px; line-height: 1.2; letter-spacing: .02em; }
.tile-name :is(.is-cm, .is-alim)::before { font-size: 11px; text-align: center; }

.avatar-btn { position: relative; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; }
.avatar-btn:hover .avatar { filter: brightness(1.06); }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--surface);
}
.avatar-edit .icon { width: 14px; height: 14px; }
.avatar-picker { display: grid; gap: 10px; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.avatar-choice {
  aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px;
  background: var(--surface-2); font-size: 18px; line-height: 1; transition: background .12s var(--ease), transform .12s var(--ease);
}
.avatar-choice:hover { background: var(--surface-3); transform: scale(1.08); }
.avatar-choice[aria-checked="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

.brand-mark {
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 80%, white), var(--accent) 55%, color-mix(in oklab, var(--accent) 70%, black));
  color: #fff; box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark .icon { width: 19px; height: 19px; }
.brand-mark.lg { width: 54px; height: 54px; border-radius: 16px; }
.brand-mark.lg .icon { width: 27px; height: 27px; }

/* ---------- Giriş ekranı ---------- */
.join { position: relative; min-height: 100%; display: grid; place-items: center; padding: 32px 16px; overflow: hidden; }
.join-aura {
  position: absolute; inset: -20%; pointer-events: none;
  background:
    radial-gradient(40% 35% at 30% 30%, color-mix(in oklab, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(35% 30% at 75% 70%, color-mix(in oklab, #2ec4b6 18%, transparent), transparent 70%),
    radial-gradient(30% 30% at 70% 20%, color-mix(in oklab, #f06ba8 14%, transparent), transparent 70%);
  filter: blur(20px); animation: aura 18s ease-in-out infinite alternate;
}
@keyframes aura { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
.join-theme { position: absolute; top: 16px; right: 16px; z-index: 2; }
.join-card {
  position: relative; z-index: 1; width: min(440px, 100%); display: grid; gap: 18px; padding: 32px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow-lg);
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.join-brand { display: flex; align-items: center; gap: 16px; }
.join-brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.lead { margin: 2px 0 0; color: var(--text-2); font-size: 14.5px; }
.join-identity { display: flex; align-items: flex-end; gap: 14px; }
.join-identity .avatar { transition: background .3s var(--ease), color .3s var(--ease); }
.join-features { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.join-features li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.feature-ico .icon { width: 15px; height: 15px; color: var(--accent); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Uygulama yerleşimi ---------- */
.app {
  height: 100dvh; display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--chat-w);
  grid-template-areas: "side main chat";
  animation: fade .35s var(--ease) both;
  transition: grid-template-columns .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

/* Kenar çubuğu */
.sidebar { grid-area: side; display: flex; flex-direction: column; min-height: 0; background: var(--bg-elev); border-right: 1px solid var(--border); }
.side-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); }
.side-title { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.side-title strong { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.side-title small { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.side-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 20%, transparent); }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.side-label { margin: 14px 8px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.room-list, .member-list, .room-members { list-style: none; margin: 0; padding: 0; }
.room + .room { margin-top: 2px; }
.room-btn {
  position: relative; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.room-btn:hover { background: var(--surface-2); color: var(--text); }
.room-btn .icon { width: 18px; height: 18px; color: var(--muted); }
.room-name { flex: 1; font-weight: 600; }
.room-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.room-join { display: none; font-size: 12px; font-weight: 650; color: var(--accent); }
.room-btn:hover .room-join { display: inline; }
.room-btn:hover .room-meta.count { display: none; }
.room.active .room-btn { background: var(--accent-soft); color: var(--text); }
.room.active .room-btn .icon, .room.active .room-meta { color: var(--accent); }
.room.full:not(.active) .room-btn { opacity: .7; }
.room-members { padding: 2px 0 6px 22px; }

.member {
  display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: var(--radius-xs);
  color: var(--text-2); font-size: 13.5px; cursor: pointer; transition: background .15s var(--ease);
}
.member:hover { background: var(--surface-2); color: var(--text); }
.member .avatar { transition: box-shadow .12s var(--ease); }
.member.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--c); }
.member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .you { font-size: 11px; color: var(--muted); }
.member-flags { display: inline-flex; gap: 3px; color: var(--muted); }
.member-flags .icon { width: 14px; height: 14px; }
.member-flags .flag-danger { color: var(--danger); }
.member-flags .flag-warn { color: var(--warn); }
.member-flags .flag-accent { color: var(--accent); }
.member-list .member { padding-left: 10px; }

.me-panel { display: flex; align-items: center; gap: 4px; padding: 8px; border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg-elev) 70%, var(--surface)); }
.me-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; }
.me-card:hover { background: var(--surface-2); }
.me-card .avatar { --size: 34px; transition: box-shadow .1s linear; }
.me-card.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--c); }
.me-info { display: grid; min-width: 0; line-height: 1.25; }
.me-info strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-info small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-actions { display: flex; gap: 2px; }
.room-badge, .lobby-rail { display: none; }

/* Geniş ekranda soldaki panel ince bir şeride dönüşebilir: meclis simgeleri (kişi sayısıyla), lobi sayısı, mikrofon/kulaklık/ayarlar. */
@media (min-width: 901px) {
  .app.side-collapsed { --side-w: 68px; }
  .app.side-collapsed .side-head { flex-direction: column; gap: 6px; padding: 12px 0 10px; }
  .app.side-collapsed .side-head .brand-mark, .app.side-collapsed .side-title,
  .app.side-collapsed .room-name, .app.side-collapsed .room-meta, .app.side-collapsed .room-join,
  .app.side-collapsed .room-members, .app.side-collapsed .side-label, .app.side-collapsed .member-list,
  .app.side-collapsed .me-info { display: none; }
  .app.side-collapsed .side-scroll { padding: 8px 6px 16px; }
  .app.side-collapsed .room-btn { justify-content: center; padding: 11px 0; }
  .app.side-collapsed .room-btn .icon { width: 20px; height: 20px; }
  .app.side-collapsed .room-badge {
    display: grid; place-items: center; position: absolute; top: 3px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 10.5px; font-weight: 750; font-variant-numeric: tabular-nums;
  }
  .app.side-collapsed .room.active .room-badge { background: var(--accent); color: var(--on-accent); }
  .app.side-collapsed .room:has(.member.speaking) .room-btn { box-shadow: inset 0 0 0 2px var(--ok); }
  .app.side-collapsed .lobby-rail {
    display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 0; padding-top: 12px;
    border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; font-weight: 700;
  }
  .app.side-collapsed .lobby-rail .icon { width: 17px; height: 17px; }
  .app.side-collapsed .me-panel { flex-direction: column; gap: 6px; padding: 8px 0; }
  .app.side-collapsed .me-card { flex: none; padding: 4px; }
  .app.side-collapsed .me-actions { flex-direction: column; }
}

/* Ana alan */
.main { grid-area: main; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; min-height: 60px; border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 85%, var(--bg-elev)); }
.room-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.room-title h2 { font-size: 17px; font-weight: 750; }
.room-title-ico .icon { width: 20px; height: 20px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.chat-toggle { display: none; position: relative; }
.only-narrow { display: none; }
/* Geniş ekranda sohbet gizlenebilir; açmak için üst çubuktaki "Sohbet" (okunmamış sayısıyla) görünür. */
@media (min-width: 1241px) {
  .app.chat-collapsed { --chat-w: 0px; }
  .app.chat-collapsed .chat { display: none; }
  .app.chat-collapsed .chat-toggle { display: inline-flex; }
}
.banner { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 8px; background: color-mix(in oklab, var(--warn) 14%, transparent); color: var(--warn); font-weight: 550; }

/* Lobi */
.lobby { flex: 1; overflow-y: auto; padding: 36px clamp(16px, 4vw, 48px) 48px; animation: fade .3s var(--ease) both; }
.lobby-hero { max-width: 760px; margin-bottom: 26px; }
.lobby-hero h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.03em; }
.lobby-hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lobby-hero p { margin: 8px 0 0; color: var(--text-2); font-size: 15px; }
.room-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.room-card {
  position: relative; display: grid; gap: 16px; padding: 20px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  overflow: hidden;
}
.room-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 100% 0%, var(--accent-softer), transparent 70%); opacity: 0; transition: opacity .25s var(--ease); pointer-events: none; }
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.room-card:hover::before, .room-card.active::before { opacity: 1; }
.room-card.active { border-color: var(--accent); }
.room-card-head { display: flex; align-items: center; gap: 12px; }
.room-card-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.room-card-head h3 { font-size: 17px; font-weight: 750; }
.room-card-head small { color: var(--muted); font-size: 12.5px; }
.stack { display: flex; align-items: center; min-height: 34px; }
.stack .avatar { --size: 32px; box-shadow: 0 0 0 3px var(--surface); }
.stack .avatar + .avatar { margin-left: -8px; }
.stack .more { margin-left: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stack .empty { font-size: 13px; color: var(--muted); }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.card { padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-ico .icon { width: 18px; height: 18px; color: var(--accent); }
.mic-check { display: grid; gap: 12px; }
.mic-check p { margin: 0; }
.kbd-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 9px; }
.kbd-list li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; }
.kbd-list .keys { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.kbd-list li > span:last-child { color: var(--text-2); }
.kbd-list.wide li { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.kbd-list.wide li:last-child { border-bottom: 0; }
.kbd-list.wide li > span:last-child { text-align: right; }

.meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter.big { height: 12px; }
.meter-fill { height: 100%; width: 0; border-radius: inherit; background: var(--muted); transition: width .07s linear, background .15s; }
.meter-fill.open { background: linear-gradient(90deg, var(--ok), color-mix(in oklab, var(--ok) 70%, #a3d65c)); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--warn); }

/* Sahne */
.stage { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: var(--gap); min-height: 0; padding-bottom: 104px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); align-content: start; }
.tile {
  /* Tek sütun kartın genişliğinde kalır: uzun isim (ve [ChessMaster] öneki) kartı büyütmez, "…" ile kısalır. */
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; padding: 22px 14px 16px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in oklab, var(--c, var(--surface)) 11%, var(--surface)), var(--surface) 70%);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .14s var(--ease), border-color .14s var(--ease), transform .2s var(--ease);
  animation: pop .35s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.tile.self { cursor: default; }
.tile:not(.self):hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tile .avatar { --size: 72px; transition: box-shadow .12s var(--ease); }
.tile.speaking { border-color: color-mix(in oklab, var(--c) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--c) 60%, transparent), 0 8px 30px color-mix(in oklab, var(--c) 28%, transparent); }
.tile.speaking .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--c), 0 0 26px 4px color-mix(in oklab, var(--c) 45%, transparent); }
.tile.local-muted .avatar { filter: grayscale(.6) opacity(.75); }
.tile[data-away="true"] { border-style: dashed; }
.tile[data-away="true"] .status-text { color: var(--warn); }
.tile[data-conn="failed"] { border-color: color-mix(in oklab, var(--danger) 50%, transparent); }
.tile-badge {
  position: absolute; top: 76px; left: calc(50% + 18px); display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; box-shadow: 0 0 0 3px var(--surface);
}
.tile-badge.warn { background: var(--warn); color: var(--ink); }
.tile-badge.muted { background: var(--surface-3); color: var(--text-2); }
.tile-badge .icon { width: 14px; height: 14px; }
.tile-name { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; font-weight: 700; font-size: 15px; }
.tile-name .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .you, .tile-name .admin-star { flex: none; }
.tile-name .you { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.admin-star { width: 15px; height: 15px; color: var(--warn); fill: currentColor; }
.tile-status { display: flex; align-items: center; gap: 7px; min-height: 20px; font-size: 12.5px; color: var(--muted); }
.flags { display: inline-flex; gap: 4px; }
.flag { width: 15px; height: 15px; color: var(--danger); }
.flag.sharing { color: var(--accent); }
.flag.admin-muted { color: var(--warn); }
.flag.local { color: var(--muted); }
.tile-more { position: absolute; top: 8px; right: 8px; opacity: 0; }
.tile:hover .tile-more, .tile-more:focus-visible { opacity: 1; }
.tile:not(.self) { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile-react {
  position: absolute; top: 6px; left: 50%; z-index: 2; translate: -50% 0; pointer-events: none;
  font-size: 30px; line-height: 1; opacity: 0;
}
.tile-react.gg, .float-emoji.gg { font: 800 15px/1 var(--font); letter-spacing: .02em; padding: 5px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.tile-react.show { animation: tileReact 1.6s var(--ease) both; }
@keyframes tileReact {
  0% { opacity: 0; transform: translateY(10px) scale(.6); }
  15% { opacity: 1; transform: translateY(-4px) scale(1.15); }
  30% { transform: translateY(0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}
.whisper-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in oklab, var(--info) 18%, transparent); color: var(--info); font-size: 12px; font-weight: 650;
}
.whisper-tag .icon { width: 13px; height: 13px; }
.tile.whisper-in, .tile.whisper-out { border-color: color-mix(in oklab, var(--info) 65%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--info) 55%, transparent), 0 8px 30px color-mix(in oklab, var(--info) 22%, transparent); }
.tile.whisper-out { transform: scale(.985); }

/* Bağlantı kalitesi çubukları */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; border-radius: 1px; background: var(--surface-3); }
.bars i:nth-child(1) { height: 5px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 12px; }
.bars[data-level="3"] i { background: var(--ok); }
.bars[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.bars[data-level="1"] i:nth-child(1) { background: var(--danger); }
.bars[data-level="0"] i { animation: blink 1.2s ease-in-out infinite; }
.bars[data-level="0"] i:nth-child(2) { animation-delay: .15s; }
.bars[data-level="0"] i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { background: var(--muted); } }

/* Ekran paylaşımı */
.screens { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.screen { position: relative; margin: 0; display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; background: #000; border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop .35s var(--ease) both; }
.screen::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c, var(--accent)); z-index: 1; }
.screen-view { position: relative; width: 100%; max-height: 50vh; aspect-ratio: 16 / 9; overflow: hidden; background: #000; touch-action: pan-y; }
.screen-zoom { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.screen-zoom video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen.zoomed .screen-view { cursor: grab; touch-action: none; }
.screen.panning .screen-view { cursor: grabbing; }
.screen.ping-mode .screen-view { cursor: crosshair; }
.zoom-ctl {
  position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 10px; background: rgba(10, 12, 16, .62); color: #fff; backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .15s var(--ease);
}
.screen-view:hover .zoom-ctl, .screen.zoomed .zoom-ctl, .zoom-ctl:focus-within { opacity: 1; }
.zoom-ctl .icon-btn { width: 28px; height: 28px; color: #fff; font: 700 17px/1 var(--font); }
.zoom-ctl .icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.zoom-level { min-width: 34px; text-align: center; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ping-layer { position: absolute; inset: 0; pointer-events: none; }
.ping { position: absolute; width: 0; height: 0; transform: scale(var(--inv, 1)); }
.ping-dot { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 2px 10px rgba(0, 0, 0, .5); animation: pingDot 2.6s var(--ease) both; }
.ping-ring { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--c); animation: pingRing 1.1s ease-out 2 both; }
.ping-ring.late { animation-delay: .35s; }
.ping-name {
  position: absolute; left: 12px; top: 10px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--c); color: var(--ink); font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  animation: pingDot 2.6s var(--ease) both;
}
@keyframes pingRing { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes pingDot { 0% { opacity: 0; transform: scale(.5); } 10% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.screen-sub { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.watchers { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.stack.mini { min-height: 0; }
.stack.mini .avatar { --size: 18px; font-size: 8px; box-shadow: 0 0 0 2px var(--surface); }
.stack.mini .avatar + .avatar { margin-left: -5px; }
.allow-pings { color: var(--muted); }
.screen-actions .icon-btn.on, .screen-actions .icon-btn.on:hover:not(:disabled),
.allow-pings.on, .allow-pings.on:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.screen:fullscreen { border: 0; border-radius: 0; background: #000; }
.screen:fullscreen .screen-view { flex: 1; max-height: none; aspect-ratio: auto; }
.screen:fullscreen figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; opacity: 0; transition: opacity .2s var(--ease); }
.screen:fullscreen:hover figcaption, .screen:fullscreen figcaption:focus-within { opacity: 1; }

.screen.invite { background: var(--surface); }
.invite-body {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 230px; padding: 28px 20px;
  text-align: center; background: radial-gradient(70% 80% at 50% 0%, color-mix(in oklab, var(--c, var(--accent)) 16%, transparent), transparent 70%);
}
.invite-body .avatar { --size: 58px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in oklab, var(--c) 55%, transparent); }
.invite-title { margin: 0; font-size: 15px; color: var(--text-2); }
.invite-title strong { color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength), var(--text)); }
.invite-live {
  position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em;
}
.invite-live .icon { width: 13px; height: 13px; }
.invite-watchers { font-size: 12.5px; color: var(--muted); }
.invite-note { max-width: 340px; color: var(--muted); font-size: 12px; }
.screen figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--surface); border-top: 1px solid var(--border); font-size: 13px; }
.screen-title { display: grid; min-width: 0; }
.screen-who { font-weight: 650; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength), var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-info { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.screen-info.warn { color: var(--warn); }
.screen-actions { display: flex; align-items: center; gap: 4px; }
.screen-vol { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-right: 4px; }
.screen-vol input { width: 100px; }
.stage.has-screens .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stage.has-screens .tile-name .you { display: none; }
.stage.has-screens .tile { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; column-gap: 12px; row-gap: 2px; padding: 12px 14px; }
.stage.has-screens .tile .avatar { --size: 42px; grid-row: span 2; }
.stage.has-screens .tile-badge { top: 38px; left: 42px; width: 20px; height: 20px; }
.stage.has-screens .tile-badge .icon { width: 11px; height: 11px; }
.stage[data-focus] .screen:not(.focused) { display: none; }
.stage[data-focus] .screen.focused .screen-view { max-height: calc(100dvh - 300px); }
.screen.focused { grid-column: 1 / -1; }

.stage-empty { margin: auto; display: grid; justify-items: center; gap: 8px; max-width: 360px; text-align: center; color: var(--text-2); padding: 24px; }
.stage-empty h3 { font-size: 17px; color: var(--text); }
.stage-empty p { margin: 0 0 6px; color: var(--muted); }
.empty-ico { width: 58px; height: 58px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.empty-ico .icon { width: 26px; height: 26px; }

/* Kontrol çubuğu (dock) */
.dock { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; pointer-events: none; z-index: 5; padding: 0 12px; }
.dock-inner {
  pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 8px;
  border-radius: 20px; border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--bg-elev) 88%, transparent); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow-lg); animation: rise .35s var(--ease) both;
}
.dock-sep { width: 1px; height: 26px; background: var(--border-strong); margin: 0 4px; }
.ctrl {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; min-width: 46px; padding: 0 14px;
  border-radius: 14px; border: 0; background: var(--surface-2); color: var(--text);
  font-weight: 600; transition: background .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
.ctrl:hover { background: var(--surface-3); }
.ctrl:active { transform: scale(.97); }
.ctrl .icon { width: 21px; height: 21px; }
.ctrl .btn-label { font-size: 13.5px; }
/* Kontrol çubuğunda yalnızca ikon (ipucu title ile); "Ayrıl" yazılı kalır. */
.dock .ctrl:not(.danger):not(.ptt) .btn-label { display: none; }
.dock .ctrl:not(.danger):not(.ptt) { padding: 0; width: 46px; }
.ctrl.off { background: color-mix(in oklab, var(--danger) 16%, transparent); color: var(--danger); }
.ctrl.active { background: var(--accent); color: var(--on-accent); }
.ctrl.danger { background: var(--danger); color: #fff; }
.ctrl.danger:hover { background: color-mix(in oklab, var(--danger) 88%, black); }
.ctrl.unsupported { opacity: .55; }
.ctrl.ptt { min-width: 150px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.ctrl.ptt.held { background: var(--ok); color: #fff; }
.mode select { height: 46px; width: auto; border-radius: 14px; border: 0; background-color: var(--surface-2); padding-left: 14px; font-weight: 600; font-size: 13.5px; }

/* Sohbet */
.chat { grid-area: chat; position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--bg-elev); border-left: 1px solid var(--border); }
/* Sohbetin sol kenarı sürüklenerek genişletilir (bkz. main.js wireChatResize); telefonda sohbet zaten tam ekran. */
.chat-resize { position: absolute; top: 0; bottom: 0; left: -5px; z-index: 6; width: 10px; cursor: col-resize; touch-action: none; outline: none; }
.chat-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .15s var(--ease); }
.chat-resize:hover::after, .chat-resize:focus-visible::after, .resizing-chat .chat-resize::after { background: var(--accent); }
.resizing-chat { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.resizing-chat .app { transition: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 60px; border-bottom: 1px solid var(--border); }
.chat-tabs { flex: 1; display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.chat-tab {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 8px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.chat-tab .icon { width: 15px; height: 15px; }
.chat-tab .tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chat-tab:disabled { opacity: .5; }
.chat-close { display: none; }
@media (min-width: 1241px) { .chat-close { display: inline-grid; } }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 6px 12px; overflow-wrap: anywhere; }
.chat-empty { margin: 28px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.msg { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; padding: 3px 10px; border-radius: var(--radius-sm); }
.msg:hover { background: var(--surface); }
.msg:not(.grouped):not(.system) { margin-top: 10px; }
.msg .avatar { --size: 34px; grid-row: span 2; margin-top: 2px; }
.msg.grouped .msg-text { grid-column: 2; }
.msg-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-name { font-weight: 700; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength), var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head time, .msg-time { font-size: 11px; color: var(--muted); }
.msg-time { position: absolute; left: 10px; top: 6px; width: 34px; text-align: center; opacity: 0; }
.msg.grouped:hover .msg-time { opacity: 1; }
.msg-text { white-space: pre-wrap; color: var(--text); line-height: 1.45; }
.msg.mention { background: color-mix(in oklab, var(--warn) 10%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.mention-tag { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.msg.system { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; padding: 0; font-size: 12px; color: var(--muted); }
.msg.system:hover { background: none; }
.msg.announce {
  display: flex; align-items: flex-start; justify-content: center; gap: 6px; margin: 12px 6px 6px; padding: 8px 12px;
  border-radius: 12px; font-size: 13px; color: var(--text-2); text-align: center;
  background: linear-gradient(90deg, color-mix(in oklab, var(--c, var(--accent)) 12%, transparent), color-mix(in oklab, var(--accent) 8%, transparent));
}
.msg.announce:hover { background: linear-gradient(90deg, color-mix(in oklab, var(--c, var(--accent)) 16%, transparent), color-mix(in oklab, var(--accent) 10%, transparent)); }
.who { font-weight: 750; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength), var(--text)); }
.msg.local { display: flex; align-items: flex-start; gap: 8px; margin: 10px 4px 4px; padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13px; }
.msg.local:hover { background: var(--surface); }
.msg.local > .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--accent); }
.msg.local.help { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.help-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.help-title .icon { width: 16px; height: 16px; color: var(--accent); }
.help-title small { margin-left: auto; color: var(--muted); font-size: 11px; }
.help-list { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0; }
.help-list dt code { font: 600 12px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.help-list dd { margin: 0; color: var(--text-2); }
.help-tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 3px; }
.msg-image {
  position: relative; display: block; max-width: 100%; margin: 4px 0 2px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: zoom-in;
}
.msg-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.msg-image.loading { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; cursor: progress; }
.msg-image.gone { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: default; }
.msg-image.gone .icon { width: 16px; height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.msg-text > span { display: block; }
.game-card {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 2px; padding: 9px 12px; border-radius: 12px; white-space: normal;
  border: 1px solid var(--border-strong); background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.game-card p { margin: 0; }
.game-card strong { font-size: 15px; color: var(--accent); }
.game-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.game-card .game-card-open { flex: none; align-self: center; margin-left: auto; }
.game-emoji { font-size: 22px; line-height: 1.1; }
.team-list { display: grid; gap: 6px; min-width: 0; }
.team { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.team-label { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; color: #fff; background: var(--team); }
.team-names { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
.team-name { font-weight: 650; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength), var(--text)); }
.tools-menu .tool-emoji { width: 17px; text-align: center; font-size: 15px; line-height: 1; }
.lightbox { max-width: min(96vw, 1600px); max-height: 94dvh; padding: 0; border: 0; border-radius: var(--radius); background: transparent; box-shadow: var(--shadow-lg); cursor: zoom-out; }
.lightbox::backdrop { background: rgba(5, 6, 9, .82); backdrop-filter: blur(4px); }
.lightbox img { display: block; max-width: min(96vw, 1600px); max-height: 94dvh; object-fit: contain; border-radius: var(--radius); }
.chat-form { padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.attach { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-2); animation: rise .2s var(--ease) both; }
.attach img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.attach-info { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.attach-info strong { font-size: 13px; }
.attach-info small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.composer textarea { flex: 1; resize: none; max-height: 140px; padding: 7px 0; border: 0 !important; background: transparent !important; box-shadow: none !important; line-height: 1.4; }
.composer .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
.composer { padding-left: 6px; }
.composer textarea { padding-left: 4px; }
.chat-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* Açılır kişi menüsü */
.popover {
  position: fixed; z-index: 60; width: 290px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface);
  box-shadow: var(--shadow-lg); animation: menuIn .16s var(--ease) both;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.um-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.um-head .avatar { --size: 46px; }
.um-title { display: grid; min-width: 0; line-height: 1.3; }
.um-title strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-title small { color: var(--muted); font-size: 12.5px; }
.um-section { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.um-section:last-child { padding-bottom: 0; }
.um-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.um-label output { color: var(--muted); font-variant-numeric: tabular-nums; }
.um-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text); text-align: left; font-weight: 550; }
.um-action:hover { background: var(--surface-2); }
.um-action .icon { width: 17px; height: 17px; color: var(--muted); }
.um-action.danger { color: var(--danger); }
.um-action.danger .icon { color: var(--danger); }
.um-action.on { color: var(--warn); }
.um-action.on .icon { color: var(--warn); }
.um-note { margin: 0; font-size: 12px; color: var(--muted); }
.um-label small { font-weight: 500; color: var(--muted); }
.um-action.hold { user-select: none; touch-action: none; }
.um-action.hold.held { background: color-mix(in oklab, var(--info) 16%, transparent); color: var(--info); }
.um-action.hold.held .icon { color: var(--info); }
.um-action:disabled { opacity: .45; cursor: not-allowed; }
.um-action:disabled:hover { background: transparent; }
.popover:has(.fun-panel), .popover:has(.avatar-picker) { width: 330px; }
.fun-panel { display: grid; gap: 8px; }
.fun-extras { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.react-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.react-btn {
  height: 42px; padding: 0; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 22px; line-height: 1;
  transition: background .12s var(--ease), transform .12s var(--ease);
}
.react-btn:hover { background: var(--surface-3); transform: translateY(-2px) scale(1.06); }
.react-btn:active { transform: scale(.94); }
.react-btn.gg { font: 800 14px/1 var(--font); color: var(--accent); }
.sfx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sfx-btn {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 9px; border: 0; border-radius: 10px;
  background: var(--surface-2); text-align: left; font-size: 12.5px; font-weight: 600;
  transition: background .12s var(--ease), transform .1s var(--ease);
}
.sfx-btn:hover { background: var(--surface-3); }
.sfx-btn:active { transform: scale(.97); }
.sfx-emoji { font-size: 17px; line-height: 1; }
.sfx-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ayarlar penceresi */
.dialog {
  width: min(860px, calc(100% - 32px)); height: min(640px, calc(100dvh - 32px)); padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: rise .25s var(--ease) both; }
.dialog::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.settings-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; background: var(--bg-elev); border-right: 1px solid var(--border); }
.settings-title { margin: 0 10px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.settings-tab { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-2); font-weight: 600; text-align: left; }
.settings-tab .icon { width: 17px; height: 17px; }
.settings-tab:hover { background: var(--surface-2); color: var(--text); }
.settings-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.settings-tab[aria-selected="true"] .icon { color: var(--accent); }
.settings-body { position: relative; overflow-y: auto; padding: 26px 28px 32px; }
.settings-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.settings-pane { display: grid; gap: 22px; animation: fade .2s var(--ease) both; }
.settings-pane h2 { font-size: 20px; font-weight: 800; }
.group { display: grid; gap: 14px; }
.group h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-option { display: grid; gap: 10px; padding: 10px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface-2); text-align: left; font-weight: 650; transition: border-color .15s var(--ease); }
.theme-option[aria-checked="true"] { border-color: var(--accent); }
.theme-option .label { display: flex; align-items: center; gap: 8px; }
.theme-option .label .icon { width: 16px; height: 16px; color: var(--accent); }
.theme-preview { height: 70px; border-radius: 9px; overflow: hidden; display: grid; grid-template-columns: 26% 1fr; border: 1px solid rgba(127, 127, 127, .2); }
.theme-preview.dark { background: #181b21; }
.theme-preview.dark i { background: #12151a; }
.theme-preview.light { background: #fff; }
.theme-preview.light i { background: #f2f3f7; }
.theme-preview.system { background: linear-gradient(135deg, #fff 50%, #181b21 50%); }
.theme-preview.system i { background: linear-gradient(135deg, #f2f3f7 50%, #12151a 50%); }
.theme-preview b { margin: 10px; border-radius: 6px; background: var(--accent); opacity: .85; height: 12px; width: 50%; }
.accent-options { display: flex; flex-wrap: wrap; gap: 12px; }
.accent-option { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--text-2); }
.accent-swatch { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--swatch); color: #fff; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px transparent; transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.accent-option:hover .accent-swatch { transform: scale(1.06); }
.accent-option[aria-checked="true"] .accent-swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--swatch); }
.accent-swatch .icon { width: 18px; height: 18px; opacity: 0; }
.accent-option[aria-checked="true"] .accent-swatch .icon { opacity: 1; }

/* Uçuşan tepkiler, giriş afişleri, hazır kontrolü */
/* Menülerin (60) ve çekmecelerin (50) üstünde, bildirimlerin (80) altında. Konum JS'te ana alana göre px ile verilir. */
.fx-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.float {
  position: absolute; bottom: 96px; display: grid; justify-items: center; gap: 4px; pointer-events: none; z-index: 6;
  animation: floatUp 3s cubic-bezier(.25, .7, .3, 1) forwards;
}
.screen:fullscreen > .float { bottom: 80px; }
.float-emoji { font-size: 40px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.float-name { max-width: 180px; padding: 2px 8px; border-radius: 999px; background: var(--c, var(--accent)); color: var(--ink); font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(0, 20px) scale(.5); }
  12% { opacity: 1; transform: translate(0, 0) scale(1.1); }
  20% { transform: translate(0, -10px) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0), calc(-1 * var(--rise, 46vh))) scale(.95); }
}
.banner-layer { position: absolute; top: 72px; left: 50%; z-index: 7; translate: -50% 0; display: grid; justify-items: center; gap: 8px; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.join-banner {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px;
  border: 1px solid color-mix(in oklab, var(--c, var(--accent)) 45%, var(--border-strong));
  background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in oklab, var(--c, var(--accent)) 10%, transparent);
  animation: bannerIn .45s cubic-bezier(.2, 1.3, .4, 1) both;
}
.join-banner.out { animation: bannerOut .4s var(--ease) both; }
.join-banner .avatar { --size: 36px; }
.join-text { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text); }
@keyframes bannerIn { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
@keyframes bannerOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

.ready-card {
  position: absolute; top: 72px; left: 50%; z-index: 8; translate: -50% 0; width: min(420px, calc(100% - 24px));
  display: grid; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid color-mix(in oklab, var(--ok) 45%, var(--border-strong)); background: var(--surface);
  box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in oklab, var(--ok) 12%, transparent);
  animation: bannerIn .4s cubic-bezier(.2, 1.3, .4, 1) both; overflow: hidden;
}
.ready-head { display: flex; align-items: center; gap: 10px; }
.ready-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); }
.ready-title { display: grid; flex: 1; line-height: 1.3; }
.ready-title strong { font-size: 15px; }
.ready-title small { color: var(--muted); font-size: 12px; }
.ready-time { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ready-people { display: flex; flex-wrap: wrap; gap: 8px; }
.ready-person { position: relative; }
.ready-person .avatar { --size: 34px; transition: filter .2s; }
.ready-person.wait .avatar { filter: grayscale(.7) opacity(.65); }
.ready-mark { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); background: var(--surface-3); color: var(--muted); }
.ready-mark .icon { width: 10px; height: 10px; stroke-width: 3; }
.ready-person.ok .ready-mark { background: var(--ok); color: #fff; }
.ready-person.no .ready-mark { background: var(--danger); color: #fff; }
.ready-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ready-mine { margin: 0; font-size: 13px; color: var(--text-2); }
.ready-bar { height: 4px; margin: 0 -16px -14px; background: var(--surface-3); }
.ready-bar i { display: block; height: 100%; background: var(--ok); transform-origin: 0 50%; transition: transform .25s linear; }
.ready-card.done { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }

/* Bildirimler */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: 13.5px; line-height: 1.45; pointer-events: auto;
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.toast.warn .toast-icon { color: var(--warn); }
.toast.ok .toast-icon { color: var(--ok); }

.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade .2s var(--ease) both; }

/* ---------- Oyunlar: davet kartları ve oyun pencereleri ---------- */
.games { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.game-invite {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-lg);
  border: 1px solid color-mix(in oklab, var(--c, var(--accent)) 35%, var(--border)); background: var(--surface);
  box-shadow: var(--shadow-sm); animation: pop .3s var(--ease) both;
}
.game-invite.for-me { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.gi-emoji { font-size: 30px; line-height: 1; }
.gi-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.gi-text p { margin: 0; font-size: 14px; color: var(--text-2); }
.gi-host { color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.gi-text small { color: var(--muted); font-size: 12px; }
.gi-avatars { display: flex; gap: 2px; }
.gi-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.game-window {
  position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow); animation: pop .3s var(--ease) both;
}
.game-window.wide { grid-column: 1 / -1; }
/* Oyunda hızlı iki dokunuş sayfayı yakınlaştırmaz (iPhone Safari); kaydırma ve iki parmakla yakınlaştırma çalışır. */
.game-window { touch-action: manipulation; }
.game-window:fullscreen { border-radius: 0; overflow: auto; }
/* Tam ekranı desteklemeyen tarayıcıda (iPhone Safari) "Tam ekran" pencereyi ekranı kaplayacak şekilde açar. */
.game-window.fs {
  position: fixed; inset: 0; z-index: 45; border: 0; border-radius: 0; overflow: auto; animation: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.gw-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.gw-emoji { font-size: 20px; line-height: 1; }
.gw-head strong { font-size: 14.5px; }
.gw-note { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-actions { display: flex; gap: 2px; }
.game-window.min .gw-body, .game-window.min .gw-say { display: none; }
.game-window.min .gw-head { border-bottom: 0; }
.gw-body { padding: 16px; min-width: 0; }
.gw-say {
  margin: 0; padding: 10px 16px; font-weight: 700; font-size: 14.5px; text-align: center;
  background: color-mix(in oklab, var(--accent) 14%, var(--surface)); border-bottom: 1px solid var(--border);
}
.gw-say.show { animation: rise .35s var(--ease) both; }
.gw-lobby { display: grid; gap: 12px; justify-items: start; }
.gw-lobby-title { margin: 0; font-weight: 650; }
.gw-lobby-note { margin: 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in oklab, var(--accent) 12%, var(--surface-2)); color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.gw-players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gw-players li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.gw-players li small { color: var(--muted); }
.gw-lobby-actions { display: flex; gap: 8px; align-items: center; }

.games-menu { display: grid; gap: 4px; }
.game-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); text-align: left;
}
.game-pick:hover { background: var(--surface-2); }
.game-pick-emoji { font-size: 24px; width: 32px; text-align: center; }
.game-pick-text { flex: 1; display: grid; gap: 2px; }
.game-pick-text small { color: var(--muted); font-size: 12px; }
.game-pick .icon { width: 16px; height: 16px; color: var(--muted); }
.game-pick.tool .game-pick-emoji, .game-pick.finished .game-pick-emoji { font-size: 19px; }
.game-pick.finished { padding: 7px 10px; }
.finished-list { display: grid; gap: 2px; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; }
.popover:has(.games-menu), .popover:has(.game-options), .popover:has(.poll-form), .popover:has(.clip-panel) { width: 340px; }
/* Uzun ayar formu (ör. yarışmanın kategori ve alt konu çipleri) ekrana sığmazsa kendi içinde kayar; "Oyunu aç" hep erişilir. */
.popover:has(.game-options) { max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.game-options, .poll-form { display: grid; gap: 12px; }
.game-options-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.game-options-title .icon { width: 18px; height: 18px; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  font-size: 13px; font-weight: 600;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.muted.small, .small.muted { font-size: 12.5px; margin: 0; }

/* ---------- Tepki kombosu ---------- */
.combo {
  position: absolute; top: 26%; left: 50%; translate: -50% 0; z-index: 7; display: grid; justify-items: center; gap: 6px;
  pointer-events: none; text-align: center; animation: comboIn .3s var(--ease) both;
}
.combo-emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .4)); }
.combo-emoji.gg { font: 900 40px/1 var(--font); padding: 8px 16px; border-radius: 16px; background: var(--accent); color: var(--on-accent); }
.combo-count {
  font: 900 34px/1 var(--font); letter-spacing: .02em; color: #fff;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, .35); text-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.combo-title { padding: 3px 12px; border-radius: 999px; background: color-mix(in oklab, var(--surface) 85%, transparent); font-weight: 750; font-size: 14px; box-shadow: var(--shadow); }
.combo-faces { display: flex; gap: 3px; }
.combo-more { font-size: 12px; font-weight: 700; color: #fff; align-self: center; }
.combo.pop .combo-count { animation: comboPop .35s var(--ease) both; }
.combo.hot .combo-count { color: #ffd166; }
.combo.hot .combo-emoji { filter: drop-shadow(0 0 22px rgba(255, 120, 40, .8)); }
.combo[data-level="10"] .combo-count, .combo.mega .combo-count { color: #ff6b3d; font-size: 42px; }
.combo.mega { animation: comboShake .5s linear both; }
.combo.out { animation: fade .5s var(--ease) reverse both; }
@keyframes comboIn { from { opacity: 0; transform: scale(.6); } }
@keyframes comboPop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes comboShake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -2px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(4px, -1px); } }

/* ---------- Anket ---------- */
.poll { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); max-width: 420px; }
.poll-q { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; }
.poll-q .icon { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: 2px; }
.poll-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.poll-options li { display: grid; gap: 3px; }
.poll-opt {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-align: left;
}
.poll-opt:not(:disabled):hover { border-color: var(--accent); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in oklab, var(--accent) 22%, transparent); transition: width .35s var(--ease); }
.poll-text, .poll-count { position: relative; }
.poll-text { flex: 1; font-weight: 600; font-size: 13.5px; }
.poll-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.poll-opt.chosen { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.poll-opt.win { border-color: var(--ok); }
.poll-opt.win .poll-bar { background: color-mix(in oklab, var(--ok) 28%, transparent); }
.poll-voters { display: flex; gap: 2px; padding-left: 4px; }
.poll-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.poll-left { font-weight: 700; color: var(--accent); }
.poll-tie { margin: 0; font-size: 13.5px; }
.poll-form-options { display: grid; gap: 6px; }

/* ---------- Oyun ekranlarının ortak parçaları ---------- */
.gw-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.gw-clock { font-weight: 700; font-variant-numeric: tabular-nums; }
.gw-timer.low { color: var(--danger); }
.gw-alert {
  display: grid; gap: 8px; margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid color-mix(in oklab, var(--warn) 45%, var(--border)); background: color-mix(in oklab, var(--warn) 10%, var(--surface));
}
.gw-alert p { margin: 0; }
.gw-row { display: flex; align-items: center; gap: 8px; }
.gw-row.wrap { flex-wrap: wrap; }
.gw-big { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.person-chip .person-name { color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.scoreboard { margin-top: 14px; }
.scoreboard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.scoreboard li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.scoreboard li.first { background: color-mix(in oklab, var(--accent) 16%, var(--surface-2)); }
.sb-rank { width: 20px; text-align: center; font-weight: 800; color: var(--muted); }
.sb-points { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-delta { font-size: 12px; font-weight: 700; color: var(--ok); }

/* ---------- Casus Kim? ---------- */
.spy { display: grid; gap: 12px; }
.spy-card {
  position: relative; display: grid; place-items: center; min-height: 150px; padding: 18px; border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: none;
}
.spy-card.watching { cursor: default; border-style: solid; color: var(--muted); }
.spy-card .spy-face { display: none; }
.spy-card.open { border-style: solid; border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, var(--surface)); }
.spy-card.open .spy-back { display: none; }
.spy-card.open .spy-face { display: grid; justify-items: center; gap: 4px; text-align: center; }
.spy-back { display: grid; justify-items: center; gap: 4px; }
.spy-back span { font-size: 40px; line-height: 1; }
.spy-back small, .spy-face small { color: var(--muted); }
.spy-loc { font-size: 24px; font-weight: 800; }
.spy-role { font-weight: 650; }
.spy-face.spy strong { font-size: 24px; letter-spacing: .08em; color: var(--danger); }
.spy-big { font-size: 46px; line-height: 1; }
.spy-player { display: inline-flex; align-items: center; gap: 4px; }
.spy-loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.spy-loc-btn { padding: 7px 8px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; text-align: left; }
.spy-loc-btn.crossed { text-decoration: line-through; opacity: .45; }
.spy-locs.guessing .spy-loc-btn { border-color: var(--accent); color: var(--text); }
.spy-locs.guessing .spy-loc-btn:hover { background: var(--accent); color: var(--on-accent); }
.spy-reveal { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 18px; border-radius: var(--radius-lg); background: var(--surface-2); }
.spy-reveal p { margin: 0; }
.spy-reveal.town { background: color-mix(in oklab, var(--ok) 14%, var(--surface-2)); }
.spy-reveal.spy { background: color-mix(in oklab, var(--danger) 14%, var(--surface-2)); }

/* ---------- Gecenin Ödülleri ---------- */
.awards-overlay {
  position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 20px;
  background: color-mix(in oklab, #05060a 78%, transparent); backdrop-filter: blur(10px); animation: fade .3s var(--ease) both;
}
.aw-inner { display: grid; justify-items: center; gap: 16px; width: min(560px, 100%); }
.aw-kicker { margin: 0; color: #d7dbea; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.aw-card {
  display: grid; justify-items: center; gap: 12px; width: 100%; padding: 32px 24px; border-radius: 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg), 0 0 0 6px color-mix(in oklab, var(--accent) 22%, transparent);
}
.aw-card.in { animation: awIn .5s var(--ease) both; }
.aw-emoji { font-size: 72px; line-height: 1; }
.aw-title { margin: 0; font-size: clamp(26px, 5vw, 36px); font-weight: 900; letter-spacing: -.03em; }
.aw-winners { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.aw-winner { display: grid; justify-items: center; gap: 6px; }
.aw-winner strong { font-size: 18px; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.aw-text { margin: 0; font-weight: 700; color: var(--text-2); }
.aw-line { margin: 0; color: var(--muted); font-style: italic; }
.aw-dots { display: flex; gap: 6px; }
.aw-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.aw-dots span.on { background: #fff; }
.aw-controls { display: flex; gap: 8px; }
@keyframes awIn { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.awards-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.awards-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; }
.aw-li-emoji { width: 20px; }
.aw-li-title { font-weight: 700; }
.aw-li-who { display: inline-flex; gap: 6px; }
.aw-li-name { color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.awards-list small { color: var(--muted); }

/* ---------- Vampir Köylü ---------- */
.tile[data-game-muted="1"] { opacity: .45; filter: grayscale(.6); }
.vk { display: grid; gap: 12px; }
.vk.phase-night { --vk-bg: color-mix(in oklab, #0b1030 70%, var(--surface)); }
.vk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vk-phase.night { background: color-mix(in oklab, #3b4cc0 35%, var(--surface-2)); }
.vk-audio { margin: 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; font-weight: 650; }
.vk-audio.mute { background: color-mix(in oklab, #3b4cc0 22%, var(--surface-2)); }
.vk-audio.vamp { background: color-mix(in oklab, var(--danger) 18%, var(--surface-2)); }
.vk-card { min-height: 130px; }
.vk-card.dead { opacity: .7; }
.vk-face.vampire .vk-role { color: var(--danger); }
.vk-role { font-size: 22px; letter-spacing: .04em; }
.vk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.vk-player {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 10px 6px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
}
.vk-player.dead { opacity: .5; filter: grayscale(.8); }
.vk-player.chosen { box-shadow: 0 0 0 3px var(--accent); }
.vk-player.mate-pick { border-color: var(--danger); }
.vk-player.speaking { box-shadow: 0 0 0 3px var(--warn); }
.vk-name { max-width: 100%; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.vk-tag { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.vk-tag.vampire { color: var(--danger); }
.vk-votes { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; }
.vk-sleep { display: grid; justify-items: center; gap: 6px; padding: 28px 12px; border-radius: var(--radius-lg); background: linear-gradient(180deg, #0b1030, #151a3a); color: #dfe4ff; text-align: center; }
.vk-sleep .muted { color: #aab3e0; }
.vk-moon { font-size: 46px; line-height: 1; animation: qz-pulse 3s ease-in-out infinite; }
.vk-watch, .vk-seer, .vk-log { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.vk-watch p, .vk-seer p, .vk-log p { margin: 0; }
.vk-action { display: grid; gap: 8px; }
.vk-action-title { margin: 0; font-weight: 800; }
.vk-action.bite .vk-action-title { color: var(--danger); }
.vk-bad { color: var(--danger); font-weight: 700; }
.vk-good { color: var(--ok); }
.vk-dead { margin: 0; color: var(--muted); font-size: 13px; }
.vk-banner { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in oklab, var(--warn) 16%, var(--surface-2)); font-weight: 700; text-align: center; }
.vk-row { justify-content: center; }
.vk-emergency { color: var(--muted); }
.vk-result { display: grid; gap: 12px; justify-items: center; }
.vk-result.vampire .gw-big { color: var(--danger); }
.vk-result.village .gw-big { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .vk-moon { animation: none; } }

/* ---------- Altın an ---------- */
.clip-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; max-width: 440px;
  padding: 10px 12px; border: 1px solid color-mix(in oklab, var(--c, var(--accent)) 35%, var(--border)); border-radius: var(--radius); background: var(--surface-2);
}
.clip-card.playing { box-shadow: 0 0 0 2px color-mix(in oklab, var(--c, var(--accent)) 55%, transparent); }
.clip-card.loading .clip-play { opacity: .6; animation: blink 1s ease-in-out infinite; }
.clip-play { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: color-mix(in oklab, var(--c, var(--accent)) 80%, #000); color: #fff; cursor: pointer; }
.clip-play:disabled { opacity: .45; cursor: not-allowed; }
.clip-play .icon { width: 16px; height: 16px; }
.clip-mid { display: grid; gap: 4px; min-width: 0; }
.clip-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.clip-title { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.clip-title small { color: var(--muted); }
.clip-wave { position: relative; display: flex; align-items: center; min-width: 0; height: 30px; overflow: hidden; cursor: pointer; }
/* Çubuklar küçülebilir (dar sohbet panelinde taşmasın); aradaki boşluk saydam kenarla verilir. */
.clip-wave i { flex: 1 1 0; min-width: 0; height: var(--h, 20%); border-right: 1px solid transparent; border-radius: 1px; background: color-mix(in oklab, var(--c, var(--accent)) 50%, var(--surface-3)); background-clip: padding-box; }
.clip-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-right: 2px solid var(--c, var(--accent)); background: color-mix(in oklab, var(--c, var(--accent)) 22%, transparent); pointer-events: none; }
.clip-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip-actions { display: flex; gap: 0; }
.clip-actions .icon-btn { width: 28px; height: 28px; }
.clip-card.gone { display: block; }
.clip-gone { color: var(--muted); font-size: 13px; }
.clip-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.clip-chips .um-label { width: 100%; margin: 0; }
.clip-panel { display: grid; gap: 12px; }
.clip-panel .btn .icon { width: 16px; height: 16px; }
.clip-unsupported { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: color-mix(in oklab, var(--warn) 14%, var(--surface-2)); font-size: 13px; }

/* ---------- Bilgi Yarışması ---------- */
.quiz { position: relative; display: grid; gap: 14px; }
.quiz .c0 { --qc: #e21b3c; }
.quiz .c1 { --qc: #1368ce; }
.quiz .c2 { --qc: #c88a00; }
.quiz .c3 { --qc: #26890c; }
.qz-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qz-count { font-weight: 800; font-size: 14px; }
.qz-cat.group { background: color-mix(in oklab, var(--accent) 22%, var(--surface-2)); }
.qz-diff { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); font-size: 12px; font-weight: 700; }
.qz-diff.d1 { color: var(--ok); }
.qz-diff.d2 { color: var(--warn); }
.qz-diff.d3 { color: var(--danger); }
.qz-left { margin-left: auto; min-width: 46px; padding: 6px 10px; border-radius: 999px; background: var(--surface-3); text-align: center; font: 800 20px/1 var(--font); font-variant-numeric: tabular-nums; }
.qz-question { margin: 0; text-align: center; font-size: clamp(17px, 2.4vw, 24px); font-weight: 800; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.qz-question.small { font-size: 15px; font-weight: 700; color: var(--text-2); }
.qz-intro { display: grid; justify-items: center; gap: 14px; padding: 18px 8px; }
.qz-bigcount { color: var(--accent); font: 900 64px/1 var(--font); animation: qz-pulse 1s ease-in-out infinite; }
@keyframes qz-pulse { 50% { transform: scale(1.12); } }
.qz-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.qz-bar span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transition: width .1s linear; }
.qz-bar span.low { background: var(--danger); }
.qz-ask, .qz-reveal, .qz-standings, .qz-done { display: grid; gap: 12px; }
.qz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qz-opt {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--qc); color: #fff; font: 700 15px/1.25 var(--font); text-align: left; cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22); transition: box-shadow .12s, opacity .2s, filter .2s;
}
/* Hover tıklama alanını kaydırmaz: imleç kenardayken düğme titremesin. */
.qz-opt:not(:disabled):hover { filter: brightness(1.08); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 6px 18px rgba(0, 0, 0, .25); }
.qz-opt:disabled { cursor: default; }
.qz-opt.dim { opacity: .35; }
.qz-opt.chosen { outline: 3px solid var(--text); outline-offset: 2px; }
.qz-shape { flex: none; width: 22px; font-size: 20px; line-height: 1; text-align: center; }
.qz-opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qz-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.qz-person {
  display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; transition: transform .12s, opacity .2s, border-color .2s;
}
.qz-person:not(:disabled):hover { border-color: color-mix(in oklab, var(--c, var(--accent)) 65%, var(--border)); background: var(--surface-3); }
.qz-person:disabled { cursor: default; }
.qz-person.dim, .qz-person:disabled:not(.chosen) { opacity: .45; }
.qz-person.chosen { box-shadow: 0 0 0 3px var(--accent); }
.qz-person-name { font-size: 13.5px; text-align: center; overflow-wrap: anywhere; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.qz-status { margin: 0; text-align: center; font-size: 13.5px; font-weight: 700; }
.qz-mine { margin: 0; text-align: center; font: 800 21px/1.2 var(--font); }
.qz-mine.good { color: var(--ok); }
.qz-mine.bad { color: var(--danger); }
.qz-mine.none { color: var(--muted); font-size: 15px; }
.qz-streak { color: var(--warn); font-size: 15px; }
.qz-results { display: grid; gap: 8px; }
.qz-res {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(56px, 28%) 26px 18px; align-items: center; gap: 10px;
  padding: 8px 12px; border-left: 5px solid var(--qc); border-radius: 10px; background: var(--surface-2);
}
.qz-res.wrong { opacity: .6; }
.qz-res.correct { background: color-mix(in oklab, var(--ok) 18%, var(--surface-2)); }
.qz-res.mine { box-shadow: inset 0 0 0 2px var(--text-2); }
.qz-res .qz-shape { color: var(--qc); }
.qz-res-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.qz-res-bar span { display: block; height: 100%; border-radius: inherit; background: var(--qc, var(--accent)); transition: width .5s var(--ease); }
.qz-res-n { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.qz-tick { color: var(--ok); font-weight: 900; }
.qz-fastest { margin: 0; text-align: center; font-weight: 700; }
.qz-award { display: grid; justify-items: center; gap: 6px; padding: 14px; border-radius: 14px; background: color-mix(in oklab, var(--warn) 14%, var(--surface-2)); animation: pop .4s var(--ease) both; }
.qz-award-emoji { font-size: 34px; line-height: 1; }
.qz-award-people { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.qz-award-person { display: grid; justify-items: center; gap: 4px; }
.qz-award-person strong { color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.qz-votes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.qz-votes li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 40%) 26px; align-items: center; gap: 10px; }
.qz-foot { justify-content: center; }
.qz-board { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.qz-board li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.qz-board li[data-moved] { position: relative; z-index: 1; animation: qz-slide .8s var(--ease) both; }
@keyframes qz-slide { from { transform: translateY(calc(var(--from) * (100% + 6px))); } }
.qz-board li.first { background: color-mix(in oklab, var(--warn) 16%, var(--surface-2)); }
.qz-board li.left { opacity: .55; }
.qz-rank { width: 22px; color: var(--muted); font-weight: 800; text-align: center; }
.qz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.qz-move { font-size: 12px; font-weight: 800; }
.qz-move.up { color: var(--ok); }
.qz-move.down { color: var(--danger); }
.qz-delta { color: var(--ok); font-size: 12.5px; font-weight: 800; }
.qz-fire { font-size: 12.5px; }
.qz-score { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.qz-done { position: relative; overflow: hidden; }
.qz-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 6px; }
.qz-step { display: grid; justify-items: center; gap: 4px; width: min(30%, 140px); animation: qz-rise .6s var(--ease) both; }
.qz-step.p1 { animation-delay: .5s; }
.qz-step.p2 { animation-delay: .25s; }
.qz-step-name { font-size: 14px; text-align: center; overflow-wrap: anywhere; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.qz-step-score { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.qz-step-block { display: grid; place-items: center; width: 100%; border-radius: 10px 10px 0 0; background: color-mix(in oklab, var(--c, var(--accent)) 30%, var(--surface-3)); font-size: 26px; }
.qz-step.p1 .qz-step-block { height: 96px; }
.qz-step.p2 .qz-step-block { height: 70px; }
.qz-step.p3 .qz-step-block { height: 52px; }
@keyframes qz-rise { from { transform: translateY(30px); opacity: 0; } }
.qz-confetti { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.qz-confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: qz-fall linear 2 both; }
@keyframes qz-fall { to { transform: translateY(480px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .qz-bigcount, .qz-board li[data-moved], .qz-step, .qz-award { animation: none; }
  .qz-opt, .qz-person, .qz-res-bar span { transition: none; }
}
@media (max-width: 520px) {
  .qz-options { grid-template-columns: 1fr; }
  .qz-opt { min-height: 54px; }
  .qz-res { grid-template-columns: 18px minmax(0, 1fr) 48px 22px 16px; gap: 8px; padding: 8px 10px; }
}
/* Doğru şıkkın yanındaki açıklama/kaydet düğmesi: metnin ardından akar, sığmazsa alt satıra iner. */
.qz-info {
  display: inline-flex; align-items: center; min-height: 28px; margin-left: 8px; padding: 3px 10px; vertical-align: middle;
  border: 1px solid color-mix(in oklab, var(--ok) 55%, var(--border)); border-radius: 999px; background: var(--surface);
  color: var(--text); font: 700 12px/1.2 var(--font); white-space: nowrap; cursor: pointer;
}
.qz-info:hover { background: var(--surface-3); }
.qz-done-actions { justify-content: center; }

/* Küçük pencere (yarışma açıklaması, kaydedilen cevaplar): telefonda ekrana sığar, içerik kendi içinde kayar. */
.sheet {
  width: min(520px, calc(100% - 24px)); max-height: min(640px, calc(100dvh - 32px)); padding: 0; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.sheet[open] { display: flex; flex-direction: column; animation: rise .22s var(--ease) both; }
.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--border); }
.sheet-title { flex: 1; min-width: 0; font-size: 16px; }
.sheet-body { display: grid; gap: 10px; min-height: 0; padding: 14px 18px 16px; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.sheet-foot { padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.sheet p { margin: 0; }
.saved-q { font-weight: 700; line-height: 1.35; }
.saved-a { color: var(--ok); font-weight: 800; }
.saved-e, .qz-info-exp { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.qz-info-exp { font-size: 15px; }
.saved-src { justify-self: start; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
a.saved-src:hover { text-decoration: underline; }
.sheet .btn.primary.saved { background: color-mix(in oklab, var(--gold) 24%, var(--surface-2)); border-color: var(--gold); color: var(--text); }
.saved-tabs { margin-bottom: 2px; }
.saved-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.saved-item { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.saved-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }

/* Yarışma bitince yalnızca kaydedene görünen altın düğme (sohbette ve kürsüde). */
.saved-cta {
  padding: 9px 16px; border: 1px solid var(--gold); border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--gold) 92%, white), var(--gold)); color: #2b2000;
  font: 800 13.5px/1.2 var(--font); cursor: pointer; animation: saved-glow 1.8s ease-in-out infinite;
}
.saved-cta:hover { filter: brightness(1.06); }
@keyframes saved-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--gold) 55%, transparent); }
  50% { box-shadow: 0 0 16px 3px color-mix(in oklab, var(--gold) 55%, transparent); }
}
.msg.local.saved-msg { flex-wrap: wrap; align-items: center; border-color: color-mix(in oklab, var(--gold) 60%, var(--border)); }
.msg.local.saved-msg small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .saved-cta, .sheet[open] { animation: none; }
}

/* ---------- Satranç ----------
   Geniş pencerede Lichess düzeni: tahta solda, saatler tahtanın üst ve alt hizasında ve tahtaya bitişik (satırın başında,
   büyük), hamleler arada. Tahta, kontrol çubuğu
   ve başlıklar düşüldükten sonra ekran yüksekliğine sığar (tam ekranda daha büyük). Dar pencerede (telefon) alt alta dizilir:
   rakibin saati, tahta, kendi saatin ve durum satırı (ilk hamle sayacı, teklifler) alttaki kontrol çubuğunun üstünde
   kalacak kadar küçülür; sayfa kaydırılmadan oynanır. --cb-vfixed-n: telefonda tahta dışındaki dikey pay (üst çubuk 60,
   sahne boşluğu 12, pencere başlığı 43, iç boşluk 8, iki saat satırı 88, aralıklar 18, durum satırı 34, kontrol çubuğu 70). */
.game-window[data-kind="chess"] .gw-body { container-type: inline-size; --cb-vfixed: 300px; --cb-vfixed-n: 334px; }
.game-window[data-kind="chess"]:is(:fullscreen, .fs) .gw-body { --cb-vfixed: 120px; --cb-vfixed-n: 205px; }
/* Anlatıcının satırı (ör. "İyi oyunlar!") satranç düzeninin içinde rakibin saat satırının üstünde yüzer (geniş pencerede yan
   sütunda): tahtayı aşağı itip 6 sn sonra geri zıplatmaz (oyunun ilk saniyelerinde yanlış kareye dokunulurdu), tahtayı
   örtmez ve dokunmayı engellemez. */
.chess > .gw-say {
  position: absolute; top: 0; left: 0; right: 0; grid-column: 2; grid-row: 1 / 3; z-index: 4; pointer-events: none;
  padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.chess {
  --cb-size: max(240px, min(760px, calc(100cqi - 268px), calc(100dvh - var(--cb-vfixed))));
  position: relative; display: grid; gap: 8px 18px; grid-template-columns: var(--cb-size) minmax(230px, 340px); height: var(--cb-size);
  grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: "board meta" "board top" "board side" "board bottom";
}
.cb-meta { grid-area: meta; }
.cb-player.cb-top { grid-area: top; }
.cb-player.cb-bottom { grid-area: bottom; }
.cb-board-wrap { grid-area: board; width: var(--cb-size); }
.chess > .cb-side { grid-area: side; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chess > .cb-side .cb-moves { flex: 1 1 0; max-height: none; }
@container (max-width: 500px) {
  .chess {
    --cb-size: min(100%, max(240px, calc(100dvh - var(--cb-vfixed-n))));
    height: auto; justify-items: center; grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "top" "board" "bottom" "meta" "side"; gap: 6px;
  }
  .chess > .cb-player, .chess > .cb-meta, .chess > .cb-side { justify-self: stretch; }
  .chess > .gw-say { grid-area: top; }
  .chess > .cb-side { overflow: visible; }
  /* Teslim, beraberlik, rövanş düğmeleri hamle listesinden önce: kısa bir kaydırmayla erişilir; gezinme düğmeleri arada. */
  .chess > .cb-side .cb-actions { order: 1; }
  .chess > .cb-side .cb-moves { order: 3; flex: none; max-height: 180px; }
  .cb-meta { min-height: 34px; }
  /* Telefonda saat satırın sonunda (Lichess mobil gibi), yine büyük; satır yüksekliği eskisiyle aynı kalır. */
  .chess .cb-player { gap: 8px; padding: 4px 4px 4px 6px; }
  .chess .cb-clock { order: 3; min-width: 92px; padding: 3px 10px; font-size: 27px; }
  .chess > .cb-side .cb-nav { order: 2; }
  /* Durum (sayaç, teklif) varken tempo etiketi yer kaplamaz: satır tek satırda kalsın. */
  .cb-meta.has-status > .pill { display: none; }
  .cb-result { scroll-margin-bottom: 90px; }
}
.cb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-abort { font-size: 12.5px; font-weight: 700; color: var(--warn); }
.cb-player { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cb-player.turn { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c, var(--accent)) 60%, transparent); }
.cb-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cb-name { min-width: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 18px; }
.cb-name strong { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: color-mix(in oklab, var(--c, var(--text)) var(--c-strength, 70%), var(--text)); }
.cb-name small { color: var(--muted); font-weight: 600; }
.cb-away { color: var(--warn) !important; }
.cb-name .cb-diff { font-weight: 800; }
.cb-diff.up { color: var(--ok); }
.cb-diff.down { color: var(--danger); }
/* Alınan taşlar (rakipten aldıkları, türe göre üst üste binerek) ve taş üstünlüğü; boşken de satırın yüksekliği sabit. */
.cb-captured { display: flex; align-items: center; gap: 3px; min-height: 16px; }
.cb-cap-group { display: inline-flex; }
.cb-cap { width: 16px; height: 16px; flex: none; }
.cb-cap + .cb-cap { margin-left: -8px; }
.cb-captured .cb-mat { margin-left: 2px; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 16px; }
.cb-clock {
  flex: none; min-width: 104px; padding: 3px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); text-align: right;
  font: 800 31px/1.1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.cb-player.active .cb-clock { background: var(--text); color: var(--bg); }
.cb-clock.low { background: var(--danger) !important; color: #fff !important; }
.cb-board-wrap { position: relative; }
/* Sağ tıkla çizilen oklar ve daireler tahtanın ve taşların üstünde (Lichess gibi yarı saydam); dokunmayı engellemez. */
.cb-shapes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; opacity: .6; overflow: visible; }
/* Lichess "brown" tahtası ve cburnett taşları: renkler, vurgular ve hamle noktaları Lichess'teki değerlerle. Sıralar ve
   sütunlar sabit 1fr: boş bir sıra asla daralmaz. Vurgular kare renginin üstüne yarı saydam katman olarak biner. */
.cb-board {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); width: 100%; aspect-ratio: 1;
  overflow: hidden; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
/* Oyunu süren oyuncunun satranç penceresi açıkken giriş afişleri ve hazır kartı tahtanın, saatin ve ilk hamle uyarısının
   üstünü kapatmaz (hazır kartı tıklamayı da yutardı). Giriş cümlesi sohbette yine görünür; hazır kartı oyun bitince ya
   da pencere küçültülünce kendiliğinden geri gelir. */
#room-view:has(.game-window[data-kind="chess"]:not(.min) .cb-board.live) :is(.join-banner, .ready-card) { display: none !important; }
.cb-sq { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; }
.cb-sq.light { background-color: #f0d9b5; }
.cb-sq.dark { background-color: #b58863; }
.cb-sq.last { background-image: linear-gradient(rgba(155, 199, 0, .41), rgba(155, 199, 0, .41)); }
.cb-sq.sel { background-image: linear-gradient(rgba(20, 85, 30, .5), rgba(20, 85, 30, .5)); }
.cb-sq.pre { background-image: linear-gradient(rgba(20, 30, 85, .5), rgba(20, 30, 85, .5)); }
.cb-sq.check { background-image: radial-gradient(ellipse at center, #f00 0%, #e70000 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%); }
.cb-sq.sel.check { background-image: radial-gradient(ellipse at center, #f00 0%, #e70000 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%), linear-gradient(rgba(20, 85, 30, .5), rgba(20, 85, 30, .5)); }
.cb-sq.dot::after, .cb-sq.cap::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.cb-sq.dot::after { background: radial-gradient(rgba(20, 85, 30, .5) 19%, rgba(0, 0, 0, 0) 20%); }
.cb-sq.cap::after { background: radial-gradient(transparent 0%, transparent 79%, rgba(20, 85, 0, .3) 80%); }
.cb-board.premoving .cb-sq.dot::after { background: radial-gradient(rgba(20, 30, 85, .5) 19%, rgba(0, 0, 0, 0) 20%); }
.cb-board.premoving .cb-sq.cap::after { background: radial-gradient(transparent 0%, transparent 79%, rgba(20, 30, 85, .3) 80%); }
.cb-sq.over::after { background: rgba(20, 85, 30, .3); }
.cb-board.premoving .cb-sq.over::after { background: rgba(20, 30, 85, .3); }
@media (hover: hover) {
  .cb-sq.dot:hover::after, .cb-sq.cap:hover::after { background: rgba(20, 85, 30, .3); }
  .cb-board.premoving .cb-sq.dot:hover::after, .cb-board.premoving .cb-sq.cap:hover::after { background: rgba(20, 30, 85, .3); }
}
.cb-piece { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.cb-board.mine { cursor: pointer; }
.cb-ghost { position: fixed; z-index: 90; pointer-events: none; }
/* Koordinatlar Lichess'teki gibi tahtanın içinde: sıra numarası sağ kenarda üstte, sütun harfi alt kenarda solda. */
.cb-coord { position: absolute; z-index: 2; font: 700 11px/1 var(--font); pointer-events: none; }
.cb-coord.rank { top: 2px; right: 3px; }
.cb-coord.file { bottom: 2px; left: 3px; }
.cb-sq.light .cb-coord { color: #946f51; }
.cb-sq.dark .cb-coord { color: #f0d9b5; }
/* Terfi seçimi (Lichess): tahta açık bir perdeyle solar; terfi edilen sütunda hedef kareden başlayarak vezir, at, kale, fil
   yuvarlak karelerde; üstüne gelinen kare turuncu parlar ve taş büyür. Perdeye dokunmak vazgeçer. */
.cb-promo { position: absolute; inset: 0; z-index: 5; background: rgba(250, 250, 250, .7); -webkit-tap-highlight-color: transparent; }
.cb-promo-btn {
  position: absolute; width: 12.5%; height: 12.5%; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle, #e9e9e9 0%, #b9b9b9 58%, #8a8a8a 100%); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: border-radius .15s var(--ease), background .15s var(--ease); -webkit-tap-highlight-color: transparent;
}
.cb-promo-btn img { display: block; width: 100%; height: 100%; transform: scale(.82); transition: transform .15s var(--ease); pointer-events: none; }
.cb-promo-btn:is(:hover, :focus-visible) { border-radius: 0; background: radial-gradient(circle, #fff3e6 0%, #ffb27a 45%, #d85000 100%); outline: none; }
.cb-promo-btn:is(:hover, :focus-visible) img { transform: none; }
.cb-side { display: grid; gap: 12px; align-content: start; }
.cb-moves {
  position: relative; margin: 0; padding: 6px 8px; list-style: none; min-height: 52px; max-height: 260px; overflow-y: auto; border-radius: var(--radius-sm); background: var(--surface-2);
  display: grid; grid-template-columns: 1fr; align-content: start; gap: 1px; font-variant-numeric: tabular-nums;
}
/* Hamleye basınca o konum gösterilir; gösterilen hamle vurgulu. */
.cb-mv { padding: 0 5px; border-radius: 4px; cursor: pointer; }
.cb-mv:empty, .cb-mv.empty { cursor: default; }
.cb-mv.empty { color: var(--muted); }
@media (hover: hover) { .cb-mv[data-ply]:hover { background: var(--surface-3); } }
.cb-mv.active { background: color-mix(in oklab, var(--accent) 26%, var(--surface-2)); color: var(--text); }
.cb-nav { display: flex; gap: 4px; }
.cb-nav-btn { flex: 1; width: auto; height: 30px; border-radius: 8px; background: var(--surface-2); }
.cb-nav-btn:disabled { opacity: .35; }
.cb-nav-btn.live-cta { background: var(--accent); color: var(--on-accent); }
.cb-moves:empty::before { content: "Henüz hamle yok"; padding: 4px 6px; color: var(--muted); font-size: 12.5px; }
.cb-moves li { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; padding: 2px 6px; font-size: 13.5px; font-weight: 600; }
.cb-moves li:nth-child(odd) { background: color-mix(in oklab, var(--surface-3) 50%, transparent); border-radius: 4px; }
.cb-no { color: var(--muted); }
.cb-actions { display: grid; gap: 6px; }
.cb-offers { display: grid; gap: 6px; flex: 1 1 100%; min-width: 0; }
.cb-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 2px 2px 10px; border-radius: var(--radius-sm); background: color-mix(in oklab, var(--warn) 14%, var(--surface-2)); font-size: 13px; font-weight: 600; }
.cb-offer > span { flex: 1; min-width: 0; }
.cb-offer .btn.small { height: 30px; padding: 0 11px; }
.cb-result { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); text-align: center; }
.cb-result.win { background: color-mix(in oklab, var(--ok) 16%, var(--surface-2)); }
.cb-result-emoji { font-size: 34px; }
.cb-result small { color: var(--muted); }
/* Tahta düzenleyici (pencere): taş paletleri tahtanın üstünde ve altında, telefonda da tahta ekrana sığar. */
.sheet.sheet-editor { width: min(560px, calc(100% - 16px)); max-height: calc(100dvh - 16px); }
.ed { display: grid; gap: 10px; }
.ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-hint { flex: 1 1 150px; }
.ed-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.ed-tool .icon { width: 16px; height: 16px; }
.ed-tool.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.ed-palette { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; width: min(100%, 400px, calc(100dvh - 300px)); justify-self: center; }
.ed-palette .ed-tool { height: auto; aspect-ratio: 1; min-width: 0; padding: 2px; }
.ed-palette img { width: 100%; height: 100%; pointer-events: none; }
.ed-board-wrap { width: min(100%, 400px, calc(100dvh - 300px)); min-width: 240px; justify-self: center; }
.ed-board { cursor: pointer; }
.ed .seg { display: inline-flex; gap: 4px; }
.ed-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ed-check.off { opacity: .45; }
.ed-fen { width: 100%; font-family: var(--mono); font-size: 12.5px; }
.ed-fen.bad { border-color: var(--danger); }
.ed-status { font-size: 13px; font-weight: 600; }
.ed-status.ok { color: var(--ok); }
.ed-status.bad { color: var(--danger); }
.ed-play { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ed-play .field { flex: 1 1 140px; }
.switch.small { font-size: 12.5px; }
.ratings-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.ratings-cat ol { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; }
.ratings-cat li { display: flex; gap: 6px; align-items: baseline; }
.rt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ratings-cat small { color: var(--muted); }
.din-scores-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 3px; font-size: 13px; }
.din-scores-list li { display: flex; gap: 8px; align-items: baseline; }
.din-scores-list small { color: var(--muted); }
.qz-flag-reasons { display: grid; gap: 8px; }
.qz-flag-reasons .btn { justify-content: flex-start; text-align: left; white-space: normal; }

/* ---------- Duyarlı yerleşim ---------- */
@media (max-width: 1240px) {
  .app { grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "side main"; }
  .chat { display: none; }
  .chat-toggle { display: inline-flex; }
  .app.chat-open .chat { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--chat-w), 100%); z-index: 50; box-shadow: var(--shadow-lg); animation: slideL .25s var(--ease) both; }
  .app.chat-open .chat-close { display: inline-grid; }
}
@keyframes slideL { from { transform: translateX(24px); opacity: 0; } }
@keyframes slideR { from { transform: translateX(-24px); opacity: 0; } }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
  .only-narrow { display: inline-grid; }
  .only-wide { display: none; }
  .sidebar { display: none; }
  .app.side-open .sidebar { display: flex; position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 50; box-shadow: var(--shadow-lg); animation: slideR .25s var(--ease) both; }
  .app.chat-open .chat { width: 100%; }
  .topbar { padding: 10px 12px; }
  .room-title h2 { font-size: 16px; }
  .chat-toggle .btn-label { display: none; }
  .stage { padding: 12px 12px 104px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile { padding: 18px 10px 14px; }
  .tile .avatar { --size: 60px; }
  .tile-badge { top: 64px; left: calc(50% + 14px); }
  .dock { bottom: max(10px, env(safe-area-inset-bottom)); }
  /* Çubuk ekrandan asla taşmaz: sığmayan satıra iner. Bas-konuş butonu ikonların üstünde tam genişlikte ayrı bir satırdır. */
  .dock-inner { gap: 4px; padding: 6px; border-radius: 18px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .ctrl { height: 44px; min-width: 44px; padding: 0 11px; }
  .ctrl .btn-label { display: none; }
  .ctrl.ptt { order: -1; flex: 1 0 100%; min-width: 0; height: 52px; font-size: 15px; }
  .mode { min-width: 0; }
  .mode select { height: 44px; max-width: 128px; min-width: 0; }
  .dock-sep { display: none; }
  .app.ptt-mode .stage { padding-bottom: 164px; }
  .app.ptt-mode ~ .toasts { bottom: 148px; }
  .lobby { padding: 24px 16px 40px; }
  .settings-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .settings-title { display: none; }
  .settings-tab { flex: none; }
  .settings-body { padding: 20px 16px 28px; }
  .two { grid-template-columns: 1fr; }
  .toasts { left: 50%; right: auto; transform: translateX(-50%); bottom: 88px; }
  .banner-layer, .ready-card { top: 64px; }
  .screen-vol input { width: 70px; }
  .allow-pings .btn-label { display: none; }
}

@media (max-width: 520px) {
  .join-card { padding: 24px 20px; }
  /* Dar telefonda bu düğmeler kontrol çubuğunda yer kaplamaz; tepki panelinin içinde bulunur. */
  .dock .wide-only { display: none; }
  .game-invite { flex-wrap: wrap; }
  .gw-head { padding: 4px 6px 4px 12px; }
  .gw-body { padding: 12px; }
  .game-window[data-kind="chess"] .gw-body { padding: 8px; }
  .dock-inner { gap: 3px; padding: 5px; }
  .ctrl { height: 42px; min-width: 42px; }
  .dock .ctrl:not(.danger):not(.ptt) { width: 42px; }
  .mode select { height: 42px; max-width: 104px; padding-left: 10px; padding-right: 26px; font-size: 12.5px; }
  .theme-options { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .room-title .pill.status { display: none; }
}

/* 360 px'lik Android telefonlar: 6 buton + mod seçici tek satıra sığsın. */
@media (max-width: 380px) {
  .dock { padding: 0 8px; }
  .ctrl { height: 40px; min-width: 38px; }
  .ctrl.danger { padding: 0 9px; }
  .dock .ctrl:not(.danger):not(.ptt) { width: 38px; }
  .mode select { height: 40px; max-width: 92px; padding-left: 8px; padding-right: 22px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* Tepkiler animasyon bitince silinir; animasyonsuz kalırsa hiç görünmezdi. Hareket etmeden belirip solarlar. */
  .float { animation: reactFade 2s linear forwards !important; }
  .tile-react.show { animation: reactFade 1.6s linear both !important; }
}
@keyframes reactFade {
  0% { opacity: 0; }
  10%, 75% { opacity: 1; }
  100% { opacity: 0; }
}
