/* ═══ Hersek Lagünü 2D Oyun — renkli, mobil öncelikli ═══ */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; overflow:hidden; font-family:'Segoe UI',system-ui,-apple-system,sans-serif; user-select:none; -webkit-user-select:none; }
.hidden { display:none !important; }
button { font-family:inherit; touch-action:manipulation; }

/* ── DAVET KAPISI ── */
#gate { position:fixed; top:0;left:0;right:0;bottom:0; z-index:100; display:flex; align-items:center; justify-content:center; background:#0f2e42; transition:opacity .4s; }
#gate.gate-out { opacity:0; pointer-events:none; }
.gate-bg { position:absolute; top:0;left:0;right:0;bottom:0; background:linear-gradient(160deg,#0f2e42 0%,#123a54 55%,#1e5a7d 100%); }
#gate-card { position:relative; display:flex; flex-direction:column; align-items:center; width:min(92vw,380px); background:rgba(255,255,255,.97); border-radius:22px; border:4px solid #4ec9f5; padding:28px 22px 22px; box-shadow:0 24px 70px rgba(0,0,0,.55); }
#gate-card.shake-now { animation:shake .4s; }
.gate-lock { font-size:2.4rem; margin-bottom:4px; }
.gate-sub { color:#567; font-weight:700; font-size:clamp(.82rem,3.2vw,.95rem); text-align:center; line-height:1.4; margin:8px 0 16px; }
#gate-code { width:100%; text-align:center; font-family:inherit; user-select:text; -webkit-user-select:text; font-weight:900; font-size:clamp(1.05rem,4vw,1.25rem); letter-spacing:.18em; color:#123a54; background:#f0f9ff; border:3px solid #d9e6ee; border-radius:14px; padding:13px 12px; outline:none; text-transform:uppercase; }
#gate-code:focus { border-color:#4ec9f5; background:#e3f6ff; box-shadow:0 0 0 4px rgba(78,201,245,.25); }
#gate-code::placeholder { color:#9db8c6; letter-spacing:.12em; }
#gate-btn { margin-top:14px; width:100%; background:linear-gradient(180deg,#ff5e7a,#e8365d); color:#fff; border:none; padding:13px 0; border-radius:999px; font-weight:900; font-size:clamp(.95rem,3.6vw,1.1rem); cursor:pointer; box-shadow:0 5px 0 #a81f40,0 10px 26px rgba(232,54,93,.45); transition:.15s; }
#gate-btn:active { transform:translateY(4px); box-shadow:0 1px 0 #a81f40; }
#gate-err { margin-top:12px; min-height:20px; color:#e8365d; font-weight:800; font-size:clamp(.78rem,3vw,.9rem); opacity:0; transition:opacity .2s; }
#gate-err.show { opacity:1; }

/* ── AÇILIŞ ── */
#splash { position:fixed; top:0;left:0;right:0;bottom:0; display:flex; flex-direction:column; background:#0f2e42; }
.splash-bg { position:absolute; top:0;left:0;right:0;bottom:0; background:url('assets/concept_art.png') center/cover; filter:blur(14px) brightness(.55); transform:scale(1.1); }
.splash-inner { position:relative; flex:1; display:flex; align-items:center; justify-content:center; min-height:0; }
.splash-art { max-width:min(96vw,1200px); max-height:calc(100% - 16px); object-fit:contain; border-radius:14px; box-shadow:0 24px 70px rgba(0,0,0,.55); }
.splash-logo { position:absolute; top:calc(10px + env(safe-area-inset-top)); right:12px; height:clamp(34px,5.5vh,50px); filter:drop-shadow(0 2px 6px rgba(0,0,0,.5)); z-index:2; }
.splash-bar { position:relative; display:flex; align-items:center; justify-content:center; gap:clamp(10px,3vw,30px); padding:14px 16px calc(14px + env(safe-area-inset-bottom)); background:#123a54; border-top:3px solid #1e5a7d; flex-wrap:wrap; }
.splash-love { color:#ff8fab; font-weight:800; font-size:clamp(.8rem,3.4vw,1.05rem); letter-spacing:.03em; }
.splash-sub { color:#9fd4ef; font-weight:600; font-size:clamp(.7rem,2.8vw,.85rem); }
#btn-start { background:linear-gradient(180deg,#ff5e7a,#e8365d); color:#fff; border:none; padding:13px 34px; border-radius:999px; font-weight:900; font-size:clamp(.95rem,3.6vw,1.15rem); cursor:pointer; box-shadow:0 5px 0 #a81f40,0 10px 26px rgba(232,54,93,.45); transition:.15s; }
#btn-start:active { transform:translateY(4px); box-shadow:0 1px 0 #a81f40; }

/* ── HARİTA ── */
#map-screen { position:fixed; top:0;left:0;right:0;bottom:0; display:flex; flex-direction:column; background:linear-gradient(180deg,#bfe9f7,#8fd4ec); }
#topbar { display:flex; align-items:center; gap:10px; padding:8px 12px; background:#123a54; }
.top-logo { height:34px; }
.stat { background:rgba(255,255,255,.14); color:#fff; font-weight:700; padding:5px 14px; border-radius:999px; font-size:1rem; }
.stat b { color:#ffd94d; }
#topbar button { background:rgba(255,255,255,.14); color:#fff; border:none; width:38px; height:38px; border-radius:12px; font-size:1.1rem; cursor:pointer; }
#btn-book { margin-left:auto; }

#map-wrap { position:relative; flex:1; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
#map-wrap::-webkit-scrollbar { display:none; }
#map-inner { position:absolute; top:0; left:0; height:100%; width:100%; animation:mapin .5s ease-out; }
@keyframes mapin { from{opacity:0} to{opacity:1} }
.stat.ptitle { color:#ffd94d; font-weight:900; font-size:.78rem; letter-spacing:.05em; }
.cert-in { display:block; margin:10px auto 0; padding:10px 16px; border-radius:12px; border:3px solid #4ec9f5; font-size:1rem; font-weight:700; text-align:center; max-width:280px; width:90%; }
.cert-btn { display:block; margin:8px auto 0; background:linear-gradient(180deg,#ff5e7a,#e8365d); color:#fff; border:none; padding:11px 26px; border-radius:999px; font-weight:900; cursor:pointer; }
#map-img { width:100%; height:100%; display:block; user-select:none; -webkit-user-drag:none; }

.hotspot { position:absolute; transform:translate(-50%,-50%); width:clamp(64px,15vw,104px); height:clamp(64px,15vw,104px); border-radius:50%; border:4px solid #fff; background:radial-gradient(circle at 35% 30%, #fff8, #0000 60%), var(--c,#4ec9f5); box-shadow:0 6px 0 rgba(0,0,0,.18),0 10px 26px rgba(0,0,0,.3); cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; animation:pulse 2s infinite; transition:transform .12s; }
.hotspot:active { transform:translate(-50%,-50%) scale(.9); }
.hotspot .hs-emoji { font-size:clamp(1.6rem,6vw,2.4rem); }
.hotspot .hs-label { font-size:clamp(.5rem,1.9vw,.72rem); font-weight:900; color:#fff; text-shadow:0 1px 3px rgba(0,0,0,.6); letter-spacing:.02em; margin-top:2px; }
.hotspot.done { border-color:#ffd94d; }
.hotspot.done::after { content:'✔'; position:absolute; top:-6px; right:-6px; background:#ffd94d; color:#7a5200; font-weight:900; width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.9rem; box-shadow:0 2px 6px rgba(0,0,0,.3); }
@keyframes pulse { 0%,100%{box-shadow:0 6px 0 rgba(0,0,0,.18),0 0 0 0 rgba(255,255,255,.55)} 50%{box-shadow:0 6px 0 rgba(0,0,0,.18),0 0 0 14px rgba(255,255,255,0)} }

#peli-tip { position:absolute; left:12px; bottom:calc(12px + env(safe-area-inset-bottom)); display:flex; align-items:center; gap:8px; max-width:min(78vw,420px); background:#fff; border-radius:18px; padding:10px 16px 10px 10px; box-shadow:0 8px 24px rgba(0,0,0,.25); border:3px solid #4ec9f5; }
img.peli-face { width:52px; height:52px; border-radius:50%; object-fit:cover; border:3px solid #4ec9f5; animation:bob 2.4s ease-in-out infinite; flex-shrink:0; }
span.peli-face { font-size:2rem; animation:bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
#peli-text { font-size:clamp(.78rem,3vw,.95rem); font-weight:700; color:#123a54; line-height:1.25; }

/* ── MİNİ OYUN KATMANI ── */
#game-modal { position:fixed; top:0;left:0;right:0;bottom:0; z-index:20; background:#0f2e42; display:flex; align-items:center; justify-content:center; }
#game-frame { position:relative; width:100%; height:100%; display:flex; flex-direction:column; overflow:hidden; background:#0f2e42; }
#game-head { display:flex; align-items:center; gap:10px; padding:9px 14px; background:#123a54; color:#fff; z-index:5; }
#game-title { font-weight:900; font-size:clamp(.85rem,3.2vw,1.1rem); }
#game-timer { background:#ff5e7a; border-radius:999px; padding:3px 12px; font-weight:900; margin-left:auto; }
#game-score { background:#ffd94d; color:#7a5200; border-radius:999px; padding:3px 12px; font-weight:900; }
#game-close { background:rgba(255,255,255,.15); border:none; color:#fff; width:34px; height:34px; border-radius:10px; font-size:1rem; cursor:pointer; }
#game-area { position:relative; flex:1; overflow:hidden; touch-action:manipulation; }
.fit { position:absolute; top:0;left:0;right:0;bottom:0; background-size:100% 100%; animation:scenefade .35s ease-out; }
@keyframes scenefade { from{opacity:0;transform:scale(1.03)} to{opacity:1;transform:scale(1)} }
#game-msg { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); background:rgba(18,58,84,.92); color:#fff; padding:9px 20px; border-radius:999px; font-weight:800; font-size:clamp(.8rem,3vw,1rem); white-space:nowrap; max-width:94vw; overflow:hidden; text-overflow:ellipsis; opacity:0; transition:opacity .25s; pointer-events:none; z-index:6; }
#game-msg.show { opacity:1; }

/* ── oyun elemanları ── */
.fly-bird { position:absolute; transform:translate(-50%,-50%); cursor:pointer; user-select:none; filter:drop-shadow(0 3px 4px rgba(0,0,0,.3)); transition:transform .1s; }
.fly-bird:active { transform:translate(-50%,-50%) scale(1.3); }
.fly-bird .bimg { width:clamp(72px,11vw,120px); display:block; pointer-events:none; }
.fly-bird .em { font-size:clamp(2rem,7vw,3rem); display:inline-block; }
.fly-bird span.name { position:absolute; top:100%; left:50%; transform:translateX(-50%); font-size:.6rem; font-weight:800; color:#fff; text-shadow:0 1px 3px #000; white-space:nowrap; }
.fly-bird.gold { filter:drop-shadow(0 0 14px #ffd94d) drop-shadow(0 3px 4px rgba(0,0,0,.3)); animation:goldpulse .6s infinite alternate; }
@keyframes goldpulse { from{filter:drop-shadow(0 0 10px #ffd94d)} to{filter:drop-shadow(0 0 22px #fff)} }
.goal-hud { position:absolute; top:10px; left:12px; background:rgba(18,58,84,.85); color:#fff; font-weight:900; font-size:clamp(.9rem,3.4vw,1.2rem); padding:6px 16px; border-radius:999px; border:2px solid #ffd94d; z-index:5; }

.bed { position:absolute; width:21%; height:32%; border-radius:50%; transform:translate(-50%,-50%); display:flex; align-items:center; justify-content:center; cursor:pointer; border:3px dashed rgba(255,255,255,.45); }
.bed.ready { border:3px solid #ffd94d; box-shadow:0 0 22px 8px rgba(255,217,77,.75); animation:bedpulse 1s infinite; }
.bed.ready::after { content:'TOPLA!'; position:absolute; top:-14%; left:50%; transform:translateX(-50%); background:#ffd94d; color:#7a5200; font-size:clamp(.55rem,2vw,.8rem); font-weight:900; padding:2px 10px; border-radius:999px; box-shadow:0 3px 8px rgba(0,0,0,.3); white-space:nowrap; }
@keyframes bedpulse { 0%,100%{box-shadow:0 0 22px 8px rgba(255,217,77,.75)} 50%{box-shadow:0 0 34px 14px rgba(255,217,77,.4)} }

.trash { position:absolute; transform:translate(-50%,-50%); cursor:pointer; filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); user-select:none; }
.trash .timg { width:clamp(52px,8vw,80px); display:block; pointer-events:none; }
.bird-thumb { width:44px; height:44px; object-fit:contain; }
.ing-img { width:34px; height:34px; border-radius:50%; object-fit:cover; vertical-align:middle; margin-right:4px; }
.mem-front img, .mem-back img { width:82%; height:82%; object-fit:contain; }
.mem-front img { width:70%; border-radius:50%; border:3px solid #ffd94d; }

.ing { display:inline-flex; align-items:center; gap:6px; background:#fff; border:3px solid #d9e6ee; border-radius:999px; padding:9px 16px; margin:5px; font-weight:800; color:#123a54; font-size:clamp(.8rem,3vw,1rem); cursor:pointer; box-shadow:0 3px 0 #b9ccd8; }
.ing:active { transform:scale(.93); }
.ing.sel { border-color:#4ec9f5; background:#e3f6ff; box-shadow:0 3px 0 #2890d8; }
.ing.wrong { animation:shake .4s; border-color:#ff5e7a !important; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }
.recipe-card { background:#fff; border-radius:18px; padding:14px 18px; margin:10px auto; max-width:400px; text-align:center; box-shadow:0 8px 24px rgba(0,0,0,.25); }
.recipe-card h3 { color:#e8365d; font-size:clamp(1rem,4vw,1.3rem); }
.recipe-card .need { display:flex; justify-content:center; gap:8px; margin:10px 0; font-size:1.6rem; }

/* ── MODAL / TOAST ── */
#modal { position:fixed; top:0;left:0;right:0;bottom:0; z-index:30; background:rgba(8,30,44,.7); display:flex; align-items:center; justify-content:center; padding:14px; }
.modal-card { position:relative; background:#fff; border-radius:20px; max-width:520px; width:100%; max-height:82vh; overflow-y:auto; padding:22px; box-shadow:0 24px 70px rgba(0,0,0,.5); }
.modal-x { position:absolute; top:10px; right:10px; width:34px; height:34px; border-radius:50%; border:none; background:#eef4f7; cursor:pointer; font-weight:900; }
#modal-body h2 { color:#123a54; margin-bottom:10px; font-size:1.2rem; }
#modal-body .fact { background:#f0f9ff; border-left:4px solid #4ec9f5; border-radius:10px; padding:10px 14px; margin:8px 0; font-size:.9rem; line-height:1.45; }
#modal-body .bird-row { display:flex; align-items:center; gap:10px; padding:7px 4px; border-bottom:1px dashed #dbe7ee; font-size:.9rem; }
#modal-body .bird-row .e { font-size:1.5rem; }
#modal-body b { color:#e8365d; }

#toast { position:fixed; top:calc(60px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%) scale(.8); background:linear-gradient(180deg,#ff5e7a,#e8365d); color:#fff; font-weight:900; padding:11px 26px; border-radius:999px; font-size:clamp(.85rem,3vw,1.05rem); box-shadow:0 10px 30px rgba(232,54,93,.5); opacity:0; transition:.25s; z-index:40; pointer-events:none; text-align:center; }
#toast.show { opacity:1; transform:translateX(-50%) scale(1); }

/* puan baloncuğu */
.pop { position:fixed; z-index:60; transform:translate(-50%,-50%); color:#fff; font-weight:900; font-size:1.1rem; text-shadow:0 2px 4px rgba(0,0,0,.5); animation:popfly .9s ease-out forwards; pointer-events:none; }
@keyframes popfly { 0%{opacity:1;transform:translate(-50%,-50%) scale(.7)} 100%{opacity:0;transform:translate(-50%,-160%) scale(1.3)} }
/* yıldızlar */
.stars { text-align:center; font-size:2.6rem; color:#ffd94d; text-shadow:0 2px 0 #d9a400; letter-spacing:.15em; animation:starpop .6s ease-out; margin:4px 0; }
@keyframes starpop { 0%{transform:scale(0) rotate(-30deg)} 70%{transform:scale(1.3)} 100%{transform:scale(1)} }
/* süre uyarısı */
#game-timer.warn { animation:blink .5s infinite alternate; }
@keyframes blink { from{background:#ff5e7a} to{background:#c00f35} }
/* kuş defteri kilitli */
.bird-row.locked { opacity:.45; }

/* hafıza kartları */
.mem-grid { position:absolute; top:0;left:0;right:0;bottom:0; display:grid; grid-template-columns:repeat(4,1fr); grid-template-rows:repeat(3,1fr); gap:2.5%; padding:3%; }
.memcard { width:100%; height:100%; perspective:600px; cursor:pointer; }
.mem-in { position:relative; width:100%; height:100%; transform-style:preserve-3d; transition:transform .4s; }
.memcard.flip .mem-in { transform:rotateY(180deg); }
.mem-front,.mem-back { position:absolute; top:0;left:0;right:0;bottom:0; display:flex; align-items:center; justify-content:center; font-size:clamp(1.6rem,6vw,2.6rem); border-radius:14px; backface-visibility:hidden; -webkit-backface-visibility:hidden; }
.mem-front { background:linear-gradient(160deg,#2e9e5b,#1d7a42); border:3px solid #ffd94d; color:#fff; }
.mem-back { background:#fff; border:3px solid #7ed957; transform:rotateY(180deg); }
.memcard.matched .mem-back { background:#e8ffd9; border-color:#ffd94d; box-shadow:0 0 18px #ffd94d; }
/* quiz şıkları */
.quiz-opts { display:flex; flex-direction:column; gap:8px; }
.qopt { width:100%; text-align:left; }
.qopt:disabled { opacity:.85; }

/* konfeti */
.confetti { position:fixed; width:10px; height:14px; top:-20px; z-index:50; animation:fall linear forwards; pointer-events:none; }
@keyframes fall { to { transform:translateY(110vh) rotate(720deg); } }

@media (max-width:640px) {
  .top-logo { height:26px; }
  #topbar { gap:6px; padding:6px 8px; }
  #topbar button { width:32px; height:32px; border-radius:9px; font-size:.95rem; }
  .stat { font-size:.8rem; padding:3px 8px; }
  .stat.ptitle { display:none; }
  /* ipucu balonu mobilde kompakt */
  #peli-tip { left:8px; bottom:calc(8px + env(safe-area-inset-bottom)); max-width:58vw; padding:6px 10px 6px 6px; border-width:2px; border-radius:14px; }
  img.peli-face { width:36px; height:36px; border-width:2px; }
  #peli-text { font-size:.72rem; }
  /* oyun başlığı */
  #game-head { gap:6px; padding:7px 8px; }
  #game-close { width:30px; height:30px; }
  #game-timer, #game-score { padding:2px 9px; font-size:.85rem; }
}
