/* GeoGames yeni oyunlar: okul öncesi ve ilkokul ortak görünümü
   Büyük dokunma alanları, yuvarlak kartlar, canlı renkler. Her oyun --tema ve --tema2 renklerini belirler. */
@font-face { font-family: 'DynaPuff'; src: url('/fonts/DynaPuff.woff2') format('woff2'), url('/fonts/DynaPuff.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('/fonts/Nunito.woff2') format('woff2'), url('/fonts/Nunito.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }

:root {
    --tema: #0ea5e9;
    --tema2: #6366f1;
    --ink: #10223a;
    --muted: #5b6b7b;
    --ok: #22c55e;
    --bad: #ef4444;
    --sun: #ffc93c;
    --kart: #ffffff;
    --golge: 0 6px 0 rgba(16, 34, 58, .18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
    font-family: 'Nunito', system-ui, sans-serif; font-weight: 800; color: var(--ink);
    background: linear-gradient(180deg, color-mix(in srgb, var(--tema) 30%, #fff) 0%, #fff8e7 100%);
    min-height: 100vh; overflow-x: hidden;
    -webkit-user-select: none; user-select: none;
}
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3, .k-baslik { font-family: 'DynaPuff', 'Nunito', sans-serif; font-weight: 600; margin: 0; }

/* ---------- Üst bar ---------- */
.k-ust {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: color-mix(in srgb, var(--tema) 88%, #000); color: #fff;
}
.k-ust .k-baslik { flex: 1; min-width: 70px; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-yuvarlak {
    position: relative; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1.3rem;
}
.k-yuvarlak:active { transform: scale(.92); }
/* Geri oku: yazı karakteri değil, CSS çizgisi */
.k-geri::before, .k-geri::after {
    content: ''; position: absolute; left: 15px; width: 13px; height: 3.5px; border-radius: 2px; background: #fff; transform-origin: 0 50%;
}
.k-geri::before { top: 21px; transform: rotate(-45deg); }
.k-geri::after { top: 19px; transform: rotate(45deg); }
.k-ses.kapali { opacity: .5; }
.k-ilerleme { display: flex; gap: 4px; flex: none; }
.k-ilerleme i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.k-ilerleme i.tamam { background: var(--sun); }
.k-ilerleme i.simdi { background: #fff; transform: scale(1.3); }

/* ---------- Başlangıç ekranı (ses için ilk dokunuş) ---------- */
.k-giris {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: safe center; padding: 20px; overflow-y: auto;
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--tema) 35%, #fff), var(--tema2));
}
.k-giris-kart { width: 100%; max-width: 420px; text-align: center; background: #fff; border-radius: 32px; padding: 22px 18px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.k-giris img { width: 150px; height: 150px; object-fit: contain; animation: k-zipla 1.6s ease-in-out infinite; }
.k-giris h1 { font-size: 1.9rem; margin: 6px 0; color: var(--tema2); }
.k-giris p { margin: 0 0 16px; color: var(--muted); font-size: 1rem; line-height: 1.4; }
.k-yas { display: inline-block; margin-bottom: 8px; padding: 4px 12px; border-radius: 999px; background: #fff3c4; color: #92400e; font-size: .85rem; }

.k-dugme {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 12px 26px;
    border: 0; border-radius: 22px; color: #fff; font: 600 1.35rem 'DynaPuff', 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--tema), var(--tema2)); box-shadow: 0 7px 0 color-mix(in srgb, var(--tema2) 70%, #000);
}
.k-dugme:active { transform: translateY(4px); box-shadow: 0 3px 0 color-mix(in srgb, var(--tema2) 70%, #000); }
.k-dugme.ikincil { background: #fff; color: var(--ink); box-shadow: 0 7px 0 #cbd5e1; border: 3px solid #e2e8f0; }
.k-dugme.genis { width: 100%; }

/* ---------- Oyun alanı ---------- */
.k-sahne { max-width: 980px; margin: 0 auto; padding: 12px 12px 28px; }
.k-yonerge {
    display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 20px;
    background: #fff; box-shadow: var(--golge); font-size: 1.1rem; line-height: 1.3;
}
.k-yonerge img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.k-yonerge .k-yuvarlak { background: color-mix(in srgb, var(--tema) 20%, #fff); }

.k-kart {
    border: 0; border-radius: 22px; background: var(--kart); box-shadow: var(--golge);
    display: grid; place-items: center; text-align: center; padding: 8px;
    transition: transform .15s, box-shadow .15s;
}
.k-kart:active { transform: scale(.96); }
.k-kart.secili { outline: 5px solid var(--sun); transform: scale(1.06); }
.k-kart.dogru { background: #dcfce7; outline: 5px solid var(--ok); animation: k-pop .4s; }
.k-kart.yanlis { animation: k-salla .4s; background: #fee2e2; }
.k-kart.soluk { opacity: .35; pointer-events: none; }
.k-emoji { font-size: 3rem; line-height: 1.1; }
.k-etiket { font-size: .95rem; margin-top: 4px; }

/* Sürüklenen öğe parmağı izler */
.k-surukleniyor { position: fixed !important; z-index: 80; pointer-events: none; transform: scale(1.12) rotate(-4deg); box-shadow: 0 16px 30px rgba(0, 0, 0, .25) !important; }
.k-hedef-ustunde { outline: 5px dashed var(--sun) !important; outline-offset: 2px; }

/* ---------- Bitiş ---------- */
.k-bitis {
    position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
    background: rgba(16, 34, 58, .55); animation: k-belir .25s;
}
.k-bitis-kart { width: 100%; max-width: 400px; background: #fff; border-radius: 32px; padding: 20px 18px; text-align: center; animation: k-pop .45s; }
.k-bitis img { width: 140px; height: 140px; object-fit: contain; }
.k-bitis h2 { font-size: 1.8rem; color: var(--tema2); margin: 4px 0; }
.k-yildizlar { font-size: 2.6rem; letter-spacing: 6px; margin: 4px 0 6px; }
.k-yildizlar span { display: inline-block; animation: k-yildiz .5s both; }
.k-yildizlar span.bos { filter: grayscale(1); opacity: .3; }
.k-bitis p { color: var(--muted); margin: 0 0 14px; }
.k-bitis .k-dugme { margin-top: 8px; }

/* Konfeti */
.k-konfeti { position: fixed; top: -20px; z-index: 90; width: 10px; height: 16px; border-radius: 3px; pointer-events: none; animation: k-dus linear forwards; }
.k-patlama { position: fixed; z-index: 85; pointer-events: none; font-size: 1.8rem; animation: k-patla .7s ease-out forwards; }

@keyframes k-zipla { 50% { transform: translateY(-10px) rotate(-3deg); } }
@keyframes k-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes k-salla { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes k-belir { from { opacity: 0; } }
@keyframes k-yildiz { from { transform: scale(0) rotate(-90deg); } }
@keyframes k-dus { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes k-patla { from { opacity: 1; transform: translate(-50%, -50%) scale(.5); } to { opacity: 0; transform: translate(-50%, -160%) scale(1.4); } }

/* Dar ekran: ilerleme noktaları başlığa yer bıraksın */
@media (max-width: 420px) {
    .k-ust { gap: 6px; padding: 8px 10px; }
    .k-yuvarlak { width: 40px; height: 40px; font-size: 1.15rem; }
    .k-ilerleme i { width: 6px; height: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ================= Sahne arka planı ve anlatıcı Geogo ================= */
/* Sitenin resimli poster sahneleri, okunurluk için açık bir perdenin arkasında */
.k-arkaplan {
    position: fixed; inset: -12px; z-index: -1; pointer-events: none;
    background-size: cover; background-position: center; filter: blur(4px) saturate(1.15); transform: scale(1.04);
}
.k-arkaplan::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .55) 45%, rgba(255, 248, 231, .75)); }
body.k-sahneli { background: #fff8e7; }

/* Giriş kartı: üstte sahne afişi, Geogo afişten taşar */
/* Sahne, kartın arkasında hafif bulanık (düşük çözünürlüklü sahneler büyük ekranda gerilince bozuk görünmez) */
.k-giris-zemin { position: fixed; inset: -20px; z-index: -1; background-size: cover; background-position: center; filter: blur(5px) saturate(1.1); }
.k-giris { isolation: isolate; }
.k-giris::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(16, 34, 58, .35); }
.k-giris-kart { position: relative; padding-top: 0; overflow: visible; }
.k-giris-afis { height: 150px; margin: 0 -18px 0; border-radius: 32px 32px 0 0; background-size: cover; background-position: center 30%; }
.k-giris .k-giris-kart img { position: relative; width: 170px; height: 170px; margin-top: -110px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .3)); }

/* Anlatıcı: sol altta Geogo + altyazı balonu (konuşurken zıplar) */
.k-rehber { position: fixed; left: 6px; bottom: 6px; z-index: 40; display: flex; align-items: flex-end; gap: 4px; pointer-events: none; max-width: calc(100vw - 12px); }
.k-rehber img { width: 92px; height: 104px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); transition: transform .3s; }
/* Konuşmuyorken anlatıcı küçülüp köşeye çekilir: oyunun kartlarını kapatmaz; konuşurken tam boyuna çıkar */
.k-rehber:not(.goster) img { transform: translate(-14px, 26px) scale(.55); transform-origin: bottom left; opacity: .92; }
.k-rehber.konusuyor img { animation: k-konus .45s ease-in-out infinite alternate; }
.k-balon {
    position: relative; margin-bottom: 56px; padding: 9px 13px; border-radius: 18px 18px 18px 4px; background: #fff;
    box-shadow: 0 6px 18px rgba(16, 34, 58, .2); font-size: .95rem; line-height: 1.35; max-width: min(420px, 72vw);
    opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .25s, transform .25s;
}
.k-rehber.goster .k-balon { opacity: 1; transform: none; }
@keyframes k-konus { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-6px) rotate(2deg); } }
.k-sahne { padding-bottom: 120px; }

/* ================= Gerçek fotoğraf kartı ================= */
/* Kartpostal görünümü: beyaz çerçeve, yumuşak gölge; öğrenilen nesne her zaman gerçek fotoğrafla gösterilir */
.k-foto {
    position: relative; display: block; overflow: hidden; border-radius: 18px; background: #fff; padding: 6px;
    box-shadow: 0 6px 0 rgba(16, 34, 58, .14), 0 10px 22px rgba(16, 34, 58, .14);
}
.k-foto img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.k-foto figcaption, .k-foto-yazi { display: block; padding: 6px 4px 2px; text-align: center; font-size: 1rem; line-height: 1.2; }

/* Siyasi haritalar (ortak/turkiye-harita.js, ortak/dunya-harita.js) */
.th-deniz { fill: #a5d8f5; }
.th-komsu { fill: #e7e5e4; stroke: #e7e5e4; stroke-width: 3; stroke-linejoin: round; }
.th-deniz-adi { font: 800 19px 'Nunito', sans-serif; letter-spacing: 6px; fill: #0369a1; opacity: .75; pointer-events: none; }
.th-il { stroke: #fff; stroke-width: 1.1; stroke-linejoin: round; cursor: pointer; transition: filter .2s, opacity .2s; }
.th-il:hover { filter: brightness(1.08) saturate(1.2); }

/* ================= Kısa ve yatay ekranlar (masaüstü site çerçevesi, yatay telefon) ================= */
/* Giriş kartı kısa ekranda küçülür; geniş ve kısa ekranda afiş solda, yazılar sağda */
@media (max-height: 640px) {
    .k-giris-afis { height: 110px; }
    .k-giris .k-giris-kart img { width: 130px; height: 130px; margin-top: -84px; }
    .k-giris h1 { font-size: 1.6rem; }
    .k-giris p { margin-bottom: 12px; }
}
@media (max-height: 560px) and (min-width: 640px) {
    .k-giris-kart {
        max-width: 720px; display: grid; grid-template-columns: 300px 1fr; column-gap: 22px; align-items: center;
        padding: 0 22px 0 0; text-align: left;
    }
    .k-giris-afis { grid-column: 1; grid-row: 1 / 5; align-self: stretch; height: auto; min-height: 260px; margin: 0; border-radius: 32px 0 0 32px; }
    .k-giris .k-giris-kart img { grid-column: 1; grid-row: 1 / 5; align-self: end; justify-self: center; margin: 0 0 8px; }
    .k-giris .k-yas { grid-column: 2; justify-self: start; margin-top: 18px; }
    .k-giris h1, .k-giris p, .k-giris .k-dugme { grid-column: 2; }
    .k-giris .k-dugme { margin-bottom: 18px; }
}
/* Yatay ekranda anlatıcı Geogo oyun sütununun dışında kalır: alttaki boşluğa gerek yok */
body.k-yatay .k-sahne { padding-bottom: 16px; }
@media (min-width: 1200px) { body.k-yatay .k-rehber { left: 16px; } }
