/* —— Kale yükseltme ekranı —— */
.kc {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #071426;
  color: #f7f1e4;
  font-family: var(--font);
  user-select: none;
}
.kc button { -webkit-tap-highlight-color: transparent; }
.kc svg { display: block; flex-shrink: 0; }

.kc-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
  padding:
    calc(8px + env(safe-area-inset-top, 0px))
    10px
    8px;
  background: #0a1628;
  border-bottom: 1px solid rgba(246, 196, 69, 0.22);
}
.kc-top h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.kc-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #f6c445;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.kc-icon-btn svg { width: 22px; height: 22px; }
.kc-icon-btn:active { transform: scale(0.95); }

.kc-hero {
  position: relative;
  flex: 0 0 auto;
  height: clamp(190px, 33dvh, 280px);
  overflow: hidden;
  background: #6eb6e6;
}
.kc-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 36%;
  opacity: 1;
  pointer-events: none;
}
.kc-hero .hh-bgvid { object-position: center 36%; }
.kc-hero-fg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
}
.kc-lv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 12px;
  background: rgba(8, 18, 36, 0.88);
  border: 1.5px solid rgba(232, 197, 107, 0.85);
  font-weight: 900;
  font-size: clamp(14px, 3.8vw, 17px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.kc-lv i {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.kc-lv svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 3px rgba(124, 255, 154, 0.55));
}

.kc-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 8px;
}
.kc-sec {
  margin: 4px 0 8px;
  color: #f6c445;
  font-size: clamp(13px, 3.5vw, 15px);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.kc-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.kc-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(12, 24, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.kc-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-style: normal;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.kc-ico svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.kc-name {
  min-width: 0;
  font-weight: 800;
  font-size: clamp(12px, 3.3vw, 14px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kc-vals {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: clamp(12px, 3.2vw, 14px);
  white-space: nowrap;
}
.kc-vals b { color: #fff; font-weight: 800; }
.kc-vals em {
  font-style: normal;
  color: #3ddc6e;
  font-weight: 900;
}
.kc-arr {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-style: normal;
  filter: drop-shadow(0 0 3px rgba(124, 255, 154, 0.55));
}
.kc-arr svg { width: 16px; height: 16px; }

.kc-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.kc-res {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 10px 6px 8px;
  border-radius: 14px;
  background: rgba(12, 24, 40, 0.92);
  border: 1.5px solid rgba(232, 197, 107, 0.45);
  text-align: center;
}
.kc-res.need { border-color: rgba(224, 106, 88, 0.7); }
.kc-res.ok { border-color: rgba(61, 220, 110, 0.45); }
.kc-res i,
.kc-res-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.kc-res svg { width: 26px; height: 26px; }
.kc-res-art,
.kc-res img.kc-res-art {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}
.kc-res strong {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.kc-res.ok strong { color: #b8ffce; }
.kc-res.need strong { color: #ffb4a8; }
.kc-res span {
  font-size: 10px;
  font-weight: 800;
  color: #c5d0bf;
}

.kc-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 6px;
  color: #e8eef6;
  font-weight: 800;
  font-size: clamp(12px, 3.3vw, 14px);
}
.kc-time svg { width: 16px; height: 16px; }
.kc-time.is-build { color: #ffe56a; }
.kc-time.is-max { color: #9fe870; }
.kc-lv.is-max {
  background: linear-gradient(180deg, rgba(61, 220, 110, 0.25), rgba(20, 60, 40, 0.85));
  border-color: rgba(61, 220, 110, 0.45);
}
.kc-lv.is-build {
  background: linear-gradient(180deg, rgba(246, 196, 69, 0.28), rgba(60, 40, 10, 0.85));
  border-color: rgba(246, 196, 69, 0.5);
}
.kc-buildbar {
  height: 10px;
  margin: 0 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.kc-buildbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c47d08, #f0a000 45%, #ffe56a);
  box-shadow: 0 0 8px rgba(246, 196, 69, 0.4);
  transition: width 0.35s linear;
}

.kc-foot {
  flex: 0 0 auto;
  padding: 8px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(7, 20, 38, 0.95) 30%);
}
.kc-up {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 900;
  font-size: clamp(17px, 4.8vw, 22px);
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 70, 20, 0.45);
  background: linear-gradient(180deg, #6dff8f 0%, #2fdc63 48%, #18b84a 100%);
  box-shadow:
    0 4px 0 #0e8a34,
    0 8px 16px rgba(0, 0, 0, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.kc-up:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0e8a34, 0 4px 10px rgba(0, 0, 0, 0.28);
}
.kc-up.off,
.kc-up:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

@media (max-height: 640px) {
  .kc-hero { height: clamp(132px, 24dvh, 170px); }
  .kc-row { min-height: 36px; padding: 4px 8px; }
  .kc-up { min-height: 46px; font-size: 16px; }
}
@media (max-width: 360px) {
  .kc-resources { gap: 6px; }
  .kc-res { padding: 8px 4px 6px; }
}

/* —— Kale bilgi paneli —— */
.kc-info {
  position: relative;
  padding-top: 2px;
}
.kc-info-x {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: rgba(247, 241, 228, 0.75);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.kc-info-x:active { transform: scale(0.94); }
.kc-info-hero {
  position: relative;
  height: 120px;
  margin: 0 0 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(246, 196, 69, 0.28);
  background: #0a1628;
}
.kc-info-hero img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 40%;
}
.kc-info-hero-fg {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, transparent 20%, rgba(4, 12, 24, 0.88) 100%);
  text-align: center;
}
.kc-info-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #f6c445;
}
.kc-info-hero-fg h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}
.kc-info-pill {
  display: inline-flex;
  margin-top: 2px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.kc-info-pill.is-ready {
  color: #8dffb0;
  background: rgba(61, 220, 110, 0.14);
  border-color: rgba(61, 220, 110, 0.4);
}
.kc-info-pill.is-build {
  color: #ffe56a;
  background: rgba(246, 196, 69, 0.14);
  border-color: rgba(246, 196, 69, 0.4);
}
.kc-info-pill.is-max {
  color: #9fe870;
  background: rgba(61, 220, 110, 0.12);
  border-color: rgba(61, 220, 110, 0.35);
}
.kc-info-lv {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.kc-info-lv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.kc-info-lv-top strong {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}
.kc-info-lv-top em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
}
.kc-info-lv-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.kc-info-lv-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c47d08, #f0a000, #ffe56a);
}
.kc-info-blurb {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: rgba(247, 241, 228, 0.7);
}
.kc-info-block {
  margin: 0 0 12px;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.kc-info-block h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 196, 69, 0.9);
}
.kc-info-block.is-max-note p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(247, 241, 228, 0.72);
}
.kc-info-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
}
.kc-info-stat:last-child { border-bottom: 0; }
.kc-info-stat strong { color: #fff; font-weight: 900; }
.kc-info-vals {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.kc-info-vals i {
  font-style: normal;
  color: #7CFF9A;
  font-weight: 900;
  text-shadow: 0 0 4px rgba(124, 255, 154, 0.45);
}
.kc-info-vals em {
  font-style: normal;
  font-weight: 900;
  color: #c5d4e8;
}
.kc-info-vals b {
  font-size: 11px;
  font-weight: 900;
  color: #3ddc6e;
  background: rgba(61, 220, 110, 0.14);
  border: 1px solid rgba(61, 220, 110, 0.35);
  border-radius: 999px;
  padding: 1px 6px;
}
.kc-info-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
}
.kc-info-meta:last-child { border-bottom: 0; }
.kc-info-meta span:first-child { color: rgba(247, 241, 228, 0.65); }
.kc-info-meta strong { color: #ffe56a; font-weight: 900; }
.kc-info-cost .rw { color: #9fe870; font-size: 13px; }
.kc-info-cost .rw-ico,
.kc-info-cost img.rw-ico {
  width: 16px;
  height: 16px;
}
.kc-info-ok { margin-top: 4px; }

/* —— İnşa başladı / bitti modal —— */
.modal-card:has(.kc-build-modal) {
  padding: 0;
  overflow: hidden;
  border-radius: 20px 20px 16px 16px;
}
.kc-build-modal { color: var(--cream, #f7f1e4); }
.kc-build-hero {
  position: relative;
  height: 148px;
  overflow: hidden;
}
.kc-build-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(1.15) brightness(1.05);
}
.kc-build-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 20, 38, 0.15) 0%, rgba(7, 20, 38, 0.55) 55%, #0d1826 100%),
    radial-gradient(ellipse at 50% 30%, rgba(246, 196, 69, 0.18), transparent 60%);
}
.kc-build-badge {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 1;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #3a2608;
  background: linear-gradient(180deg, #ffe56a, #f0a000);
  border: 1px solid rgba(255, 220, 120, 0.55);
  box-shadow: 0 3px 0 #c47d08;
}
.kc-build-badge.is-ok {
  color: #103018;
  background: linear-gradient(180deg, #7dff9a, #3ddc6e);
  border-color: rgba(180, 255, 200, 0.45);
  box-shadow: 0 3px 0 #1a7a48;
}
.kc-build-body {
  padding: 14px 16px 16px;
  text-align: center;
}
.kc-build-kicker {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #f6c445;
}
.kc-build-body h2 {
  margin: 4px 0 12px;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
}
.kc-build-lv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 12px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(246, 196, 69, 0.3);
}
.kc-build-lv span {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}
.kc-build-lv.is-solo span {
  color: #9fe870;
  font-size: 22px;
}
.kc-build-arr {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.kc-build-arr svg { width: 16px; height: 16px; }
.kc-build-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 18, 36, 0.85);
  border: 1px solid rgba(120, 170, 230, 0.28);
  text-align: left;
}
.kc-build-time > svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.kc-build-time em {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
}
.kc-build-time strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #7ec8ff;
}
.kc-build-note {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  color: rgba(247, 241, 228, 0.65);
}
.kc-build-modal.is-done .kc-build-veil {
  background:
    linear-gradient(180deg, rgba(7, 20, 38, 0.12) 0%, rgba(7, 20, 38, 0.5) 55%, #0d1826 100%),
    radial-gradient(ellipse at 50% 30%, rgba(61, 220, 110, 0.22), transparent 60%);
}
