/* Dilimin Ucunda: "Kâğıt ve Mürekkep" (bkz. docs/GORSEL_DIL.md).
   Kurallar: açık zemin, koyu yazı; boştayken hiçbir şey kıpırdamaz; bulanıklık yok. */

:root {
  --paper: #f6f1e7;
  --paper-2: #ece5d6;
  --card: #fffdf8;
  --ink: #1b2333;
  --ink-2: #5a6475;
  --ink-3: #9aa2af;
  --line: rgba(27, 35, 51, .12);
  --line-2: rgba(27, 35, 51, .22);
  --indigo: #27335a;
  --indigo-2: #33427a;
  --gold: #c39a3f;
  --gold-2: #e9d5a1;
  --clay: #b8674a;
  --green: #2f7d5b;   /* çözülen söz: zümrüt yeşili, beyaz harfle yaklaşık 5:1 */
  --green-d: #1f5a40;
  --accent: var(--indigo);
  --shadow-s: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 2px 0 rgba(27, 35, 51, .1), 0 6px 14px -8px rgba(27, 35, 51, .35);
  --shadow-l: 0 30px 70px -24px rgba(27, 35, 51, .5);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --box: 30px;
  font-family: var(--sans);
  color: var(--ink);
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1  0 0 0 0 .13  0 0 0 0 .2  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(120% 70% at 50% 0%, #fbf8f0 0%, var(--paper) 55%, var(--paper-2) 100%);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.coin { display: inline-block; width: 15px; height: 15px; border-radius: 50%; flex: 0 0 auto; background: radial-gradient(circle at 35% 30%, #f6e6b8, var(--gold) 55%, #a07a2c); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.grow { flex: 1; }

/* ---------- yerleşim ---------- */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; padding: calc(var(--top) + 12px) max(18px, calc(50% - 230px)) calc(var(--bottom) + 14px); }
.screen.center { align-items: center; justify-content: center; gap: 14px; }
.bar { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 44px; }

/* ---------- tipografi ---------- */
.eyebrow { font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.note { margin: 0; font-weight: 500; font-size: 15px; line-height: 1.45; color: var(--ink-2); }

/* ---------- düğmeler ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 0 22px; border-radius: 16px;
  font-weight: 700; font-size: 16px; background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-s);
  transition: transform .1s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: linear-gradient(180deg, var(--indigo-2), var(--indigo)); color: var(--card); box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 3px 0 #1a2340, 0 14px 26px -14px rgba(27, 35, 51, .7); }
.btn.big { min-height: 58px; font-size: 17px; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto; display: grid; place-items: center; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-s); transition: transform .1s ease; }
.icon-btn:active { transform: scale(.95); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- ana ekran ---------- */
.home { justify-content: space-between; }
.brand { text-align: center; padding-bottom: 6vh; }
.wordmark { margin: 10px 0 0; font-family: var(--serif); font-weight: 500; font-size: clamp(56px, 17vw, 84px); line-height: .98; letter-spacing: -.02em; color: var(--ink); }
.wordmark em { font-style: italic; color: var(--clay); }
.wordmark .gap { display: inline-block; width: .5em; height: .62em; margin-left: .06em; border-radius: .1em; border: .045em solid var(--gold); vertical-align: -.02em; }
.lede { margin: 16px 0 0; font-weight: 500; font-size: 17px; color: var(--ink-2); }
.home-foot { display: grid; gap: 12px; text-align: center; }

/* ---------- oyun ---------- */
.game { gap: 0; }
.lvl { flex: 1; text-align: center; font-family: var(--serif); font-weight: 500; font-size: 18px; color: var(--ink-2); }
.src { flex: 0 0 auto; margin-top: 14px; min-height: 18px; text-align: center; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.src span { color: var(--ink-2); }
.board { flex: 1 1 auto; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px 16px; padding: 10px 0; }
.w { display: flex; gap: 3px; }
.b {
  width: var(--box); height: calc(var(--box) * 1.22); border-radius: calc(var(--box) * .22);
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--box) * .56); line-height: 1; color: var(--ink);
  background: var(--card); box-shadow: 0 0 0 1px var(--line-2) inset;
  transition: background .25s, color .25s, box-shadow .25s;
}
.b.o { box-shadow: 0 0 0 1px var(--line) inset, 0 2px 0 rgba(27, 35, 51, .08); }
.b.flip { animation: flip .32s var(--ease); }
@keyframes flip { 0% { transform: scaleY(1); } 45% { transform: scaleY(.05); } 100% { transform: scaleY(1); } }
.w.f .b { background: var(--indigo); color: var(--card); box-shadow: 0 2px 0 #1a2340; }
.b.press { animation: press .34s var(--spring); }
@keyframes press { 0% { transform: translateY(-5px) scale(1.12); } 60% { transform: translateY(1px) scale(.95); } 100% { transform: none; } }
.board.done .w.f .b { background: var(--green); color: var(--card); box-shadow: 0 2px 0 var(--green-d); transition-duration: .5s; }

.preview-row { flex: 0 0 auto; height: 46px; display: grid; place-items: center; }
.preview { height: 40px; min-width: 40px; padding: 0 16px; border-radius: 12px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .14em; color: var(--ink); background: var(--card); box-shadow: 0 0 0 1px var(--line); opacity: 0; transition: opacity .1s, box-shadow .15s; }
.preview.on { opacity: 1; }
.preview.phrase { box-shadow: 0 0 0 2.5px var(--gold); }
.preview.bonus { box-shadow: 0 0 0 2px var(--indigo-2); }
.preview.bad { animation: shake .3s; }
.preview small { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.wheel-wrap { flex: 0 0 auto; display: grid; place-items: center; padding: 2px 0 8px; }
.wheel { position: relative; width: var(--wd, 300px); height: var(--wd, 300px); border-radius: 50%; background: rgba(255, 253, 248, .6); box-shadow: 0 0 0 1px var(--line) inset; touch-action: none; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.trail polyline { fill: none; stroke: rgba(39, 51, 90, .28); stroke-linecap: round; stroke-linejoin: round; }
.tile {
  position: absolute; left: 0; top: 0; width: var(--ts); height: var(--ts); margin: calc(var(--ts) / -2) 0 0 calc(var(--ts) / -2); border-radius: 26%;
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--ts) * .5); line-height: 1; color: var(--ink);
  background: linear-gradient(180deg, #fffefb, #f4eee0); box-shadow: 0 0 0 1px var(--line), 0 3px 0 rgba(27, 35, 51, .14), 0 10px 16px -10px rgba(27, 35, 51, .5);
  transition: transform .28s var(--ease), background .08s, color .08s, box-shadow .12s, opacity .2s;
  pointer-events: none;
}
.tile.sel { background: linear-gradient(180deg, var(--indigo-2), var(--indigo)); color: var(--card); box-shadow: 0 3px 0 #1a2340, 0 10px 18px -10px rgba(27, 35, 51, .8); }
.tile.new { opacity: 0; }
.tile.gone { opacity: 0; transition: opacity .12s; }
.center { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-s); transition: transform .1s ease, background .15s, color .15s; }
.center:active { transform: scale(.94); }
.center .ok { display: none; }
.center.go { background: var(--indigo); color: var(--card); }
.center.go .ok { display: block; }
.center.go .sh { display: none; }
.hand { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -8px 0 0 -12px; pointer-events: none; z-index: 5;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M18 6a4 4 0 0 1 8 0v14l2-.4a4 4 0 0 1 4.6 2.6l.4 1 1.2-.2a4 4 0 0 1 4.4 3l.2.7c1.7-.2 3.6 1 3.9 2.8L44 38c.6 4.5-2.8 8-7.3 8H26c-2.4 0-4.6-1.2-6-3.2L10.5 30a3.6 3.6 0 0 1 5.4-4.7L18 27z' fill='%23fffdf8' stroke='%231b2333' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 8px 10px rgba(27, 35, 51, .3)); transition: transform .32s ease, opacity .2s; }

.tools { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tool { min-width: 104px; height: 48px; padding: 0 14px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-s); font-weight: 700; font-size: 14px; transition: transform .1s ease, opacity .2s; }
.tool:active { transform: scale(.97); }
.tool b { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tool.poor { opacity: .45; }
.tool.quiet { min-width: 0; background: none; box-shadow: none; color: var(--ink-2); font-size: 13px; }
.tool .ic { width: 16px; height: 16px; }

.fly { position: fixed; z-index: 55; pointer-events: none; display: grid; place-items: center; font-weight: 700; color: var(--card); border-radius: 26%; background: var(--indigo); box-shadow: 0 6px 14px -6px rgba(27, 35, 51, .6); }
/* Bilgi kartı: kendiliğinden kaybolmaz; "Devam"a ya da ekrana dokununca geçer. */
.coach-block { position: fixed; inset: 0; z-index: 69; }
.coach { position: fixed; left: 50%; z-index: 70; transform: translateX(-50%); width: min(420px, calc(100% - 28px)); padding: 16px 16px 12px; border-radius: 20px; background: var(--ink); color: var(--card); box-shadow: var(--shadow-l); animation: coachIn .3s var(--ease); }
@keyframes coachIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.coach p { margin: 0 0 12px; font-weight: 600; font-size: 16px; line-height: 1.45; }
.coach-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.coach-row > span:first-child { font-weight: 700; font-size: 12px; letter-spacing: .12em; color: rgba(255, 253, 248, .6); }
.coach.nobtn p { margin-bottom: 6px; }
.coach.nobtn .coach-row { min-height: 0; }
.cbtn { min-width: 96px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 15px; background: var(--gold-2); color: #33270a; }
.cbtn.ghost { background: rgba(255, 253, 248, .14); color: var(--card); }
.cbtn:active { transform: scale(.97); }
.spot { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 18px; }
.wheel.spot { border-radius: 50%; }
.board.spot { outline-offset: -6px; }
.center.spot { border-radius: 50%; outline-offset: 4px; }

/* ---------- katmanlar ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: calc(var(--top) + 16px) 12px calc(var(--bottom) + 12px); background: rgba(27, 35, 51, .42); animation: fadeIn .25s; overflow-y: auto; touch-action: pan-y; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: 100%; max-width: 420px; margin: auto auto 0; display: flex; flex-direction: column; gap: 14px; text-align: center; padding: 22px 20px 20px; border-radius: 28px; background: var(--paper); box-shadow: var(--shadow-l); animation: sheetIn .45s var(--ease); }
@media (min-height: 720px) { .sheet { margin: auto; } }
.sheet.tall { max-height: 88vh; overflow-y: auto; }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }

.quote-card { position: relative; padding: 26px 22px 22px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 14px 30px -18px rgba(27, 35, 51, .45); text-align: left; overflow: hidden; }
.quote-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.q-type { font-weight: 700; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.quote-card blockquote { margin: 12px 0 14px; font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 7vw, 30px); line-height: 1.18; letter-spacing: -.01em; color: var(--ink); }
.quote-card blockquote::before { content: '“'; display: block; height: .5em; font-size: 2em; line-height: 1; color: var(--gold); }
.q-src { font-weight: 700; font-size: 14px; color: var(--ink); }
.q-note { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 500; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.reward { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--serif); font-weight: 600; font-size: 20px; }
.reward .coin { width: 20px; height: 20px; }
.reward span { font-family: var(--sans); font-weight: 600; font-size: 13px; color: var(--ink-2); }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-radius: 14px; overflow: hidden; background: var(--line); box-shadow: 0 0 0 1px var(--line); }
.toggle { min-height: 48px; font-weight: 700; font-size: 14px; background: var(--card); color: var(--ink-3); }
.toggle[aria-pressed='true'] { background: var(--indigo); color: var(--card); }
.book-list { display: grid; gap: 8px; text-align: left; }
.book-list .label { margin-top: 8px; font-weight: 700; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.book-item { padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line); border-left: 4px solid var(--accent); }
.book-item b { display: block; font-family: var(--serif); font-weight: 500; font-size: 17px; line-height: 1.25; }
.book-item span { font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.loader { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--indigo); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- favoriler ---------- */
.book-item { display: flex; align-items: center; gap: 10px; }
.book-item > div { flex: 1; min-width: 0; }
.fav { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-3); }
.fav.on { color: var(--clay); }
.fav.on .ic, #favToggle.on .ic { fill: currentColor; }
#favToggle.on { color: var(--clay); }
