/* Karakter — oyun UI diliyle uyumlu, sıfırdan */
.ch {
  --navy: #071426;
  --panel: #0a1628;
  --yellow: #ffc107;
  --gold: #f6c445;
  --cream: #f7f1e4;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font);
  user-select: none;
}
.ch button { -webkit-tap-highlight-color: transparent; }
.ch svg { display: block; flex-shrink: 0; }

.ch-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: var(--panel);
  border-bottom: 1px solid rgba(246, 196, 69, 0.22);
  z-index: 3;
}
.ch-top h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.ch-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ch-icon-btn svg { width: 22px; height: 22px; }
.ch-icon-btn:active { transform: scale(0.95); }
.ch-pad { width: 40px; height: 40px; }

/* —— Sahne —— */
.ch-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 78px 1fr 78px;
  gap: 4px;
  align-items: stretch;
  padding: 10px 8px 8px;
  overflow: hidden;
}
.ch-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.08) brightness(0.78) contrast(1.04);
  pointer-events: none;
  z-index: 0;
}
.ch-stage-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18, 28, 48, 0.35) 0%, transparent 28%, transparent 52%, rgba(10, 18, 32, 0.88) 100%),
    radial-gradient(65% 55% at 50% 38%, transparent 40%, rgba(12, 20, 36, 0.42) 100%);
}

.ch-col {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1.1dvh, 8px);
  align-items: center;
  padding-bottom: 8px;
}

.ch-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}
/* Karakter slot — çanta ile aynı Background kare dili */
.ch-slot-frame {
  position: relative;
  width: clamp(48px, 13vw, 60px);
  height: clamp(48px, 13vw, 60px);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.05), transparent 58%),
    linear-gradient(165deg, #141c2a 0%, #070b12 100%);
  border: 1.5px solid rgba(160, 175, 200, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 12px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* boş slot */
.ch-slot.rarity-empty .ch-slot-frame {
  border-color: rgba(255, 255, 255, 0.18);
  border-style: dashed;
  background: rgba(8, 12, 20, 0.55);
  box-shadow: none;
  opacity: 0.85;
}
.ch-slot.rarity-common .ch-slot-frame {
  border-color: #8fa0b8;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 6px rgba(140, 160, 190, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 10px rgba(0, 0, 0, 0.45);
}
.ch-slot.rarity-uncommon .ch-slot-frame {
  border-color: #4eb8ff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 8px rgba(78, 184, 255, 0.28),
    inset 0 0 0 1px rgba(120, 200, 255, 0.14),
    inset 0 0 10px rgba(0, 0, 0, 0.45);
}
.ch-slot.rarity-rare .ch-slot-frame {
  border-color: #f6c445;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 9px rgba(246, 196, 69, 0.36),
    inset 0 0 0 1px rgba(255, 230, 150, 0.18),
    inset 0 0 10px rgba(0, 0, 0, 0.45);
}
.ch-slot.rarity-legendary .ch-slot-frame {
  border-color: #e04040;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(220, 48, 48, 0.42),
    inset 0 0 0 1px rgba(255, 160, 140, 0.22),
    inset 0 0 12px rgba(0, 0, 0, 0.42);
}
.ch-slot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
/* Background pack — renk zemini asset’ten, ince rarity kenar */
.ch-slot-frame.is-bg-frame {
  border-width: 2px;
  background: #05080e;
}
.ch-slot-frame.is-bg-frame img {
  width: 100%;
  height: 100%;
  filter: none;
}
.ch-slot.rarity-common .ch-slot-frame.is-bg-frame {
  border-color: #d8dee8;
  box-shadow:
    0 0 0 1px rgba(40, 48, 64, 0.45),
    0 0 10px rgba(220, 228, 240, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.ch-slot.rarity-rare .ch-slot-frame.is-bg-frame {
  border-color: #f6c445;
  box-shadow:
    0 0 0 1px rgba(80, 50, 0, 0.55),
    0 0 14px rgba(246, 196, 69, 0.5),
    inset 0 0 0 1px rgba(255, 230, 150, 0.2);
}
.ch-slot.rarity-legendary .ch-slot-frame.is-bg-frame {
  border-color: #e04040;
  box-shadow:
    0 0 0 1px rgba(60, 10, 10, 0.55),
    0 0 14px rgba(220, 48, 48, 0.5),
    inset 0 0 0 1px rgba(255, 160, 140, 0.2);
}
.ch-slot-frame em {
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  color: rgba(247, 241, 228, 0.35);
}
/* +N → ortak .iq-lv (home.css) */
.ch-slot-name {
  font-size: 9px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.ch-slot:active .ch-slot-frame { transform: scale(0.93); }

.ch-figure {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  min-height: 0;
  padding-bottom: 2px;
}
/* 2D karakter mount — profil avatarı (şövalye / okçu) */
.ch-hero2d {
  position: relative;
  width: min(42vw, 148px);
  height: min(42vw, 148px);
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}
.ch-hero2d[data-hero-mode="avatar"] {
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(246, 196, 69, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.45);
  background: #1a2a44;
}
.ch-hero2d-view {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 18%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center bottom;
  animation: ch-hero-idle 2.4s ease-in-out infinite;
}
.ch-hero2d[data-hero-mode="avatar"] .ch-hero2d-view {
  filter: none;
  transform-origin: center center;
}
.ch-hero2d[data-hero-anim="idle"] .ch-hero2d-view {
  animation-name: ch-hero-idle;
}
@keyframes ch-hero-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.ch-pedestal {
  margin-top: -10px;
  width: min(52vw, 200px);
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #8a9aaa 0%, #4a5564 45%, #2a3340 72%, transparent 74%);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.15);
  z-index: 1;
}
.ch-who {
  margin-top: 6px;
  text-align: center;
  line-height: 1.15;
}
.ch-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
}
.ch-who strong {
  min-width: 0;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-rename {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #f6c445;
  background: rgba(246, 196, 69, 0.12);
  border: 1px solid rgba(246, 196, 69, 0.4);
}
.ch-rename svg { width: 14px; height: 14px; }
.ch-rename:active { transform: scale(0.94); background: rgba(246, 196, 69, 0.22); }
.ch-who em {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.65);
}

.ch-power {
  margin-top: 8px;
  min-width: 118px;
  padding: 5px 18px 6px;
  border-radius: 999px;
  text-align: center;
  background: rgba(6, 10, 18, 0.9);
  border: 1.5px solid rgba(246, 196, 69, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.ch-power span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.75);
  line-height: 1.1;
}
.ch-power strong {
  display: block;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
}

/* —— Tab / panel (kale ekranı ile aynı dil) —— */
.ch-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1c30;
}
.ch-tab {
  padding: 11px 8px;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 900;
  color: var(--cream);
  background: transparent;
}
.ch-tab.on {
  color: #111;
  background: var(--yellow);
}
.ch-tab:active:not(.on) { background: rgba(255, 255, 255, 0.06); }

.ch-panel {
  flex: 0 0 auto;
  height: min(40dvh, 300px);
  max-height: min(40dvh, 300px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  padding: 2px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--panel);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ch-stat {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ch-stat:last-child { border-bottom: 0; }
.ch-stat i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.ch-stat i svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.ch-stat span { font-size: 15px; font-weight: 800; }
.ch-stat strong { font-size: 16px; font-weight: 900; color: #fff; }

.ch-skills {
  padding: 8px 2px 12px;
  text-align: left;
}
.ch-sk-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(94, 200, 255, 0.1);
  border: 1px solid rgba(94, 200, 255, 0.28);
}
.ch-sk-wallet strong {
  font-size: 16px;
  font-weight: 900;
  color: #b8ecff;
  font-variant-numeric: tabular-nums;
}
.ch-sk-wallet > span {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
  margin-left: auto;
  text-align: right;
}
.ch-sk-yp {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #081018;
  background: linear-gradient(180deg, #9fe8ff, #4db8e8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.ch-sk-cost-bit.is-yp .ch-sk-yp {
  min-width: 24px;
  height: 20px;
  font-size: 10px;
}
.ch-sk-pop-pts {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  opacity: 0.85;
}
.ch-sk-pop-pts b { color: #9fe8ff; }
.ch-sk-pop-note.is-soft { opacity: 0.65; font-weight: 700; }
.ch-sk-boost {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ch-sk-btn-boost {
  width: 100%;
  background: linear-gradient(180deg, rgba(159, 232, 255, 0.22), rgba(40, 90, 120, 0.35));
  border: 1px solid rgba(159, 232, 255, 0.4);
  color: #e8f8ff;
}
.ch-sk-sec + .ch-sk-sec { margin-top: 14px; }
.ch-sk-sec h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow, #f6c445);
}
.ch-sk-hint {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(247, 241, 228, 0.45);
}
.ch-sk-grid {
  display: grid;
  gap: 8px;
}
.ch-sk-grid-active { grid-template-columns: repeat(4, 1fr); }
.ch-sk-grid-passive { grid-template-columns: repeat(5, 1fr); }
.ch-sk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  text-align: center;
  min-width: 0;
}
.ch-sk.is-on {
  border-color: rgba(72, 210, 120, 0.65);
  background: rgba(48, 140, 80, 0.14);
  box-shadow: inset 0 0 0 1px rgba(120, 255, 160, 0.12);
}
.ch-sk-eq {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #08140c;
  background: linear-gradient(180deg, #7dff9f, #2ec95a);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.ch-sk-eq svg { width: 12px; height: 12px; }
.ch-sk em.is-eq {
  color: #7dff9f;
  font-weight: 800;
}
.ch-sk.is-locked {
  opacity: 0.55;
}
.ch-sk:not(:disabled):active { transform: scale(0.97); }
.ch-sk-frame {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.ch-sk-art,
.ch-sk-frame img.ch-sk-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ch-sk-lock {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  color: rgba(247, 241, 228, 0.85);
}
.ch-sk-lock svg { width: 12px; height: 12px; }
.ch-sk-lv {
  position: absolute;
  left: 2px;
  bottom: 2px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  line-height: 1.2;
  color: #1a1208;
  background: linear-gradient(180deg, #ffe56a, #f0a000);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.ch-sk strong {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ch-sk em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(247, 241, 228, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.ch-sk-pop {
  position: relative;
  text-align: center;
  padding-top: 4px;
}
.ch-sk-pop-ico {
  width: 96px;
  height: 96px;
  margin: 8px auto 10px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.ch-sk-pop-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ch-sk-pop-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ch-sk-btn-out {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream, #f7f1e4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
.ch-sk-pop h2 {
  margin: 0 0 6px;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
}
.ch-sk-pop-blurb {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(247, 241, 228, 0.7);
}
.ch-sk-pop-mods {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--yellow, #f6c445);
}
.ch-sk-pop-next {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(160, 220, 255, 0.85);
}
.ch-sk-pop-note {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(247, 241, 228, 0.45);
}
.ch-sk-cost {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin: 0 0 8px;
}
.ch-sk-cost-bit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.ch-sk-pay,
.ch-sk-cost-bit img.ch-sk-pay {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.ch-sk-pop-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-height: 700px) {
  .ch-stage { min-height: 220px; padding-top: 6px; }
  .ch-hero2d { width: min(36vw, 120px); height: min(36vw, 120px); }
  .ch-slot-frame { width: 44px; height: 44px; }
  .ch-col { gap: 3px; }
  .ch-panel { height: 34dvh; max-height: 34dvh; }
}
