/* ================= MOBİL UYUM =================
   style.css'ten sonra yüklenir; masaüstü görünümü değişmez. */

/* Mobil tarayıcı çubuğu dahil gerçek ekran yüksekliği */
#game-shell {
  height: 100vh;
  height: 100dvh;
  touch-action: manipulation;
}
#game-canvas, #touch-controls, .tc-btn { touch-action: none; }

/* Menü/kart içinde parmakla kaydırma */
.overlay, .menu-card, .lb-list, #lb-overlay .lb-card {
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.menu-card { max-height: calc(100dvh - 20px); }

/* iOS: isim kutusuna yazılabilsin */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* Dokunmatik cihazda klavye ipuçları gereksiz */
@media (hover: none) and (pointer: coarse) {
  .btn-primary small { display: none; }
  .controls-grid { display: none; }
  .cta-row { margin-bottom: 0; }
}

@media (max-width: 600px) {
  .overlay { padding: 10px; }
  .menu-card { padding: 16px 14px; border-radius: 20px; }

  /* ---------- Ana menü ---------- */
  .badge-row { display: none; }
  .game-title { font-size: clamp(34px, 11.5vw, 46px); margin-bottom: 10px; }
  .game-title .subtitle { font-size: 10.5px; letter-spacing: 1.6px; margin-top: 6px; }
  .char-section { margin-bottom: 10px; }
  .char-label { margin-bottom: 6px; }
  .char-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
  .char-card { padding: 8px 4px; border-radius: 12px; gap: 2px; }
  .char-emoji { font-size: 20px; }
  .char-card strong { font-size: 12.5px; line-height: 1.1; }
  .char-card small { font-size: 9px; line-height: 1.2; }
  .best-strip { margin-bottom: 12px; padding: 7px 10px; gap: 12px; font-size: 12px; }
  .best-strip strong { font-size: 16px; }
  #screen-start .cta-row { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 0; }
  #btn-start { width: 100%; font-size: 22px; padding: 14px 16px; }
  .lb-open-btn { width: 100%; margin-top: 0; font-size: 18px; padding: 11px 14px; }
  .controls-grid { margin-top: 12px; }

  /* ---------- Oyun içi HUD ---------- */
  #hud { padding: 8px; gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); }
  .hud-left, .hud-right, .hud-center { gap: 5px; min-width: 0; }
  .score-card { min-width: 0; padding: 6px 10px; border-radius: 12px; }
  .score-label { font-size: 10px; letter-spacing: 1px; }
  .score-value { font-size: 24px !important; }
  .sub-stats { gap: 4px; font-size: 11px; flex-wrap: wrap; }
  .mult-badge, .speed-badge { font-size: 10px; padding: 1px 5px; }
  .zone-pill { font-size: 9.5px; padding: 3px 8px; letter-spacing: .4px; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hud-center { max-width: none; flex: 1 1 0; }
  .fever-wrap { padding: 5px 8px; border-radius: 11px; }
  .fever-top { font-size: 9.5px; letter-spacing: .5px; margin-bottom: 4px; gap: 4px; }
  .pill-counter { font-size: 17px !important; padding: 3px 9px !important; border-radius: 11px; gap: 4px; }
  .hud-buttons { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  #touch-controls { bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; right: 12px; }

  /* ---------- Ölüm ekranı ---------- */
  .gameover-overlay { gap: 6px; padding: 8px 10px; justify-content: center; }
  .meme-top-tag { font-size: 9px; letter-spacing: 1.5px; padding: 2px 9px; margin-bottom: 2px; }
  .meme-headline { font-size: clamp(26px, 8.6vw, 36px); letter-spacing: 1px; }
  .meme-subline { font-size: clamp(15px, 4.8vw, 20px); margin-top: 2px; }
  .gameover-card { padding: 12px 12px 14px; width: min(490px, 96vw); }
  .go-cause { font-size: 13px; margin-bottom: 6px; }
  .new-record { font-size: 11px; padding: 3px 10px; margin-bottom: 8px; }
  .go-stats-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 5px; margin-bottom: 10px; }
  .stat-box { padding: 6px 2px; gap: 1px; border-radius: 10px; }
  .st-lbl { font-size: 8.5px; letter-spacing: .6px; }
  .stat-box strong { font-size: 18px; }
  .lb-save { margin: 0 0 10px; padding: 9px 10px; border-radius: 12px; }
  .lb-save-label { font-size: 14px; margin-bottom: 6px; }
  .lb-save-row input { padding: 10px 12px; font-size: 16px; border-radius: 10px; }
  .lb-save-row .btn-secondary { font-size: 15px !important; padding: 8px 12px !important; border-radius: 10px; }
  .lb-status { font-size: 12.5px; margin-top: 6px; min-height: 0; }
  .lb-status:empty { display: none; }
  .lb-status strong { font-size: 18px; }
  #screen-gameover .cta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 0; }
  #btn-retry { grid-column: 1 / -1; font-size: 22px; padding: 12px 10px; }
  #screen-gameover .cta-row .btn-story,
  #screen-gameover .cta-row .btn-secondary,
  #screen-gameover .cta-row .btn-ghost {
    font-size: 13px; letter-spacing: .3px; padding: 10px 4px; border-radius: 12px; min-width: 0; white-space: nowrap;
  }
  .story-preview img { max-height: 46dvh; }

  /* ---------- Duraklat ---------- */
  .overlay-heading { font-size: 32px; }
}

/* Kısa ekranlar (yatay telefon / küçük cihaz) */
@media (max-width: 600px) and (max-height: 640px) {
  .meme-subline { display: none; }
  .meme-headline { font-size: 26px; }
  .new-record { margin-bottom: 6px; }
  .game-title { font-size: 32px; }
  .char-card small { display: none; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .viral-meme-banner { display: none; }
  .go-stats-grid { margin-bottom: 6px; }
  .menu-card { padding: 10px 14px; }
  .badge-row, .char-card small, .controls-grid { display: none; }
}
