/* Desen Defteri — 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(16px + env(safe-area-inset-bottom));
  user-select: none; -webkit-user-select: none;
}
header {
  width: 100%; max-width: 760px; display: flex; align-items: center;
  gap: 8px; flex-wrap: nowrap; padding: 4px 2px 8px;
}
h1 {
  font-size: 20px; letter-spacing: .02em; font-weight: 700; margin-right: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.ekran { width: 100%; max-width: 760px; }
.gizli { display: none !important; }
/* dar ekranda bakiye pipleri gizlenir (sayı + damla kalır); bedel pipleri
   düğmelerde ve açılım panosunda her boyutta durur — kıyas orada yapılır */
@media (max-width: 459px) {
  header h1 { font-size: 18px; }
}

.rozet {
  border: 2px solid #2a2622; border-radius: 999px; background: #fffdf6;
  padding: 4px 12px; font-size: 13px; 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.mor { background: #9a6a9e; border-color: #6b3f70; color: #fffdf6; }
.buton.kucuk { font-size: 13.5px; padding: 6px 12px; border-radius: 12px; min-height: 44px; }
.buton.buyuk { font-size: 18px; padding: 13px 26px; border-radius: 18px; }
.buton:disabled { opacity: .45; cursor: default; }
.buton.aktif { background: #2a2622; color: #fffdf6; }
.buton.kilitli { opacity: .62; background: #efe9d8; }

/* bedel/bakiye göstergesi: sayı + tek keskin SVG damla */
.bedelYazi {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 700; line-height: 1;
}
.bedelYazi svg { display: block; flex: 0 0 auto; }

/* sahne */
#sahneKutu { position: relative; width: 100%; }
#sahne {
  width: 100%; display: block; border: 2px solid #2a2622; border-radius: 18px;
  background: #fffdf6; touch-action: manipulation;
}
#btnSoru { position: absolute; right: 10px; bottom: 10px; }
#sahneMesaj {
  position: absolute; left: 10px; top: 10px; font-size: 13px; font-weight: 700;
  background: #fffdf6dd; border: 2px solid #2a2622; border-radius: 12px;
  padding: 5px 10px; max-width: 70%; pointer-events: none;
}

/* çubuklar: eş boyutlu ikon taşları */
.cubuk { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: flex-start; }
.cubukBaslik { font-size: 12.5px; font-weight: 700; opacity: .6; flex: 0 0 100%; margin-top: 4px; }
.tas {
  flex-direction: column; justify-content: flex-start; gap: 3px;
  width: 66px; min-height: 76px; padding: 8px 2px 6px;
  font-size: 10.5px; border-radius: 16px;
}
.tas svg { flex: 0 0 auto; }
.tas .tasEtiket { line-height: 1.05; }
.tas.kilitli { opacity: .62; background: #efe9d8; }
.tas.mor { background: #9a6a9e; border-color: #6b3f70; color: #fffdf6; }
.tas .bedelYazi { font-size: 11.5px; }
.altKume { display: contents; }

/* karakter şeridi */
#karakterSeridi {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px; margin-top: 12px;
}
.kkart {
  border: 2px solid #2a2622; border-radius: 16px; background: #fffdf6;
  padding: 6px 6px 8px; text-align: center; cursor: pointer; position: relative;
  box-shadow: 2px 3px 0 #2a262222; font-family: inherit;
  touch-action: manipulation; transition: transform .1s ease-out;
}
.kkart:active { transform: scale(.97); }
.kkart.secili { outline: 4px solid #b2863a; outline-offset: 2px; }
.kkart canvas { width: 100%; aspect-ratio: 5 / 6; display: block; }
.kkart .isim { font-size: 13px; font-weight: 700; margin-top: 3px; }
.kkart.kilitliK { background: #efe9d8; }
.kkart .bedel { justify-content: center; margin-top: 4px; font-size: 14px; width: 100%; }
#acilimBedel { font-size: 26px; gap: 6px; }

/* perde + pano: geniş ekranda ortalanmış diyalog, telefonda alt sayfa (sheet) */
.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: 16px; width: 100%; max-width: 470px;
  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; }
}
@media (prefers-reduced-motion: reduce) {
  .pano { animation: none; }
}
@media (max-width: 699px) {
  .perde { align-items: flex-end; padding: 0; }
  .pano {
    max-width: none; border-radius: 26px 26px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 -8px 24px #2a262233; max-height: 88dvh;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .pano::before {
    content: ""; display: block; width: 38px; height: 5px;
    border-radius: 999px; background: #2a262244; margin: 0 auto 10px;
  }
}
.pano h2 { font-size: 19px; margin-bottom: 6px; }
.pano p { font-size: 14.5px; line-height: 1.45; }
#soruCanvas { max-width: 100%; display: block; margin: 10px auto; border-radius: 12px; }
#soruIzgara {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  width: min(100%, 312px); margin: 10px auto; background: #fffdf6;
  border: 2px solid #2a2622; border-radius: 14px; padding: 8px;
}
#soruIzgara .bHucre {
  aspect-ratio: 1; background: #fff; border: 1.5px solid #2a262233;
  border-radius: 8px; overflow: hidden;
}
#soruIzgara .bHucre svg { width: 100%; height: 100%; display: block; }
#soruSecenekler .secenek .bSvg { width: 72px; height: 72px; display: block; }
#soruSecenekler .secenek .bSvg svg { width: 100%; height: 100%; display: block; }
.kategoriCip {
  display: inline-block; border: 2px solid #2a2622; border-radius: 999px;
  background: #fff8e0; padding: 3px 12px; font-size: 12.5px; font-weight: 700;
  margin-bottom: 4px;
}
/* 6 şık: Raven düzeni 3+3 iki satır; 4 şık: tek satır. */
#soruSecenekler { display: grid; gap: 8px; justify-content: center; }
#soruSecenekler.s3 { grid-template-columns: repeat(3, auto); }
#soruSecenekler.s4 { grid-template-columns: repeat(4, auto); }
#soruSecenekler .secenek {
  border: 2px solid #2a2622; border-radius: 14px; background: #fffdf6;
  cursor: pointer; padding: 4px; box-shadow: 2px 3px 0 #2a262233; line-height: 0;
  touch-action: manipulation;
}
#soruSecenekler .secenek:active { transform: translate(1px, 2px); box-shadow: none; }
#soruSecenekler .secenek.dogru { outline: 4px solid #4f8a52; }
#soruSecenekler .secenek.yanlisS { outline: 4px solid #a8483c; opacity: .75; }
#soruSecenekler .secenek:disabled { cursor: default; }
#soruSonuc { font-weight: 700; min-height: 22px; margin-top: 10px; }
.panoDugmeler { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
#kalemOnizleme { display: block; width: 170px; height: 170px; margin: 2px auto 4px; }
#hedefSecenekler { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
#hedefSecenekler .tas { min-height: 70px; }
#hedefSecenekler .hedefSayi { font-size: 21px; line-height: 1; }
#avIlerleme { display: flex; gap: 4px; justify-content: center; align-items: center; margin: 4px 0 2px; min-height: 21px; flex-wrap: wrap; }
.sallan { animation: sallan .45s; }
@keyframes sallan {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}
.ucanDamla {
  position: fixed; z-index: 60; pointer-events: none;
  transition: transform .7s cubic-bezier(.3,.7,.4,1), opacity .7s;
}

/* tanıtım sayfası */
.kesit { margin-top: 20px; }
.kesit h2 { font-size: 18px; margin-bottom: 8px; }
.kartlar3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tkart {
  border: 2px solid #2a2622; border-radius: 18px; background: #fffdf6;
  padding: 12px; box-shadow: 2px 3px 0 #2a262222;
}
.tkart h3 { font-size: 15.5px; margin-bottom: 6px; }
.tkart p { font-size: 13.5px; line-height: 1.45; }
.tkart canvas { width: 100%; display: block; border-radius: 12px; }
#hero { position: relative; border: 2px solid #2a2622; border-radius: 22px; overflow: hidden; background: #fffdf6; }
#heroCanvas { width: 100%; display: block; }
#heroYazi { position: absolute; left: 0; right: 0; top: 12px; text-align: center; pointer-events: none; }
#heroYazi .baslikBuyuk { font-size: clamp(26px, 6vw, 44px); font-weight: 700; }
#heroYazi .slogan { font-size: clamp(13px, 2.6vw, 17px); opacity: .8; margin-top: 2px; }
.ortala { display: flex; justify-content: center; margin: 14px 0; }
.veli {
  border: 2px dashed #2a262288; border-radius: 16px; padding: 12px 14px;
  font-size: 13px; line-height: 1.5; background: #fffdf699; margin-top: 18px;
}
.cipler { display: flex; gap: 6px; flex-wrap: wrap; }
.cip {
  border: 2px solid #2a2622; border-radius: 999px; background: #fffdf6;
  padding: 4px 11px; font-size: 12.5px; font-weight: 700;
}
footer { margin-top: 22px; font-size: 12px; opacity: .55; text-align: center; }

/* --- geniş ekran (yatay tablet + web): sahne kahraman, kontroller sağda ray.
   HIG: "content should reflow, not just scale" — telefon sütununu büyütmek
   yerine yerleşim yeniden akar. --- */
@media (min-width: 1000px) {
  header { max-width: 1240px; }
  #oyunAna {
    max-width: 1240px;
    display: grid; grid-template-columns: minmax(0, 1fr) 348px;
    gap: 18px; align-items: start;
  }
  #sagSutun {
    position: sticky; top: 10px;
    max-height: calc(100dvh - 20px); overflow-y: auto;
    padding: 2px 4px 10px;
  }
  #sagSutun .cubuk { margin-top: 6px; }
  #karakterSeridi { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
