* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: #1a2444;
  min-height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

#gameCanvas {
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* ─── Hamburger butonu ─────────────────────────────────────────────────────── */
#menuBtn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  width: 44px; height: 44px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  cursor: pointer;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
}
#menuBtn span {
  display: block; width: 20px; height: 2px; border-radius: 2px;
  background: #f5f7ff;
}
#menuBtn:active { opacity: 0.7; }

/* ─── Menü katmanı ─────────────────────────────────────────────────────────── */
#menuOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 30;
  display: block;
}
#menuOverlay.hidden { display: none; }

#menuPanel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(86vw, 380px);
  background: #2b3765;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  color: #f5f7ff;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  transform: translateX(0);
  animation: slideIn 0.18s ease-out;
  overflow: hidden;
}
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }

#menuHeader {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex: 0 0 auto;
}
#menuTitle { font-size: 1.15rem; flex: 1; }
.icon-btn {
  width: 34px; height: 34px;
  background: transparent; border: none; color: #f5f7ff;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  border-radius: 8px;
}
.icon-btn:active { background: rgba(255,255,255,0.1); }
.icon-btn.hidden { display: none; }

#menuBody {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 24px;
}

/* Menü liste öğeleri */
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 15px 18px;
  background: transparent; border: none; color: #f5f7ff;
  font-size: 1rem; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.menu-item:active { background: rgba(255,255,255,0.06); }
.menu-item .ico { font-size: 1.2rem; width: 24px; text-align: center; }
.menu-item .chev { margin-left: auto; color: #8b93b5; }

/* İçerik sayfaları */
.page { padding: 18px 18px 8px; line-height: 1.55; color: #d7dcf0; }
.page h3 { color: #f5f7ff; margin: 18px 0 8px; font-size: 1.05rem; }
.page h3:first-child { margin-top: 0; }
.page p { margin: 0 0 10px; font-size: 0.94rem; }
.page a { color: #4dabf7; }
.page .muted { color: #8b93b5; font-size: 0.85rem; }

/* Ayarlar */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.btn {
  border: none; border-radius: 10px; padding: 11px 16px;
  font-size: 0.92rem; font-weight: 600; cursor: pointer; color: #0b1020;
}
.btn.red { background: #ff6b6b; color: #fff; }
.btn.ghost { background: rgba(255,255,255,0.08); color: #f5f7ff; }
.toggle { width: 52px; height: 30px; border-radius: 15px; position: relative;
  background: #2a3357; border: none; cursor: pointer; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; transition: left 0.15s; }
.toggle.on { background: #51cf66; }
.toggle.on .knob { left: 25px; }

/* Liderlik tablosu */
.lb-list { list-style: none; padding: 6px 0; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lb-rank { width: 30px; font-weight: 800; color: #ffd43b; text-align: center; }
.lb-rank.top1 { color: #ffd700; }
.lb-rank.top2 { color: #c0c8e0; }
.lb-rank.top3 { color: #d9945b; }
.lb-name { flex: 1; font-weight: 600; }
.lb-meta { color: #8b93b5; font-size: 0.8rem; }
.lb-score { color: #51cf66; font-weight: 700; }
.lb-you { background: rgba(81,207,102,0.10); }
.lb-loading, .lb-error { padding: 28px 18px; text-align: center; color: #8b93b5; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.15); border-top-color: #4dabf7;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
