:root { --bg:#14111f; --card:#1f1a33; --line:#3a3358; --text:#f3eefc; --muted:#9b93b8; --a:#6ee7c8; --b:#ffb36b; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html { height: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body { margin:0; min-height:100%; background:var(--bg); color:var(--text); overscroll-behavior:none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; cursor: default; user-select: none; }

/* Ekran tüm sayfayı kaplar: main dikey flex, aktif .screen kalan alanı doldurur */
main { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display:flex; flex-direction:column;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); }
body.dev main { padding-bottom: 150px; }
.screen { flex:1; display:flex; flex-direction:column; gap:16px; }
.screen[hidden] { display:none; }
.screen.center { justify-content:center; align-items:center; text-align:center; }

h1 { margin:0; font-size: clamp(2rem, 9vw, 2.9rem); line-height:1.12; letter-spacing:-.01em; }
h2 { margin:0; font-size: 1.6rem; line-height:1.3; }
p { color: var(--muted); margin:0; }
input { width:100%; padding:16px; border-radius:14px; border:1px solid var(--line); background:var(--card); color:var(--text); font-size:1rem; user-select:text; cursor:text; }
button { cursor:pointer; font:inherit; border:0; }
.main { padding:16px; border-radius:14px; background:var(--text); color:var(--bg); font-weight:700; font-size:1.05rem; }

/* 1) Ana ekran */
.top { display:flex; justify-content:space-between; align-items:center; padding-bottom:14px; border-bottom:1px solid var(--line); }
.logo { font-size:1.5rem; font-weight:800; letter-spacing:.08em; }
.pill { padding:6px 12px; border-radius:999px; background:var(--card); color:var(--a); font-size:.85rem; font-weight:600; }
.hero { flex:1; display:flex; flex-direction:column; justify-content:center; gap:28px; }
.steps { list-style:none; margin:0; padding:0; display:grid; gap:14px; }
.steps li { display:flex; align-items:center; gap:14px; font-size:1.05rem; }
.steps b { flex:none; width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:var(--card); border:1px solid var(--line); color:var(--a); }
.form { display:grid; gap:12px; }

/* 3) Lobi */
.lobby-label { font-size: clamp(1.1rem, 5vw, 1.4rem); color:var(--muted); }
.clock { font-size: clamp(3.2rem, 17vw, 5.6rem); font-weight:800; font-variant-numeric: tabular-nums; line-height:1; }
.waiting { margin-top:24px; display:flex; flex-direction:column; align-items:center; gap:4px; }
.count { font-size: clamp(5rem, 28vw, 9rem); font-weight:800; line-height:1; color:var(--a); font-variant-numeric: tabular-nums; }
.waiting-text { display:flex; align-items:center; gap:10px; font-size: clamp(1.2rem, 5.5vw, 1.6rem); }
.dot { width:10px; height:10px; border-radius:50%; background:var(--a); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.25; } }
.hint { margin-top:20px; max-width:26ch; }

/* 4) Soru ekranı: üst bar, ortada soru, altta ekranı dolduran A/B */
.bar { position:fixed; top:0; left:0; right:0; height:8px; background:#2a2445; z-index:5; }
#fill { height:100%; width:100%; background:var(--a); }
#question { gap:14px; padding-top:8px; }
.status { display:grid; grid-template-columns:1fr 1.2fr 1fr; gap:10px; }
.cell { padding:12px 6px; border-radius:14px; background:var(--card); text-align:center; font-weight:700;
  font-size: clamp(1rem, 4.6vw, 1.3rem); font-variant-numeric: tabular-nums; white-space:nowrap; }
.cell.time { color:var(--a); }
#qText { flex:1 1 auto; display:flex; align-items:center; font-size: clamp(1.8rem, 8vw, 2.7rem); line-height:1.2; }
.choices { flex:2 1 0; display:grid; grid-template-rows:1fr 1fr; gap:14px; min-height:260px; }
.choice { padding:20px 22px; border-radius:22px; background:var(--card); color:var(--text); text-align:left; font-weight:600;
  font-size: clamp(1.3rem, 6vw, 1.9rem); line-height:1.25; border:3px solid transparent; border-left:8px solid; transition: border-color .15s, box-shadow .15s; }
.choice.a { border-left-color:var(--a); } .choice.b { border-left-color:var(--b); }
.choice.selected.a { border-color:var(--a); box-shadow:0 0 22px #6ee7c855; }
.choice.selected.b { border-color:var(--b); box-shadow:0 0 22px #ffb36b55; }
.choice:disabled { opacity:.6; }

/* Sohbet */
#messages { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px; user-select:text; }
.msg { background:var(--card); padding:10px 12px; border-radius:12px; } .msg b { color:var(--a); }
#chatForm { display:flex; gap:8px; } #chatForm .main { padding:0 18px; }

/* Test paneli */
#devPanel { position:fixed; left:0; right:0; bottom:0; max-height:45dvh; overflow-y:auto; background:#0d0b16; border-top:1px solid var(--line); padding:8px 12px calc(8px + env(safe-area-inset-bottom)); font-size:.85rem; z-index:10; }
#devPanel[hidden] { display:none; }
#devPanel summary { cursor:pointer; font-weight:700; }
.devRow { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:8px 0; }
.devRow label { display:flex; align-items:center; gap:6px; color:var(--muted); }
.devRow input { width:64px; padding:6px; font-size:.85rem; border-radius:8px; }
.devRow button { padding:7px 12px; border-radius:8px; background:var(--card); color:var(--text); }
.legend { margin-bottom:6px; }
#tree ul { list-style:none; margin:2px 0 2px 14px; padding-left:10px; border-left:1px solid var(--line); }
#tree > ul { margin-left:0; padding-left:0; border:0; }
#tree li { margin:3px 0; }
#tree .who { color:var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }
