:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #16181d;
  --muted: #6a6f78;
  --line: #e5e1d8;
  --soft: #f1eee7;
  --accent: #c2462c;
  --navy: #0f1e3e;
  --navy-2: #1b2f5c;
  --gold: #ffc94a;
  --sea: #d6e5ee;
  --land: #f1ecdf;
  --land-line: #cbc1ab;
  --hot: #2f9a52;
  --warm: #8fb83a;
  --mild: #e3a426;
  --cold: #b6b1a7;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, 'Roboto Mono', monospace;
  --shadow: 0 1px 2px rgba(15,30,62,.06), 0 8px 24px rgba(15,30,62,.07);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111214; --card: #1a1b1e; --text: #ecebe7; --muted: #9a9ca3; --line: #2b2c30; --soft: #222327; --accent: #ea8566; --sea: #15202b; --land: #2a2a2b; --land-line: #45444a; --cold: #4b4a50; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem 2rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* üst çubuk */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.2rem 0 0.9rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand .logo { width: 2.5rem; height: 2.5rem; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: var(--gold); font-size: 1.25rem; transform: rotate(-12deg); box-shadow: var(--shadow); }
.brand b { display: block; font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.02em; }
.tools { display: flex; align-items: center; gap: 0.45rem; }
.ic { width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 800; font-size: 0.95rem; display: grid; place-items: center; transition: border-color .15s, transform .15s; }
.ic:hover { border-color: var(--muted); transform: translateY(-1px); }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); }
.langs button { border: 0; background: transparent; padding: 0.22rem 0.65rem; border-radius: 999px; cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.langs button[aria-pressed='true'] { background: var(--text); color: var(--bg); }

/* sekmeler ve hedef cümlesi */
.tabs { display: flex; gap: 0.4rem; margin: 1.2rem 0 0; }
.tabs button { border: 1px solid var(--line); background: var(--card); padding: 0.45rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.tabs button span { font-family: var(--mono); font-weight: 600; font-size: 0.78rem; opacity: 0.75; margin-left: 0.25rem; }
.tabs button[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; }
.goal { font-family: var(--serif); font-size: clamp(1.2rem, 2.6vw, 1.55rem); line-height: 1.35; margin: 1rem 0 0.9rem; max-width: 46rem; }
.goal b { color: var(--accent); font-weight: 700; }

/* bilet */
.ticket { position: relative; display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; gap: 1rem; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 20px; padding: 1.3rem 1.6rem; box-shadow: var(--shadow); overflow: hidden; }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; background: var(--bg); }
.ticket::before { left: -12px; } .ticket::after { right: -12px; }
.ap small, .facts small { display: block; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; font-weight: 700; }
.ap { min-width: 0; }
.ap.r { text-align: right; }
.ap .code { font-family: var(--mono); font-size: clamp(2.1rem, 7vw, 3.2rem); font-weight: 800; letter-spacing: 0.04em; line-height: 1.05; }
.ap .code.q { color: var(--gold); }
.ap .city { font-size: 0.88rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mid { text-align: center; }
.line { position: relative; height: 1.6rem; margin: 0 0 0.5rem; }
.line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(255,255,255,0.35); }
.plane { position: relative; display: inline-block; background: var(--navy); padding: 0 0.4rem; font-size: 1.3rem; line-height: 1.6rem; color: var(--gold); }
.facts { display: flex; justify-content: center; gap: 1.6rem; }
.facts b { font-family: var(--mono); font-size: 1.05rem; white-space: nowrap; }
.facts small { white-space: nowrap; }

/* düzen */
.grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.2rem; }
@media (min-width: 900px) { .grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } .side { position: sticky; top: 1rem; } }
.side { display: grid; gap: 1rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }

/* sıra göstergesi ve giriş */
.turn { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.55rem; }
.tl b { font-size: 1rem; }
.tl span { margin-left: 0.6rem; color: var(--muted); font-size: 0.88rem; }
.tl span.warn { color: var(--accent); font-weight: 700; }
.pips { display: flex; gap: 0.3rem; }
.pips i { width: 1.4rem; height: 0.45rem; border-radius: 999px; background: var(--line); }
.pips i.used { background: var(--cold); }
.pips i.now { background: var(--accent); }
.entry { position: relative; display: flex; gap: 0.5rem; }
.entry input { flex: 1; min-width: 0; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 0.95rem 1.1rem; outline: none; font-weight: 600; font-size: 1rem; box-shadow: var(--shadow); transition: border-color .15s; }
.entry input:focus { border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .entry input:focus { border-color: var(--gold); } }
.btn { border: 0; border-radius: 14px; padding: 0 1.4rem; min-height: 3.2rem; cursor: pointer; font-weight: 800; background: var(--navy); color: #fff; white-space: nowrap; box-shadow: var(--shadow); transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.wide { width: 100%; margin-top: 1rem; }
.helper { margin: 0.45rem 0 0; font-size: 0.85rem; color: var(--muted); min-height: 1.3rem; }
.helper.err { color: var(--accent); font-weight: 600; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.14); overflow: hidden; }
.sugg button { display: flex; width: 100%; gap: 0.7rem; align-items: baseline; text-align: left; border: 0; background: transparent; padding: 0.65rem 1rem; cursor: pointer; }
.sugg button b { font-family: var(--mono); min-width: 2.9rem; }
.sugg button span { color: var(--muted); font-size: 0.9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sugg button.act, .sugg button:hover { background: var(--soft); }

/* tahmin tablosu */
.table { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0.4rem; box-shadow: var(--shadow); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 6.6rem 3.6rem 6.4rem; gap: 0.35rem; align-items: center; padding: 0.35rem; border-radius: 12px; }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row.th { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-top: 0.45rem; padding-bottom: 0.45rem; }
.row.th > div:not(.nm) { text-align: center; }
.row .nm { display: flex; align-items: center; gap: 0.5rem; min-width: 0; white-space: nowrap; }
.row .nm .n { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; color: var(--muted); flex: none; }
.row .nm b { font-family: var(--mono); font-size: 1rem; }
.row .nm .c { color: var(--muted); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; }
.row .km { text-align: center; font-family: var(--mono); font-weight: 700; font-size: 0.95rem; }
.row .ar { text-align: center; font-size: 1.25rem; }
.row .pc { position: relative; height: 1.9rem; border-radius: 999px; background: var(--soft); overflow: hidden; }
.row .pc i { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 999px; transition: width .6s ease-out; }
.row .pc span { position: relative; display: grid; place-items: center; height: 100%; font-weight: 800; font-size: 0.85rem; color: var(--text); text-shadow: 0 0 6px var(--card); }
.row.win { background: rgba(47,154,82,0.1); }
.row.win .km { color: var(--hot); }
@keyframes pop { 0% { transform: translateY(6px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.row.new { animation: pop 0.4s ease-out both; }
.emptyrow { padding: 1.2rem; text-align: center; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }

/* ipuçları */
.ph { display: flex; justify-content: space-between; align-items: baseline; }
.ph b { font-size: 1rem; }
.ph span { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.clues .sub { margin: 0.15rem 0 0.6rem; font-size: 0.82rem; color: var(--muted); }
.clues ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; counter-reset: c; }
.clues li { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.5rem 0.75rem; border-radius: 10px; border: 1px dashed var(--line); font-size: 0.86rem; color: var(--muted); counter-increment: c; }
.clues li span::before { content: counter(c) '. '; font-family: var(--mono); opacity: 0.7; }
.clues li b { text-align: right; font-weight: 700; }
.clues li.on { border-style: solid; background: var(--soft); color: var(--text); }
.clues li.on b { color: var(--accent); }
.hbtn { width: 100%; margin-top: 0.6rem; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 10px; padding: 0.55rem; cursor: pointer; font-weight: 800; font-size: 0.86rem; }
.hbtn:hover { background: var(--accent); color: #fff; }

/* harita */
.mapp { padding: 0.6rem; }
.map { background: var(--sea); border-radius: 12px; overflow: hidden; }
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.4; }
.map .hl { fill: var(--accent); opacity: 0.35; stroke: var(--accent); stroke-width: 0.8; }
.map .arc { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; opacity: 0.5; }
.map .ring { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 5 5; opacity: 0.85; }
.map .route { fill: none; stroke: var(--navy); stroke-width: 2.2; }
@media (prefers-color-scheme: dark) { .map .route { stroke: var(--gold); } }
.map .o { fill: var(--navy); stroke: #fff; stroke-width: 2; }
.map .g { stroke: #fff; stroke-width: 1.2; }
.map .tg { fill: var(--gold); stroke: var(--navy); stroke-width: 2; }
.map .lbl { font: 700 10px var(--mono); fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.mleg { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; padding: 0.55rem 0.4rem 0; font-size: 0.78rem; color: var(--muted); }
.mleg .d { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: -1px; }
.mleg .d.o { background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.mleg .d.g { background: var(--mild); }
.mleg .d.ring { border-radius: 0; height: 0; width: 1.1rem; border-top: 2px dashed var(--accent); vertical-align: 3px; }
.note { margin: 0.4rem 0.4rem 0.2rem; font-size: 0.78rem; color: var(--muted); }

/* sonuç */
.result { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem 1.3rem; text-align: center; box-shadow: var(--shadow); }
.result.ok { border-color: rgba(47,154,82,0.45); background: linear-gradient(180deg, rgba(47,154,82,0.08), var(--card) 60%); }
.r-badge { font-size: 2rem; }
.result h2 { margin: 0.1rem 0 0.4rem; font-size: 1.6rem; }
.result .ans { font-size: 1.05rem; }
.result .ans .hl { color: var(--hot); font-weight: 700; }
.result .fact { margin: 0.7rem auto 0; color: var(--muted); font-size: 0.9rem; max-width: 32rem; }
.result .acts { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.result .next { margin-top: 0.8rem; font-size: 0.85rem; color: var(--muted); }
.result .next b { font-family: var(--mono); color: var(--text); }
.foot { margin-top: 2rem; text-align: center; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* pencere */
.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 1rem; background: rgba(15,20,30,0.45); backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s; }
.modal.on { opacity: 1; }
.mbox { position: relative; width: min(34rem, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--card); border-radius: 20px; padding: 1.6rem 1.5rem 1.4rem; box-shadow: 0 30px 80px rgba(0,0,0,0.3); transform: translateY(10px); transition: transform .18s; }
.modal.on .mbox { transform: none; }
.mx { position: absolute; right: 0.9rem; top: 0.8rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.mk { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.mbox h2 { margin: 0.3rem 0 0.5rem; font-size: 1.6rem; }
.mbox h3 { margin: 1.1rem 0 0.5rem; font-size: 1.05rem; }
.mbox .lead { color: var(--muted); margin: 0 0 1rem; }
.mbox .lead b { color: var(--text); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.steps li { display: flex; gap: 0.8rem; align-items: flex-start; }
.steps .si { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 1.1rem; }
.steps b { display: block; }
.steps li span:not(.si) { color: var(--muted); font-size: 0.9rem; }
.ex { margin-top: 1.1rem; border: 1px solid var(--line); border-radius: 14px; padding: 0.6rem; background: var(--bg); }
.exh { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 0.35rem 0.3rem; }
.ex .row { background: var(--card); border-radius: 10px; }
.ex p { margin: 0.5rem 0.35rem 0.1rem; font-size: 0.85rem; color: var(--muted); }
.rules { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.rules li { padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--soft); font-size: 0.82rem; font-weight: 700; }
.who { margin: 0.8rem 0 0; font-size: 0.85rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; margin-top: 0.4rem; }
.stats div { background: var(--soft); border-radius: 12px; padding: 0.7rem 0.3rem; text-align: center; }
.stats b { display: block; font-size: 1.5rem; font-family: var(--mono); }
.stats span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.distrib { display: grid; gap: 0.3rem; }
.distrib div { display: grid; grid-template-columns: 1.2rem 1fr; gap: 0.5rem; align-items: center; font-size: 0.82rem; font-family: var(--mono); }
.distrib i { display: block; height: 1.3rem; background: var(--cold); border-radius: 6px; color: #fff; font-style: normal; text-align: right; padding-right: 0.45rem; line-height: 1.3rem; min-width: 1.6rem; }
.distrib i.me { background: var(--hot); }
.toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 0.65rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; z-index: 3100; box-shadow: var(--shadow); }

@media (max-width: 560px) {
  .wrap { padding: 0 1rem 2rem; }
  .brand small { display: none; }
  .ticket { grid-template-columns: 1fr 1fr; padding: 1.1rem 1.2rem; }
  .ticket .mid { grid-column: 1 / -1; order: 3; }
  .line { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) 5.2rem 2.4rem 4.2rem; gap: 0.25rem; }
  .row .nm .c { display: none; }
  .row.th { font-size: 0.6rem; letter-spacing: 0.04em; }
  .row .km { font-size: 0.82rem; }
  .tl span { display: block; margin: 0; }
}
