/* =========================================================
   Giriş ekranı: giriş kutusu, "Nasıl oynanır?" düğmesi, görev brifingi, öğretici
   (stil.css'ten sonra yüklenir)
   ========================================================= */

/* ---------- giriş kutusu (maket 8) ---------- */
.giris-kutu {
  position: absolute; left: 50%; bottom: calc(3.5vh + env(safe-area-inset-bottom, 0px)); translate: -50% 0;
  width: clamp(272px, 24vw, 336px); max-height: calc(100dvh - 24px); overflow-y: auto; overflow-x: hidden;
  display: grid; gap: 0; padding: 0 14px 14px;
  background: linear-gradient(180deg, rgba(40, 38, 35, .95), rgba(27, 26, 24, .96));
  border: 2px solid #c9a24e; border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(10, 8, 4, .9), inset 0 0 0 1px rgba(233, 205, 140, .28), 0 16px 40px rgba(0, 0, 0, .6);
  color: #ece5d3; text-align: left;
  transition: opacity .5s, transform .5s;
  scrollbar-width: thin;
}
.giris-kutu.gizli { opacity: 0; transform: translateY(12px); pointer-events: none; }
.gk-sekmeler { display: flex; margin: 0 -14px 12px; border-bottom: 1px solid rgba(233, 205, 140, .22); }
.gk-sekmeler button {
  flex: 1; min-height: 44px; padding: 10px 8px 8px; cursor: pointer; background: transparent; border: 0; border-bottom: 3px solid transparent;
  font-family: var(--type); font-weight: 700; font-size: 17px; color: #8b8573; letter-spacing: .01em;
}
.gk-sekmeler button.aktif { color: #f1e8d2; border-bottom-color: #d9b25e; }
.gk-sekmeler button:not(.aktif):hover { color: #cfc6ad; }
.gk-form { display: grid; gap: 9px; }
.giris-kutu input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 6px;
  background: #1c1b1a; border: 1px solid rgba(233, 228, 214, .24); color: #f3ecd9;
  font-family: var(--ui); font-size: 16px; /* 16px: iOS yakınlaştırmasın */
}
.giris-kutu input::placeholder { color: #7f7a6c; }
.giris-kutu input:focus { outline: 2px solid #e8c36f; outline-offset: 1px; border-color: #c9a24e; }
.gk-sifre-sar { position: relative; }
.gk-sifre-sar input { padding-right: 70px; }
.gk-sifre-sar button {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 56px; padding: 0 8px; cursor: pointer;
  background: transparent; border: 0; border-radius: 4px; color: #b6ae98; font-family: var(--type); font-size: 12.5px;
}
.gk-sifre-sar button:hover { color: #f1e8d2; background: rgba(255, 255, 255, .06); }
.gk-not { font-size: 12px; line-height: 1.4; color: #b6ae98; }
.gk-mesaj { min-height: 0; margin: 8px 2px 0; font-size: 13px; line-height: 1.4; color: #d3c9b0; }
.gk-mesaj:empty { display: none; }
.gk-mesaj.hata { color: #ffa99a; }
.gk-mesaj.iyi { color: #a9d9a1; }

.giris-kutu .enter {
  position: static; translate: none; width: 100%; margin-top: 12px; min-height: 64px;
  padding: 10px 16px 9px; border: 2px solid #d9b25e; border-radius: 7px;
  background: linear-gradient(180deg, #2c2a27, #1b1a18);
  box-shadow: inset 0 0 0 3px #1b1a18, inset 0 0 0 4px rgba(233, 205, 140, .65), 0 2px 0 rgba(0, 0, 0, .5);
  transition: opacity .5s, transform .2s, background .2s;
}
.giris-kutu .enter span { font-size: 23px; color: #f6edd4; }
.giris-kutu .enter small { font-size: 14px; color: #cdc4ad; }
.giris-kutu .enter:hover { background: linear-gradient(180deg, #38352f, #23211e); }
.giris-kutu .enter:active { transform: translateY(1px); }
.giris-kutu .enter:disabled { opacity: .6; cursor: wait; }
.giris-kutu .enter.gizli { opacity: 0; pointer-events: none; }

.gk-alt { margin: 10px 0 0; text-align: center; font-size: 13.5px; }
.gk-baglanti {
  min-height: 36px; padding: 4px 8px; cursor: pointer; background: none; border: 0; border-radius: 4px;
  font-family: var(--ui); font-size: 13.5px; color: #c9bfa5; text-decoration: underline; text-underline-offset: 3px;
}
.gk-baglanti:hover { color: #f3e9cd; }
.gk-hesap { display: grid; gap: 3px; justify-items: center; padding: 14px 0 2px; text-align: center; }
.gk-hesap > p:first-child { font-family: var(--type); font-size: 17px; }
.gk-hesap b { color: #f1d58c; }
.gk-esit { font-size: 12px; color: #a9a290; }
.gk-esit.uyari { color: #ffb9a8; }
.gk-cakisma { display: grid; gap: 8px; padding: 14px 0 0; font-size: 13.5px; line-height: 1.45; }
.gk-cakisma .gk-ince { font-size: 12px; color: #a9a290; }
.gk-sec {
  min-height: 44px; padding: 8px 12px; cursor: pointer; text-align: left;
  background: #24221f; border: 1px solid rgba(233, 205, 140, .5); border-radius: 6px; color: #f3ecd9; font-family: var(--type); font-weight: 700; font-size: 14px;
}
.gk-sec:hover { background: #302d28; }
.gk-sec:disabled { opacity: .5; }

/* "Nasıl oynanır?" düğmesi (koridor ekranı) */
.ogretici-btn {
  left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  font-size: 14px; font-weight: 700; color: #f3ecd9; border-color: rgba(233, 205, 140, .55);
  transition: opacity .5s;
}
.ogretici-btn b {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #d9b25e; color: #1b1a18; font-family: var(--type); font-size: 14px;
}
.ogretici-btn.gizli { opacity: 0; pointer-events: none; }

/* sunucu eşitleme bildirimi */
.hesap-bildirim {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); translate: -50% 0; z-index: 90;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 8px 12px;
  background: rgba(20, 18, 16, .94); color: #efe6d2; border: 1px solid rgba(233, 205, 140, .5); border-radius: 6px;
  font-family: var(--type); font-size: 13px;
}
.hesap-bildirim .hud-btn { position: static; min-height: 36px; white-space: nowrap; }

/* kısa ekranda başlık küçülür */
@media (max-height: 720px) {
  .baslik-kart { top: 4vh; padding-top: 14px; }
  .baslik-kart h1 { font-size: clamp(28px, 5vw, 44px); }
  .bk-alt { font-size: 14px; margin-top: 8px; }
}
@media (max-height: 620px) { .bk-alt { display: none; } }

/* =========================================================
   Görev brifingi ve öğretici (tam ekran katman)
   ========================================================= */
.ogr-katman {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(5, 4, 3, .82); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  padding: max(2.5vh, 10px) 14px max(2.5vh, 14px); display: grid; place-items: start center;
  color: var(--ink); font-family: var(--type);
}
.ogr-katman[hidden] { display: none; }
.ogr-kart {
  position: relative; width: min(900px, 100%); margin: 0 auto;
  background: var(--noise), var(--paper); color: var(--ink);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .35), 0 30px 60px -20px rgba(0, 0, 0, .9);
  padding: 22px clamp(16px, 3.2vw, 34px) 24px;
  animation: kagit .4s cubic-bezier(.2, .8, .3, 1);
}
.ogr-kart.dar { width: min(700px, 100%); }
.ogr-kapat {
  position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 2px; background: transparent; font-size: 22px; line-height: 1; color: var(--ink);
}
.ogr-kapat:hover { background: rgba(0, 0, 0, .07); }
.ogr-ust { font-size: 12.5px; color: var(--ink-soft); padding-right: 52px; }
.ogr-kart h2 { margin: 2px 0 10px; padding: 0 52px 10px 0; border-bottom: 2px solid var(--ink); font-size: clamp(20px, 3.4vw, 26px); line-height: 1.25; }
.ogr-kart h3 { margin: 16px 0 6px; font-size: 15.5px; }
.ogr-kart p { margin: 0 0 10px; line-height: 1.65; font-size: 15px; }
.ogr-kart ul, .ogr-kart ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.6; font-size: 15px; }
.ogr-kart li { margin-bottom: 4px; }
.ogr-kart .ince { font-size: 13px; color: var(--ink-soft); }
.ogr-kart mark { background: rgba(227, 194, 122, .5); padding: 0 2px; }
.ogr-aksiyon { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.ogr-btn {
  min-height: 44px; padding: 9px 18px; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 2px; background: transparent; color: var(--ink);
  font-family: var(--type); font-weight: 700; font-size: 14.5px;
}
.ogr-btn:hover { background: rgba(0, 0, 0, .06); }
.ogr-btn.ana { background: var(--ink); color: var(--paper); }
.ogr-btn.ana:hover { background: #3a342c; }
.ogr-btn:disabled { opacity: .4; cursor: not-allowed; }
.ogr-btn.kirmizi { background: var(--stamp); border-color: var(--stamp); color: #fff4ea; }

/* brifing: damga ve imza */
.br-muhur {
  display: inline-block; padding: 3px 10px; border: 2px solid var(--stamp); color: var(--stamp);
  font-weight: 700; font-size: 12px; letter-spacing: .08em; transform: rotate(-2deg); margin-bottom: 6px;
}

/* öğretici */

@media (max-width: 760px) {
  .ogr-kart { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ogr-kart { animation: none; }
}

.ogr-kart h2:focus, .ogr-kart h2:focus-visible { outline: none; }

/* hedef kartı: dar ekranda yedek bağlantılar (brifing ve ders çekmecelerde, pano duvarda) */
.hk-yedek { display: none; gap: 12px; flex-wrap: wrap; margin-top: 8px !important; }
.hk-yedek button { min-height: 32px; padding: 0; background: none; border: 0; border-bottom: 1px dotted rgba(233, 228, 214, .5); color: #d9cfae; font: inherit; font-size: 12px; cursor: pointer; }
@media (max-width: 640px) {
  .hk-yedek { display: flex; }
  /* dar ekranda kart küçülür ve üste çıkar: alttaki çekmeceleri kapatmasın (ayrıntı panoda) */
  .hedef-kart { top: calc(54px + env(safe-area-inset-top, 0px)) !important; bottom: auto !important; left: 10px !important; right: auto !important; width: min(300px, calc(100vw - 20px)) !important; padding: 8px 10px; }
  .hedef-kart .hk-hedef, .hedef-kart .hk-ilerle { display: none; }
}
.hk-oneri { margin-top: 3px !important; color: #b9b19c; font-size: 11.5px; }

@media (max-width: 560px) {
  .ogr-katman { padding: 0; }
  .ogr-kart { width: 100%; min-height: 100dvh; padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: none; }
  .ogr-kart h2 { font-size: 19px; padding-bottom: 8px; }
  .ogr-kart p, .ogr-kart ul, .ogr-kart ol { font-size: 13.5px; line-height: 1.6; }
  .ogr-ust { font-size: 11.5px; line-height: 1.4; }
  .ogr-aksiyon .ogr-btn { flex: 1 1 100%; }
}

/* pano penceresi: sicil, hedef, yaprak sayacı, bölümler */
.pk-ozet { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 0 6px 18px; }
.pk-kutu { padding: 14px 16px; background: #f1ece0; color: #24211c; font-family: var(--type); font-size: 13px; line-height: 1.5; box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .55); }
.pk-kutu p { margin: 0; }
.pk-k { font-size: 11.5px; color: #6b655a; text-transform: uppercase; letter-spacing: .04em; }
.pk-b { font-weight: 700; font-size: 14.5px; }
.pk-acik { color: #2f6a35; } .pk-gerek { color: #9a2a20; }
.pk-cubuk { display: flex; align-items: center; gap: 8px; margin-top: 6px !important; font-size: 11.5px; color: #6b655a; }
.pk-cubuk span { flex: 1; height: 5px; background: #d4ccb8; } .pk-cubuk i { display: block; height: 100%; background: #b8873a; }
.pk-sayi { font-size: 15px; } .pk-sayi b { font-size: 30px; color: #9a2a20; }
.pk-yaprak { grid-column: span 2; }
.pk-yaprakl { display: flex; flex-wrap: wrap; gap: 5px 4px; margin-top: 8px; }
.py { width: 15px; height: 24px; background: #7b3f24; clip-path: polygon(50% 0, 88% 28%, 90% 62%, 50% 100%, 10% 62%, 12% 28%); }
.py.bekliyor { background: #a58a60; } .py.cicek { background: #8c2a2a; clip-path: circle(50%); width: 20px; height: 20px; margin-top: 2px; }
.py.bos { background: none; box-shadow: inset 0 0 0 2px rgba(60, 35, 15, .25); }
.pk-bolum { grid-column: 1 / -1; }
.pk-bolum ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; }
.pk-bolum li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.pk-bolum li b { min-width: 18px; } .pk-bolum li span { flex: 1; } .pk-bolum li em { font-style: normal; font-size: 11.5px; color: #6b655a; }
.pk-bolum li.tamam em { color: #2f6a35; } .pk-bolum li.kilit { opacity: .65; }
@media (max-width: 560px) { .pk-yaprak { grid-column: auto; } }

/* Çevrimdışı yedek dosya listesi */
.yedek-liste .yedek-giris { display: none; }
.yedek-liste-kutu { position: fixed; inset: 0; z-index: 15; overflow-y: auto; padding: 24px 16px 48px; background: #14110e; color: #e9e4d6; font-family: var(--type, monospace); }
.yedek-liste-kutu h1 { margin: 0 0 8px; font-size: 22px; }
.yedek-liste-kutu ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; max-width: 520px; }
.yedek-liste-kutu button { width: 100%; text-align: left; padding: 12px 14px; cursor: pointer; border: 1px solid #5a5244; background: #1d1913; color: inherit; font: inherit; }
.yedek-liste-kutu button:hover, .yedek-liste-kutu button:focus-visible { border-color: #e9e4d6; }
