/*
  ENYAKIN web istemcisi.

  Tasarım dili iOS uygulamasıyla aynı: koyu gradyan zemin, cam yüzeyler,
  kategoriye göre değişen vurgu rengi. Renkler tek yerden — kategori değişince
  JS yalnızca bu özel değişkenleri güncelliyor, geri kalan her şey onlardan
  türüyor.
*/

:root {
  --g1: #1b1e5c;
  --g2: #4a1d6b;
  --g3: #0e3a5c;
  --accent: #7dd3fc;
  --on-accent: #08111f;

  --ink: #ffffff;
  --ink2: rgba(255, 255, 255, 0.72);
  --ink3: rgba(255, 255, 255, 0.48);
  --glass: rgba(255, 255, 255, 0.09);
  --glass-deep: rgba(0, 0, 0, 0.24);
  --edge: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.09);
  --danger: #ff5c8a;

  --c0: #4da6ff; --c1: #ff5c8a; --c2: #3ddc84; --c3: #c77dff;
  --c4: #ffa53c; --c5: #31d8d0; --c6: #ffe14d; --c7: #ff7a5c;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, Roboto, "Helvetica Neue", sans-serif;
  --radius: 22px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.18), 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  background: #12122a;
  overflow-x: hidden;
}

/* Zemin: gradyan + iki ışık havuzu + ölçü ızgarası. iOS'taki ThemedBackground. */
#backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(150deg, var(--g1) 0%, var(--g2) 52%, var(--g3) 100%);
  transition: background 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
#backdrop::before,
#backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  transition: background 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
#backdrop::before {
  width: 62vw; height: 62vw; top: -18vw; right: -14vw;
  background: var(--accent); opacity: 0.28;
}
#backdrop::after {
  width: 52vw; height: 52vw; bottom: -20vw; left: -16vw;
  background: var(--g2); opacity: 0.6;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse at 50% 18%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 18%, #000 20%, transparent 78%);
}

.num { font-variant-numeric: tabular-nums; }

/* ── Üst çubuk ─────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 26, 0.34);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  border-bottom: 1px solid var(--hairline);
  padding: 11px 20px;
}
header[hidden] { display: none; }
.bar { max-width: 940px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.wordmark { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.round-chip {
  font-size: 13px; color: var(--ink2);
  background: var(--glass); padding: 4px 10px; border-radius: 980px;
}
.leader {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 13px; background: var(--glass); padding: 5px 12px;
  border-radius: 980px; border: 1px solid var(--hairline);
}
.leader .score { color: var(--accent); font-weight: 700; }

main {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

/* ── Tipografi ─────────────────────────────────── */
h1 { font-size: clamp(38px, 8vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
h2 { font-size: clamp(24px, 5vw, 38px); font-weight: 700; letter-spacing: -0.032em; line-height: 1.14; }
.lede { font-size: clamp(15px, 2.2vw, 18px); color: var(--ink2); line-height: 1.55; max-width: 34em; }
.cap { font-size: 13px; color: var(--ink3); }

/* ── Bileşenler ────────────────────────────────── */
.card {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card h3 {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink3); margin-bottom: 14px;
}

button { font-family: inherit; font-size: 17px; border: none; cursor: pointer; letter-spacing: -0.01em; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn {
  background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: 15px 28px; border-radius: 980px; min-height: 52px;
  transition: transform 0.12s, filter 0.2s;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 38%, transparent);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.3; cursor: default; transform: none; box-shadow: none; }
.btn.wide { width: 100%; }
.btn.ghost {
  background: var(--glass); color: var(--ink); font-weight: 600;
  border: 1px solid var(--edge); box-shadow: none;
}
.btn.ghost:hover { filter: none; border-color: var(--accent); }
.btn.link {
  background: none; color: var(--ink2); font-size: 15px; font-weight: 500;
  padding: 10px 14px; min-height: 0; box-shadow: none;
}
.btn.link:hover { color: var(--ink); }

input[type="text"] {
  width: 100%; font-family: inherit; font-size: 17px; color: var(--ink);
  background: var(--glass-deep); border: 1px solid var(--edge);
  padding: 15px 16px; border-radius: 14px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input[type="text"]::placeholder { color: var(--ink3); }
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.row { display: flex; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

.seg {
  display: flex; background: var(--glass-deep); padding: 4px;
  border-radius: 14px; gap: 4px; border: 1px solid var(--hairline);
}
.seg button {
  flex: 1; background: transparent; color: var(--ink2); font-size: 15px;
  font-weight: 600; padding: 10px 6px; border-radius: 11px;
  transition: background 0.18s, color 0.18s; min-height: 0;
}
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.tag {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 13px;
  border-radius: 980px; background: var(--accent); color: var(--on-accent);
}
.tag.muted { background: var(--glass); color: var(--ink2); border: 1px solid var(--hairline); }

.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #0b0b18; font-weight: 800; flex: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

/* ── Mod kartları ──────────────────────────────── */
.modes { display: grid; gap: 10px; margin-top: 24px; }
.mode {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--glass); border: 1px solid var(--hairline);
  border-radius: 18px; padding: 14px 16px; color: var(--ink);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: border-color 0.18s, transform 0.12s;
}
.mode:hover { border-color: var(--accent); }
.mode:active { transform: scale(0.99); }
.mode .glyph {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.mode .title { font-size: 16.5px; font-weight: 650; }
.mode .sub { font-size: 12.5px; color: var(--ink2); }
.mode .chev { margin-left: auto; color: var(--ink3); }

/* ── Oda kodu ──────────────────────────────────── */
.code {
  font-size: clamp(34px, 9vw, 46px); font-weight: 800; letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
}
.code-input {
  text-align: center; font-size: 34px; font-weight: 800;
  letter-spacing: 0.22em; text-transform: uppercase;
}

/* ── Oyuncu listesi ────────────────────────────── */
.people { display: flex; flex-direction: column; }
.person {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-top: 1px solid var(--hairline);
}
.person:first-child { border-top: none; }
.person .name { font-weight: 600; }
.person .note { font-size: 12px; color: var(--ink3); }

/* ── Soru ──────────────────────────────────────── */
.tagrow { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.qtext {
  font-size: clamp(26px, 5.4vw, 44px); font-weight: 750;
  letter-spacing: -0.038em; line-height: 1.11; max-width: 17em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.answerbox { margin-top: 30px; max-width: 540px; }
.bigin {
  display: flex; align-items: stretch; background: var(--glass-deep);
  border: 1px solid var(--edge); border-radius: 18px; overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.bigin:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.bigin input {
  flex: 1; min-width: 0; background: none; border: none; border-radius: 0;
  color: var(--ink); font-size: clamp(28px, 6vw, 42px); font-weight: 750;
  letter-spacing: -0.035em; padding: 18px; font-variant-numeric: tabular-nums;
}
.bigin input:focus { box-shadow: none; }
.bigin .unit {
  display: flex; align-items: center; padding: 0 20px; color: var(--accent);
  font-size: 16px; font-weight: 600; background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid var(--hairline); white-space: nowrap;
}
.echo { margin-top: 11px; font-size: 14px; color: var(--ink2); min-height: 20px; font-variant-numeric: tabular-nums; }
.echo b { color: var(--accent); font-weight: 700; }
.hint { margin-top: 6px; font-size: 13.5px; color: var(--ink3); line-height: 1.5; }
.hint b { color: var(--ink2); }

.countdown {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px;
  padding: 5px 12px; border-radius: 980px;
  background: rgba(255, 255, 255, 0.1); color: var(--ink2);
}
.countdown.urgent { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }

.locks { display: flex; gap: 10px; align-items: flex-end; margin-top: 26px; flex-wrap: wrap; }
.lock-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0.3; transition: opacity 0.3s; }
.lock-chip.on { opacity: 1; }
.lock-chip .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); }
.lock-chip.on .pip { background: var(--c2); }

/* ── Açılış ────────────────────────────────────── */
.truth { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 10px 0 12px; }
.truth .value {
  font-size: clamp(42px, 9.5vw, 76px); font-weight: 800; letter-spacing: -0.045em;
  line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent);
  text-shadow: 0 4px 40px color-mix(in srgb, var(--accent) 45%, transparent);
}
.truth .unit { font-size: clamp(16px, 3vw, 22px); color: var(--ink2); font-weight: 600; }
.note {
  color: var(--ink2); font-size: 15.5px; line-height: 1.65; max-width: 44em;
  border-left: 3px solid var(--accent); padding-left: 15px;
}

.winbar {
  display: flex; align-items: center; gap: 15px; margin-top: 22px;
  border-radius: var(--radius); padding: 16px 20px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 26%, transparent), var(--glass));
  border: 1px solid var(--edge); backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.winbar .label {
  font-size: 11.5px; color: var(--ink2); font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.winbar .who { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }
.winbar .detail { font-size: 13.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.winbar .pts { margin-left: auto; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Ölçek — iOS'taki LogScaleView ile aynı geometri. */
.scalewrap {
  margin-top: 14px; background: var(--glass); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 18px 20px 14px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden; box-shadow: var(--shadow);
}
.scalewrap .caption {
  font-size: 11.5px; color: var(--ink3); font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 8px;
}
.scale { position: relative; height: 206px; }
.axis { position: absolute; left: 0; right: 0; top: 166px; height: 2px; background: var(--edge); }
.tick { position: absolute; top: 166px; transform: translateX(-50%); text-align: center; pointer-events: none; }
.tick i { display: block; width: 1px; height: 8px; background: var(--edge); margin: 0 auto; }
.tick span { display: block; font-size: 10.5px; color: var(--ink3); margin-top: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.pin { position: absolute; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.pin.in { opacity: 1; }
.pin .who { font-size: 10.5px; color: var(--ink2); margin-bottom: 4px; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
/*
  Rozetin zemini oyuncunun rengi: .pin üzerindeki `color` inline geliyor,
  `currentColor` onu taşıyor. Bu yüzden burada `color` YENİDEN TANIMLANMAZ —
  tanımlanırsa currentColor da onunla değişip zemin ve metin aynı renge düşer,
  rozet okunmaz olur. Metin rengi iç <s> öğesinde veriliyor.
*/
.pin .value {
  font-size: 11px; font-weight: 800; padding: 3px 9px;
  border-radius: 980px; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: currentColor;
}
.pin .value s { text-decoration: none; color: #0b0b18; }
.pin .stem { width: 2px; background: currentColor; margin: 0 auto; opacity: 0.6; }

.truthpin {
  position: absolute; top: 4px; width: 3px; background: #fff;
  transform: translateX(-50%); border-radius: 2px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.85);
  opacity: 0; transition: opacity 0.45s ease;
}
.truthpin.in { opacity: 1; }
.truthpin b {
  position: absolute; top: -6px; left: 8px; background: #fff; color: #111;
  font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 980px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.truthpin.flip b { left: auto; right: 8px; }

/* ── Satırlar ──────────────────────────────────── */
.rows { display: flex; flex-direction: column; }
.rw { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.rw:first-child { border-top: none; }
.rw .rank { font-size: 13px; color: var(--ink3); width: 20px; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.rw .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw .guess { font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; text-align: right; }
.rw .guess em { display: block; font-style: normal; font-size: 12px; color: var(--ink3); }
.rw .pts { font-weight: 800; font-variant-numeric: tabular-nums; width: 54px; text-align: right; flex: none; }
.rw .pts.gain { color: var(--accent); }
.badge {
  font-size: 10.5px; font-weight: 800; color: var(--on-accent); background: #fff;
  padding: 2px 8px; border-radius: 980px; margin-left: 7px; white-space: nowrap;
}
.move { font-size: 11px; width: 28px; text-align: right; flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.move.up { color: var(--c2); }
.move.down { color: var(--ink3); }

.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; align-items: center; }

/* ── Final ─────────────────────────────────────── */
.crown { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 6px; }
.crown .name { font-size: clamp(34px, 8vw, 60px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
.crown .score { font-size: 20px; color: var(--ink2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.stat { background: var(--glass); border: 1px solid var(--hairline); border-radius: 18px; padding: 17px; }
.stat .label { font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.stat .value { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.stat .sub { font-size: 13.5px; color: var(--ink3); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ── Durum ve hata ─────────────────────────────── */
.center { text-align: center; padding: clamp(40px, 14vh, 120px) 0; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 20px;
  border: 3px solid var(--hairline); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%);
  background: var(--danger); color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 980px; z-index: 200;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
#toast.show { opacity: 1; }

#confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

@media (max-width: 560px) {
  main { padding: 24px 16px 44px; }
  .card { padding: 18px; }
  .rw .guess em { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Bilgi sayfaları (destek, gizlilik, tanıtım) ─────────────── */
.sitenav {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  max-width: 940px; margin: 0 auto; padding: 18px 20px 0;
}
.sitenav a { color: var(--ink2); text-decoration: none; font-size: 14px; }
.sitenav a:hover { color: var(--ink); }
.sitenav .brand { font-weight: 700; font-size: 15px; color: var(--ink); }
.sitenav .spacer { flex: 1; }

.prose { max-width: 44em; }
.prose h2 { margin-top: 34px; }
.prose h3 {
  font-size: 17px; font-weight: 700; color: var(--ink);
  margin-top: 24px; margin-bottom: 6px; letter-spacing: -0.01em;
}
.prose p { color: var(--ink2); margin-top: 10px; line-height: 1.65; }
.prose ul { color: var(--ink2); margin: 10px 0 0 20px; line-height: 1.7; }
.prose li { margin-top: 4px; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose .updated { font-size: 13px; color: var(--ink3); margin-top: 8px; }

.sitefoot {
  max-width: 940px; margin: 0 auto; padding: 40px 20px 48px;
  border-top: 1px solid var(--hairline); margin-top: 48px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
}
.sitefoot a { color: var(--ink3); text-decoration: none; font-size: 13px; }
.sitefoot a:hover { color: var(--ink2); }
.sitefoot .spacer { flex: 1; }
.sitefoot span { color: var(--ink3); font-size: 13px; }
