/* Şekilleri Bul - Mobil V2 (Safari bar sorunsuz) */
:root{
  --bg1:#eaf2ff;
  --bg2:#cfe3ff;
  --ink:#0f172a;
  --muted:#64748b;
  --line: rgba(15,23,42,.12);
  --shadow: 0 16px 35px rgba(0,0,0,.12);
  --r:18px;
  --trayH: 170px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--ink);
  background: radial-gradient(circle at 30% 0%, #ffffff 0%, var(--bg1) 40%, var(--bg2) 100%);
  overflow:hidden;
}
.top{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.back{
  width:42px;height:42px; flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  border-radius:999px; text-decoration:none; color:var(--ink);
  background: rgba(15,23,42,.06);
}
.title{min-width:0; flex:1}
.h1{font-weight:1000; font-size:18px; line-height:1.1}
.sub{font-size:12px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.reset{
  border:0; padding:10px 12px; border-radius:999px;
  background:#fde047; font-weight:900; cursor:pointer;
  box-shadow:0 10px 22px rgba(253,224,71,.35);
}
.stage{
  height: calc(100dvh - 64px - var(--trayH) - env(safe-area-inset-bottom));
  padding:12px;
}
.board{
  height:100%;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.slot{
  position:relative;
  border:2px dashed rgba(15,23,42,.25);
  border-radius: var(--r);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  padding:10px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  min-height: 120px;
}
.slotLabel{
  position:absolute; left:10px; top:8px;
  font-size:12px; font-weight:900; color: rgba(15,23,42,.70);
}
.slotDone{
  position:absolute; right:10px; top:8px;
  font-size:18px; opacity:0; transform:scale(.9);
}
.slot.isDone .slotDone{opacity:1; transform:scale(1);}

.tray{
  position:fixed;
  left:12px; right:12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: var(--trayH);
  z-index:20;
  background: rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding:12px;
  backdrop-filter: blur(10px);
}
.trayTitle{
  font-size:13px; font-weight:1000;
  color: rgba(15,23,42,.80);
  margin-bottom:10px;
}
.pieces{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  height: calc(100% - 28px);
}
.piece{
  border-radius: 16px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  min-height: 64px;
}
.piece.isSelected{
  outline:4px solid rgba(34,197,94,.35);
  transform: translateY(-1px);
}

.slotIcon{
  width: clamp(52px, 16vw, 70px);
  height: clamp(52px, 16vw, 70px);
  opacity:.22;
}
.pieceIcon{
  width: clamp(38px, 12vw, 50px);
  height: clamp(38px, 12vw, 50px);
}
.slotIcon--circle, .pieceIcon--circle{ border-radius:999px; background:#3b82f6; }
.slotIcon--square, .pieceIcon--square{ border-radius:10px; background:#22c55e; }
.slotIcon--star, .pieceIcon--star{
  background:#f59e0b;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  border-radius: 6px;
}
.slotIcon--heart, .pieceIcon--heart{
  background:#ef4444;
  clip-path: polygon(50% 100%, 0 55%, 0 20%, 20% 0, 50% 20%, 80% 0, 100% 20%, 100% 55%);
  border-radius: 10px;
}

.toast{
  position:fixed;
  left:12px; right:12px;
  bottom: calc(var(--trayH) + 26px + env(safe-area-inset-bottom));
  z-index:25;
  padding:12px 14px;
  border-radius: 16px;
  background: rgba(15,23,42,.92);
  color:#fff;
  font-weight:900;
  text-align:center;
  opacity:0;
  transform: translateY(8px);
  transition: .18s ease;
  pointer-events:none;
}
.toast.show{opacity:1; transform: translateY(0);}
.win{
  position:fixed; inset:0;
  display:none;
  align-items:center; justify-content:center;
  background: rgba(0,0,0,.35);
  z-index:30;
  padding:16px;
}
.win.show{display:flex;}
.winCard{
  width:min(360px, 92vw);
  background:#fff;
  border-radius:22px;
  padding:18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  text-align:center;
}
.winTitle{font-size:22px; font-weight:1000}
.winSub{margin-top:6px; color:#64748b; font-weight:800}
.again{
  margin-top:14px;
  width:100%;
  border:0;
  border-radius:16px;
  padding:12px 14px;
  font-weight:1000;
  background: linear-gradient(180deg,#22c55e,#16a34a);
  color:#fff;
  cursor:pointer;
}
