/* Çengel — gazete bulmacası havası: kağıt zemin, mürekkep çizgiler, düz renkler. Gradyan yok. */
:root {
  --paper: #f3eee4;
  --paper-2: #e9e2d3;
  --card: #fffdf8;
  --ink: #1d1a16;
  --ink-2: #5f584e;
  --edge: #1d1a16;          /* çerçeve ve gölge rengi */
  --coral: #ff6a4d;
  --mustard: #ffc53d;
  --sky: #6cbcff;
  --mint: #43c9a2;
  --lilac: #c4a8ff;
  --clue: #ffd3dc;
  --clue-on: #ff9fb4;
  --clue-ink: #3b1820;
  --sel: #ffc53d;
  --hl: #fff1bf;
  --ok: #d3f1e4;
  --ok-ink: #0f6b4a;
  --bad: #d6362f;
  --reveal: #5b45c9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191714;
    --paper-2: #24211c;
    --card: #221f1b;
    --ink: #f2ebdf;
    --ink-2: #a89f92;
    --edge: #000000;
    --clue: #4b2a33;
    --clue-on: #7a3a4b;
    --clue-ink: #ffdfe6;
    --hl: #3d3520;
    --ok: #193a2d;
    --ok-ink: #8be0bd;
    --bad: #ff7a70;
    --reveal: #b5a6ff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.1; }
svg { display: block; flex: none; }

/* ---------- üst çubuk */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 700 23px/1 var(--serif); letter-spacing: -.01em; }
.logo {
  display: grid; place-items: center; width: 28px; height: 28px;
  background: var(--coral); color: var(--ink); border: 2px solid var(--ink);
  font: 700 16px/1 var(--serif);
}
.top-title { flex: 1; text-align: center; font: 700 17px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font: 700 15px/1 var(--sans); font-variant-numeric: tabular-nums; min-width: 58px; text-align: center; border: 2px solid var(--ink); padding: 5px 8px; background: var(--card); }
.icon-btn { border: 2px solid transparent; background: none; font-size: 22px; line-height: 1; padding: 2px 8px; }
.icon-btn:hover { border-color: var(--ink); }
body.playing .brand { display: none; }
body.playing .top-title { text-align: left; }

/* ---------- genel */
.page { max-width: 640px; margin: 0 auto; padding: 18px 16px 56px; }
.empty { color: var(--ink-2); text-align: center; padding: 40px 0; }
.section-title {
  font: 800 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2);
  margin: 34px 0 12px; display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 2px; background: var(--ink); opacity: .15; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  padding: 10px 18px; font-weight: 800; text-decoration: none; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--edge);
  transition: transform .06s, box-shadow .06s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--edge); }
.btn.primary, .btn.ink { background: var(--ink); color: var(--paper); }
.btn.small { padding: 7px 14px; font-size: 14px; box-shadow: 2px 2px 0 var(--edge); }
.link { border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 4px; font-size: 14px; }

/* ---------- ana sayfa */
.dateline {
  margin: 0 0 12px; font: 600 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2);
}
.daily {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  background: var(--coral); color: #1d1a16;
  border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--edge);
  padding: 22px;
}
.daily-text { min-width: 0; }
.daily-meta { display: flex; gap: 14px; flex-wrap: wrap; font: 800 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.daily h1 { font-size: clamp(30px, 8vw, 42px); margin: 12px 0 10px; letter-spacing: -.015em; }
.daily p { margin: 0 0 18px; max-width: 32ch; }
.daily .btn.ink { background: #1d1a16; color: #fffdf8; border-color: #1d1a16; box-shadow: 3px 3px 0 #fffdf8; }
.mini {
  display: grid; grid-template-columns: repeat(4, 30px); grid-auto-rows: 30px; gap: 2px;
  background: #1d1a16; border: 2px solid #1d1a16; flex: none;
}
.mini > * { display: grid; place-items: center; font-style: normal; }
.mini b { background: #fffdf8; font: 700 16px/1 var(--serif); color: #1d1a16; }
.mini .q { background: #ffd3dc; color: #3b1820; font: 700 8px/1 var(--sans); }
.mini .f { background: #e9e2d3; }
@media (max-width: 430px) { .mini { display: none; } }

.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.level-card {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #1d1a16;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--edge);
  padding: 14px; min-height: 150px; transition: transform .06s, box-shadow .06s;
}
.level-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--edge); }
.level-card:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--edge); }
.lv0 { background: var(--mint); }
.lv1 { background: var(--sky); }
.lv2 { background: var(--mustard); }
.lv3 { background: var(--lilac); }
.level-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: auto; }
.level-id { font: 700 34px/1 var(--serif); }
.level-count { font: 800 13px/1 var(--sans); font-variant-numeric: tabular-nums; background: #fffdf8; border: 2px solid #1d1a16; padding: 4px 7px; }
.level-card strong { font-size: 17px; margin-top: 18px; }
.level-desc { font-size: 13px; line-height: 1.3; opacity: .8; }
.bar { height: 8px; background: rgb(255 255 255 / .55); border: 2px solid #1d1a16; margin-top: 10px; }
.bar i { display: block; height: 100%; background: #1d1a16; }

.row-link {
  display: flex; justify-content: space-between; align-items: center; margin-top: 16px;
  background: var(--card); border: 2px solid var(--ink); padding: 14px 16px; text-decoration: none; font-weight: 800;
  box-shadow: 4px 4px 0 var(--edge);
}
.row-link b { font: 700 18px/1 var(--serif); }

.code-card {
  margin-top: 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 2px dashed var(--ink); padding: 14px 16px;
}
.code-card strong { font: 700 18px/1.2 var(--serif); }
.code-card p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; max-width: 34ch; }
.code-row { display: flex; gap: 10px; align-items: center; }
.code {
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: 800 16px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; padding: 9px 10px;
}
.code-input {
  width: 100%; font: 800 24px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .14em; text-align: center; text-transform: uppercase;
  padding: 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
}
.code-input:focus { outline: 3px solid var(--mustard); outline-offset: 2px; }
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; }
.support-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--edge); padding: 14px; text-decoration: none;
  font: inherit; color: var(--ink); background: var(--card); transition: transform .06s, box-shadow .06s;
}
.support-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--edge); }
.support-card:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--edge); }
.support-card svg { margin-bottom: 6px; }
.support-card strong { font: 700 18px/1.2 var(--serif); }
.support-card span { font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.support-card.coffee { background: var(--mustard); color: #1d1a16; }
.support-card.coffee span { color: #1d1a16; opacity: .8; }
@media (max-width: 380px) { .support { grid-template-columns: 1fr; } }
.mail-big {
  display: block; text-align: center; font: 700 20px/1.3 var(--serif); word-break: break-all;
  border: 2px dashed var(--ink); padding: 14px; text-decoration: none; background: var(--card);
}
.footer-actions { display: flex; justify-content: center; gap: 12px; margin-top: 30px; }

/* ---------- seviye sayfası */
.level-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.level-head h1 { font-size: 30px; }
.level-head p { margin: 6px 0 0; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; }
.tile {
  aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 2px;
  background: var(--card); border: 2px solid var(--ink); text-decoration: none; font: 700 20px/1 var(--serif);
}
.tile small { font: 700 11px/1 var(--sans); }
.tile.done { background: var(--mint); color: #1d1a16; }
.tile.next { background: var(--mustard); color: #1d1a16; box-shadow: 3px 3px 0 var(--edge); }
.tile.locked { border-style: dashed; color: var(--ink-2); background: transparent; opacity: .55; }

/* ---------- kelime listesi */
.wordlist { list-style: none; padding: 0; margin: 0; display: grid; }
.wordlist li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); padding: 8px 2px; }
.wordlist li:last-child { border-bottom: 0; }
.wordlist b { font: 700 18px/1.2 var(--serif); }
.wordlist span { color: var(--ink-2); flex: 1; }
.speak { display: grid; place-items: center; border: 2px solid var(--ink); background: var(--card); width: 34px; height: 34px; flex: none; padding: 0; }
.speak:hover { background: var(--mustard); color: #1d1a16; }
.wordlist .x { border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; }

/* ---------- oyun */
.play { max-width: 760px; margin: 0 auto; padding: 12px 10px 24px; }
.board-col { display: grid; gap: 12px; align-content: start; }
.clue-bar {
  display: flex; align-items: center; gap: 4px;
  background: var(--clue); color: var(--clue-ink); border: 2px solid var(--ink); padding: 4px; min-height: 54px;
}
.clue-bar .nav { border: 0; background: none; font-size: 26px; width: 40px; height: 42px; flex: none; color: inherit; }
.clue-bar .nav:hover { background: rgb(0 0 0 / .07); }
.clue-bar .cb-main { flex: 1; text-align: center; border: 0; background: none; padding: 4px; color: inherit; }
.cb-num { font-weight: 900; margin-right: 8px; font-size: 18px; }
.cb-text { font: 700 21px/1.2 var(--serif); }
.cb-len { margin-left: 8px; font-size: 13px; font-weight: 700; opacity: .7; }

.board-wrap { display: flex; justify-content: center; }
.board {
  --cell-size: min(calc((100vw - 30px) / var(--w)), calc((100dvh - 350px) / var(--h)), 46px);
  display: grid;
  grid-template-columns: repeat(var(--w), var(--cell-size));
  grid-auto-rows: var(--cell-size);
  gap: 1px; background: var(--ink); border: 3px solid var(--ink);
  user-select: none; touch-action: manipulation;
  box-shadow: 5px 5px 0 var(--edge);
}
.cell {
  position: relative; background: var(--card); cursor: pointer;
  display: grid; place-items: center;
  font: 700 calc(var(--cell-size) * .56)/1 var(--serif); text-transform: uppercase;
}
.cell.hl { background: var(--hl); }
.cell.ok { background: var(--ok); color: var(--ok-ink); }
.cell.sel { background: var(--sel); color: #1d1a16; box-shadow: inset 0 0 0 2px #1d1a16; }
.cell.wrong .ch { color: var(--bad); }
.cell.wrong::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 47%, var(--bad) 48%, var(--bad) 52%, transparent 53%); opacity: .55; }
.cell.revealed .ch { color: var(--reveal); }
.cell.revealed::before { content: ""; position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; background: var(--reveal); }
.board.solved .cell { background: var(--ok); color: var(--ok-ink); }

.fill {
  background-color: var(--paper-2);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 22%, transparent) 1px, transparent 1.3px);
  background-size: 6px 6px;
}

.clue { position: relative; background: var(--clue); color: var(--clue-ink); display: flex; flex-direction: column; cursor: pointer; }
.clue.split .q + .q { border-top: 1px solid var(--clue-ink); }
.q {
  position: relative; flex: 1; min-height: 0;
  display: grid; place-items: center; text-align: center; padding: 1px 2px;
  font: 700 11px/1.05 var(--sans); overflow: hidden;
}
.q span { display: inline-block; }
.q-a { padding-right: 7px; }
.q-d { padding-bottom: 5px; }
.q.active { background: var(--clue-on); }
.q.done { opacity: .45; }
.q-a::after, .q-d::after { content: ""; position: absolute; width: 0; height: 0; }
.q-a::after { right: 1px; top: 50%; transform: translateY(-50%); border: 4px solid transparent; border-left: 5px solid var(--clue-ink); border-right: 0; }
.q-d::after { bottom: 1px; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top: 5px solid var(--clue-ink); border-bottom: 0; }

.tools { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.keyboard { display: grid; gap: 6px; max-width: 520px; width: 100%; margin: 0 auto; user-select: none; touch-action: manipulation; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1; max-width: 46px; height: 50px; padding: 0;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: 700 18px/1 var(--serif); box-shadow: 0 3px 0 var(--edge);
}
.key.wide { max-width: 68px; flex: 1.5; font: 800 17px/1 var(--sans); background: var(--clue); color: var(--clue-ink); }
.key:active { transform: translateY(3px); box-shadow: none; }

@media (hover: hover) and (pointer: fine) {
  .keyboard { display: none; }
  .board { --cell-size: min(calc((100vw - 40px) / var(--w)), calc((100dvh - 240px) / var(--h)), 62px); }
  .play { padding-top: 20px; }
}

/* ---------- bildirim ve pencere */
.toast {
  position: fixed; left: 50%; top: 74px; transform: translate(-50%, -10px);
  background: var(--ink); color: var(--paper); padding: 10px 18px; font-weight: 800; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .18s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog {
  border: 2px solid var(--ink); padding: 0; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 40px);
  background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--edge);
}
dialog::backdrop { background: rgb(29 26 22 / .55); }
.modal-body { padding: 24px; display: grid; gap: 14px; }
.modal-body h2 { font-size: 24px; }
.modal-body p { margin: 0; color: var(--ink-2); }
.result { display: grid; justify-items: center; gap: 10px; text-align: center; }
.stamp {
  font: 800 13px/1 var(--sans); text-transform: uppercase; letter-spacing: .16em;
  border: 2px solid var(--ink); background: var(--mustard); color: #1d1a16; padding: 7px 12px; transform: rotate(-3deg);
}
.stats { display: flex; justify-content: center; border: 2px solid var(--ink); background: var(--card); }
.stats div { display: grid; text-align: center; padding: 10px 6px; flex: 1; }
.stats div + div { border-left: 2px solid var(--ink); }
.stats b { font: 700 24px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.share-preview { white-space: pre-line; border: 2px dashed var(--ink); padding: 10px 12px; font-size: 15px; }
