@font-face { font-family: "Space Grotesk"; src: url("vendor/fonts/space-grotesk-var.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("vendor/fonts/jetbrains-mono-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0f1419;
  --yuzey: rgba(16, 21, 28, 0.88);
  --yuzey2: #18202a;
  --cizgi: #2b3540;
  --metin: #dfe6ec;
  --soluk: #8b97a3;
  --vurgu: #39c5cf;
  --sari: #f2c200;
  --yesil: #2ea043;
  --kirmizi: #f85149;
  --turuncu: #d29922;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--metin);
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif; }
#sahne { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

/* ---------------- üst şerit */
#ust { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 8px 14px; background: linear-gradient(180deg, rgba(10,14,19,.95), rgba(10,14,19,.75)); border-bottom: 1px solid var(--cizgi); }
.marka { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 26px; color: var(--sari); line-height: 1; }
.baslik { font-weight: 700; letter-spacing: 2px; font-size: 15px; }
.alt { font-size: 11.5px; color: var(--soluk); }
.bosluk { flex: 1; }
.dugme { background: var(--yuzey2); color: var(--metin); border: 1px solid var(--cizgi); border-radius: 6px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.dugme:hover { border-color: var(--vurgu); color: #fff; }
.dugme.vr { background: #1f6feb; border-color: #388bfd; color: #fff; font-weight: 700; letter-spacing: .5px; }
.dugme.vr:disabled { background: #222b35; border-color: var(--cizgi); color: var(--soluk); cursor: help; font-weight: 500; }
.anahtar { font-size: 12.5px; color: var(--soluk); display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }

/* ---------------- sol liste */
#liste { position: fixed; top: 62px; left: 10px; z-index: 15; width: 232px; max-height: calc(100vh - 110px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; }
.kart { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--yuzey); border: 1px solid var(--cizgi);
  border-radius: 8px; cursor: pointer; backdrop-filter: blur(6px); transition: border-color .15s, background .15s; }
.kart:hover { border-color: #4a5867; }
.kart.secili { border-color: var(--vurgu); background: rgba(24, 40, 50, .92); }
.kart .no { font-family: var(--mono); font-size: 12px; color: var(--sari); width: 20px; }
.kart .ad { font-size: 13px; line-height: 1.2; flex: 1; }
.kart .ad small { display: block; color: var(--soluk); font-size: 11px; }
.nokta { width: 9px; height: 9px; border-radius: 50%; background: #6e7681; flex: none; }
.nokta.calisiyor { background: var(--yesil); box-shadow: 0 0 6px var(--yesil); }
.nokta.uyari { background: var(--turuncu); }
.nokta.alarm { background: var(--kirmizi); animation: yanson .6s infinite alternate; }
@keyframes yanson { to { opacity: .25; } }

/* ---------------- sağ panel */
#panel { position: fixed; top: 62px; right: 10px; bottom: 10px; z-index: 15; width: 360px; background: var(--yuzey);
  border: 1px solid var(--cizgi); border-radius: 10px; backdrop-filter: blur(8px); display: flex; flex-direction: column; }
#panel[hidden] { display: none; }
#panel-ic { overflow-y: auto; padding: 14px 16px 18px; }
.p-ust { display: flex; align-items: flex-start; gap: 10px; }
.p-ust h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.p-dugmeler { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.p-ust .kapat, .p-ust .gizle { background: none; border: none; color: var(--soluk); font-size: 20px; line-height: 1; padding: 2px 6px;
  border-radius: 6px; cursor: pointer; }
.p-ust .gizle { font-size: 17px; }
.p-ust .kapat:hover, .p-ust .gizle:hover { color: #fff; background: #222b35; }
/* panel gizliyken sağ üstte geri açma düğmesi (seçili makinenin adıyla) */
#panel-ac { position: fixed; top: 62px; right: 10px; z-index: 15; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
#panel-ac[hidden] { display: none; }
.p-kisa { color: var(--soluk); font-size: 13px; margin: 6px 0 10px; line-height: 1.4; }
.durum { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: #222b35; font-family: var(--mono); }
.p-bolum { margin-top: 16px; }
.p-bolum > h3 { font-size: 11px; letter-spacing: 1.5px; color: var(--soluk); margin: 0 0 8px; font-weight: 600; text-transform: uppercase; }
.k-baslik { font-size: 12px; color: var(--vurgu); margin: 12px 0 6px; font-weight: 600; }
.k-satir { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.k-dugme { flex: 1 1 auto; min-width: 70px; background: #222b35; color: var(--metin); border: 1px solid #36424f; border-radius: 6px;
  padding: 7px 8px; font: inherit; font-size: 12.5px; cursor: pointer; user-select: none; touch-action: none; }
.k-dugme:hover { border-color: var(--vurgu); }
.k-dugme:active, .k-dugme.basili { background: #2d3a48; }
.k-dugme.basla { border-color: #2a6f36; background: #17321d; }
.k-dugme.dur { border-color: #6b5a1d; background: #2e2914; }
.k-dugme.acil { border-color: #8a2622; background: #4a1513; color: #ffd5d2; font-weight: 700; }
.k-kaydir { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 10px; font-size: 12.5px; }
.k-kaydir input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--vurgu); }
.k-kaydir output { font-family: var(--mono); color: #fff; }
.k-secim { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.k-secim select { background: #222b35; color: var(--metin); border: 1px solid #36424f; border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 12.5px; }
.k-anahtar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 8px; cursor: pointer; }
.degerler { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; }
.degerler span:nth-child(odd) { color: var(--soluk); }
.degerler span:nth-child(even) { font-family: var(--mono); text-align: right; color: #fff; }
#trend { width: 100%; height: 150px; background: #0c1116; border: 1px solid var(--cizgi); border-radius: 6px; display: block; }
.liste-m { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; color: #c9d3dc; }
.liste-m li { margin-bottom: 3px; }
details.cikarim summary { cursor: pointer; font-size: 11px; letter-spacing: 1.5px; color: var(--soluk); font-weight: 600; text-transform: uppercase; }
details.cikarim[open] summary { margin-bottom: 8px; }

/* ---------------- alt ipucu, tooltip, yükleniyor */
/* kontrol kartı: sol liste ile sağ panel (açıksa) arasındaki alanın altında ortalanır */
#ipucu { position: fixed; left: 252px; right: 10px; bottom: 12px; z-index: 12; display: flex; justify-content: center; pointer-events: none; }
body:has(#panel:not([hidden])) #ipucu { right: 380px; }
#ipucu[hidden], #ipucu-ac[hidden] { display: none; }
.ip-kart { pointer-events: auto; position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px 24px; padding: 10px 42px 10px 18px; background: rgba(10,14,19,.88); border: 1px solid #3a4652; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); backdrop-filter: blur(8px); }
.ip-fare, .ip-dokunma { display: contents; }
.ip-dokunma { display: none; }
@media (hover: none) and (pointer: coarse) { .ip-fare { display: none; } .ip-dokunma { display: contents; } }
.ip-grup { display: flex; align-items: center; gap: 10px; }
.ip-yazi { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; white-space: nowrap; }
.ip-yazi b { font-size: 13.5px; color: #fff; font-weight: 600; }
.ip-yazi span { font-size: 12px; color: var(--soluk); }
.ip-ikon { width: 24px; height: 30px; color: var(--metin); flex: none; }
#ipucu kbd { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 26px; height: 26px; padding: 0 6px;
  font: 600 12.5px var(--mono); color: var(--metin); background: linear-gradient(#2c3742, #1d252e); border: 1px solid #4a5867;
  border-bottom-width: 3px; border-radius: 6px; transition: transform .06s, background-color .06s, color .06s; }
.ip-yazi kbd { height: 19px !important; min-width: 0 !important; padding: 0 5px !important; font-size: 10.5px !important;
  border-bottom-width: 2px !important; margin-right: 3px; vertical-align: 1px; }
.wasd { display: grid; grid-template-columns: repeat(3, 26px); grid-template-rows: 26px 26px; gap: 3px; }
.wasd kbd { color: var(--sari) !important; border-color: #6e5d17 !important; }
.wasd kbd[data-t="w"] { grid-area: 1 / 2; }
.wasd kbd[data-t="a"] { grid-area: 2 / 1; }
.wasd kbd[data-t="s"] { grid-area: 2 / 2; }
.wasd kbd[data-t="d"] { grid-area: 2 / 3; }
.tuslar { display: flex; gap: 3px; }
#ipucu kbd.basik { background: var(--sari); color: #111 !important; border-color: #a88600 !important; transform: translateY(2px); }
.ip-kapat { position: absolute; top: 3px; right: 5px; background: none; border: 0; color: var(--soluk); font-size: 19px; line-height: 1;
  padding: 4px 6px; cursor: pointer; }
.ip-kapat:hover { color: #fff; }
#ipucu-ac { position: fixed; left: 252px; bottom: 12px; z-index: 12; }
/* ilk açılışta kart birkaç kez parlasın */
.ip-kart.parla { animation: ipParla 1.4s ease-in-out 3; }
@keyframes ipParla { 50% { border-color: var(--sari); box-shadow: 0 0 0 3px rgba(242,194,0,.28), 0 6px 24px rgba(0,0,0,.35); } }
@media (prefers-reduced-motion: reduce) { .ip-kart.parla { animation: none; } }
.ip-ic { display: contents; }
#tooltip { position: fixed; z-index: 30; pointer-events: none; background: rgba(10,14,19,.92); border: 1px solid var(--vurgu);
  padding: 4px 9px; border-radius: 6px; font-size: 12.5px; }

/* ---------------- birinci şahıs: nişangâh, yolculuk göstergesi, karartma, sanal kumanda, karşılama */
#nisan { position: fixed; left: 50%; top: 50%; z-index: 14; pointer-events: none; transform: translate(-50%, -50%); display: none; }
body.kilitli[data-mod="gez"] #nisan { display: block; }
.n-nokta { display: block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.92);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); transition: width .12s, height .12s; }
#nisan.makine .n-nokta { width: 20px; height: 20px; background: rgba(242,194,0,.12); border: 2px solid var(--sari); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
#nisan-ad { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(10,14,19,.9);
  border: 1px solid var(--sari); padding: 3px 9px; border-radius: 6px; font-size: 12.5px; }
#nisan-ad[hidden] { display: none; }
#yolculuk { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 16; display: flex; align-items: center; gap: 10px;
  background: var(--yuzey); border: 1px solid var(--vurgu); border-radius: 999px; padding: 4px 5px 4px 14px; font-size: 13px;
  backdrop-filter: blur(6px); white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
#yolculuk[hidden] { display: none; }
#yolculuk .dugme { border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
#yolculuk kbd { font: 600 10px var(--mono); padding: 1px 4px; border: 1px solid #4a5867; border-radius: 4px; margin-left: 4px; color: var(--soluk); }
@media (hover: none) and (pointer: coarse) { #yolculuk kbd { display: none; } }
#karartma { position: fixed; inset: 0; z-index: 13; background: #05080b; opacity: 0; pointer-events: none; transition: opacity .17s; }
#karartma.acik { opacity: .9; transition: none; }
#joy { position: fixed; z-index: 13; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255,255,255,.35); background: rgba(10,14,19,.28); }
#joy[hidden] { display: none; }
.joy-dugme { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border-radius: 50%; background: rgba(242,194,0,.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.4); transform: translate(-50%, -50%); }
#karsilama { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; pointer-events: none; padding: 16px; }
#karsilama[hidden] { display: none; }
.k-kart { pointer-events: auto; max-width: 470px; background: rgba(10,14,19,.9); border: 1px solid #3a4652; border-radius: 14px;
  padding: 20px 22px 18px; box-shadow: 0 12px 40px rgba(0,0,0,.45); backdrop-filter: blur(8px); }
.k-ust { font: 600 11px var(--mono); letter-spacing: 2px; color: var(--sari); }
.k-kart h1 { margin: 6px 0 10px; font-size: 22px; line-height: 1.2; }
.k-kart p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: #c9d3dc; }
.k-kart p.k-soluk { font-size: 12.5px; color: var(--soluk); }
.k-kart kbd { font: 600 11.5px var(--mono); padding: 1px 5px; margin: 0 1px; border: 1px solid #4a5867; border-bottom-width: 2px;
  border-radius: 4px; background: #1d252e; color: var(--metin); }
.k-dokun { display: none; }
@media (hover: none) and (pointer: coarse) { .k-fare { display: none; } .k-dokun { display: block; } }
.k-dugmeler { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dugme.ana { background: var(--sari); border-color: var(--sari); color: #111; font-weight: 700; padding: 8px 16px; font-size: 14px; }
.dugme.ana:hover { background: #ffd21f; color: #111; }
#yukleniyor { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); font-size: 15px;
  letter-spacing: 2px; color: var(--soluk); transition: opacity .5s; }
#yukleniyor.bitti { opacity: 0; pointer-events: none; }

body.arayuzsuz #ust, body.arayuzsuz #liste, body.arayuzsuz #panel, body.arayuzsuz #ipucu, body.arayuzsuz #ipucu-ac,
body.arayuzsuz #nisan, body.arayuzsuz #yolculuk, body.arayuzsuz #karsilama { display: none !important; }

/* ---------------- dar ekran */
@media (max-width: 900px) {
  #ust { gap: 8px; padding: 6px 10px; }
  #ust .alt, .anahtar { display: none; }
  .logo { font-size: 22px; }
  .baslik { font-size: 12.5px; letter-spacing: 1.2px; line-height: 1.15; }
  .dugme { padding: 6px 9px; font-size: 12.5px; white-space: nowrap; }
  /* --ust-h: üst şeridin gerçek yüksekliği (main.js gorunumAyarla ölçer) */
  #liste { top: calc(var(--ust-h, 46px) + 6px); left: 0; right: 0; width: auto; flex-direction: row; overflow-x: auto;
    padding: 0 8px; max-height: none; scrollbar-width: none; }
  .kart { flex: none; padding: 6px 9px; }
  .kart .ad small { display: none; }
  #panel { top: auto; left: 8px; right: 8px; width: auto; height: 46vh; }
  #ipucu { left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .ip-kart { gap: 8px 16px; padding: 9px 36px 9px 12px; }
  #ipucu-ac { left: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* panel açıkken ekranın altı panelin: kart da düğme de çekilsin */
  body:has(#panel:not([hidden])) #ipucu, body:has(#panel:not([hidden])) #ipucu-ac { display: none; }
  #panel-ac { top: auto; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 62vw; }
  #yolculuk { top: calc(var(--ust-h, 46px) + 56px); font-size: 12.5px; }
  body:has(#panel-ac:not([hidden])) #ipucu { bottom: calc(56px + env(safe-area-inset-bottom)); }
}
/* çok dar telefon: üst şerit tek satırda kalsın */
@media (max-width: 480px) {
  .dugme .uzun { display: none; }
  #ust { gap: 6px; }
  .dugme { padding: 6px 8px; }
}
/* yatay telefon: panel altta kalırsa sahneye yer kalmaz, sağa al */
@media (max-width: 900px) and (orientation: landscape) {
  #panel { top: calc(var(--ust-h, 46px) + 52px); bottom: 8px; left: auto; width: 46vw; height: auto; }
}
