/* Karalama Odaları — kâğıt + mürekkep görsel dili (Karalama Labirenti ailesi). */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  background: #f6f1e5; color: #2a2622;
  font-family: "Chalkboard SE", "Comic Sans MS", "Segoe Print", system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 12px calc(18px + env(safe-area-inset-bottom));
  user-select: none; -webkit-user-select: none;
}
header { width: 100%; max-width: 860px; display: flex; align-items: center; gap: 8px; padding: 4px 2px 8px; }
h1 { font-size: 20px; font-weight: 700; margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ekran { width: 100%; max-width: 860px; }
.gizli { display: none !important; }

.rozet {
  border: 2px solid #2a2622; border-radius: 999px; background: #fffdf6;
  padding: 4px 12px; font-size: 14px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.buton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; border: 2px solid #2a2622; border-radius: 14px;
  background: #fffdf6; color: #2a2622; font-family: inherit;
  font-size: 15px; font-weight: 700; padding: 9px 16px;
  min-height: 48px; touch-action: manipulation;
  box-shadow: 2px 3px 0 #2a262233; transition: transform .06s;
}
.buton:active { transform: translate(1px, 2px); box-shadow: none; }
.ikonDugme { width: 44px; min-height: 44px; padding: 0; border-radius: 999px; flex: 0 0 auto; }
.ikonDugme svg { display: block; }
.buton.birincil { background: #b2863a; border-color: #7c5a22; color: #fffdf6; }
.buton.yesil { background: #4f8a52; border-color: #33612f; color: #fffdf6; }
.buton.kucuk { font-size: 13.5px; padding: 6px 12px; border-radius: 12px; min-height: 44px; }
.buton.buyuk { font-size: 19px; padding: 14px 28px; border-radius: 18px; }
.buton:disabled { opacity: .45; cursor: default; }

.rozetDugme {
  cursor: pointer; font-family: inherit; color: inherit; gap: 5px;
  min-height: 44px; touch-action: manipulation; box-shadow: 2px 3px 0 #2a262226;
}
.rozetDugme:active { transform: translate(1px, 2px); box-shadow: none; }
.rozetDugme.kazandi { animation: anahtarPat .6s cubic-bezier(.22, 1.3, .35, 1); }
@keyframes anahtarPat { 40% { transform: scale(1.28) rotate(-6deg); } }

/* arkadaş defteri */
.pano.genis { max-width: 720px; }
.defterBaslik { font-size: 15px; margin: 14px 0 6px; opacity: .7; }
/* usta/detay: solda küçük kartlar, sağda seçilenin büyüğü (Ersan) */
#defterGovde { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
/* Geniş ekran: büyük önizleme solda ana alanı alır, küçük kartlar sağa
   yanaşık dar bir şerit olur (Ersan). Dar ekranda sıra bozulmaz: önce liste. */
@media (min-width: 580px) {
  #defterGovde { grid-template-columns: minmax(0, 1.6fr) minmax(152px, 0.7fr); }
  #defterSag { order: 1; }
  #defterSol { order: 2; justify-self: end; width: 100%; }
  #defterSol #kadroIzgara { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 7px; }
}
#kadroIzgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
#turIzgara, #susIzgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.susKart .susOnizleme {
  display: block; width: 100%; aspect-ratio: 5 / 4; border: 2px solid #2a262244;
  border-radius: 10px; background: #f6f1e5;
}
.sus-cizgili { background: repeating-linear-gradient(#f6f1e5 0 9px, #6a7fb055 9px 10px) !important; }
.sus-kareli {
  background:
    repeating-linear-gradient(#f6f1e500 0 9px, #6a7fb044 9px 10px),
    repeating-linear-gradient(90deg, #f6f1e500 0 9px, #6a7fb044 9px 10px), #f6f1e5 !important;
}
.sus-gokyuzu { background: linear-gradient(#cfe0f2, #f6f1e5 70%) !important; }
.sus-gece { background: linear-gradient(#3a5a8c, #6a7fb0 55%, #f6f1e5) !important; }
.sus-orman { background: linear-gradient(#f6f1e5 55%, #9dc79f) !important; }
#defterSag {
  border: 2px dashed #2a262233; border-radius: 18px; padding: 10px;
  min-height: 190px; display: flex; flex-direction: column; justify-content: center;
}
#detayAlan canvas { width: 100%; height: min(280px, 34vh); display: block; }
#detayAlan .detayIsim { font-size: 17px; font-weight: 700; text-align: center; margin-top: 4px; }
#detayAlan .detayBos { font-size: 14px; opacity: .6; text-align: center; line-height: 1.4; }
#defterSag.yenilendi { animation: yenilendiPat .55s cubic-bezier(.22, 1.25, .35, 1); }
@keyframes yenilendiPat { 35% { border-color: #4f8a52; transform: scale(1.012); } }
@media (max-width: 460px) {
  #detayAlan canvas { height: min(200px, 26vh); }
  /* dört kart tek satıra sığsın: üç arkadaş + "Yeni Arkadaş" */
  #kadroIzgara { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
  .akart { padding: 5px 4px 6px; }
  .akart .isim { font-size: 11px; }
}
.akart {
  border: 2px solid #2a2622; border-radius: 16px; background: #fffdf6;
  padding: 6px 6px 8px; text-align: center; cursor: pointer; font-family: inherit;
  color: inherit; box-shadow: 2px 3px 0 #2a262222; touch-action: manipulation;
}
.akart:active { transform: scale(.97); }
.akart.secili { outline: 4px solid #b2863a; outline-offset: 2px; }
.akart canvas { width: 100%; aspect-ratio: 5 / 6; display: block; }
/* büyük önizleme paneli uzatıyor: kapatma düğmesi hep görünsün */
#defterPerde .panoDugmeler {
  position: sticky; bottom: -18px; margin-top: 12px; padding: 10px 0 2px;
  background: linear-gradient(to top, #fffdf6 72%, #fffdf600);
}
.akart .isim { font-size: 12px; font-weight: 700; margin-top: 3px; }
.akart .fiyat {
  display: inline-flex; align-items: center; gap: 3px; font-size: 13px;
  font-weight: 700; margin-top: 3px; color: #7c5a22;
}
.akart.kilitli { background: #efe9d8; }
.akart.yetmez { opacity: .55; }
.akart .turIkon {
  width: 100%; aspect-ratio: 5 / 6; display: flex; align-items: center;
  justify-content: center; font-size: 30px; font-weight: 700; color: #7c5a22;
}
#parcaAlan { margin-top: 12px; border-top: 2px dashed #2a262233; padding-top: 10px; }
#parcaAlan p { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
#parcaDugmeler { justify-content: center; }

/* kat şeridi: dört işlem */
#katSerit { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.kat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 2px solid #2a2622; border-radius: 16px; background: #fffdf6;
  padding: 8px 4px 6px; cursor: pointer; font-family: inherit; color: inherit;
  box-shadow: 2px 3px 0 #2a262222; min-height: 74px; touch-action: manipulation;
}
.kat:active { transform: translate(1px, 2px); box-shadow: none; }
.kat .isaretBuyuk { font-size: 26px; font-weight: 700; line-height: 1; }
.kat .katAd { font-size: 10.5px; opacity: .72; line-height: 1.1; text-align: center; }
.kat .katYildiz { font-size: 11px; font-weight: 700; color: #7c5a22; }
.kat.secili { background: #b2863a; border-color: #7c5a22; color: #fffdf6; }
.kat.secili .katYildiz { color: #fffdf6; }
.kat.kilitli { opacity: .5; background: #efe9d8; }

/* ders noktaları */
#dersSerit { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.dersNokta {
  width: 30px; height: 30px; border-radius: 999px; border: 2px solid #2a2622;
  background: #fffdf6; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; color: #2a2622; padding: 0; touch-action: manipulation;
}
.dersNokta.bitti { background: #b2863a; border-color: #7c5a22; color: #fffdf6; }
/* eksik odalar: bilinmeyen sonuç değil parça — nokta "?" gösterir */
.dersNokta.eksik { border-style: dashed; font-size: 14px; }
.dersNokta.eksik.bitti { border-style: solid; }
/* kalanlı bölme: artan koridorda kalır */
.dersNokta.kalanli { border-color: #33612f; box-shadow: 0 0 0 2px #4f8a5233; }
.dersNokta.yeniSoru { display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; }
.dersNokta.simdi { outline: 3px solid #4f8a52; outline-offset: 2px; }

#serbestSatir { display: flex; justify-content: center; margin-bottom: 6px; }

#anlatim {
  font-size: 17px; font-weight: 700; line-height: 1.35; text-align: center;
  min-height: 46px; display: flex; align-items: center; justify-content: center;
  padding: 4px 6px;
}

#sahneKutu { position: relative; width: 100%; }
#sahne {
  width: 100%; display: block; border: 2px solid #2a2622; border-radius: 18px;
  background: #fffdf6; touch-action: none;   /* parmakla taşıma sayfayı kaydırmasın */
}
#btnGoster { position: absolute; right: 10px; bottom: 10px; }

/* işlem şeridi: rakam + sayılabilir noktalar */
#islemSerit {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 6px; flex-wrap: wrap; margin-top: 12px;
}
.tas {
  border: 2.5px solid #2a2622; border-radius: 16px; background: #fffdf6;
  padding: 6px 10px 8px; min-width: 62px; text-align: center;
  box-shadow: 2px 3px 0 #2a262222;
}
.tas .rakam { display: block; font-size: 32px; font-weight: 700; line-height: 1.05; }
.tas .pipler { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; max-width: 78px; margin: 3px auto 0; }
.pip { width: 9px; height: 9px; border-radius: 999px; border: 1.6px solid #2a2622; background: transparent; }
.pip.dolu { background: #b2863a; border-color: #7c5a22; }
.tas.sonuc { border-color: #33612f; }
.tas.sonuc .rakam { color: #33612f; }
.tas.bekleyen .rakam { color: #b2863a; }
.tas.yeni { animation: tasGir .4s cubic-bezier(.22, 1.2, .35, 1); }
@keyframes tasGir { from { transform: scale(.5) translateY(10px); opacity: 0; } }
.isaret { font-size: 30px; font-weight: 700; padding: 6px 2px 0; opacity: .8; }
.isaretSoru { font-size: 30px; font-weight: 700; color: #b2863a; }

/* kavram şeridi: aynı olgunun ikinci okunuşu (4 tane 2 → 2+2+2+2) */
#kavramSerit {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap; margin-top: 8px; min-height: 0;
}
#kavramSerit:empty { display: none; }
#kavramSerit .kavramEtiket {
  font-size: 14px; font-weight: 700; color: #7c5a22; margin-right: 4px;
}
#kavramSerit .tas {
  min-width: 40px; padding: 3px 7px 5px; border-width: 2px;
  box-shadow: 1px 2px 0 #2a262218;
}
#kavramSerit .tas .rakam { font-size: 19px; }
#kavramSerit .tas .pipler { max-width: 46px; gap: 2px; margin-top: 2px; }
#kavramSerit .pip { width: 6px; height: 6px; border-width: 1.3px; }
#kavramSerit .isaret { font-size: 18px; padding: 3px 0 0; }
#kavramSerit .isaret svg { width: 17px; height: 17px; }
#kavramSerit.yeni { animation: tasGir .45s cubic-bezier(.22, 1.2, .35, 1); }

/* seçenekler: oda kartı gibi — rakam + sayılacak noktalar */
#secenekAlan { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.secenek {
  border: 2.5px solid #2a2622; border-radius: 18px; background: #fffdf6;
  padding: 8px 12px 10px; min-width: 84px; cursor: pointer; font-family: inherit;
  color: inherit; box-shadow: 2px 4px 0 #2a262226; touch-action: manipulation;
  transition: transform .1s;
}
.secenek:active { transform: translate(1px, 2px); box-shadow: none; }
.secenek .rakam { display: block; font-size: 38px; font-weight: 700; line-height: 1; }
.secenek .pipler { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; max-width: 92px; margin: 5px auto 0; }
.secenek .pip { width: 11px; height: 11px; background: #b2863a; border-color: #7c5a22; }
.secenek.dogru { background: #dff0d8; border-color: #33612f; }
.secenek.yanlis { opacity: .45; }
.ipucu { animation: durt 1.1s ease-in-out infinite; }
@keyframes durt { 0%, 100% { transform: none; } 40% { transform: translateY(-7px) rotate(-2deg); } }

#dugmeAlan { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

.perde {
  position: fixed; inset: 0; background: #2a262255; display: flex;
  align-items: center; justify-content: center; padding: 14px; z-index: 30;
}
.pano {
  background: #fffdf6; border: 2.5px solid #2a2622; border-radius: 20px;
  box-shadow: 4px 6px 0 #2a262244; padding: 18px; width: 100%; max-width: 460px;
  max-height: 92vh; overflow-y: auto; text-align: center;
  animation: panoGir .45s cubic-bezier(.22, 1.15, .35, 1);
}
@keyframes panoGir { from { transform: translateY(46px); opacity: .55; } }
.pano h2 { font-size: 21px; margin-bottom: 8px; }
.pano p { font-size: 15px; line-height: 1.45; }
.panoDugmeler { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 420px) {
  h1 { font-size: 17px; }
  #serbestSatir { display: flex; justify-content: center; margin-bottom: 6px; }

#anlatim { font-size: 15.5px; }
  .tas .rakam { font-size: 27px; }
  .isaret { font-size: 25px; }
  .secenek .rakam { font-size: 32px; }
}
@media (min-width: 700px) {
  .kat .katAd { font-size: 12px; }
}

/* kat diploması — yazdırılabilir belge */
#diplomaTuval { width: 100%; display: block; border-radius: 12px; }
@media print {
  body > *:not(#diplomaPerde) { display: none !important; }
  #diplomaPerde { position: static; background: none; padding: 0; }
  #diplomaPerde .pano { box-shadow: none; border: none; max-width: none; animation: none; }
  .yazdirmaGizle { display: none !important; }
}
