/* Binde Bir — arayüz katmanı
   Görsel kimlik pixel art sahnesinden gelir. Bu dosya sahneyi yerleştirir ve üstüne sade bir arayüz çizer.
   Sahne görselleri: assets/README.md */

:root {
  --ink: #fdf8ec;
  --ink-dim: #c9c3b4;
  --plate: #151a2b;
  --sun: #ffd23f;
  --miss: #ff6b57;
  --px: 2px;
  --font-pixel: 'Pixelify Sans', ui-monospace, monospace;
  --font-text: 'Atkinson Hyperlegible', system-ui, sans-serif;

  /* sahne: --f rotada alınan yol (0 = çıkış, 1 = son durak). JS ayarlar. */
  --f: 0;
  --u: 4px;          /* 1 çizim pikseli kaç ekran pikseli: masaüstü 4, küçük ekran 3 */
  --vx: 20vw;        /* aracın ekrandaki yatay yeri */
  --rail-y: calc(80 * var(--u));  /* zemin yüksekliği = ground.png yüksekliği */
  --travel: 0px; --far-travel: 0px;  /* alınan yola göre zemin ve tepelerin kayması, JS tam piksel ayarlar */
  --sky-top: #2b2f6b; /* gökyüzü görselinin üstünde kalan alanın rengi */
  --img-sky: none; --img-far: none; --img-ground: none; --img-rail: none; --img-vehicle: none;
  --dock-h: 84px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #10142a; color: var(--ink); font: 17px/1.45 var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: var(--px) dashed var(--sun); outline-offset: 3px; }

/* ================= SAHNE =================
   Pixel art tam kat büyütülür: 1 çizim pikseli = --u ekran pikseli (masaüstü 4, küçük ekran 3).
   Boyutlar çizim pikseli cinsinden yazılır: calc(<çizim px> * var(--u)).
   Görseller CSS değişkenlerinden gelir; JS her rota için assets/routes/<rota>/ klasörüne bakar,
   yoksa assets/ içindeki ortak görseli kullanır (bkz. assets/README.md). */
#scene {
  position: fixed; inset: 0; overflow: hidden; z-index: 0; image-rendering: pixelated;
  /* Gökyüzü görseli yoksa geçici basamaklı geçiş */
  background: linear-gradient(to bottom, #2b2f6b 0 18%, #3d4689 18% 34%, #5b62a6 34% 48%, #8b78b4 48% 58%, #c98aa6 58% 66%, #f0a989 66% 72%, #f7c58d 72% 100%);
}
#scene.has-sky {
  background: var(--img-sky) center bottom / calc(480 * var(--u)) calc(270 * var(--u)) repeat-x, var(--sky-top);
}
#far {
  position: absolute; left: 0; bottom: calc(var(--rail-y) - var(--u)); height: calc(96 * var(--u));
  width: 100%;
  background:
    radial-gradient(60px 46px at 8% 100%, #6b4f86 98%, transparent) 0 100% / 260px 100% repeat-x,
    radial-gradient(90px 70px at 55% 100%, #57457a 98%, transparent) 0 100% / 340px 100% repeat-x;
}
#far.has-img { background: var(--img-far) left bottom / calc(256 * var(--u)) calc(96 * var(--u)) repeat-x; }
#world { position: absolute; left: 0; right: 0; bottom: 0; top: 0; }
/* Yol alındıkça zemin, yol çizgisi ve uzak tepeler sola akar (--travel: JS tam piksel ayarlar) */
#world .ground, #world .rail { background-position-x: calc(var(--travel) * -1) !important; transition: background-position 1.8s cubic-bezier(.25, .8, .3, 1); }
#far { background-position-x: calc(var(--far-travel) * -1) !important; transition: background-position 1.8s cubic-bezier(.25, .8, .3, 1); }

/* Bulunulan durağın manzarası: assets/routes/<rota>/<durak>.png (480×160), yoksa geçici siluet.
   Yeni durağa varınca yenisi sağdan kayarak gelir, eskisi sola çıkar. */
#places { position: absolute; left: 0; right: 0; bottom: calc(var(--rail-y) - var(--u)); height: calc(160 * var(--u)); pointer-events: none; }
.place { position: absolute; inset: 0; transition: transform 1.8s cubic-bezier(.25, .8, .3, 1); }
.place.has-img { background: var(--img) center bottom / calc(480 * var(--u)) calc(160 * var(--u)) no-repeat; image-rendering: pixelated; }
.place.enter { transform: translateX(100vw); }
.place.leave { transform: translateX(-100vw); }
.place .b { position: absolute; bottom: 0; background: #3b3562; }
.place .b.w::after { content: ''; position: absolute; left: 35%; top: calc(3 * var(--u)); width: var(--u); height: var(--u); background: #ffd23f; box-shadow: 0 calc(4 * var(--u)) 0 #ffd23f; }

/* Tabela: yalnızca bulunulan yer */
.here {
  position: absolute; right: 5vw; bottom: calc(var(--rail-y) + 6 * var(--u)); padding: 6px 10px;
  background: var(--plate); border: var(--px) solid var(--ink); font: 600 15px/1.1 var(--font-pixel); color: var(--ink);
  text-align: center; transition: opacity .3s steps(2);
}
.here::after { content: ''; position: absolute; left: 50%; top: 100%; width: var(--px); height: calc(6 * var(--u)); background: var(--ink); }
.here em { display: block; font-style: normal; font-size: 11px; color: var(--ink-dim); }
.here:empty { display: none; }
/* Menü ekranlarında tabela gizli: telefonda menü bağlantılarının üstüne biniyordu; rota şeridi zaten başlangıcı gösteriyor */
[data-screen="menu"] .here { opacity: 0; pointer-events: none; }
#world .ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--rail-y);
  background: linear-gradient(to bottom, #c98a52 0 calc(2 * var(--u)), #a8693e calc(2 * var(--u)) 40%, #7e4a2d 40% 70%, #5a3320 70% 100%);
}
#world .ground.has-img { background: var(--img-ground) left top / calc(64 * var(--u)) calc(80 * var(--u)) repeat; }
#world .rail {
  position: absolute; left: 0; right: 0; bottom: var(--rail-y); height: calc(2 * var(--u));
  background: repeating-linear-gradient(90deg, #e9dcc0 0 calc(3 * var(--u)), #3a2a20 calc(3 * var(--u)) calc(4 * var(--u)));
}
#world .rail.has-img { background: var(--img-rail) left center / calc(16 * var(--u)) calc(2 * var(--u)) repeat-x; }
.stop {
  position: absolute; bottom: calc(var(--rail-y) + var(--u)); left: calc(var(--s) * (var(--worldw) - 100vw) + var(--vx));
  transform: translateX(-50%); text-align: center; pointer-events: none;
}
.stop i { display: block; width: calc(3 * var(--u)); height: calc(3 * var(--u)); margin: 0 auto; background: #10142a; border: var(--px) solid var(--ink); }
.stop span {
  position: absolute; bottom: calc(5 * var(--u)); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 14px/1.1 var(--font-pixel); letter-spacing: .04em; color: var(--ink); text-shadow: 0 2px 0 rgba(16, 20, 42, .9);
}
.stop span em { display: block; font-style: normal; font-size: 11px; color: var(--ink-dim); }
.stop.passed i { background: var(--sun); border-color: var(--sun); }
.stop.passed span { color: var(--sun); }
/* Araç boyutu çizim pikseli cinsinden (--veh-w × --veh-h), JS araca göre ayarlar.
   --veh-sink: araç yol çizgisinin ne kadar altına iner (vapur suya gömülür). */
#vehicle {
  --veh-w: 24; --veh-h: 14; --veh-sink: -2;
  position: absolute; left: var(--vx); bottom: calc(var(--rail-y) - var(--veh-sink) * var(--u));
  width: calc(var(--veh-w) * var(--u)); height: calc(var(--veh-h) * var(--u)); transform: translateX(-50%);
  background: var(--img-vehicle) left bottom / calc(var(--veh-w) * var(--u)) calc(var(--veh-h) * var(--u)) no-repeat; image-rendering: pixelated;
}
/* İki kareli sprite (<araç>-frames.png): iki kare yan yana, giderken kareler arasında geçiş */
#vehicle.frames { background-size: calc(var(--veh-w) * 2 * var(--u)) calc(var(--veh-h) * var(--u)); }
#vehicle.frames.moving { animation: frames .3s steps(1) infinite; }
@keyframes frames { 50% { background-position: calc(var(--veh-w) * -1 * var(--u)) bottom; } }
/* Vapur hep hafifçe dalgada sallanır */
[data-track="sea"] #vehicle:not(.moving) { animation: sway 2.4s steps(4) infinite; }
@keyframes sway { 50% { transform: translateX(-50%) translateY(var(--u)) rotate(-2deg); } }
#vehicle.moving:not(.frames) { animation: chug .25s steps(2) infinite; }
@keyframes chug { 50% { transform: translateX(-50%) translateY(calc(-1 * var(--u))); } }

/* ================= GEÇİCİ ARAÇ ÇİZİMLERİ (görsel yoksa) =================
   4 px'lik pikseller; gerçek görseller assets/vehicles/ klasörüne gelince bunlar kullanılmaz. */
#vehicle.placeholder { background: none; }
#vehicle.placeholder::before { content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 4px; background: transparent; }
[data-vehicle="tren"] #vehicle.placeholder { width: 56px; height: 28px; }
[data-vehicle="tren"] #vehicle.placeholder::before { box-shadow: 8px 0px #2a2233, 12px 0px #2a2233, 8px 4px #2a2233, 12px 4px #2a2233, 36px 4px #ff6b57, 40px 4px #ff6b57, 44px 4px #ff6b57, 48px 4px #ff6b57, 52px 4px #ff6b57, 4px 8px #ff6b57, 8px 8px #ff6b57, 12px 8px #ff6b57, 16px 8px #ff6b57, 20px 8px #ff6b57, 24px 8px #ff6b57, 28px 8px #ff6b57, 32px 8px #ff6b57, 36px 8px #ff6b57, 40px 8px #ffd23f, 44px 8px #ffd23f, 48px 8px #ffd23f, 52px 8px #ff6b57, 0px 12px #ff6b57, 4px 12px #ff6b57, 8px 12px #ff6b57, 12px 12px #ff6b57, 16px 12px #ff6b57, 20px 12px #ff6b57, 24px 12px #ff6b57, 28px 12px #ff6b57, 32px 12px #ff6b57, 36px 12px #ff6b57, 40px 12px #ffd23f, 44px 12px #ffd23f, 48px 12px #ffd23f, 52px 12px #ff6b57, 0px 16px #ff6b57, 4px 16px #ff6b57, 8px 16px #ff6b57, 12px 16px #ff6b57, 16px 16px #ff6b57, 20px 16px #ff6b57, 24px 16px #ff6b57, 28px 16px #ff6b57, 32px 16px #ff6b57, 36px 16px #ff6b57, 40px 16px #ff6b57, 44px 16px #ff6b57, 48px 16px #ff6b57, 52px 16px #ff6b57, 0px 20px #2a2233, 4px 20px #2a2233, 8px 20px #2a2233, 12px 20px #2a2233, 16px 20px #2a2233, 20px 20px #2a2233, 24px 20px #2a2233, 28px 20px #2a2233, 32px 20px #2a2233, 36px 20px #2a2233, 40px 20px #2a2233, 44px 20px #2a2233, 48px 20px #2a2233, 52px 20px #2a2233, 4px 24px #2a2233, 8px 24px #2a2233, 20px 24px #2a2233, 24px 24px #2a2233, 40px 24px #2a2233, 44px 24px #2a2233; }
[data-vehicle="vapur"] #vehicle.placeholder { width: 64px; height: 32px; }
[data-vehicle="vapur"] #vehicle.placeholder::before { box-shadow: 24px 0px #f08a24, 28px 0px #f08a24, 24px 4px #2a2233, 28px 4px #2a2233, 12px 8px #fdf8ec, 16px 8px #fdf8ec, 20px 8px #fdf8ec, 24px 8px #fdf8ec, 28px 8px #fdf8ec, 32px 8px #fdf8ec, 36px 8px #fdf8ec, 40px 8px #fdf8ec, 44px 8px #fdf8ec, 48px 8px #fdf8ec, 12px 12px #fdf8ec, 16px 12px #3d5a8c, 20px 12px #fdf8ec, 24px 12px #3d5a8c, 28px 12px #fdf8ec, 32px 12px #3d5a8c, 36px 12px #fdf8ec, 40px 12px #3d5a8c, 44px 12px #fdf8ec, 48px 12px #fdf8ec, 4px 16px #fdf8ec, 8px 16px #fdf8ec, 12px 16px #fdf8ec, 16px 16px #fdf8ec, 20px 16px #fdf8ec, 24px 16px #fdf8ec, 28px 16px #fdf8ec, 32px 16px #fdf8ec, 36px 16px #fdf8ec, 40px 16px #fdf8ec, 44px 16px #fdf8ec, 48px 16px #fdf8ec, 52px 16px #fdf8ec, 56px 16px #fdf8ec, 4px 20px #fdf8ec, 8px 20px #3d5a8c, 12px 20px #fdf8ec, 16px 20px #3d5a8c, 20px 20px #fdf8ec, 24px 20px #3d5a8c, 28px 20px #fdf8ec, 32px 20px #3d5a8c, 36px 20px #fdf8ec, 40px 20px #3d5a8c, 44px 20px #fdf8ec, 48px 20px #3d5a8c, 52px 20px #fdf8ec, 56px 20px #fdf8ec, 0px 24px #22263a, 4px 24px #22263a, 8px 24px #22263a, 12px 24px #22263a, 16px 24px #22263a, 20px 24px #22263a, 24px 24px #22263a, 28px 24px #22263a, 32px 24px #22263a, 36px 24px #22263a, 40px 24px #22263a, 44px 24px #22263a, 48px 24px #22263a, 52px 24px #22263a, 56px 24px #22263a, 60px 24px #22263a, 4px 28px #22263a, 8px 28px #22263a, 12px 28px #22263a, 16px 28px #22263a, 20px 28px #22263a, 24px 28px #22263a, 28px 28px #22263a, 32px 28px #22263a, 36px 28px #22263a, 40px 28px #22263a, 44px 28px #22263a, 48px 28px #22263a, 52px 28px #22263a, 56px 28px #22263a; }
[data-vehicle="araba"] #vehicle.placeholder { width: 48px; height: 20px; }
[data-vehicle="araba"] #vehicle.placeholder::before { box-shadow: 16px 0px #9fd3ff, 20px 0px #9fd3ff, 12px 4px #ff6b57, 16px 4px #9fd3ff, 20px 4px #9fd3ff, 24px 4px #ff6b57, 28px 4px #ff6b57, 32px 4px #ff6b57, 0px 8px #ff6b57, 4px 8px #ff6b57, 8px 8px #ff6b57, 12px 8px #ff6b57, 16px 8px #ff6b57, 20px 8px #ff6b57, 24px 8px #ff6b57, 28px 8px #ff6b57, 32px 8px #ff6b57, 36px 8px #ff6b57, 40px 8px #ff6b57, 44px 8px #ffd23f, 0px 12px #ff6b57, 4px 12px #ff6b57, 8px 12px #ff6b57, 12px 12px #ff6b57, 16px 12px #ff6b57, 20px 12px #ff6b57, 24px 12px #ff6b57, 28px 12px #ff6b57, 32px 12px #ff6b57, 36px 12px #ff6b57, 40px 12px #ff6b57, 44px 12px #ff6b57, 4px 16px #2a2233, 8px 16px #2a2233, 32px 16px #2a2233, 36px 16px #2a2233; }
[data-vehicle="dolmus"] #vehicle.placeholder { width: 56px; height: 28px; }
[data-vehicle="dolmus"] #vehicle.placeholder::before { box-shadow: 4px 0px #ffd23f, 8px 0px #ffd23f, 12px 0px #ffd23f, 16px 0px #ffd23f, 20px 0px #ffd23f, 24px 0px #ffd23f, 28px 0px #ffd23f, 32px 0px #ffd23f, 36px 0px #ffd23f, 40px 0px #ffd23f, 44px 0px #ffd23f, 48px 0px #ffd23f, 0px 4px #ffd23f, 4px 4px #3d5a8c, 8px 4px #3d5a8c, 12px 4px #ffd23f, 16px 4px #3d5a8c, 20px 4px #3d5a8c, 24px 4px #ffd23f, 28px 4px #3d5a8c, 32px 4px #3d5a8c, 36px 4px #ffd23f, 40px 4px #3d5a8c, 44px 4px #3d5a8c, 48px 4px #3d5a8c, 52px 4px #ffd23f, 0px 8px #ffd23f, 4px 8px #3d5a8c, 8px 8px #3d5a8c, 12px 8px #ffd23f, 16px 8px #3d5a8c, 20px 8px #3d5a8c, 24px 8px #ffd23f, 28px 8px #3d5a8c, 32px 8px #3d5a8c, 36px 8px #ffd23f, 40px 8px #3d5a8c, 44px 8px #3d5a8c, 48px 8px #3d5a8c, 52px 8px #ffd23f, 0px 12px #ffd23f, 4px 12px #ffd23f, 8px 12px #ffd23f, 12px 12px #ffd23f, 16px 12px #ffd23f, 20px 12px #ffd23f, 24px 12px #ffd23f, 28px 12px #ffd23f, 32px 12px #ffd23f, 36px 12px #ffd23f, 40px 12px #ffd23f, 44px 12px #ffd23f, 48px 12px #ffd23f, 52px 12px #ffd23f, 0px 16px #ffd23f, 4px 16px #111111, 8px 16px #fdf8ec, 12px 16px #111111, 16px 16px #fdf8ec, 20px 16px #111111, 24px 16px #fdf8ec, 28px 16px #111111, 32px 16px #fdf8ec, 36px 16px #111111, 40px 16px #fdf8ec, 44px 16px #111111, 48px 16px #fdf8ec, 52px 16px #ffd23f, 0px 20px #ffd23f, 4px 20px #ffd23f, 8px 20px #ffd23f, 12px 20px #ffd23f, 16px 20px #ffd23f, 20px 20px #ffd23f, 24px 20px #ffd23f, 28px 20px #ffd23f, 32px 20px #ffd23f, 36px 20px #ffd23f, 40px 20px #ffd23f, 44px 20px #ffd23f, 48px 20px #ffd23f, 52px 20px #ffd23f, 4px 24px #2a2233, 8px 24px #2a2233, 40px 24px #2a2233, 44px 24px #2a2233; }
[data-vehicle="otobus"] #vehicle.placeholder { width: 72px; height: 28px; }
[data-vehicle="otobus"] #vehicle.placeholder::before { box-shadow: 0px 0px #fdf8ec, 4px 0px #fdf8ec, 8px 0px #fdf8ec, 12px 0px #fdf8ec, 16px 0px #fdf8ec, 20px 0px #fdf8ec, 24px 0px #fdf8ec, 28px 0px #fdf8ec, 32px 0px #fdf8ec, 36px 0px #fdf8ec, 40px 0px #fdf8ec, 44px 0px #fdf8ec, 48px 0px #fdf8ec, 52px 0px #fdf8ec, 56px 0px #fdf8ec, 60px 0px #fdf8ec, 64px 0px #fdf8ec, 68px 0px #fdf8ec, 0px 4px #fdf8ec, 4px 4px #3d5a8c, 8px 4px #3d5a8c, 12px 4px #fdf8ec, 16px 4px #3d5a8c, 20px 4px #3d5a8c, 24px 4px #fdf8ec, 28px 4px #3d5a8c, 32px 4px #3d5a8c, 36px 4px #fdf8ec, 40px 4px #3d5a8c, 44px 4px #3d5a8c, 48px 4px #fdf8ec, 52px 4px #3d5a8c, 56px 4px #3d5a8c, 60px 4px #fdf8ec, 64px 4px #9fd3ff, 68px 4px #9fd3ff, 0px 8px #fdf8ec, 4px 8px #3d5a8c, 8px 8px #3d5a8c, 12px 8px #fdf8ec, 16px 8px #3d5a8c, 20px 8px #3d5a8c, 24px 8px #fdf8ec, 28px 8px #3d5a8c, 32px 8px #3d5a8c, 36px 8px #fdf8ec, 40px 8px #3d5a8c, 44px 8px #3d5a8c, 48px 8px #fdf8ec, 52px 8px #3d5a8c, 56px 8px #3d5a8c, 60px 8px #fdf8ec, 64px 8px #9fd3ff, 68px 8px #9fd3ff, 0px 12px #fdf8ec, 4px 12px #fdf8ec, 8px 12px #fdf8ec, 12px 12px #fdf8ec, 16px 12px #fdf8ec, 20px 12px #fdf8ec, 24px 12px #fdf8ec, 28px 12px #fdf8ec, 32px 12px #fdf8ec, 36px 12px #fdf8ec, 40px 12px #fdf8ec, 44px 12px #fdf8ec, 48px 12px #fdf8ec, 52px 12px #fdf8ec, 56px 12px #fdf8ec, 60px 12px #fdf8ec, 64px 12px #fdf8ec, 68px 12px #fdf8ec, 0px 16px #1f5fa8, 4px 16px #1f5fa8, 8px 16px #1f5fa8, 12px 16px #1f5fa8, 16px 16px #1f5fa8, 20px 16px #1f5fa8, 24px 16px #1f5fa8, 28px 16px #1f5fa8, 32px 16px #1f5fa8, 36px 16px #1f5fa8, 40px 16px #1f5fa8, 44px 16px #1f5fa8, 48px 16px #1f5fa8, 52px 16px #1f5fa8, 56px 16px #1f5fa8, 60px 16px #1f5fa8, 64px 16px #1f5fa8, 68px 16px #1f5fa8, 0px 20px #fdf8ec, 4px 20px #fdf8ec, 8px 20px #fdf8ec, 12px 20px #fdf8ec, 16px 20px #fdf8ec, 20px 20px #fdf8ec, 24px 20px #fdf8ec, 28px 20px #fdf8ec, 32px 20px #fdf8ec, 36px 20px #fdf8ec, 40px 20px #fdf8ec, 44px 20px #fdf8ec, 48px 20px #fdf8ec, 52px 20px #fdf8ec, 56px 20px #fdf8ec, 60px 20px #fdf8ec, 64px 20px #fdf8ec, 68px 20px #fdf8ec, 4px 24px #2a2233, 8px 24px #2a2233, 52px 24px #2a2233, 56px 24px #2a2233; }

/* ================= YOL TİPİNE GÖRE GEÇİCİ ZEMİN =================
   rail: ray (tren) · road: asfalt (araba, dolmuş, otobüs) · sea: deniz (vapur)
   ground.png / rail.png varsa bunlar kullanılmaz. */
[data-track="road"] #world .ground:not(.has-img) { background: linear-gradient(to bottom, #3b3b48 0 calc(10 * var(--u)), #c98a52 calc(10 * var(--u)) calc(12 * var(--u)), #a8693e calc(12 * var(--u)) 45%, #7e4a2d 45% 75%, #5a3320 75%); }
[data-track="road"] #world .rail:not(.has-img) { bottom: calc(var(--rail-y) - 6 * var(--u)); background: repeating-linear-gradient(90deg, #fdf8ec 0 calc(6 * var(--u)), transparent calc(6 * var(--u)) calc(12 * var(--u))); }
[data-track="sea"] #world .ground:not(.has-img) { background: repeating-linear-gradient(90deg, #8fd0e8 0 calc(4 * var(--u)), transparent calc(4 * var(--u)) calc(10 * var(--u))) 0 0 / 100% var(--u) no-repeat, linear-gradient(to bottom, #3a8fc0 0 25%, #2d74a8 25% 55%, #215a8a 55% 80%, #19456d 80%); }
[data-track="sea"] #world .rail:not(.has-img) { background: repeating-linear-gradient(90deg, #fdf8ec 0 var(--u), transparent var(--u) calc(5 * var(--u))); opacity: .7; }

/* ================= HUD ================= */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px;
  font-family: var(--font-pixel);
}
.wordmark { background: none; border: 0; padding: 0; font: 700 20px/1 var(--font-pixel); text-shadow: 0 2px 0 rgba(16, 20, 42, .9); }
#hudstats { display: flex; gap: 16px; font-size: 15px; text-align: right; text-shadow: 0 2px 0 rgba(16, 20, 42, .9); }
#hudstats b { color: var(--sun); font-weight: 600; }
#hudstats button { background: none; border: 0; padding: 0; font: inherit; }

/* ================= İÇERİK ================= */
#app { position: relative; z-index: 2; width: 100%; max-width: 640px; margin: 0 auto; padding: 64px 16px calc(var(--rail-y) + 24px); min-height: 100vh; }
.shade { text-shadow: 0 2px 0 rgba(16, 20, 42, .85); }
.plate { background: var(--plate); border: var(--px) solid var(--ink); padding: 20px; }
.label { font: 600 13px/1.25 var(--font-pixel); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.center { text-align: center; }
.dim { color: var(--ink-dim); }
.small { font-size: 14px; }
h2.h { font: 700 30px/1.1 var(--font-pixel); margin: 0 0 8px; }
h3.h { font: 700 20px/1.1 var(--font-pixel); margin: 22px 0 8px; }
.back { background: none; border: 0; padding: 0; margin: 0 0 14px; font: 600 15px/1 var(--font-pixel); color: var(--ink); text-shadow: 0 2px 0 rgba(16, 20, 42, .9); }

/* Rota şeridi: sahnedeki rotanın küçük özeti */
.route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font: 600 14px/1 var(--font-pixel); }
.route .track { position: relative; height: 10px; }
.route .track::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: rgba(253, 248, 236, .35); }
.route .fill { position: absolute; left: 0; top: 3px; height: 4px; background: var(--sun); width: calc(var(--f) * 100%); transition: width 1.8s cubic-bezier(.25, .8, .3, 1); }
.route .dot { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; left: calc(var(--s) * 100%); background: #10142a; border: var(--px) solid var(--ink); }
.route .dot.on { background: var(--sun); border-color: var(--sun); }
.route .me { position: absolute; top: -3px; width: 6px; height: 16px; margin-left: -3px; left: calc(var(--f) * 100%); background: var(--ink); transition: left 1.8s cubic-bezier(.25, .8, .3, 1); }

/* Ana ekran */
.home { padding-top: 6vh; }
.title { font: 700 clamp(56px, 15vw, 104px)/.9 var(--font-pixel); margin: 0; }
.tagline { font: 600 clamp(20px, 4.6vw, 26px)/1.2 var(--font-pixel); margin: 14px 0 6px; color: var(--sun); }
.rules-line { margin: 0 auto 22px; max-width: 30em; }
.today { margin: 0 auto 22px; max-width: 420px; text-align: left; }
.today .route { margin-top: 12px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-family: var(--font-pixel); font-size: 16px; }
.links button { background: none; border: 0; padding: 4px 0; border-bottom: var(--px) solid transparent; }
.links button:hover { border-bottom-color: currentColor; }

/* Butonlar */
.btn { display: inline-block; border: var(--px) solid var(--ink); background: var(--plate); padding: 12px 20px; font: 600 17px/1 var(--font-pixel); letter-spacing: .03em; }
.btn:hover { background: #222943; }
.btn:active { transform: translateY(2px); }
.btn.go { background: var(--sun); color: #1b1505; border-color: var(--sun); }
.btn.go:hover { background: #ffe07a; }
.btn.big { font-size: 22px; padding: 16px 30px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ================= OYUN ================= */
.question { padding-top: 4px; }
.question .route { margin: 4px 0 18px; }
.prompt { font: 700 clamp(28px, 6.4vw, 40px)/1.1 var(--font-pixel); margin: 10px 0 16px; }
.timer { height: 8px; background: rgba(253, 248, 236, .2); }
.timer i { display: block; height: 100%; background: var(--ink); }
.timer i.hurry { background: var(--miss); }
.timer-row { display: flex; justify-content: space-between; margin-top: 6px; font: 600 14px/1 var(--font-pixel); color: var(--ink); }

/* Alt çubuk: cevap kutusu / sıradaki düğmesi */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--plate); border-top: var(--px) solid var(--ink);
}
.dock-inner { max-width: 640px; margin: 0 auto; }
.answer { display: flex; gap: 8px; }
.answer input, .input {
  flex: 1; min-width: 0; font: 400 20px/1.1 var(--font-text); color: var(--ink); background: #0b0e1e;
  border: var(--px) solid var(--ink); padding: 12px 14px; border-radius: 0; width: 100%;
}
.answer input:focus, .input:focus { outline: none; border-color: var(--sun); }
.shake { animation: shake .3s steps(3); }
@keyframes shake { 33% { transform: translateX(-6px); } 66% { transform: translateX(6px); } }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-dim); }
.dock .btn.go.wide { width: 100%; font-size: 20px; padding: 15px; }

/* "Bunu mu demek istedin?" */
.suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border: var(--px) solid var(--sun); }
.suggest[hidden] { display: none; }
.suggest b { color: var(--sun); font-family: var(--font-pixel); }
.suggest-btns { display: flex; gap: 8px; }
.suggest .btn { padding: 8px 14px; }

/* ================= AÇILIŞ: 100 KİŞİYE SORDUK ================= */
.reveal { text-align: center; }
.reveal .said { font: 700 clamp(30px, 7vw, 42px)/1.05 var(--font-pixel); margin-top: 6px; }
.reveal .pts { font: 700 56px/1 var(--font-pixel); color: var(--sun); margin: 6px 0 2px; }
.reveal .pts.zero { color: var(--miss); }
.reveal .verdict { font: 600 18px/1.3 var(--font-pixel); }
.crowd-wrap { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin: 16px 0 4px; text-align: left; }
.crowd { display: grid; grid-template-columns: repeat(10, 14px); gap: 4px 5px; }
.pp { position: relative; width: 14px; height: 18px; color: rgba(253, 248, 236, .22); }
.pp::before { content: ''; position: absolute; left: 4px; top: 0; width: 6px; height: 6px; background: currentColor; }
.pp::after { content: ''; position: absolute; left: 2px; top: 7px; width: 10px; height: 11px; background: currentColor; }
.has-person .pp { background: url('assets/person.png') center / contain no-repeat; opacity: .3; }
.has-person .pp::before, .has-person .pp::after { display: none; }
.pp.on { color: var(--sun); animation: raise .35s steps(2) both; animation-delay: var(--d); }
.has-person .pp.on { opacity: 1; }
@keyframes raise { from { transform: translateY(4px); color: rgba(253, 248, 236, .22); } }
.crowd-note b { display: block; font: 700 34px/1 var(--font-pixel); color: var(--sun); }
.crowd-note span { font-size: 15px; }
.gold-box { border: var(--px) dashed var(--sun); padding: 10px 12px; margin-top: 14px; font-size: 15px; text-align: left; }
.gold-box b { color: var(--sun); font-family: var(--font-pixel); }
.others { margin-top: 12px; font-size: 14px; color: var(--ink-dim); text-align: left; }
.others b { color: var(--ink); }
.passed-note { margin: 12px 0 0; font: 600 15px/1.3 var(--font-pixel); color: var(--sun); }
.misses { margin-top: 12px; border-top: var(--px) solid rgba(253, 248, 236, .2); padding-top: 10px; text-align: left; }
.miss { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
.miss .btn { padding: 6px 12px; font-size: 14px; }

/* ================= SONUÇ: KARTPOSTAL ================= */
.postcard { background: #f3e9d2; color: #22263a; padding: 10px; border: var(--px) solid var(--ink); }
.postcard-in { border: var(--px) dashed #b9a985; padding: 18px; position: relative; }
.postcard .label { color: #6c6552; }
.postcard h2 { font: 700 clamp(30px, 7vw, 44px)/1.05 var(--font-pixel); margin: 8px 0 6px; }
.postcard .stamp {
  position: absolute; right: 14px; top: 14px; width: 62px; height: 74px; display: grid; place-items: center; text-align: center;
  background: #ff6b57; color: #fff; font: 700 13px/1.1 var(--font-pixel);
  outline: 4px dotted #f3e9d2; outline-offset: -2px;
}
.postcard .stamp b { display: block; font-size: 24px; }
.postcard .score { font: 700 64px/1 var(--font-pixel); margin: 12px 0 0; }
.postcard .score small { font-size: 22px; color: #6c6552; }
.postcard .route { margin-top: 14px; color: #22263a; }
.postcard .route .track::before { background: #b9a985; }
.postcard .route .dot { background: #f3e9d2; border-color: #22263a; }
.postcard .route .dot.on, .postcard .route .fill { background: #e0a400; border-color: #e0a400; }
.postcard .route .me { background: #22263a; }
.card-row { display: flex; gap: 6px; margin: 14px 0 0; }
.card-row i { width: 22px; height: 22px; border: var(--px) solid currentColor; }
.card-row i.t0 { border-color: var(--miss); }
.card-row i.t1 { background: rgba(127, 127, 127, .2); }
.card-row i.t2 { background: rgba(127, 127, 127, .5); }
.card-row i.t3 { background: #8a8577; }
.card-row i.t4 { background: #f0c64a; }
.card-row i.t5, .card-row i.gold { background: #e0a400; }
.card-row i.gold { box-shadow: inset 0 0 0 3px #fff6d0; }
.postcard .btns { justify-content: flex-start; }
.postcard .btn { border-color: #22263a; color: #22263a; background: transparent; }
.postcard .btn.go { background: #22263a; color: #f3e9d2; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 10px; margin-top: 16px; }
.vs .n { font-family: var(--font-pixel); font-weight: 600; }
.vs .s { font: 700 44px/1 var(--font-pixel); }
.vs .s.win { color: #e0a400; }
.plate .vs .s.win { color: var(--sun); }

.rows details { border-top: var(--px) solid rgba(253, 248, 236, .2); }
.rows summary { display: grid; grid-template-columns: 1fr auto 44px; gap: 12px; align-items: baseline; padding: 12px 0; cursor: pointer; list-style: none; }
.rows summary::-webkit-details-marker { display: none; }
.rows .q { font-size: 15px; color: var(--ink-dim); }
.rows .a { font-family: var(--font-pixel); font-weight: 600; }
.rows .p { font: 700 20px/1 var(--font-pixel); text-align: right; color: var(--sun); }
.rows .p.zero { color: var(--miss); }
.alist { columns: 2; column-gap: 20px; list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; }
.alist li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; break-inside: avoid; color: var(--ink-dim); }
.alist li.you { color: var(--ink); font-weight: 700; }
.alist li.gold span:first-child { color: var(--sun); }

/* Listeler, formlar */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: var(--px) solid rgba(253, 248, 236, .15); }
.list li:first-child { border-top: 0; }
.field { display: block; margin: 14px 0 6px; font: 600 14px/1 var(--font-pixel); color: var(--ink-dim); }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 0 0 12px; border: var(--px) solid rgba(253, 248, 236, .25); cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sun); }
.tier-bar { height: 10px; background: rgba(253, 248, 236, .15); margin-top: 10px; }
.tier-bar i { display: block; height: 100%; background: var(--sun); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { border: var(--px) solid rgba(253, 248, 236, .25); padding: 10px; font-size: 14px; color: var(--ink-dim); }
.badge b { display: block; font-family: var(--font-pixel); color: var(--ink); font-size: 15px; }
.badge.on { border-color: var(--sun); }
.badge.on b { color: var(--sun); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats b { display: block; font: 700 28px/1.1 var(--font-pixel); }
.stats span { font-size: 13px; color: var(--ink-dim); }
.stack > * + * { margin-top: 14px; }

#toast {
  position: fixed; left: 50%; top: 60px; z-index: 6; transform: translate(-50%, -20px); visibility: hidden; opacity: 0;
  background: var(--plate); border: var(--px) solid var(--ink); padding: 10px 16px; font: 600 15px/1.3 var(--font-pixel);
  max-width: calc(100% - 32px); text-align: center; transition: transform .2s steps(3), opacity .2s steps(3);
}
#toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }


@media (max-width: 560px) {
  :root { --vx: 26vw; }
  .here { right: 4vw; font-size: 13px; }
  body { font-size: 16px; }
  .plate { padding: 16px; }
  .alist { columns: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .rows summary { grid-template-columns: 1fr 40px; }
  .crowd { gap: 3px 3px; }
  .crowd-note b { font-size: 28px; }
  .postcard .stamp { width: 52px; height: 62px; }
}
/* Küçük ekranda 3 kat büyütme */
@media (max-width: 560px), (max-height: 720px) { :root { --u: 3px; } }
@media (max-height: 480px) { :root { --u: 2px; } }

@media (prefers-reduced-motion: reduce) {
  #world .ground, #world .rail, #far, .place, .route .fill, .route .me { transition: none !important; }
  #vehicle.moving, .pp.on, .shake { animation: none; }
}
/* Pul başlığın üstüne binmesin */
.postcard .label, .postcard h2, .postcard h2 + p { padding-right: 76px; }
@media (max-width: 560px) { .postcard .label, .postcard h2, .postcard h2 + p { padding-right: 62px; } }

/* ================= OYUN TÜRÜ SEÇİCİ ================= */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: var(--px) solid rgba(253, 248, 236, .25); cursor: pointer; }
.mode:has(input:checked) { border-color: var(--sun); }
.mode input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sun); }
.mode b { font-family: var(--font-pixel); }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }

/* ================= KARTPOSTAL ALBÜMÜ ================= */
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pc-card {
  position: relative; aspect-ratio: 3 / 2; padding: 8px 10px; display: flex; flex-direction: column; justify-content: flex-end;
  background: #f3e9d2 url('assets/cards/blank.png') center / cover no-repeat; color: #22263a;
  border: var(--px) solid var(--ink); outline: var(--px) dashed #b9a985; outline-offset: -7px;
}
.pc-card b { font: 700 15px/1.1 var(--font-pixel); }
.pc-card span { font-size: 12px; color: #6c6552; }
.pc-card em { position: absolute; top: 8px; right: 10px; font: 600 11px/1 var(--font-pixel); font-style: normal; color: #ff6b57; }
.pc-card.special { background-color: #ffe9a3; }
.pc-card.locked { background: transparent; color: var(--ink-dim); border: var(--px) dashed rgba(253, 248, 236, .3); outline: 0; }
.pc-card.locked span, .pc-card.locked em { color: rgba(253, 248, 236, .4); }

/* ================= TAM KAT BOYUTLAR (çizim pikseli × 2) ================= */
/* Kalabalık: person.png 7x9 → 14x18 */
.has-person .pp { background: url('assets/person.png') center / 14px 18px no-repeat; }
/* Albüm: cards/blank.png 60x40 → 120x80 */
.album { grid-template-columns: repeat(auto-fill, 120px); justify-content: start; }
.pc-card { width: 120px; height: 80px; aspect-ratio: auto; background-size: 120px 80px; }
@media (max-width: 380px) { .album { grid-template-columns: repeat(2, 120px); } }
@media (prefers-reduced-motion: reduce) { [data-track="sea"] #vehicle:not(.moving) { animation: none; } }
