/* ŞAHMERAN — arayüz stili
   Koyu mücevher paleti: gece mavisi zemin, altın ve zümrüt vurgular.
   Tipografi ve geometri odaklı — görsel varlık gerektirmez. */

:root {
  --bg: #070b0f;
  --bg2: #0c151c;
  --panel: #101c25;
  --panel2: #162833;
  --line: #23404c;
  --ink: #dfeef2;
  --dim: #7d99a3;
  --gold: #e8c04a;
  --emerald: #2fa383;
  --cyan: #7ef0ff;
  --red: #e0533f;
  --violet: #b06bff;
  --r1: #6e8b96;
  --r2: #4aa3d8;
  --r3: #e8c04a;
}

* { 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(1100px 620px at 50% -12%, #16303a 0%, var(--bg) 62%);
}

.hidden { display: none !important; }

/* ---------- Üst çubuk ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  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 8px rgba(47,163,131,.6)); }
.brand .bTitle {
  font-weight: 800;
  letter-spacing: 3px;
  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: 62px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .28);
  text-align: center;
  line-height: 1.15;
}
.stat.wide { min-width: 92px; }
.stat.dim { opacity: .62; }
.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:nth-child(2) span { color: var(--gold); }
.stat:nth-child(3) span { color: var(--emerald); }

.tools { display: flex; gap: 6px; flex: 0 0 auto; }
.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;
}
.tools button:hover { background: var(--panel2); border-color: var(--emerald); }

/* ---------- Zaman çubuğu ---------- */
#timeBar {
  position: relative;
  flex: 0 0 auto;
  height: 20px;
  background: #0a1319;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
#timeFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(47, 163, 131, .5), rgba(126, 240, 255, .38));
  transition: width .12s linear;
}
#timeFill.low { background: linear-gradient(90deg, rgba(224, 83, 63, .6), rgba(255, 155, 61, .45)); }
#timeVal, #threatRow {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  padding-left: 12px;
  text-shadow: 0 1px 3px #000;
}
#threatRow { margin-left: auto; padding-right: 14px; color: var(--red); }

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

#popups {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.pop {
  position: absolute;
  top: 62%;
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan);
  text-shadow: 0 2px 10px #000;
  animation: rise 1s ease-out forwards;
  white-space: nowrap;
}
.pop.big { font-size: 28px; color: var(--gold); }
.pop.warn { color: var(--red); }
@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%, -52px) scale(1); }
}

/* ---------- Yetenekler ---------- */
#abilityBar {
  position: absolute;
  left: 12px; bottom: 12px;
  display: flex;
  gap: 8px;
}
#abilityBar button {
  width: 50px; height: 50px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: rgba(8, 14, 19, .8);
  color: var(--dim);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
#abilityBar button.ready {
  border-color: var(--cyan);
  color: var(--ink);
  box-shadow: 0 0 16px rgba(126, 240, 255, .32);
}

/* ---------- Mobil yön pedi ---------- */
#dpad {
  position: absolute;
  right: 10px; bottom: 10px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: .55;
}
#dpad .dRow { display: flex; gap: 46px; }
#dpad button {
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 19, .72);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
@media (pointer: coarse) { #dpad { display: flex; } }

/* ---------- Örtüler ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 11, .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);
}

/* ---------- Yükseltme seçimi ---------- */
.upBox {
  width: min(880px, 100%);
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
}
.upBox h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold);
}
.upBox p { color: var(--dim); font-size: 13px; margin-top: 4px; }
.upBonus {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}

#upCards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 620px) { #upCards { grid-template-columns: 1fr; } }

.upCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 14px 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  font-family: inherit;
}
.upCard:hover { transform: translateY(-4px); }
.upCard.r1 { border-color: var(--r1); }
.upCard.r2 { border-color: var(--r2); }
.upCard.r3 { border-color: var(--r3); }
.upCard.r1:hover { box-shadow: 0 8px 24px rgba(110, 139, 150, .3); }
.upCard.r2:hover { box-shadow: 0 8px 26px rgba(74, 163, 216, .34); }
.upCard.r3:hover { box-shadow: 0 8px 30px rgba(232, 192, 74, .38); }

.uRar {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dim);
}
.upCard.r2 .uRar { color: var(--r2); }
.upCard.r3 .uRar { color: var(--r3); }
.uIco { font-size: 34px; line-height: 1; }
.uName { font-size: 16px; font-weight: 800; letter-spacing: .4px; }
.uLvl {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold);
  border: 1px solid rgba(232, 192, 74, .4);
  border-radius: 999px;
  padding: 1px 8px;
}
.uDesc { font-size: 12.5px; line-height: 1.45; color: var(--dim); }

/* ---------- Giriş ekranı ---------- */
#titleScreen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(720px 460px at 50% 34%, #16323d 0%, #070b0f 68%);
  padding: 18px;
}
.tBox { text-align: center; max-width: 460px; }
.tLogo {
  font-size: 66px;
  filter: drop-shadow(0 0 26px rgba(47, 163, 131, .65));
  animation: sway 3.4s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
.tBox h1 {
  margin-top: 6px;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 7px;
  background: linear-gradient(180deg, #fff6d4, var(--gold) 58%, #a8801f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tSub {
  color: var(--emerald);
  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.7; }

/* ---------- 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(460px, 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);
}
.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: #c3d6dc; }
#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(--emerald); }
#modalActions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

/* ---------- Bildirimler ---------- */
#toasts {
  position: fixed;
  left: 50%;
  top: 76px;
  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(10, 18, 24, .94);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  animation: toastIn .22s ease-out;
}
.toast.good { border-color: var(--emerald); color: #b9f0dd; }
.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: 560px) {
  .brand .bTitle { display: none; }
  #topbar { gap: 8px; padding: 6px 8px; }
  .stat { min-width: 52px; padding: 3px 7px; }
  .stat.wide { min-width: 74px; }
  .stat span { font-size: 15px; }
  .stat.dim { display: none; }
  .tBox h1 { font-size: 34px; letter-spacing: 5px; }
}
