/* ============================================
   Eğim — Oyun Stilleri
   ============================================ */

.eg-wrap {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 800 / 500;
  background: #02000a;
  border-radius: 18px;
  box-shadow:
    0 0 0 2px rgba(0, 255, 208, 0.5),
    0 0 40px rgba(255, 42, 138, 0.45),
    0 20px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
}

.eg-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.eg-ui-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eg-ui-layer > * { pointer-events: auto; }

/* ---- HUD ---- */
.eg-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  font-family: 'Comic Sans MS', 'Baloo', system-ui, sans-serif;
}

.eg-hud-box {
  background: rgba(10, 0, 30, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(0, 255, 208, 0.55);
  border-radius: 10px;
  padding: 6px 12px;
  color: #e0fffa;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow:
    inset 0 0 8px rgba(0, 255, 208, 0.15),
    0 0 16px rgba(0, 255, 208, 0.35);
  text-shadow: 0 0 8px rgba(0, 255, 208, 0.6);
}

.eg-hud-box span:not(.eg-hud-label) {
  color: #00ffd0;
  font-variant-numeric: tabular-nums;
}

.eg-hud-label {
  font-size: 11px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.eg-score, .eg-dist, .eg-best { margin-left: auto; }
.eg-dist, .eg-best { margin-left: 0; }

.eg-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 0, 30, 0.8);
  color: #ff2a8a;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Orbitron', 'Arial Black', system-ui, sans-serif;
  border: 1px solid rgba(255, 42, 138, 0.5);
  box-shadow: 0 0 14px rgba(255, 42, 138, 0.4);
  text-shadow: 0 0 6px rgba(255, 42, 138, 0.7);
  white-space: nowrap;
  pointer-events: none;
}

/* ---- Mobil ---- */
.eg-mobile {
  position: absolute;
  bottom: 60px;
  left: 12px;
  right: 12px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.eg-mbtn {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(10, 0, 30, 0.7);
  border: 2px solid rgba(0, 255, 208, 0.7);
  color: #00ffd0;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(0, 255, 208, 0.4), inset 0 0 10px rgba(0, 255, 208, 0.15);
  text-shadow: 0 0 10px rgba(0, 255, 208, 0.8);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.eg-mbtn:active { background: rgba(0, 255, 208, 0.25); transform: scale(0.95); box-shadow: 0 0 24px rgba(0, 255, 208, 0.7); }
.eg-mjump { margin: 0 auto; }

@media (pointer: coarse), (hover: none), (max-width: 820px) {
  .eg-mobile { display: flex; }
  .eg-hint { display: none; }
}

@media (orientation: landscape) and (max-width: 820px) {
  .eg-mobile { bottom: 20px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
}

@media (max-width: 420px) {
  .eg-mbtn { width: 54px; height: 54px; font-size: 20px; border-radius: 12px; }
  .eg-hud-box { padding: 4px 8px; font-size: 12px; }
  .eg-hud-label { font-size: 9px; }
  .eg-mobile { bottom: 40px; }
}

/* ---- Modal ---- */
.eg-modal {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 20, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: egFadeIn 0.3s ease;
}
@keyframes egFadeIn { from { opacity: 0; } to { opacity: 1; } }

.eg-modal-card {
  background: linear-gradient(145deg, #10002a 0%, #1a003a 60%, #2a0048 100%);
  border: 2px solid rgba(0, 255, 208, 0.45);
  border-radius: 14px;
  padding: 24px 28px;
  min-width: 320px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  box-shadow:
    0 0 40px rgba(255, 42, 138, 0.4),
    0 0 0 1px rgba(0, 255, 208, 0.3) inset,
    0 25px 80px rgba(0,0,0,0.8);
  color: #e0fffa;
  font-family: 'Orbitron', 'Arial Black', system-ui, sans-serif;
}

.eg-gameover-title {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ff2a8a;
  text-shadow:
    0 0 12px rgba(255, 42, 138, 0.9),
    0 0 24px rgba(255, 42, 138, 0.5);
}

.eg-gameover-score {
  background: rgba(10, 5, 25, 0.5);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.eg-go-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.eg-go-row:last-child { border-bottom: none; }
.eg-go-row b {
  color: #00ffd0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(0, 255, 208, 0.7);
}

.eg-gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eg-btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
  font-family: inherit;
}
.eg-btn:hover { transform: translateY(-2px); }
.eg-btn:active { transform: translateY(0); }
.eg-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.eg-btn-primary {
  background: linear-gradient(135deg, #ff2a8a, #a00060);
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(255, 42, 138, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 0 8px rgba(255, 42, 138, 0.8);
}
.eg-btn-secondary {
  background: rgba(10, 0, 30, 0.6);
  color: #e0fffa;
  border: 1.5px solid rgba(0, 255, 208, 0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: inset 0 0 12px rgba(0, 255, 208, 0.1);
}
.eg-btn-accent {
  background: linear-gradient(135deg, #00ffd0, #00a080);
  color: #05010f;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(0, 255, 208, 0.6);
}
.eg-btn-ghost {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 14px;
  font-size: 13px;
}

/* ---- Save & Leaderboard ---- */
.eg-save-area { margin-top: 14px; }
.eg-save-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.eg-save-form input {
  flex: 1;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid rgba(0, 255, 208, 0.45);
  background: rgba(5, 0, 15, 0.7);
  color: #e0fffa;
  font-size: 15px;
  letter-spacing: 1px;
  font-family: 'Orbitron', 'Arial Black', system-ui, sans-serif;
  box-shadow: inset 0 0 10px rgba(0, 255, 208, 0.1);
}
.eg-save-form input:focus {
  outline: none;
  border-color: #00ffd0;
  box-shadow: 0 0 14px rgba(0, 255, 208, 0.5), inset 0 0 10px rgba(0, 255, 208, 0.2);
}
.eg-shake { animation: egShake 0.4s ease; }
@keyframes egShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.eg-save-ok { color: #2ecc71; font-weight: 700; text-align: center; padding: 8px; }
.eg-error { color: #ff6a6a; font-weight: 700; text-align: center; padding: 8px; }

.eg-leaderboard-area { margin-top: 16px; }
.eg-lb-loading { text-align: center; padding: 14px; color: #ffd54a; }
.eg-lb-title {
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #00ffd0;
  text-shadow: 0 0 10px rgba(0, 255, 208, 0.6);
}
.eg-lb-table {
  background: rgba(10, 5, 25, 0.5);
  border-radius: 10px;
  overflow: hidden;
}
.eg-lb-head, .eg-lb-row {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  padding: 8px 12px;
  align-items: center;
  font-size: 14px;
}
.eg-lb-head {
  background: rgba(255, 42, 138, 0.18);
  font-weight: 800;
  color: #ff2a8a;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.eg-lb-row { border-bottom: 1px solid rgba(255,255,255,0.06); }
.eg-lb-row:last-child { border-bottom: none; }
.eg-lb-row.eg-lb-me {
  background: linear-gradient(90deg, rgba(0, 255, 208, 0.15), rgba(255, 42, 138, 0.15));
  font-weight: 800;
  box-shadow: inset 0 0 12px rgba(0, 255, 208, 0.1);
}
.eg-lb-rank { color: #ff2a8a; font-weight: 800; }
.eg-lb-score { text-align: right; color: #00ffd0; font-weight: 800; font-variant-numeric: tabular-nums; }
.eg-lb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
}
.eg-lb-pageinfo { color: rgba(255,255,255,0.7); font-size: 12px; }
.eg-lb-out {
  text-align: center;
  padding: 18px;
  background: rgba(10, 5, 25, 0.5);
  border-radius: 12px;
}
.eg-lb-rank-big {
  font-size: 56px;
  font-weight: 900;
  color: #00ffd0;
  margin: 10px 0;
  letter-spacing: 4px;
  text-shadow:
    0 0 14px rgba(0, 255, 208, 0.9),
    0 0 28px rgba(0, 255, 208, 0.4);
}
.eg-lb-msg { color: rgba(255,255,255,0.8); font-size: 13px; }
