/* Arayüz: sistem yazı tipi, buzlu cam yüzeyler, gruplu listeler, bölmeli denetimler. */
:root {
  --bg: #f2f2f7;
  --ink: #1c1c1e;
  --ink2: rgba(60, 60, 67, .6);
  --ink3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .14);
  --fill: rgba(120, 120, 128, .12);
  --fill2: rgba(120, 120, 128, .2);
  --glass: rgba(255, 255, 255, .72);
  --raised: #ffffff;
  --blue: #007aff;
  --accent: #007aff;            /* seçili koltuğun rengi (3D sahneyle aynı) */
  --warn-bg: rgba(255, 149, 0, .16);
  --warn-ink: #b25000;
  --blur: saturate(180%) blur(28px);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", "Segoe UI", Roboto, sans-serif;
}
/* gece ve dış görünümde koyu cam */
body.dark {
  --ink: #ffffff;
  --ink2: rgba(235, 235, 245, .62);
  --ink3: rgba(235, 235, 245, .3);
  --sep: rgba(84, 84, 88, .6);
  --fill: rgba(118, 118, 128, .24);
  --fill2: rgba(118, 118, 128, .36);
  --glass: rgba(30, 30, 32, .68);
  --raised: #636366;
  --blue: #0a84ff;
  --warn-bg: rgba(255, 159, 10, .22);
  --warn-ink: #ffb340;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 15px/1.35 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.mono { font-family: var(--font); font-variant-numeric: tabular-nums; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#fade { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .32s ease; }
#fade.on { opacity: 1; }

/* ---- üst başlık ---- */
#top { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 12px; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; pointer-events: none; color: var(--ink); transition: color .4s; }
#top > * { pointer-events: auto; }
#top h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.022em; }
#top p { margin: 1px 0 0; font-size: 12px; font-weight: 500; color: var(--ink2); }
body.dark #top { text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }

.round { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  display: grid; place-items: center; cursor: pointer; flex: none;
  box-shadow: 0 0 0 .5px var(--sep), 0 4px 16px rgba(0, 0, 0, .1); transition: transform .2s var(--ease), opacity .2s; }
.round:active { transform: scale(.9); opacity: .7; }
#back { color: var(--blue); }

/* ---- alt panel ---- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px; color: var(--ink);
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 28px 28px 0 0; padding: 22px 20px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 0 0 .5px var(--sep), 0 -10px 40px rgba(0, 0, 0, .12); transition: background .4s, color .4s; }
.sheet::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
  border-radius: 3px; background: var(--ink3); }
.sheet h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.022em; }
.sheet p { margin: 3px 0 0; font-size: 13px; color: var(--ink2); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 14px; padding-top: 12px;
  border-top: .5px solid var(--sep); font-size: 13px; color: var(--ink2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sw.free { background: #b9c1cc; } .sw.taken { background: #e4e2de; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); } .sw.sel { background: var(--accent); }
.link { margin-left: auto; border: 0; background: none; padding: 0; font-size: 15px; color: var(--blue); cursor: pointer; }
.link:active { opacity: .5; }

.row { display: flex; justify-content: space-between; align-items: center; }
.clock { display: flex; align-items: baseline; gap: 8px; }
#clock { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
#phase { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink2); }
#play { width: 44px; height: 44px; background: var(--fill); color: var(--blue); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#headline { margin-top: 8px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
#subline { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9cc0ea; flex: none; transition: background .3s;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15); }

/* zaman çizelgesi */
#timeline { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 8px 0 0; background: transparent; cursor: pointer; touch-action: none; }
#timeline::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--track, var(--fill2)); }
#timeline::-moz-range-track { height: 6px; border-radius: 3px; background: var(--track, var(--fill2)); }
#timeline::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 .5px 4px rgba(0, 0, 0, .12), 0 6px 13px rgba(0, 0, 0, .12); }
#timeline::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 .5px 4px rgba(0, 0, 0, .12), 0 6px 13px rgba(0, 0, 0, .12); }
.ticks { display: flex; justify-content: space-between; font-size: 11px; font-weight: 500; color: var(--ink2); margin-top: 0; }

/* bölmeli denetim */
.chips { display: flex; gap: 0; margin-top: 12px; background: var(--fill); border-radius: 10px; padding: 2px; }
.chips button { flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer; transition: background .25s var(--ease), box-shadow .25s; }
.chips button.on { background: var(--raised); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }

.tags { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tags::-webkit-scrollbar { display: none; }
.tags span { white-space: nowrap; flex: none; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 20px;
  background: var(--fill); color: var(--ink2); }
.tags span.warn { background: var(--warn-bg); color: var(--warn-ink); }

.cta { width: 100%; margin-top: 12px; border: 0; border-radius: 14px; height: 50px; background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; letter-spacing: -.02em; cursor: pointer; transition: background .25s, transform .2s var(--ease), opacity .2s; }
.cta small { font-weight: 400; opacity: .75; margin-left: 6px; font-size: 15px; }
.cta:active { transform: scale(.98); opacity: .8; }
.cta.done { background: #34c759; }

/* ---- perde sürgüsü ---- */
#shadeCtl { position: fixed; right: 12px; top: calc(74px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
#shadeTrack { position: relative; width: 34px; height: 120px; border-radius: 17px; background: rgba(120, 120, 128, .32);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); touch-action: none; cursor: ns-resize; overflow: hidden;
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .3), 0 4px 16px rgba(0, 0, 0, .15); }
#shadeFill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: rgba(255, 255, 255, .92); }
#shadeKnob { position: absolute; left: 9px; right: 9px; top: 6px; height: 5px; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }

#hint, #toast { position: fixed; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: 22px;
  background: rgba(30, 30, 32, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff;
  pointer-events: none; white-space: nowrap; transition: opacity .4s; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
#hint { top: calc(72px + env(safe-area-inset-top)); }
#hint.off { opacity: 0; }
#toast { top: calc(72px + env(safe-area-inset-top)); opacity: 0; }
#toast.on { opacity: 1; }

/* çift katlı uçaklarda kat seçimi */
#decks { position: fixed; right: 12px; top: calc(62px + env(safe-area-inset-top)); flex-direction: column; margin: 0;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 12px; box-shadow: 0 0 0 .5px var(--sep), 0 4px 16px rgba(0, 0, 0, .1); }
#decks button { padding: 8px 14px; border-radius: 10px; white-space: nowrap; }
#decks button.on { background: var(--blue); color: #fff; box-shadow: none; }

@media (min-width: 800px) {
  .sheet { left: 20px; right: auto; bottom: 20px; width: 390px; border-radius: 28px; padding-top: 20px;
    box-shadow: 0 0 0 .5px var(--sep), 0 20px 60px rgba(0, 0, 0, .16); }
  .sheet::before { display: none; }
}

/* ---- uçuş girişi ---- */
#entry { position: fixed; inset: 0; display: flex; padding: calc(64px + env(safe-area-inset-top)) 20px 20px;
  background: rgba(242, 242, 247, .6); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); overflow-y: auto; }
#entry .card { width: 100%; max-width: 400px; margin: auto; /* taşarsa üstten kaydırılabilir kalır */ color: var(--ink); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 30px; padding: 28px 20px 20px; box-shadow: 0 0 0 .5px var(--sep), 0 30px 80px rgba(0, 0, 0, .18); }
#entry .eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--blue); }
#entry h2 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
#entry p { margin: 8px 0 0; font-size: 15px; color: var(--ink2); }
#entryMode { margin-top: 18px; }
#entryForm { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
#flightNo { grid-column: 1 / -1; min-width: 0; height: 54px; border-radius: 14px; border: 0; background: var(--fill); color: var(--ink);
  padding: 0 16px; font-size: 22px; font-weight: 600; letter-spacing: .01em; text-transform: uppercase; outline: none;
  transition: box-shadow .2s; }
#flightNo::placeholder { color: var(--ink3); }
#flightDate { min-width: 0; height: 50px; border-radius: 14px; border: 0; background: var(--fill); color: var(--ink);
  padding: 0 14px; font-size: 17px; outline: none; transition: box-shadow .2s; }
#flightNo:focus, #flightDate:focus, #routeForm input:focus { box-shadow: 0 0 0 3.5px rgba(0, 122, 255, .3); }
#entryForm button, #routeGo { height: 50px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; cursor: pointer; transition: transform .2s var(--ease), opacity .2s; }
#entryForm button:active, #routeGo:active { transform: scale(.97); opacity: .8; }
#entryForm button:disabled, #routeGo:disabled { opacity: .5; cursor: default; }
#entry #entryErr { color: #ff3b30; min-height: 18px; font-size: 13px; }
#entry .label { margin: 12px 0 0 16px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0; color: var(--ink2); }
/* gruplu liste */
#entry .list { display: flex; flex-direction: column; margin-top: 7px; background: rgba(255, 255, 255, .8); border-radius: 14px; overflow: hidden; }
#entry .list button { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--ink);
  padding: 11px 34px 11px 16px; font-size: 15px; cursor: pointer; text-align: left; transition: background .15s; }
#entry .list button + button::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
#entry .list button::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-right: 2px solid var(--ink3); border-top: 2px solid var(--ink3); transform: rotate(45deg); border-radius: 1px; }
#entry .list button:hover, #entry .list button:active { background: var(--fill); }
#entry .list b { font-weight: 600; min-width: 58px; }
#entry .list span { flex: 1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#entry .list em { font-style: normal; font-size: 13px; color: var(--ink2); white-space: nowrap; }
#entry .note { margin: 10px 16px 0; font-size: 12px; line-height: 1.35; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(0, 122, 255, .45); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* rota araması: nereden / nereye tek grupta, ortada yer değiştirme düğmesi */
#routeForm { margin-top: 10px; display: grid; gap: 8px; }
#routeForm .pair { position: relative; display: grid; gap: 2px; border-radius: 14px; overflow: visible; }
#routeForm input { width: 100%; min-width: 0; height: 50px; border: 0; background: var(--fill); color: var(--ink); padding: 0 16px;
  font-size: 17px; outline: none; transition: box-shadow .2s; }
#routeForm input::placeholder { color: var(--ink3); }
#fromAp { border-radius: 14px 14px 4px 4px; padding-right: 56px !important; }
#toAp { border-radius: 4px 4px 14px 14px; padding-right: 56px !important; }
#swapAp { position: absolute; right: 12px; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; border: 0;
  background: #fff; color: var(--blue); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 0 0 .5px var(--sep), 0 2px 8px rgba(0, 0, 0, .12); transition: transform .3s var(--ease); }
#swapAp:active { transform: rotate(180deg) scale(.92); }
#routeForm .line { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#routeDate { border-radius: 14px; }
#entry .list em b { display: block; min-width: 0; font-weight: 400; font-size: 12px; text-align: right; }
#results time { font-weight: 600; min-width: 46px; font-variant-numeric: tabular-nums; }
#results { max-height: 264px; overflow-y: auto; }

/* müzik düğmesi: giriş ekranının da üstünde durur */
/* sağ üst köşe: dil ve müzik düğmeleri; giriş ekranının da üstünde durur */
#corner { position: fixed; z-index: 5; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; gap: 8px; align-items: flex-start; }
#music { color: var(--blue); }
#langBtn { width: auto; padding: 0 12px 0 10px; gap: 5px; display: flex; border-radius: 19px; color: var(--blue); font-size: 13px; font-weight: 600; }
#langMenu { position: absolute; top: 46px; right: 0; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 0 0 .5px var(--sep), 0 12px 40px rgba(0, 0, 0, .18); }
#langMenu button { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; color: var(--ink);
  padding: 10px 12px; border-radius: 9px; font-size: 15px; cursor: pointer; text-align: left; }
#langMenu button:hover { background: var(--fill); }
#langMenu button[aria-checked="true"]::after { content: "✓"; color: var(--blue); font-weight: 600; }
.legend b { font-weight: inherit; }
#music[aria-pressed="true"] #musicOff { display: none; }
#music[aria-pressed="false"] { color: var(--ink2); }
#music[aria-pressed="true"] { animation: pulse 1.62s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 .5px var(--sep), 0 0 0 6px rgba(0, 122, 255, .16), 0 4px 16px rgba(0, 0, 0, .1); } }

.sheet .credit { margin: 8px 0 0; font-size: 10px; line-height: 1.3; color: var(--ink3); text-align: center; }
.sheet .credit a { color: inherit; }

/* başlık sağ üstteki düğmelerin altına girmesin */
#top { padding-right: 140px; }
#top > div { min-width: 0; }
#top h1, #top p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
