/* NAZAR — arayüz stili
   Cam boncuk paleti: gece laciverti zemin, nazar mavisi ve altın vurgular. */

:root {
  --bg: #080a12;
  --panel: #121a2c;
  --panel2: #1a2540;
  --line: #28344f;
  --ink: #e6ecff;
  --dim: #8496b8;
  --gold: #e8c04a;
  --nazar: #3d7bf0;
  --turkuaz: #22c7d4;
  --red: #e0473f;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#game {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1000px 600px at 50% -10%, #1c2b4d 0%, var(--bg) 62%);
}

.hidden { display: none !important; }

/* ---------- Üst çubuk ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand .logo { font-size: 22px; filter: drop-shadow(0 0 9px rgba(61,123,240,.75)); }
.brand .bTitle {
  font-weight: 800;
  letter-spacing: 4px;
  font-size: 15px;
  background: linear-gradient(180deg, #fff3c9, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats { display: flex; gap: 6px; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; }
.stat {
  min-width: 64px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  text-align: center;
  line-height: 1.15;
}
.stat.wide { min-width: 96px; }
.stat.dim { opacity: .6; }
.stat b { display: block; font-size: 9px; letter-spacing: 1.4px; color: var(--dim); font-weight: 700; }
.stat span { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.wide span { color: var(--gold); }
#chainStat span { color: var(--turkuaz); }

.tools { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.tools button {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  color: var(--ink);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.tools button.wideBtn {
  width: auto;
  padding: 0 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tools button.wideBtn .ico { font-size: 14px; }
.tools button:hover { background: var(--panel2); border-color: var(--nazar); }

/* ---------- Sıra çubuğu ---------- */
#rowBar {
  flex: 0 0 auto;
  height: 5px;
  background: #0b1120;
  border-bottom: 1px solid var(--line);
}
#rowFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--nazar), var(--turkuaz));
  transition: width .18s ease;
}
#rowFill.low { background: linear-gradient(90deg, var(--red), #ff9b3d); }

/* ---------- Arena ---------- */
#arena {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: none;
  cursor: crosshair;
}
#cv { display: block; }

#popups { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute;
  top: 58%;
  font-size: 20px; font-weight: 800;
  color: var(--turkuaz);
  text-shadow: 0 2px 10px #000;
  animation: rise 1s ease-out forwards;
  white-space: nowrap;
}
.pop.big { font-size: 28px; color: var(--gold); }
@keyframes rise {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.85); }
  22% { opacity: 1; transform: translate(-50%, -4px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -54px) scale(1); }
}

/* ---------- Örtüler ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, .82);
  backdrop-filter: blur(3px);
  padding: 16px;
}
#modalBack { position: fixed; z-index: 60; }

.pauseCard {
  font-size: 26px; font-weight: 800; letter-spacing: 5px;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 34px;
  background: var(--panel);
}

/* ---------- Giriş ekranı ---------- */
#titleScreen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(700px 460px at 50% 34%, #1d3160 0%, #080a12 68%);
  padding: 18px;
}
.tBox { text-align: center; max-width: 470px; }
.tLogo {
  font-size: 66px;
  filter: drop-shadow(0 0 28px rgba(61, 123, 240, .8));
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-9px) rotate(5deg); }
}
.tBox h1 {
  margin-top: 6px;
  font-size: 46px; font-weight: 900; letter-spacing: 9px;
  background: linear-gradient(180deg, #fff6d4, var(--gold) 58%, #a8801f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tSub {
  color: var(--turkuaz);
  letter-spacing: 4px; font-size: 12px; font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}
.tBtns { display: flex; flex-direction: column; gap: 9px; margin-top: 26px; }
.tHint { margin-top: 18px; font-size: 11px; color: var(--dim); line-height: 1.8; }

/* ---------- Düğmeler ---------- */
button {
  font-family: inherit;
  font-size: 15px; font-weight: 700;
  padding: 12px 20px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--ink);
  cursor: pointer;
  transition: filter .12s ease, transform .1s ease;
}
button:hover { filter: brightness(1.16); }
button:active { transform: translateY(1px); }
button.primary {
  border-color: var(--gold);
  background: linear-gradient(180deg, #f4d670, #c2941d);
  color: #241c04;
  font-weight: 800;
}
button.ghost { background: transparent; color: var(--dim); }
button.ghost:hover { color: var(--ink); }
button:disabled { opacity: .45; cursor: default; transform: none; filter: none; }

/* ---------- Modal ---------- */
.modal {
  width: min(470px, 100%);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  max-height: 100%;
  overflow-y: auto;
}
.modal h3 {
  font-size: 19px; font-weight: 800; letter-spacing: .6px;
  text-align: center; color: var(--gold);
  margin-bottom: 12px;
}
#modalBody { font-size: 13.5px; line-height: 1.65; color: #c6d3ec; }
#modalBody p + p { margin-top: 8px; }
#modalBody b { color: var(--ink); }
#modalBody .big {
  margin-top: 12px; text-align: center;
  font-size: 30px; font-weight: 900; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
#modalBody .big.good { font-size: 16px; color: var(--turkuaz); }
#modalActions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

/* ---------- Bildirimler ---------- */
#toasts {
  position: fixed;
  left: 50%; top: 72px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(12, 18, 32, .94);
  border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700;
  animation: toastIn .22s ease-out;
}
.toast.good { border-color: var(--turkuaz); color: #c2f2f7; }
.toast.err { border-color: var(--red); color: #ffc7bd; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Küçük ekran ---------- */
@media (max-width: 620px) {
  .brand .bTitle { display: none; }
  #topbar { gap: 8px; padding: 6px 8px; }
  .stat { min-width: 54px; padding: 3px 7px; }
  .stat.wide { min-width: 78px; }
  .stat span { font-size: 15px; }
  .stat.dim { display: none; }
  /* Mobilde S tuşu yok → düğme kalmalı, sadece ikona iner */
  .tools button.wideBtn { width: 34px; padding: 0; justify-content: center; }
  .tools button.wideBtn .lbl { display: none; }
  .tBox h1 { font-size: 34px; letter-spacing: 6px; }
}
