/* ===== TilkoLand — Kelime Kulesi =====
   fabuwords.css'i TAMAMLAR (çark/düğüm/line stilleri oradan gelir).
   Buradaki fark: FabuWords grid'i ekrana SIĞDIRIR; TilkoLand kulesi SINIRSIZ büyür → dikey kaydırma. */

/* TAM EKRAN -- FabuWords ile AYNI karar (2026-08-23): site telefon kolonuna hapsedilmez.
   Kule DIKEY buyur; genis ekranda kule alani genisler, petek kontrol kolonunda kalir. */
.tl-game { width: 100%; max-width: min(1500px, 100%); }

/* Kule sayacı + rekor rozeti */
.tl-counter { gap: 5px; padding: 8px 14px; }
/* Sayaç ikonu = KİTAP (kelime), rekor ikonu = ÜZÜM (kule).
   ⚠️ Üzüm = KULE dilidir (Unity portal rozeti: üzüm + kule yüksekliği) — kelime sayacına konmaz. */
.tl-counter-ico, .tl-record-ico { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.tl-record {
  position: absolute; right: 0;
  gap: 5px;
  padding: 8px 12px;
  font-size: .95rem;
}

/* ---- Kule alanı: DİKEY kaydırılır, yatay ASLA (Unity: MAX_COLS=10 ekrana sığar) ---- */
.tl-board { gap: 6px; }
.tl-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;   /* kule TABANDAN yukarı büyür → alta yasla */
  align-items: center;
  padding: 8px 2px;
  scrollbar-width: thin;
}
.tl-grid { display: grid; justify-content: center; }

.tl-cell { aspect-ratio: 1/1; position: relative; }
.tl-cell.bos { visibility: hidden; }
.tl-cell .ch {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: clamp(4px, 1.4vw, 8px);
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  font-size: calc(var(--tl-cell, 44px) * .5);
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
/* Çözülmüş harf = kulenin gövdesi (magenta, FabuWords "revealed" ile aynı dil) */
.tl-cell.cozuldu .ch {
  background: var(--fw-magenta, #e237c1);
  color: #fff;
  box-shadow: 0 2px 5px rgba(226, 55, 193, .28);
}
/* Aktif (çözülmemiş) kelimenin harfleri GİZLİ — saf anagram, ipucu yok */
.tl-cell.aktif .ch {
  background: var(--fw-cell, #fff7e2);
  box-shadow: inset 0 0 0 2px var(--fw-magenta, #e237c1);
  color: var(--fw-cell-ink, #3a2415);
}
.tl-cell.aktif.acik .ch { animation: tl-pop .4s ease; }   /* ipucu/balta ile açıldı */
@keyframes tl-pop { 0% { transform: scale(.5); } 55% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Balta hedefi — nabız (Unity: PulseAxeTarget) */
.tl-cell.axe-hedef .ch {
  cursor: pointer;
  animation: tl-axe-pulse .9s ease-in-out infinite;
  box-shadow: inset 0 0 0 2px #f5c842, 0 0 10px rgba(245, 200, 66, .5);
}
@keyframes tl-axe-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }

/* ---- Çözüm geribildirimi: anadil anlamı flash (Unity: AnlamGoster) ---- */
.tl-meaning {
  position: absolute;
  top: 44%; left: 50%;
  transform: translate(-50%, 0);
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 4.6vw, 26px);
  color: var(--fw-magenta, #e237c1);
  text-shadow: 0 2px 8px rgba(255, 255, 255, .9), 0 0 18px rgba(255, 255, 255, .7);
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  white-space: nowrap;
}
.tl-meaning.gorunur { animation: tl-anlam 1.6s ease-out forwards; }
@keyframes tl-anlam {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.9); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  70%  { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(.96); }
}

/* NOT: ipucu buton ikonu FENER'dir (Unity TilkoLand.unity: Butonlar/İpucu/Ana alan/Item →
   fabuwords_hint_icon_28.png — FabuWords ile AYNI). Tilki yalnız İPUCU VFX ANİMASYONUDUR,
   buton ikonu değil. Önceki 🦊 emoji YANLIŞTI.
   Karakter ayrımı: KARGA baltayı kullanır (buton ikonu = eseleme karesi) · TİLKİ ipucu animasyonunu. */

/* Bilgi paneli (kelime yetersiz / kule doldu) */
.tl-info-card { max-width: min(90vw, 380px); text-align: center; }
.tl-info-ico { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.tl-info-card h3 { margin: 0 0 8px; font-size: 1.25rem; }
.tl-info-card p { margin: 0 0 18px; opacity: .82; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .tl-cell.aktif.acik .ch, .tl-cell.axe-hedef .ch, .tl-meaning.gorunur { animation: none; }
  .tl-meaning.gorunur { opacity: 1; }
}

/* ============================================================
   TİLKOLAND KAPISI — Unity "Tilko Land Kapı" portal aynası (2026-07-31)
   Girdap: PortalGirdapVfx birebir — -28°/s dönüş (12.857s/tur), ±%3.5
   ölçek pulsu 0.6 Hz (1.667s), dönmeyen ebeveyn scaleX(0.62) = elips.
   Sprite'lar: assets/fabuwords/kapi/ (Unity'den WebP kesim).
   ============================================================ */
.tl-kapi {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  position: relative;
}
.tl-kapi-portal {
  position: relative;
  border: 0; padding: 0; background: transparent; cursor: pointer;
  height: min(66vh, 560px);
  aspect-ratio: 894 / 1233;               /* Unity kapı oranı */
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
}
.tl-kapi-portal:hover { transform: scale(1.02); }
.tl-kapi-portal:active { transform: scale(0.98); }
.tl-kapi-cerceve {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(58, 36, 21, 0.35));
}
.tl-girdap-elips {
  position: absolute; left: 50%; top: 47%;
  width: 78%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scaleX(0.62);   /* Unity: dönmeyen ebeveyn elips ölçeği */
  pointer-events: none;
}
.tl-girdap-puls {
  position: absolute; inset: 0;
  animation: tl-girdap-puls 1.667s ease-in-out infinite;   /* 0.6 Hz ±%3.5 */
}
.tl-girdap {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  animation: tl-girdap-don 12.857s linear infinite;        /* 360° / 28°sn⁻¹ */
}
@keyframes tl-girdap-don { to { transform: rotate(-360deg); } }
@keyframes tl-girdap-puls {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}
/* Üzüm rozeti — Unity `Assets/Prefab/UI/KuleRozeti.prefab` (0 iken GİZLİ: yeni oyuncuya "0" gösterme).
   📍 KAPININ ÜSTÜNDE: prefab anchor (0.5, 1) + anchoredPosition y = +10 → butonun ÜST kenarının
   ÜZERİNDE durur. Sitede yanlışlıkla `bottom: 4%` ile ALTA konmuştu (kullanıcı bildirimi 2026-08-23).
   `bottom: 100%` = kabın üst kenarının hemen üstü; küçük bir pay ile ayrılır. */
.tl-kapi-rozet {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16, 34, 62, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 5px 16px;
  color: #fff; font-weight: 800; font-size: 1.05rem;
}
.tl-kapi-rozet img { width: 22px; height: 22px; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  .tl-girdap, .tl-girdap-puls { animation: none; }
}

/* KAPI EKRANI — üst bar sayaçları gizlenir (kullanıcı bildirimi 2026-08-21).
   Neden: (1) üzüm ikonu hem kapı rozetinde hem "rekor" hapında çıkıyordu — aynı sembol
   ekranda iki kez; üzüm = kule dilidir ve kapıya aittir. (2) `bulunan`/`rekor` yalnız
   kapıdan GİRİLDİKTEN sonra (`kayitYukle`) dolar, yani kapı ekranında ikisi de her zaman
   0'dır — kapı "11" derken üst bar "0 Kelime / 0 üzüm" diyordu (yanlış bilgi).
   Para hapı GİZLENMEZ: `onUserData`dan gelir ve kapı ekranında da doğrudur. */
.tl-game.tl-kapida .tl-counter,
.tl-game.tl-kapida .tl-record { display: none; }


/* ============================================================
   PETEK — Unity `TilkoLandPetekGirisi` (2026-08-10 çarkın yerini aldı)
   Altıgen taşlar; renk durumları Unity ile birebir:
   normal BEYAZ → seçili SARI → doğru YEŞİL (pop) → yanlış KIRMIZI (sarsıntı).
   Taş konumları/boyutu JS'te hesaplanır (hex matematiği); burada yalnız GÖRÜNÜM yaşar.
   ============================================================ */
.tl-petek {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  min-height: clamp(150px, 34vw, 260px);
  touch-action: none;            /* sürükleme zinciri sayfayı kaydırmasın */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tl-tas {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  /* Pointy-top altıgen (Unity kit sprite'ı Button_Hexagon199_White_Bg'nin CSS karşılığı) */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: #fff;
  color: #294b7a;                /* Unity HARF_NORMAL: lacivert (kit stili) */
  font-family: 'Fredoka', sans-serif; font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  animation: tl-tas-gir .28s cubic-bezier(.2, 1.5, .4, 1) both;   /* Unity: OutBack pop-in */
  filter: drop-shadow(0 2px 3px rgba(58, 36, 21, .28));
}
@keyframes tl-tas-gir { from { transform: scale(0); } to { transform: scale(1); } }
.tl-tas-harf { pointer-events: none; line-height: 1; }
.tl-tas.secili { background: #ffb838; color: #fff; }              /* Unity RENK_SECILI (sıcak sarı) */
.tl-tas.dogru  { background: #61d15c; color: #fff; }              /* Unity RENK_DOGRU */
.tl-tas.yanlis { background: #ed4c42; color: #fff; }              /* Unity RENK_YANLIS */
.tl-tas.vur { animation: tl-tas-vur .16s ease; }                  /* Unity DOPunchScale(0.08) */
@keyframes tl-tas-vur { 50% { transform: scale(1.08); } }
.tl-tas.dogru { animation: tl-tas-vur-buyuk .30s ease; }          /* Unity DOPunchScale(0.14) */
@keyframes tl-tas-vur-buyuk { 50% { transform: scale(1.14); } }
/* Unity DOShakeAnchorPos(0.38s, 18px yatay) */
.tl-petek.sarsil { animation: tl-petek-sarsil .38s ease; }
@keyframes tl-petek-sarsil {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-9px); } 30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); } 60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); } 90% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .tl-tas, .tl-tas.vur, .tl-tas.dogru, .tl-petek.sarsil { animation: none; }
}

/* GENIS EKRAN (>=900px) -- FabuWords ile AYNI iki-kolon dili:
   solda buyuyen kule, sagda petek + guc butonlari. */
@media (min-width: 900px) {
  .tl-game { padding-left: 24px; padding-right: 24px; }
  .tl-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 460px);
    grid-template-areas: "kule kontrol";
    align-items: stretch;
    gap: 10px 26px;
  }
  .tl-grid-scroll { grid-area: kule; }
  .tl-board > .fw-bottom { grid-area: kontrol; align-self: center; }
  .tl-meaning { top: 38%; }
}
