/* SEFER — stil (klasik "Yönet ve Fethet" HUD düzeni: üst bar + ikon rıhtımı) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #10161f;
  color: #e8e2d4;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

#game { height: 100%; display: flex; flex-direction: column; }

/* ---------- ŞEHİR BARI (halat çekme — dolduran kazanır) ---------- */
#cityBar {
  position: relative; height: 14px; display: flex;
  background: #0a0f16;
  border-bottom: 2px solid #000;
}
#cityBar i { display: block; height: 100%; transition: width .35s ease; }
#cityMe  { background: linear-gradient(180deg, #6fd8a8, #2f9e6a); width: 50%; }
#cityFoe { background: linear-gradient(180deg, #e8865f, #b0432c); width: 50%; }
#cityMark {
  position: absolute; top: -2px; bottom: -2px; width: 4px;
  background: #ffe9a8; box-shadow: 0 0 6px #ffe9a8;
  transform: translateX(-2px); transition: left .35s ease;
  left: 50%;
}

/* ---------- HUD BANDI ---------- */
#band {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 26px;
  background: linear-gradient(180deg, #5a1712, #43110d);
  border-bottom: 3px solid #2a0b08;
  flex: 0 0 auto;
}

/* Birim rıhtımı: yuvarlak ikonlar, seçili büyür (orijinaldeki gibi) */
#unitDock, #foeDock { display: flex; gap: 6px; align-items: center; }
#foeDock { margin-left: auto; opacity: .9; }
.dockBtn {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3f6d3a, #24421f);
  border: 2px solid #1a2e16;
  color: #fff; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, border-color .12s;
  flex: 0 0 auto;
}
.dockBtn .sp {
  width: 40px; height: 40px; border-radius: 50%;
  background-size: 900% 100%; background-position: 0 0; background-repeat: no-repeat;
}
.dockBtn .cost {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; color: #ffd86a;
  background: rgba(20,10,6,.9); border-radius: 6px; padding: 0 4px;
  white-space: nowrap;
}
.dockBtn .cd {
  position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(rgba(8,10,14,.78) var(--p, 0%), transparent 0);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  pointer-events: none;
}
.dockBtn.poor { filter: grayscale(.7) brightness(.65); }
.dockBtn.picked {
  transform: scale(1.32) translateY(-4px);
  border-color: #ffd86a;
  box-shadow: 0 0 10px rgba(255, 216, 106, .55);
  z-index: 2;
}
.dockBtn:active { transform: scale(1.15); }
#foeDock .dockBtn { width: 32px; height: 32px; font-size: 14px; border-color: #4a1610; background: radial-gradient(circle at 35% 30%, #6d3a33, #421f1a); }
#foeDock .dockBtn .sp { width: 28px; height: 28px; }
#foeDock .dockBtn.flash { border-color: #ffd86a; transform: scale(1.2); }

/* Seçili birimin adı — orijinaldeki kalın beyaz etiket */
#selName {
  position: absolute; left: 12px; bottom: 3px;
  font-size: 13px; font-weight: 800; color: #fff;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: .5px;
  pointer-events: none;
}
#foeName {
  position: absolute; right: 12px; bottom: 1px;
  font-size: 12px; font-weight: 800; color: #ffd9c9;
  text-shadow: 1px 1px 0 #000;
}

/* Orta: pasta zamanlayıcı + altın/süre */
#mid { display: flex; align-items: center; gap: 8px; margin: 0 6px; }
#pie {
  width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(#20140f var(--p, 0%), var(--acc, #e8c04a) 0);
  border: 3px solid #20140f;
  box-shadow: inset 0 0 6px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
#pie b { font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; }
#pie.ready { animation: piePulse 1s infinite; }
@keyframes piePulse { 50% { box-shadow: 0 0 10px var(--acc, #e8c04a); } }
#chargeBtn {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7a5a22, #4a3410);
  border: 2px solid #20140f; color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
#chargeBtn .cd {
  position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(rgba(8,10,14,.78) var(--p, 0%), transparent 0);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  pointer-events: none;
}
#chargeBtn.ready { animation: piePulse 1.2s infinite; --acc: #ffd86a; }
#chargeBtn.active { border-color: #ffd86a; box-shadow: 0 0 12px #ffd86a; }
#midInfo { display: flex; flex-direction: column; line-height: 1.2; }
#midInfo #goldVal { font-size: 14px; font-weight: 800; color: #ffd86a; }
#midInfo #timeVal { font-size: 11px; color: #e8c6b8; font-variant-numeric: tabular-nums; }

.tools { display: flex; gap: 5px; margin-left: 8px; }
.tools button {
  background: rgba(20,10,6,.5); color: #e8e2d4; border: 1px solid #6b241c;
  border-radius: 8px; width: 30px; height: 30px; font-size: 13px;
}
.tools button:active { transform: scale(.94); }

/* ---------- Arena ---------- */
#arena { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* ---------- Kaplamalar ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 18, .55);
  backdrop-filter: blur(2px);
  padding: 16px;
}
#titleScreen, #modalBack, #kampView, #haritaView { position: fixed; }
#modalBack { z-index: 40; background: rgba(8, 12, 18, .78); }
.panel {
  background: rgba(19, 26, 37, .92); border: 1px solid #33445a; border-radius: 16px;
  padding: 22px 26px; max-width: 620px; width: 100%; max-height: 92%;
  overflow-y: auto; text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
/* Sıcak (ahşap/çadır) tema — cephanelik ve harita paneli */
.panel.sicak, #hPanel.sicak {
  background: linear-gradient(180deg, rgba(46, 32, 20, .96), rgba(32, 21, 13, .96));
  border: 1px solid #8a6a3f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 216, 106, .12);
}
.panel h1 {
  letter-spacing: 6px; font-size: 34px; margin-bottom: 2px;
  background: linear-gradient(180deg, #ffe9a8, #c9a227);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.panel h2 { font-size: 22px; margin-bottom: 8px; }
.panel .sub { color: #8fa1b8; font-size: 13px; margin-bottom: 14px; }
.tLogo { font-size: 42px; margin-bottom: 4px; }

.raceRow { display: flex; gap: 10px; margin: 10px 0 4px; }
.raceCard {
  flex: 1; background: #202c3c; border: 2px solid #33445a; border-radius: 12px;
  padding: 12px 10px; color: #e8e2d4; text-align: center;
}
.raceCard .rIc { font-size: 30px; }
.raceCard .rNm { font-weight: 800; font-size: 15px; margin: 3px 0; }
.raceCard .rDs { font-size: 11px; color: #aebccd; line-height: 1.35; }
.raceCard.picked { border-color: var(--acc, #e8c04a); box-shadow: 0 0 12px -4px var(--acc, #e8c04a); }

.lvRow { display: flex; gap: 8px; margin: 8px 0 14px; }
.lvBtn {
  flex: 1; background: #202c3c; border: 2px solid #33445a; border-radius: 10px;
  padding: 8px 6px; color: #e8e2d4;
}
.lvBtn .lNm { font-weight: 800; font-size: 14px; }
.lvBtn .lDs { font-size: 10px; color: #8fa1b8; margin-top: 2px; line-height: 1.3; }
.lvBtn.picked { border-color: #e8c04a; }

.primary {
  background: linear-gradient(180deg, #e8c04a, #c9a227); color: #241c05;
  border: none; border-radius: 10px; padding: 12px 26px;
  font-size: 16px; font-weight: 800; letter-spacing: 1px;
}
.ghost {
  background: none; border: 1px solid #33445a; color: #aebccd;
  border-radius: 10px; padding: 10px 18px; font-size: 13px;
}
.btnRow { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.tHint { margin-top: 12px; font-size: 11px; color: #667a92; }

.cycle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: #aebccd; flex-wrap: wrap;
  background: #131b26; padding: 8px 10px; border-radius: 10px; margin: 10px 0;
}
.cycle b { color: #e8e2d4; }

/* Kampanya: cephanelik listesi (sıcak tema) */
#kampList { margin: 10px 0 4px; max-height: 46vh; overflow-y: auto; }
.kampRow {
  display: flex; align-items: center; gap: 8px;
  background: rgba(58, 42, 26, .8); border: 1px solid #6b512e; border-radius: 10px;
  padding: 6px 10px; margin-bottom: 6px; text-align: left;
}
.kampRow .kIc { font-size: 20px; width: 40px; text-align: center; flex: 0 0 auto; }
.kampRow .kIc .sp {
  display: block; width: 38px; height: 38px; border-radius: 50%;
  background-size: 900% 100%; background-position: 0 0; background-repeat: no-repeat;
  background-color: rgba(20, 12, 6, .5); border: 1px solid #8a6a3f;
}
.kampRow .kAd { flex: 1; min-width: 0; }
.kampRow .kAd b { font-size: 13px; display: block; }
.kampRow .kAd span { font-size: 10px; color: #8fa1b8; }
.kampRow .kYildiz { color: #e8c04a; font-size: 12px; letter-spacing: 1px; min-width: 40px; }
.kampRow.kilitli { opacity: .75; }
.kampRow button {
  background: linear-gradient(180deg, #c9a227, #8a6a1a); color: #241c05;
  border: 1px solid #e8c04a; border-radius: 8px;
  padding: 5px 10px; font-size: 11px; font-weight: 800; white-space: nowrap;
}
.kampRow button.pahali { filter: grayscale(.7) brightness(.7); }
.kampRow .tamam { color: #5fce74; font-size: 11px; font-weight: 800; }

/* Rıhtım kademe yıldızları */
.dockBtn .kd {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 8px; color: #ffd86a; text-shadow: 0 0 2px #000;
  white-space: nowrap; pointer-events: none;
}

/* Sonuç ekranı ödül dökümü */
.odulKutu {
  background: #131b26; border: 1px solid #33445a; border-radius: 10px;
  padding: 8px 14px; margin: 10px auto 0; font-size: 13px; max-width: 340px;
}
.odulKutu .satir { display: flex; justify-content: space-between; margin: 2px 0; color: #cfd8e4; }
.odulKutu .satir.top { border-top: 1px solid #33445a; padding-top: 4px; font-weight: 800; color: #ffd86a; }

.endStats { display: flex; justify-content: center; gap: 22px; margin: 12px 0; }
.endStats .es { display: flex; flex-direction: column; }
.endStats .es b { font-size: 20px; font-weight: 800; }
.endStats .es span { font-size: 10px; color: #8fa1b8; letter-spacing: 1px; }

.howList { text-align: left; font-size: 13px; line-height: 1.5; color: #cfd8e4; }
.howList li { margin: 6px 0 6px 18px; }

.pauseCard { font-size: 26px; font-weight: 800; letter-spacing: 6px; color: #cfd8e4; }

#toasts {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(23, 32, 44, .95); border: 1px solid #33445a; color: #e8e2d4;
  border-radius: 8px; padding: 6px 14px; font-size: 13px;
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* ---------- Feyra haritası ---------- */
#haritaKutu {
  display: flex; gap: 12px; width: 100%; height: 100%;
  max-width: 1400px; max-height: 780px; align-items: stretch;
}
#hcvWrap {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  background: #0d2033; border: 2px solid #8a6a3f; border-radius: 14px;
  overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
}
#hcv { width: 100%; height: 100%; object-fit: contain; cursor: pointer; display: block; }
#hPanel {
  flex: 0 0 270px; border-radius: 14px; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
#hPanel h3 { font-size: 18px; color: #ffe9a8; letter-spacing: 1px; }
#hBilgi { font-size: 12px; line-height: 1.55; color: #e8d7bd; text-align: left; flex: 1; }
#hBilgi .satir { margin: 5px 0; padding-left: 2px; }
#hBilgi b { color: #ffe9a8; }
#hOzet { font-size: 11px; color: #b89c72; }
#hSaldir:disabled { filter: grayscale(.8); opacity: .5; cursor: default; }

@media (max-width: 820px) {
  #haritaKutu { flex-direction: column; }
  #hPanel { flex: 0 0 auto; max-height: 40%; }
}

/* Dar ekran */
@media (max-width: 700px) {
  .dockBtn { width: 38px; height: 38px; font-size: 16px; }
  .dockBtn .sp { width: 32px; height: 32px; }
  #foeDock .dockBtn { width: 24px; height: 24px; font-size: 11px; }
  #foeDock .dockBtn .sp { width: 20px; height: 20px; }
  #pie { width: 38px; height: 38px; }
  #selName { font-size: 11px; }
  #foeName { display: none; }
  .panel { padding: 16px 14px; }
  .raceRow { flex-direction: column; }
}
