@font-face{font-family:'Rubik';font-style:normal;font-weight:300 900;font-display:swap;src:url('/rubik-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Rubik';font-style:normal;font-weight:300 900;font-display:swap;src:url('/rubik-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

/* Yalan Makinesi: polygraph paper theme (ported from the prototype). */
:root {
  --paper: #e6efe0;
  --grid: #cfe0c7;
  --grid-major: #b5cfab;
  --ink: #1e2c52;
  --ink-soft: #4a587c;
  --needle: #cf3a2a;
  --marker: #f2c230;
  --slip: #fbfdf8;
  --ok: #2f7d5b;
  --font: Rubik, 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #142019;
    --grid: #1c2c23;
    --grid-major: #26392e;
    --ink: #e3ecdd;
    --ink-soft: #9fb3a6;
    --needle: #ff6a55;
    --marker: #f2c230;
    --slip: #1b2a22;
    --ok: #6fcf9f;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }

html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Poligraf iğnesi: sayfanın tek gösterişli öğesi */
#needle {
  position: sticky; top: 0; z-index: 5;
  display: block; width: 100%; height: 96px;
  border-bottom: 2px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(2px);
}
body.player #needle { height: 52px; }
@media (max-width: 760px) { #needle { height: 52px; } }

main { padding: clamp(16px, 3vw, 40px); overflow-wrap: anywhere; }
.wrap { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 480px; margin: 0 auto; }

h1, h2, h3, p { margin: 0; }
.title {
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.04em;
}
.h2 { font-size: clamp(1.8rem, 4.5vw, 3.6rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.lede { font-size: clamp(1.05rem, 2vw, 1.4rem); color: var(--ink-soft); max-width: 46ch; }
.small { font-size: .95rem; color: var(--ink-soft); }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Butonlar ve alanlar */
.btn {
  font: inherit; font-weight: 800; font-size: 1.15rem;
  border: 2px solid var(--ink); border-radius: 6px;
  background: var(--ink); color: var(--paper);
  padding: .8rem 1.3rem; cursor: pointer;
  min-height: 52px;
  transition: transform .08s ease;
}
.btn:active { transform: translateY(2px); }
.btn.alt { background: transparent; color: var(--ink); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn:focus-visible, .opt:focus-visible, input:focus-visible, .back:focus-visible {
  outline: 3px solid var(--marker); outline-offset: 3px;
}
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=text] {
  width: 100%; font: inherit; font-size: 1.4rem; font-weight: 600;
  color: var(--ink); background: var(--slip);
  border: 2px solid var(--ink); border-radius: 6px;
  padding: .7rem .9rem;
}
input.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; }
.error { color: var(--needle); font-weight: 600; }

/* Giriş ekranı */
.landing { display: grid; gap: 3rem; grid-template-columns: 1.2fr 1fr; align-items: end; padding-top: 4vh; }
@media (max-width: 760px) { .landing { grid-template-columns: 1fr; gap: 2rem; padding-top: 0; } }
.slip {
  background: var(--slip); border: 2px solid var(--ink); border-radius: 8px;
  padding: 1.4rem;
  box-shadow: 6px 6px 0 var(--ink);
}

/* Oda kodu */
.code { display: flex; gap: .5rem; }
.code span {
  display: grid; place-items: center;
  width: clamp(64px, 9vw, 110px); aspect-ratio: 1;
  font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800;
  background: var(--slip); border: 3px solid var(--ink); border-radius: 8px;
}

/* Oyuncu etiketleri */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin-inline: 0; margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--slip); border: 2px solid var(--ink); border-radius: 999px;
  padding: .35rem .9rem .35rem .4rem; font-weight: 600;
}
.chip .dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: .8rem; font-weight: 800;
  background: var(--seat-color, var(--ink));
}
.chip.off { opacity: .45; }
.kick {
  font: inherit; font-weight: 800; line-height: 1; cursor: pointer;
  border: 0; background: transparent; color: var(--ink-soft);
  padding: .1rem .2rem; margin-left: .1rem; border-radius: 4px;
}
.kick:hover, .kick:focus-visible { color: var(--needle); outline: 2px solid var(--marker); }
.chip.done { background: var(--ink); color: var(--paper); }
.chip.empty { border-style: dashed; color: var(--ink-soft); background: transparent; }

/* Zamanlayıcı */
.timer { display: flex; align-items: center; gap: .8rem; }
.timer .bar { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--slip); }
.timer .fill { height: 100%; background: var(--needle); width: 100%; transform-origin: left; transform: scaleX(var(--left, 1)); }
.timer .num { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; font-size: 1.3rem; }

/* Soru */
.cat { font-weight: 600; color: var(--ink-soft); font-size: 1.1rem; }
.question { font-size: clamp(1.6rem, 4.2vw, 3.4rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; max-width: 26ch; }
body.player .question { font-size: 1.45rem; max-width: none; }
.blank {
  display: inline-block; min-width: 4.5ch;
  border-bottom: .12em solid var(--needle);
  transform: translateY(-.08em);
}

/* Şıklar */
.options { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.opt {
  font: inherit; text-align: left; font-size: 1.35rem; font-weight: 600;
  background: var(--slip); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
  padding: .9rem 1rem; width: 100%; cursor: pointer;
}
body.player .options { grid-template-columns: 1fr; }
.opt[disabled] { cursor: default; }
.opt.mine { border-style: dashed; color: var(--ink-soft); }
.opt.picked { background: var(--ink); color: var(--paper); }

/* Kategori seçimi */
.cats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
body.player .cats { grid-template-columns: 1fr; }

/* Açıklama sahnesi */
.reveal-card {
  position: relative;
  background: var(--slip); border: 3px solid var(--ink); border-radius: 10px;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  box-shadow: 8px 8px 0 var(--ink);
  min-height: 260px;
}
.reveal-text { font-size: clamp(2rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stamp {
  position: absolute; right: clamp(1rem, 3vw, 2.5rem); top: clamp(1rem, 3vw, 2rem);
  border: 4px solid currentColor; border-radius: 8px;
  padding: .3rem 1rem; font-size: clamp(1.6rem, 3.5vw, 2.8rem); font-weight: 800;
  transform: rotate(-8deg);
  animation: stamp .25s ease-out;
}
.stamp.lie { color: var(--needle); }
.stamp.truth { color: var(--ok); }
@keyframes stamp { from { transform: rotate(-8deg) scale(1.8); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
@media (min-width: 761px) { .reveal-card > .reveal-text, .reveal-card > .who:first-of-type { padding-right: 11rem; } }
.who { font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 600; }
.pts { font-weight: 800; font-variant-numeric: tabular-nums; }
.pts.neg { color: var(--needle); }

/* Skor tablosu */
.board { list-style: none; padding: 0; margin-inline: 0; margin-bottom: 0; display: grid; gap: .55rem; }
.board li {
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto auto; gap: 1rem; align-items: center;
  background: var(--slip); border: 2px solid var(--ink); border-radius: 8px; padding: .6rem 1rem;
  font-size: clamp(1.1rem, 2vw, 1.5rem); font-weight: 600;
}
.board .rank { font-weight: 800; color: var(--ink-soft); }
.board .gain { font-size: .9em; color: var(--ok); font-weight: 800; }
.board .gain.neg { color: var(--needle); }
.board li.first { background: var(--marker); color: #1e2c52; }
.board li.first .rank, .board li.first .gain { color: #1e2c52; }

.awards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.center-screen { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  .btn { transition: none; }
}

/* Seat colours (players are ordered by join; max 8). */
.seat-0 { --seat-color: #cf3a2a; }
.seat-1 { --seat-color: #2f5fa8; }
.seat-2 { --seat-color: #2f7d5b; }
.seat-3 { --seat-color: #b7791f; }
.seat-4 { --seat-color: #6b4fa0; }
.seat-5 { --seat-color: #1f7a8c; }
.seat-6 { --seat-color: #a23b72; }
.seat-7 { --seat-color: #5a6b2e; }

.back { color: var(--ink-soft); font-weight: 600; text-decoration: none; display: inline-block; }
.back:hover { color: var(--ink); }
.head { margin-bottom: 1.2rem; }
.small-q { font-size: clamp(1.3rem, 3vw, 2.4rem); }
.smaller-q { font-size: clamp(1.2rem, 2.6vw, 2rem); }
.mine-lie { font-size: 2rem; }
.rules { max-width: 720px; }

/* Lobby: QR + code + invite link */
.lobby-head { align-items: flex-end; }
.join-box { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.qr { width: clamp(150px, 18vw, 220px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 8px; background: #fff; overflow: hidden; }
.qr:empty { display: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.invite { flex-wrap: nowrap; gap: .5rem; }
.invite input[type=text] { font-size: .95rem; padding: .55rem .7rem; min-width: 0; }
.invite .btn { min-height: 44px; padding: .5rem .9rem; font-size: 1rem; }

/* Leader badge, "en geride" tag, laugh-hour banner */
.badge-leader, .tag {
  display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 4px;
  font-size: .75em; font-weight: 800; letter-spacing: .02em; vertical-align: middle;
}
.badge-leader { background: var(--marker); color: #1e2c52; }
.tag { background: var(--ink); color: var(--paper); }
.banner {
  background: var(--marker); color: #1e2c52; border: 2px solid var(--ink); border-radius: 8px;
  padding: .7rem 1rem; font-size: clamp(1rem, 2.2vw, 1.5rem); font-weight: 600;
  box-shadow: 4px 4px 0 var(--ink);
}
.narrow .banner { margin-bottom: 1rem; }
.banner strong { font-weight: 800; }

/* Inspiration words */
.words { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.words li { background: var(--marker); color: #1e2c52; border-radius: 6px; padding: .35rem .8rem; font-weight: 800; font-size: 1.15rem; }

/* Scores: who wrote what */
.results { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.result { background: var(--slip); border: 2px solid var(--ink); border-radius: 8px; padding: .7rem 1rem; }
.result.truth { border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.rtext { font-weight: 800; font-size: 1.2rem; }
.bname { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.bname .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; flex: none; background: var(--seat-color, var(--ink)); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 10;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); background: var(--ink); color: var(--paper);
  padding: .7rem 1.1rem; border-radius: 8px; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .board li { gap: .6rem; padding: .5rem .7rem; }
  .join-box { gap: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
