:root {
  --bg: #0f1222;
  --bg2: #151a30;
  --surface: #1b2140;
  --surface2: #252c52;
  --line: rgba(255, 255, 255, .09);
  --text: #eef0ff;
  --muted: #a3a9cf;
  --primary: #ff8a3d;
  --primary-2: #ff6b2c;
  --secondary: #5b8cff;
  --accent: #2dd4bf;
  --danger: #f43f5e;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, .18), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(255, 138, 61, .14), transparent 60%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; font-weight: 600; letter-spacing: .2px; }
.hidden { display: none !important; }

#app { height: 100%; }
.screen { display: none; height: 100%; overflow: auto; }
.screen.active { display: block; }
#s-game.active { display: flex; flex-direction: column; overflow: hidden; }

/* Buttons */
.btn {
  border: 0; border-radius: 12px; padding: 12px 20px; cursor: pointer;
  background: var(--surface2); font-weight: 700;
  transition: transform .12s ease, background .2s, box-shadow .2s;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-align: center; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere;
}
.btn:hover { transform: translateY(-1px); background: #2f3768; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tool:focus-visible, .tile:focus-visible, .seg button:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, var(--primary), var(--primary-2)); color: #1a0d00; box-shadow: 0 6px 18px rgba(255, 107, 44, .35); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.secondary { background: linear-gradient(180deg, #6d9aff, #4a78f0); color: #04102e; box-shadow: 0 6px 18px rgba(74, 120, 240, .35); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.big { padding: 18px 28px; font-size: 20px; min-width: 240px; font-family: var(--display); font-weight: 600; }
.btn.big small { font-family: var(--font); font-size: 13px; font-weight: 600; opacity: .75; }
.btn.wide { width: 100%; font-size: 18px; padding: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.back { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 700; padding: 6px 0; }
.back:hover { color: var(--text); }

/* Menu */
.menu-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 16px; }
.logo { width: 96px; height: 96px; filter: drop-shadow(0 10px 20px rgba(255, 138, 61, .4)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-6deg); } }
.menu-wrap h1 { font-size: clamp(38px, 7vw, 68px); margin-top: 14px; background: linear-gradient(90deg, #ffd29d, #ff8a3d 40%, #7aa2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { color: var(--muted); max-width: 520px; font-size: 18px; line-height: 1.5; }
.menu-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.features { list-style: none; padding: 0; margin: 34px 0 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.features li { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; }

/* Panels */
.panel { max-width: 980px; margin: 0 auto; padding: 28px 16px 40px; }
.panel.narrow { max-width: 720px; }
.panel h2 { font-size: 32px; margin: 8px 0 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 22px; }
.card p { color: var(--muted); margin: 8px 0 16px; line-height: 1.45; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.split > .card { min-width: 0; display: flex; flex-direction: column; }
.split > .card p { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field span { font-weight: 700; color: var(--muted); font-size: 14px; }
input { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(91, 140, 255, .25); }
.join-row { display: flex; gap: 8px; flex-wrap: wrap; }
.join-row .btn { flex: 1 0 auto; }
.code-input { flex: 1 1 140px; width: 100%; min-width: 0; text-transform: uppercase; letter-spacing: 4px; font-weight: 800; font-size: 20px; text-align: center; }
.note { color: var(--muted); font-size: 14px; margin-top: 18px; line-height: 1.5; }

/* Setup */
#s-setup.active { display: flex; flex-direction: column; }
.setup-head { display: flex; align-items: center; gap: 16px; padding: 16px 20px 0; }
.setup-head h2 { font-size: 26px; }
.setup-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 16px 20px 20px; }
.gallery-col { min-height: 0; overflow: auto; padding-right: 4px; }
.gallery-col h3, .opt h4 { font-size: 16px; color: var(--muted); font-family: var(--font); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile {
  position: relative; border: 2px solid transparent; border-radius: 14px; overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3; padding: 0; background: var(--surface); box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; background: linear-gradient(110deg, #1b2140 30%, #252c52 50%, #1b2140 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.tile img[src] { animation: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tile .tname { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; text-align: left; font-weight: 800; font-size: 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.tile.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 138, 61, .35), var(--shadow); }
.tile.selected::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #1a0d00; font-weight: 900; display: grid; place-items: center; }
.tile .del { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-size: 18px; opacity: 0; transition: opacity .15s; }
.tile:hover .del { opacity: 1; }
.tile .del:hover { background: var(--danger); }
.tile.upload { border: 2px dashed rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .03); box-shadow: none; display: grid; place-items: center; text-align: center; }
.tile.upload:hover { border-color: var(--accent); background: rgba(45, 212, 191, .06); }
.up-in { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 10px; }
.up-in .plus { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #032b26; display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 4px; }
.up-in small { color: var(--muted); }

.options { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 18px; overflow: auto; box-shadow: var(--shadow); }
.sel-box { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg2); }
.sel-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-box span { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 12px 10px; font-weight: 800; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
/* Seçenek grupları: metin uzunsa düğmeler alt satıra geçer, taşmaz */
.seg { display: flex; flex-wrap: wrap; background: var(--bg2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 10px 8px; border-radius: 9px; cursor: pointer; font-weight: 800; color: var(--muted); line-height: 1.2; overflow-wrap: anywhere; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
#opt-diff button[data-v=easy].on { background: #16a34a; color: #fff; }
#opt-diff button[data-v=normal].on { background: #eab308; color: #1c1300; }
#opt-diff button[data-v=hard].on { background: #e11d48; color: #fff; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.shape-demo { width: 100%; height: 110px; margin-top: 10px; background: var(--bg2); border-radius: 12px; display: block; }
.mp-only { display: none; }
body.mp-setup .mp-only { display: block; }
.drop-hint { position: fixed; inset: 0; background: rgba(15, 18, 34, .85); display: none; place-items: center; z-index: 50; pointer-events: none; }
.drop-hint div { border: 3px dashed var(--accent); border-radius: 24px; padding: 60px 80px; font-family: var(--display); font-size: 30px; color: var(--accent); }
.drop-hint.show { display: grid; }

/* Lobby */
.code-box { background: linear-gradient(135deg, #2a2f5c, #1b2140); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.code-box > span { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; }
.code-box strong { display: block; font-family: var(--display); font-size: 56px; letter-spacing: 12px; margin: 6px 0 12px; color: #ffd29d; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lobby-info { display: flex; gap: 14px; align-items: center; margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.lobby-info img { width: 120px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.lobby-info b { display: block; font-size: 18px; margin-bottom: 4px; }
.lobby-info span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.panel h3 { font-size: 18px; margin: 10px 0; }
.players-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.players-list li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.badge { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); }
.players-list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lobby-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lobby-actions .btn.primary { margin-inline-start: auto; }
.waiting { color: var(--muted); margin: 0 0 0 auto; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.host-only, .client-only { display: none; }
body.is-host .host-only { display: inline-flex; }
body.is-client .client-only { display: block; }

/* Game */
.topbar { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: rgba(15, 18, 34, .9); border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 3; }
.timer { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; min-width: 72px; }
.progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 140px; max-width: 360px; }
.progress .bar { flex: 1; height: 10px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #a3e635); border-radius: 999px; transition: width .3s; }
.progress span { font-weight: 800; min-width: 44px; font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.tool { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; min-width: 38px; height: 38px; padding: 0 12px; cursor: pointer; font-weight: 800; font-size: 14px; }
.tool:hover { background: var(--surface2); }
.tool.toggle.on { background: rgba(45, 212, 191, .18); border-color: rgba(45, 212, 191, .6); color: #99f6e4; }
.stage { position: relative; flex: 1; min-height: 0; background: radial-gradient(circle at 50% 40%, #2b3552, #141829 75%); }
.stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 22px 22px; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.preview-float { position: absolute; left: 14px; bottom: 50px; width: 240px; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .2); box-shadow: var(--shadow); pointer-events: none; }
.preview-float img { width: 100%; display: block; }
.side-players { position: absolute; right: 14px; top: 14px; width: 230px; background: rgba(15, 18, 34, .85); border: 1px solid var(--line); border-radius: 14px; padding: 12px; backdrop-filter: blur(6px); }
.side-players h4 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font); font-weight: 800; margin-bottom: 8px; }
.side-players ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.side-players li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.side-players li .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-players li .val { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.side-players li .pbar { grid-column: 2 / 4; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.side-players li .pbar i { display: block; height: 100%; }
.help { position: absolute; left: 14px; bottom: 12px; color: rgba(255, 255, 255, .55); font-size: 13px; pointer-events: none; text-shadow: 0 1px 2px #000; }

.overlay { position: absolute; inset: 0; background: rgba(8, 10, 22, .65); display: grid; place-items: center; z-index: 10; padding: 16px; backdrop-filter: blur(3px); }
.win-card { text-align: center; max-width: 460px; width: 100%; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); position: relative; z-index: 2; }
.win-card h2 { font-size: 36px; color: #ffd29d; }
.win-card p { color: var(--text); font-size: 17px; }
.win-card .players-list { text-align: left; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.busy { position: fixed; inset: 0; background: rgba(8, 10, 22, .7); display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; z-index: 100; font-weight: 700; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .15); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #2a3160; border: 1px solid rgba(255, 255, 255, .15); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; animation: tin .25s ease; transition: opacity .3s, transform .3s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

.sheet-handle, .sheet-backdrop { display: none; }

/* Sayfa düzeni + reklam alanları (reklamlar asla oyun masasının üstüne gelmez) */
.page { display: flex; height: 100%; }
.page > #app { flex: 1; min-width: 0; height: 100%; }
.ad-rail, .ad-bottom { display: none; }
.ad-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, .35); }
.ad-placeholder { display: grid; place-items: center; border: 1px dashed rgba(255, 255, 255, .18); border-radius: 10px; color: rgba(255, 255, 255, .3); font-size: 12px; background: rgba(255, 255, 255, .02); }
.ad-rail { flex: none; width: 184px; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-inline: 1px solid var(--line); background: rgba(10, 12, 26, .45); }
.ad-rail .ad-box, .ad-rail .ad-placeholder { width: 160px; min-height: 600px; }
@media (min-width: 1400px) {
  body.ads-on .ad-rail { display: flex; }
  body.ads-on .lang-pick { right: 198px; }
  [dir=rtl] body.ads-on .lang-pick { right: auto; left: 198px; }
}
.ad-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 6px; background: rgba(10, 12, 26, .92); border-top: 1px solid var(--line); }
.ad-bottom .ad-box, .ad-bottom .ad-placeholder { width: 320px; max-width: 100%; height: 50px; }

/* Ana menü alt bağlantıları */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 28px; }
.footer-links a { color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

/* Çerez izni */
.consent { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); z-index: 300; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.consent p { margin: 0 0 12px; line-height: 1.5; font-size: 14px; }
.consent .row { justify-content: flex-end; align-items: center; }
.consent a { color: var(--muted); font-weight: 700; font-size: 14px; margin-inline-end: auto; }

/* Yazı sayfaları (nasıl oynanır, hakkında, gizlilik, ipuçları) */
body.doc { overflow: auto; }
.doc-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; line-height: 1.7; }
.doc-wrap h1 { font-size: clamp(30px, 5vw, 42px); margin: 10px 0 6px; }
.doc-wrap h2 { font-size: 24px; margin: 30px 0 8px; }
.doc-wrap h3 { font-size: 19px; margin: 22px 0 6px; }
.doc-wrap p, .doc-wrap li { color: #d7dbf5; font-size: 16.5px; }
.doc-wrap a { color: #9db8ff; }
.doc-wrap .lead { color: var(--muted); font-size: 18px; }
.doc-wrap .back { display: inline-block; text-decoration: none; }
.doc-wrap .box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; margin: 16px 0; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc-nav a { color: var(--muted); font-weight: 700; text-decoration: none; }
.doc-nav a:hover { color: var(--text); }
[data-lang] { display: none; }
html[lang=tr] [data-lang=tr], html:not([lang=tr]) [data-lang=en] { display: block; }

/* Dil seçici */
.lang-pick { position: fixed; top: 12px; right: 14px; z-index: 60; }
[dir=rtl] .lang-pick { right: auto; left: 14px; }
.lang-pick select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-weight: 700; cursor: pointer; }
body.in-game .lang-pick { display: none; }

/* Lobi + sohbet */
.lobby-main { min-width: 0; }
.lobby-wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lobby-main h2 { font-size: 32px; margin: 8px 0 18px; }
.lobby-main h3 { font-size: 18px; margin: 18px 0 10px; }
.lobby-main .lobby-info { margin: 0; }
.count { color: var(--muted); font-size: 15px; font-weight: 700; }
.lobby-side { position: sticky; top: 56px; height: min(640px, calc(100vh - 80px)); }
.chat { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-family: var(--display); font-size: 18px; }
.chat-close { display: none; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.chat-list { list-style: none; margin: 0; padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-list li { font-size: 14px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-list li .dot { display: inline-block; width: 9px; height: 9px; margin-inline-end: 6px; vertical-align: middle; box-shadow: none; }
.chat-list li b { margin-inline-end: 6px; }
.chat-list li.me b { color: #ffd29d; }
.chat-list li.sys { color: var(--muted); font-style: italic; font-size: 13px; text-align: center; }
.chat-list li.sug { background: var(--bg2); border: 1px solid rgba(255, 138, 61, .35); border-radius: 12px; padding: 10px; }
.sug-head { font-weight: 700; margin-bottom: 8px; }
.sug-body { display: flex; gap: 10px; align-items: flex-start; }
.sug-body img { width: 84px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; flex: none; }
.sug-body > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.sug-body small { color: var(--muted); }
.sug-body .btn { margin-top: 4px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 10px 12px; }
.chat-float { position: absolute; top: 12px; right: 12px; width: 320px; height: min(440px, calc(100% - 24px)); z-index: 4; }
[dir=rtl] .chat-float { right: auto; left: 12px; }
.chat-float .chat-close { display: block; }
.mp-game-only { display: none; }
body.mp-game .mp-game-only { display: inline-flex; align-items: center; gap: 6px; }
.unread { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; }

/* Üst çubuktaki oyuncular */
.top-players { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pchip { position: relative; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 13px; overflow: hidden; }
.pchip .dot { width: 10px; height: 10px; box-shadow: none; }
.pchip b { white-space: nowrap; }
.pchip .you { color: var(--muted); font-weight: 600; white-space: nowrap; }
.pchip em { font-style: normal; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pchip .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .06); }
.pchip .pbar i { display: block; height: 100%; }

/* Ses paneli */
.tool.muted { color: var(--muted); text-decoration: line-through; }
.sound-panel { position: absolute; top: calc(100% + 6px); right: 14px; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); z-index: 10; }
[dir=rtl] .sound-panel { right: auto; left: 14px; }
.sound-panel h4 { font-family: var(--font); font-weight: 800; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.snd-row { display: grid; grid-template-columns: 1fr 34px 110px 30px; gap: 8px; align-items: center; padding: 6px 0; }
.snd-label { font-weight: 700; font-size: 14px; }
.snd-mute { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; height: 30px; cursor: pointer; font-size: 15px; }
.snd-mute.off { border-color: rgba(244, 63, 94, .6); }
.snd-row input[type=range] { width: 100%; accent-color: var(--accent); padding: 0; }
.snd-val { color: var(--muted); font-size: 13px; text-align: end; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .lobby-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 52px; }
  .players-list li { flex-wrap: wrap; }
  .players-list .grow { flex: 1 1 100px; white-space: normal; overflow-wrap: anywhere; }
  .lobby-info { flex-wrap: wrap; }
  .lobby-info > div { min-width: 0; flex: 1 1 160px; }
  /* dil seçici üstte yer kaplasın, başlıkların üstüne binmesin */
  .panel, .menu-wrap { padding-top: 60px; }
  .setup-head { padding-top: 60px; flex-wrap: wrap; }
  .lang-pick { position: absolute; }
  /* telefonda ayarlar: resme dokununca alttan açılan pencere */
  .options { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 16px 20px; transform: translateY(105%); transition: transform .28s ease; gap: 14px; }
  body.sheet-open .options { transform: none; }
  .sheet-handle { display: flex; align-items: center; justify-content: center; position: relative; min-height: 28px; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
  .sheet-close { display: block; position: absolute; right: 0; top: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg2); color: var(--text); font-size: 22px; cursor: pointer; }
  .sheet-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 18, .6); z-index: 79; display: none; }
  body.sheet-open .sheet-backdrop { display: block; }
  .options .sel-box { aspect-ratio: 16/9; }
  .options .btn-go-wrap, .options #btn-go { position: sticky; bottom: 0; }
  /* telefonda: oyun dışındaki ekranlarda altta tek reklam şeridi */
  body.ads-on:not(.in-game) .ad-bottom { display: flex; }
  body.ads-on:not(.in-game) #app .screen { padding-bottom: 72px; }
  .lobby-side { position: static; height: 420px; }
  .chat-float { width: calc(100% - 24px); }
  .top-players { width: 100%; order: 5; }
  body { overflow: auto; }
  .setup-body { grid-template-columns: 1fr; padding: 12px 16px 20px; }
  #s-setup.active { display: block; }
  .gallery-col { overflow: visible; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .split { grid-template-columns: 1fr; }
  .btn.big { min-width: 0; width: 100%; }
  .menu-actions { flex-direction: column; width: 100%; max-width: 360px; }
  .topbar { gap: 8px; padding: 8px 10px; }
  .tools { margin-left: 0; width: 100%; }
  .tool { flex: 1; padding: 0 6px; font-size: 13px; }
  .side-players { width: 170px; top: 8px; right: 8px; padding: 8px; }
  .preview-float { width: 150px; }
  .help { display: none; }
  .code-box strong { font-size: 42px; letter-spacing: 8px; }
  .lobby-actions .btn { flex: 1; }
  .waiting { margin: 0; width: 100%; }
}
