/* Karargah: Legend Online'ın karakter paneli tarzında oyun ekranı */

body.karargah {
  --bronze-light: #f4d88a;
  --bronze: #b8873a;
  --bronze-dark: #4a3112;
  background: #120c08 var(--k-scene, none) center / cover fixed;
}

body.karargah::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, #00000040, #000000c8 75%);
  pointer-events: none;
}

.k-page {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px;
}

.gold-text,
.k-title,
.k-panel h2,
.k-name b,
.k-power-num {
  background: linear-gradient(#fffbe8, #f6d070 50%, #b07a22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Üst bar ve sekmeler ---- */

.k-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.k-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.04em;
  filter: drop-shadow(0 2px 2px #000);
}

/* Karargah sayfasının başlığı: üst çubukla sekmeler arasında */
.k-pagetitle {
  margin: 12px 0 0;
  line-height: 1.15;
}

.k-res {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
}

/* Cüzdanın bir bölmesi: ikon kendi renginde, sayı kalın, ad küçük ve soluk */
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
  padding: 0 10px;
  font: 600 15px var(--ui);
  color: var(--text);
  border-left: 1px solid #4a3a26b3;
  white-space: nowrap;
}

.k-chip:first-child {
  border-left: 0;
}

.k-chip b {
  font-weight: 700;
}

.k-chip .ic {
  width: 20px;
  height: 20px;
}

/* Discord'dan gelen üç kaynak biraz daha büyük */
.k-chip.discord b {
  font-size: 16px;
}

.c-vs {
  color: #ff9a8a;
}

/* Cüzdan: enerji, Ruh Taşı, Ses Sandığı (yalnız Discord'dan) */
.k-chip small {
  font-size: 13px;
  color: var(--muted);
}

.k-chip em {
  margin-left: 2px;
  font: 600 12px var(--ui);
  font-style: normal;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Enerji tavanın üstünde: bölme altın parlar */
.k-chip.over {
  background: linear-gradient(transparent, #d9ad4526);
}

.k-chip.over b {
  color: var(--gold-soft);
}

/* Hak var ama şu an VS atılamıyor (ui/nav.js arenaLock) */
.k-chip.locked {
  color: var(--muted);
}

/* Cüzdan üst çubuk dışında (ör. Harita başlığı) kendi çerçevesinde durur */
.k-res:not(.nav-res) {
  background: linear-gradient(#1a1320f2, #0f0b13f2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.k-res:not(.nav-res) .k-chip {
  min-height: 40px;
}

/* ---- Ses çipi (tasarım C3): renk durumu, cümle nedeni söyler ---- */

.k-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 8px;
  margin-top: 10px;
}

.k-voice {
  --c: #8d8578;
  --cbg: #2a2620;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 5px 12px 5px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #f2e6c8;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(90deg, var(--cbg), #140d08 75%);
  border: 1px solid var(--c);
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 #ffffff1a;
}

.k-voice i {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--c) 55%, #000 130%);
  box-shadow: 0 0 8px var(--c);
}

/* Boşluksuz uzun kanal adı çipten taşmasın, telefonda sayfayı yana kaydırmasın */
.k-voice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.k-voice.t-green {
  --c: #4fc27a;
  --cbg: #163a22;
}

.k-voice.t-green i,
.k-voice.t-purple i {
  animation: kPulse 1.8s ease-in-out infinite;
}

.k-voice.t-yellow {
  --c: #e8c547;
  --cbg: #3a3214;
}

.k-voice.t-orange {
  --c: #f08a3c;
  --cbg: #3e2412;
}

.k-voice.t-gray {
  --c: #9a917f;
  --cbg: #2a2620;
}

.k-voice.t-purple {
  --c: #b48cff;
  --cbg: #2c1f48;
}

.k-voice.t-red {
  --c: #e3545c;
  --cbg: #461a1a;
}

.k-voice.t-blue {
  --c: #58a6e8;
  --cbg: #16304a;
}

/* Dondurulmuş hesap */
.k-voice.t-ice {
  --c: #a8ecff;
  --cbg: #1b3a44;
}

/* Seste değil: uyarı değil davet */
.k-voice.t-gold {
  --c: #f4d88a;
  --cbg: #3e2e12;
}

@keyframes kPulse {
  50% {
    box-shadow: 0 0 2px var(--c);
    opacity: 0.7;
  }
}

/* Sekmedeki "tayın hazır" işareti */
.k-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  vertical-align: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #f6d070 55%, #b07a22);
  box-shadow: 0 0 8px #f4d88a;
}

.k-tabs {
  display: flex;
  gap: 2px;
  margin: 14px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.k-tab {
  flex: none;
  min-height: 44px;
  padding: 10px 18px 8px;
  font: 600 14px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(#1a1320d9, #0f0b13d9);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  text-shadow: 0 1px 2px #000;
  transition: color var(--t-hover), background var(--t-hover);
}

.k-tab:hover {
  color: var(--text);
}

.k-tab.on {
  color: var(--gold-soft);
  background: linear-gradient(#2a2016, #1a1320);
  border-color: var(--line-strong);
  box-shadow: inset 0 2px 0 var(--gold);
}

.k-body {
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
}

/* ---- Paneller ---- */

.k-panel {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #00000020, #00000070),
    var(--k-deri, linear-gradient(#2c2117, #18110b));
  background-size: auto, cover;
  border: 1px solid var(--line-strong);
  outline: 1px solid var(--line-gold);
  outline-offset: -5px;
  box-shadow:
    0 0 0 1px #000,
    inset 0 0 40px #000c,
    0 12px 30px #000b;
}

/* Altın köşe süsleri */
.k-panel::before,
.k-panel::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff1b0, var(--bronze) 60%, var(--bronze-dark));
  border: 1px solid #000;
  box-shadow: 0 0 8px #f4d88a88;
}

.k-panel::before {
  left: -5px;
}

.k-panel::after {
  right: -5px;
}

.k-panel h2 {
  font-size: 20px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f4d88a44;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.k-panel h2 small {
  font: 13px var(--ui);
  color: #c9b48a;
  -webkit-text-fill-color: #c9b48a;
}

.k-sep {
  height: 1px;
  margin: 12px 0;
  background: linear-gradient(90deg, transparent, #f4d88a66, transparent);
}

.k-hint {
  font-size: 14px;
  color: #c9b48a;
  margin: 10px 0 0;
}

.k-bar {
  height: 10px;
  border-radius: 2px;
  overflow: hidden;
  background: #000a;
  box-shadow: inset 0 0 0 1px #f4d88a44;
}

.k-bar.small {
  height: 7px;
  margin: 8px 0 4px;
}

.k-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b07a22, #f6d070, #fff1b0);
  box-shadow: 0 0 10px #f4d88a88;
  transition: width 0.4s ease;
}

/* Arayüz kiti düğmeleri: ana altın, ghost koyu altın çizgili, danger kırmızı (yıkıcı işlem), small dar */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #000;
  border-radius: var(--r-sm);
  font: 700 14px/1.1 var(--ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #241605;
  text-decoration: none;
  text-shadow: 0 1px 0 #fff0c880;
  background: linear-gradient(#f4d88a, #d9ad45 55%, #a87b26);
  box-shadow: inset 0 1px 0 #fff5d2b3, 0 0 0 1px #d9ad4573, 0 3px 8px #00000080;
  transition: filter var(--t-hover), transform var(--t-press), box-shadow var(--t-hover);
}

.k-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.k-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px #d9ad4573, 0 1px 3px #00000080;
}

.k-btn .ic {
  width: 18px;
  height: 18px;
}

.k-btn.ghost {
  color: var(--gold-soft);
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(#251d2c, #17121c);
  box-shadow: inset 0 1px 0 #f4d88a1f, 0 0 0 1px var(--line-strong), 0 3px 8px #00000066;
}

.k-btn.danger {
  color: #fff1f0;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(#b8323a, #7d1d24);
  box-shadow: inset 0 1px 0 #ffc8c859, 0 0 0 1px #e3545c80, 0 3px 8px #00000080;
}

.k-btn.small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}

.k-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* ---- Karakter sekmesi: tek sahne ----
   Kahraman ortada büyük; Özellikler ve Savaş Gücü sahnenin üstünde içerikleri kadar levha (uzayan boş panel yok);
   XP çubuğu ve beceriler altta tek şerit. Sahne karargah resmini koyu bir camın ardından gösterir. */

.k-hero {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  grid-template-areas:
    'stats stage power'
    'prog prog prog';
  align-items: start;
  gap: 0 18px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 1px solid var(--line-gold);
  outline-offset: -5px;
  background:
    radial-gradient(ellipse 40% 60% at 50% 52%, #f4d88a17, transparent 70%),
    linear-gradient(180deg, #0b080540, #0b0805b3 70%, #0b0805e0);
  box-shadow: 0 0 0 1px #000, 0 12px 30px #000b;
}

/* Ana çerçevenin üst köşelerinde elmas (k-panel ile aynı) */
.k-hero::before,
.k-hero::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #fff1b0, var(--bronze) 60%, var(--bronze-dark));
  border: 1px solid #000;
  box-shadow: 0 0 8px #f4d88a88;
}

.k-hero::before {
  left: -5px;
}

.k-hero::after {
  right: -5px;
}

/* Sahnenin üstündeki levha: içeriği kadar, koyu cam */
.k-plate {
  position: relative;
  z-index: 2;
  padding: 12px 14px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: linear-gradient(#1a120ce0, #0d0906eb);
  box-shadow: inset 0 1px 0 #f4d88a14, 0 8px 18px #000a;
  backdrop-filter: blur(3px);
}

.k-stats {
  grid-area: stats;
}

.k-power {
  grid-area: power;
}

/* Levha başlığı: küçük, aralıklı büyük harf ve sağa uzanan çizgi */
.k-plate-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font: 600 12px var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.k-plate-h::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.k-plate-h:not(:first-child) {
  margin-top: 14px;
}

.k-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f4d88a14;
  font-size: 14px;
  color: #e6dcc8;
}

.k-stat:last-child,
.k-stat:has(+ .k-plate-h) {
  border-bottom: 0;
}

.k-stat span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.k-stat .ic {
  width: 16px;
  height: 16px;
  color: var(--gold);
  opacity: 0.85;
}

.k-stat b {
  font-family: var(--ui);
  color: #ffe08a;
}

.k-stage {
  grid-area: stage;
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 0 10px;
}

.k-name {
  text-align: center;
}

.k-name b {
  display: block;
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: 0.04em;
  filter: drop-shadow(0 2px 2px #000);
}

/* Sınıf ve seviye: başlığın altında ince şerit */
.k-name span {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #e6d3a0;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(90deg, transparent, #0b0805cc 20%, #0b0805cc 80%, transparent);
  border-top: 1px solid #d9ad4533;
  border-bottom: 1px solid #d9ad4533;
}

.k-figure {
  position: relative;
  width: 100%;
  height: clamp(320px, 56vh, 520px);
  margin-bottom: 18px;
  display: grid;
  place-items: end center;
}

.k-figure img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  z-index: 1;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px #000d);
  transform-origin: 50% 100%;
  animation: kBreathe 3.2s ease-in-out infinite;
}

@keyframes kBreathe {
  50% {
    transform: scaleY(1.012) translateY(-1px);
  }
}

/* Vitrin (E9): kahraman silahı ve parıltılarıyla kendi canvas'ında; canvas kabının boyunu alır (en çok 300x420) */
.k-vitrin {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.k-vitrin-canvas {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  width: min(100%, 300px);
  height: min(100%, 420px);
  transform: translateX(-50%);
  filter: drop-shadow(0 12px 16px #000d);
}

/* Karakter sahnesinde kahraman büyük: yayınlanan kareler 460-520 px boyunda, 500 px'e kadar bulanıklaşmaz */
.k-figure .k-vitrin-canvas {
  width: min(100%, 360px);
  height: min(100%, 500px);
}

.k-vitrin-box {
  position: relative;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 50% 85%, #f4d88a30, transparent 60%),
    radial-gradient(circle at 50% 40%, #2e241a, #0d0906 80%);
  box-shadow: inset 0 0 0 1px #8a6a3a88, inset 0 0 24px #000c;
  overflow: hidden;
}

.k-vitrin-box.smith {
  height: 230px;
}

.k-vitrin-box.shop {
  position: sticky;
  top: 10px;
  height: 330px;
}

.k-vitrin-box.shop small {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 2;
  text-align: center;
  font-size: 12px;
  color: #c9b48a;
  text-shadow: 0 1px 2px #000;
}

.k-vitrin-box.shop .k-vitrin {
  bottom: 18px;
}

.k-shop-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.k-shop-body .k-offers {
  margin-top: 12px;
}

.k-glow {
  position: absolute;
  inset: 8% 18% 6%;
  background: radial-gradient(circle, #f4d88a40, transparent 65%);
  filter: blur(8px);
}

.k-pedestal {
  position: absolute;
  bottom: -10px;
  width: 62%;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #f4d88a70, #b8873a40 45%, transparent 70%);
  box-shadow: 0 0 30px #f4d88a33;
}

/* Alt şerit: seviye rozeti ve XP çubuğu, altında beceri çubuğu */
.k-progress {
  grid-area: prog;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 2px;
}

.k-xp {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  width: min(560px, 100%);
  color: #e6d3a0;
}

.k-xp .k-bar {
  height: 12px;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px #f4d88a40, 0 0 0 1px #8a6a2c80;
}

.k-xp small {
  grid-column: 2;
  justify-self: center;
  margin-top: 3px;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
}

/* Seviye rozeti: altın çerçeveli elmas */
.k-lvl {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font: 800 16px var(--ui);
  color: #241605;
  background: linear-gradient(#f4d88a, #d9ad45 55%, #a87b26);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  filter: drop-shadow(0 2px 3px #000);
}

/* Beceri çubuğu: koyu cam şerit içinde altın çerçeveli kareler */
.k-skills {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: linear-gradient(#1a120cd9, #0d0906e6);
  box-shadow: inset 0 1px 0 #f4d88a14, 0 8px 18px #0009;
}

.k-skill {
  width: 76px;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  color: #e6d3a0;
  text-shadow: 0 1px 2px #000;
  transition: transform var(--t-hover);
}

.k-skill:hover {
  transform: translateY(-2px);
}

.k-skill img {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 5px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--line-strong), 0 4px 10px #000a;
}

.k-power {
  text-align: center;
}

.k-power-num {
  margin: 2px 0 10px;
  font: 900 44px / 1.05 var(--display);
  text-align: center;
  filter: drop-shadow(0 2px 2px #000) drop-shadow(0 0 14px #f4d88a55);
}

.k-rank {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: #e6dcc8;
}

.k-rank-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 30px;
  background: radial-gradient(circle at 50% 35%, #3a2f22, #120d08 70%);
  box-shadow: 0 0 0 2px var(--line-strong), 0 0 0 4px #000;
}

.k-power .k-bar.small {
  margin: 10px 0 4px;
}

.k-power > small {
  display: block;
  font-size: 13px;
}

.k-toarena {
  width: 100%;
  margin-top: 12px;
}

.k-power .k-hint {
  margin-top: 8px;
  font-size: 13px;
  text-align: left;
}

.k-rank b {
  display: block;
  font-family: var(--ui);
  font-size: 18px;
  color: #ffe08a;
}

/* ---- Diziliş: solda savaş tahtası (arka saf → ön saf → düşman), sağda yedek ve düğmeler ---- */

.k-form-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

/* Tahta: zemin ışığı, sütun adları üstte, düşman yönü sağda */
.k-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  grid-template-areas:
    'labels .'
    'grid foe';
  gap: 8px 10px;
  justify-self: center;
  width: min(100%, 620px);
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 70% 60% at 50% 60%, #f4d88a14, transparent 70%),
    linear-gradient(#0b0805a6, #0b0805d9);
  box-shadow: inset 0 0 30px #000c;
}

.k-field-labels {
  grid-area: labels;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  font: 600 12px var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.k-field-labels span:last-child {
  color: #f0a39a;
}

.k-grid {
  grid-area: grid;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Düşman yönü: ön safın yanında dikey şerit */
.k-foe {
  grid-area: foe;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: var(--r-sm);
  color: #f0a39a;
  background: linear-gradient(90deg, #e3545c00, #e3545c26);
  border-right: 2px solid #e3545c80;
}

.k-foe .ic {
  width: 24px;
  height: 24px;
}

.k-foe span {
  writing-mode: vertical-rl;
  font: 700 12px var(--ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.k-form-side .k-bench {
  justify-content: flex-start;
  margin: 6px 0 4px;
}

.k-form-side .k-hint {
  margin: 4px 0 0;
  font-size: 13px;
}

.k-form-side .k-actions {
  justify-content: stretch;
  margin-top: 14px;
}

.k-form-side .k-actions .k-btn {
  flex: 1;
}

.k-cell {
  aspect-ratio: 1;
  position: relative;
  border-radius: var(--radius);
  display: grid;
  place-items: end center;
  padding: 4px 4px 2px;
  font-size: 12px;
  color: #f2e6c8;
  background:
    linear-gradient(#00000070, #000000b0),
    var(--k-tas, #241b13);
  background-size: auto, 110px 110px;
  border: 1px dashed #8a6a3a99;
  box-shadow: inset 0 0 18px #000c;
  transition: border-color var(--t-hover), box-shadow var(--t-hover);
}

.k-cell:hover {
  border-color: var(--gold);
}

.k-cell.front {
  box-shadow: inset 0 0 18px #000c, inset 0 -3px 0 #e3545c55;
}

.k-cell.filled {
  border-style: solid;
  border-color: #8a6a3a;
}

.k-cell.hero {
  border-color: var(--bronze-light);
  box-shadow: inset 0 0 18px #000c, 0 0 12px #f4d88a55;
}

.k-cell.selected,
.k-benchunit.selected {
  outline: 3px solid #9fd6ff;
  outline-offset: 2px;
}

.k-cell img {
  position: absolute;
  bottom: 18px;
  left: 50%;
  height: 74%;
  max-width: 96%;
  transform: translateX(-50%);
  object-fit: contain;
  filter: drop-shadow(0 4px 4px #000c);
}

.k-cell span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.k-bench {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.k-benchunit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: var(--r-sm);
  color: #f2e6c8;
  background: linear-gradient(#2e2116, #140d08);
  border: 1px solid var(--bronze);
}

.k-benchunit img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---- Kışla ---- */

.k-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.k-card {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #00000030, #00000080),
    var(--k-deri, linear-gradient(#2c2117, #18110b));
  background-size: auto, cover;
  border: 2px solid #8a6a3a;
  box-shadow: 0 0 0 1px #000, inset 0 0 30px #000b, 0 10px 24px #000a;
}

.k-card.owned {
  border-color: var(--bronze-light);
}

.k-card.locked {
  filter: grayscale(0.75) brightness(0.7);
}

.k-card-art {
  position: relative;
  background: #000;
}

.k-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.k-card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 60%, #0009);
}

.k-card-body {
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  align-content: start;
  font-size: 13px;
  color: #e6dcc8;
}

.k-card-body h3 {
  font-size: 16px;
  color: #ffe08a;
}

.k-card-body p {
  margin: 2px 0;
  color: #c9b48a;
  font-size: 12px;
}

.k-card-role {
  color: #c9b48a;
  font-size: 12px;
}

.k-stars {
  color: #ffd75e;
  letter-spacing: 1px;
  text-shadow: 0 0 6px #f4d88a88;
}

.k-stars .dim {
  color: #ffffff22;
  text-shadow: none;
}

.k-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
}

.k-card-action {
  margin-top: 4px;
}

.k-lock {
  color: #c9b48a;
  font-size: 13px;
}

/* ---- Görevler (parşömen) ---- */

.k-scroll {
  background:
    linear-gradient(180deg, #00000050, #000000a0),
    var(--k-parsomen, linear-gradient(#3a2c1e, #1c140c));
  background-size: auto, cover;
}

.k-quest {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid #f4d88a22;
  color: #efe3c4;
}

.k-quest:last-child {
  border-bottom: 0;
}

.k-quest-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.k-quest small {
  color: #c9b48a;
}

.k-quest.done .k-bar span {
  background: linear-gradient(90deg, #2f9a3a, #8ff07a);
}

.k-fullday b {
  color: #e9d2ff;
}

.k-fullday.done b {
  color: #8ff07a;
}

/* ---- Bugün paneli (Görevler sekmesinin solunda) ---- */

.k-days {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.k-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 18px;
}

.k-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f4d88a1a;
  font-size: 14px;
  color: #e6dcc8;
}

.k-meter b {
  font-family: var(--ui);
  color: #ffe08a;
  white-space: nowrap;
}

.k-meter b small {
  font-size: 0.8em;
  color: #c9b48a;
}

.k-meter .k-bar {
  grid-column: 1 / -1;
  height: 6px;
}

.k-meter > small {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #c9b48a;
}

/* Tavan doldu */
.k-meter.full .k-bar span {
  background: linear-gradient(90deg, #2f9a3a, #8ff07a);
  box-shadow: 0 0 10px #8ff07a66;
}

.k-sub {
  font-size: 15px;
  color: #ffe08a;
  margin: 0 0 8px;
}

.k-daily {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #efe3c4;
}

.k-badge {
  flex: none;
  padding: 2px 10px;
  border-radius: var(--r-sm);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 12px;
  border: 1px solid;
  box-shadow: 0 0 0 1px #000;
}

.k-badge.ok {
  color: #c8ffc0;
  background: linear-gradient(#2f7a3a, #163a1c);
  border-color: #8ff07a;
}

.k-badge.ready {
  color: #2a1606;
  background: linear-gradient(#fff1b0, #e0b04a 60%, #a87420);
  border-color: var(--bronze-light);
  box-shadow: 0 0 0 1px #000, 0 0 12px #f4d88a99;
}

.k-badge.wait {
  color: #c9b48a;
  background: linear-gradient(#2e2116, #140d08);
  border-color: #8a6a3a;
}

.k-badge.off {
  color: #d6f4ff;
  background: linear-gradient(#24414d, #0f1d24);
  border-color: #a8ecff;
}

/* Hesaba verilmeyecek ödül (güven yok ya da dondurulmuş): üstü çizili, sönük, nedeni yanında */
.k-off {
  opacity: 0.5;
  text-decoration-thickness: 1px;
}

.k-why {
  font-style: normal;
  font-size: 0.92em;
  color: #9fc4e0;
  white-space: nowrap;
}

/* Seri: 7 gün; ödüllü günlerde küçük Ruh taşı */
.k-streak {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  max-width: 340px;
  margin: 12px 0 6px;
}

.k-pip {
  position: relative;
  display: grid;
  place-items: center;
}

.k-pip b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--ui);
  font-size: 13px;
  color: #a8957a;
  background: radial-gradient(circle at 50% 35%, #3a2f22, #120d08 70%);
  box-shadow: 0 0 0 2px #8a6a3a, 0 0 0 3px #000;
}

.k-pip.on b {
  color: #2a1606;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #e0b04a 55%, #7a4e10);
  box-shadow: 0 0 0 2px var(--bronze-light), 0 0 0 3px #000, 0 0 10px #f4d88a88;
}

.k-pip.next b {
  color: #e6f4ff;
  box-shadow: 0 0 0 2px #9fd6ff, 0 0 0 3px #000, 0 0 10px #9fd6ff66;
}

.k-pip.gift::after {
  content: '';
  position: absolute;
  top: -3px;
  right: calc(50% - 19px);
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #f6eaff, #b07bff 40%, #5a24b0 75%);
  box-shadow: 0 0 0 1px #1c0a33, 0 0 6px #b98cffaa;
}

.k-gifts {
  display: block;
  font-size: 12px;
  color: #c9b48a;
}

.k-tip {
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: #0000004d;
  box-shadow: inset 0 0 0 1px #f4d88a26;
}

/* ---- VS geçmişi ---- */

.k-history {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Özet: dört küçük kutu yan yana */
.k-hist-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.k-hist-sum > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: linear-gradient(#1a120cd9, #0d0906e6);
}

.k-hist-sum span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 12px var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.k-hist-sum .ic {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.k-hist-sum b {
  font-size: 17px;
  color: #ffe08a;
}

/* Savaş kartı: solda sonuç rengi şeridi, ortada rakip ve zaman, sağda sonuç */
.k-history {
  display: grid;
  gap: 8px;
}

.k-history li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid #8a7f98;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, #ffffff08, transparent 60%), #0d0906cc;
  color: #e6dcc8;
  font-size: 15px;
}

.k-history li.win {
  border-left-color: #4fc27a;
  background: linear-gradient(90deg, #4fc27a1f, transparent 55%), #0d0906cc;
}

.k-history li.loss {
  border-left-color: #e3545c;
  background: linear-gradient(90deg, #e3545c1f, transparent 55%), #0d0906cc;
}

.k-history li.live {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, #d9ad4526, transparent 55%), #0d0906cc;
}

.k-hist-ic {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gold-soft);
  background: radial-gradient(circle at 50% 35%, #3a2f22, #120d08 70%);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.k-hist-ic .ic {
  width: 20px;
  height: 20px;
}

.k-hist-who small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.k-hist-out {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.k-res-tag {
  font: 700 13px var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.win .k-res-tag {
  color: #8ff0a8;
}

.loss .k-res-tag {
  color: #ff9a8a;
}

.k-rpd {
  font-size: 17px;
  color: #ffe08a;
}

/* Liste kısa: boşluğu Arena çağrısı doldurur */
.k-hist-call {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 26px 16px;
  text-align: center;
  border: 1px dashed #8a6a2c80;
  border-radius: var(--r-sm);
  background: radial-gradient(ellipse at 50% 0, #d9ad4514, transparent 70%);
}

.k-hist-call p {
  max-width: 440px;
  margin: 0;
  color: #e6d3a0;
}

/* ==== Eşya sistemi (Teçhizat, Demirci, Pazar, Hazine) ==== */

/* Demir külçesi */
.k-sub small,
.small:not(.k-btn) {
  font: 12px var(--ui);
  color: #c9b48a;
}

/* Fark okları: yeşil artış, kırmızı düşüş */
.k-d {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.k-d.up {
  color: #8ff07a;
  text-shadow: 0 0 6px #4fc27a66;
}

.k-d.down {
  color: #ff8a7a;
}

.k-d.same {
  color: #a8957a;
}

.k-warn {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: #ffd0a8;
  background: #3e241266;
  box-shadow: inset 0 0 0 1px #f08a3c66;
}

/* ---- Eşya kutucuğu: nadirlik renkli çerçeve ---- */

.k-item {
  --rc: rgb(241, 241, 241);
  --rcs: rgba(241, 241, 241, 0.35);
  position: relative;
  display: block;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: radial-gradient(circle at 50% 40%, #2e241a, #0d0906 75%);
  border: 2px solid var(--rc);
  box-shadow: 0 0 0 1px #000, inset 0 0 8px #000c;
}

.k-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

button.k-item:hover {
  filter: brightness(1.15);
}

/* Yayınlanmış resim ikonu saydam zeminli: zemin nadirlik rengine çalar */
.k-item.art {
  background: radial-gradient(circle at 50% 42%, var(--rcs), #120c08 72%);
}

.k-item.art img {
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #000c);
}

.k-item.r2 {
  box-shadow: 0 0 0 1px #000, inset 0 0 10px var(--rcs);
}

.k-item.r3 {
  box-shadow: 0 0 0 1px #000, inset 0 0 12px var(--rcs), 0 0 8px var(--rcs);
}

.k-item.r4 {
  box-shadow: 0 0 0 1px #000, inset 0 0 14px var(--rcs), 0 0 12px var(--rc);
  animation: kLegend 2.4s ease-in-out infinite;
}

@keyframes kLegend {
  50% {
    box-shadow: 0 0 0 1px #000, inset 0 0 18px var(--rcs), 0 0 20px var(--rc);
  }
}

.k-plus {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font: 800 12px/1 var(--ui);
  color: #fff6d8;
  text-shadow: 0 0 3px #000, 0 1px 2px #000, 0 0 6px var(--rc);
}

/* Kilit: küçük altın asma kilit */
.k-lockico {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(#fff1b0, #c8902e);
  box-shadow: 0 0 0 1px #000;
}

.k-lockico::before {
  content: '';
  position: absolute;
  left: 1.5px;
  top: -5px;
  width: 6px;
  height: 6px;
  box-sizing: border-box;
  border: 1.5px solid #e8c25a;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

/* Kuşanılamaz: sönük, köşede gereken seviye */
.k-item.nouse img {
  filter: grayscale(0.85) brightness(0.55);
}

.k-req {
  position: absolute;
  left: 2px;
  bottom: 2px;
  padding: 0 3px;
  border-radius: 3px;
  font: 700 11px/13px var(--ui);
  font-style: normal;
  color: #fff;
  background: #a8261acc;
}

.k-item.picked {
  outline: 3px solid #9fd6ff;
  outline-offset: 1px;
}

.k-check {
  position: absolute;
  top: 2px;
  right: 3px;
  font: 900 13px/1 var(--ui);
  font-style: normal;
  color: #9fd6ff;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}

.k-item.empty {
  border: 1px dashed #8a6a3a55;
  background:
    linear-gradient(#00000080, #000000b0),
    var(--k-tas, #241b13);
  background-size: auto, 90px 90px;
  box-shadow: inset 0 0 10px #000c;
}

.k-item.ghost {
  border-style: dashed;
  border-color: #8a6a3a99;
}

.k-item.big {
  width: 64px;
  flex: none;
}

.k-baggrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.k-baggrid > p {
  grid-column: 1 / -1;
  margin: 4px 0;
}

/* ---- Teçhizat ---- */

.k-gear {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.k-doll {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.k-doll-col {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.k-dslot {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 68px;
  padding: 0;
  background: none;
  border: 0;
}

.k-dslot .k-item {
  width: 62px;
}

.k-dslot small {
  font: 700 12px var(--ui);
  color: #e6d3a0;
  text-shadow: 0 1px 2px #000;
}

.k-dslot.empty small {
  color: #a8957a;
}

.k-doll-fig {
  position: relative;
  height: clamp(220px, 34vh, 330px);
  display: grid;
  place-items: end center;
}

.k-doll-fig img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 1;
  margin: 0 auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px #000d);
  transform-origin: 50% 100%;
  animation: kBreathe 3.2s ease-in-out infinite;
}

.k-doll-fig .k-pedestal {
  bottom: -6px;
  width: 80%;
}

.k-doll-score {
  display: grid;
  justify-items: center;
  width: 68px;
  padding: 6px 2px;
  border-radius: var(--r-sm);
  background: #0000005a;
  box-shadow: inset 0 0 0 1px #f4d88a33;
}

.k-doll-score small {
  font-size: 12px;
  color: #c9b48a;
}

.k-doll-score b {
  font: 800 16px var(--ui);
  color: #ffe08a;
}

.k-doll-power {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 4px;
  color: #e6d3a0;
}

.k-doll-power b {
  font: 900 26px/1 var(--display);
  background: linear-gradient(#fffbe8, #f6d070 50%, #b07a22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 2px #000);
}

.k-gstats {
  margin-top: 10px;
}

.k-gstat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px auto 76px;
  align-items: baseline;
  gap: 6px;
  padding: 6px 2px;
  border-bottom: 1px solid #f4d88a1a;
  font-size: 14px;
  color: #e6dcc8;
}

.k-gstat b {
  font-family: var(--ui);
  color: #ffe08a;
  text-align: right;
}

.k-gstat b.base {
  color: #a8957a;
  font-weight: 600;
}

.k-gstat i {
  font-style: normal;
  color: #8a6a3a;
  text-align: center;
}

.k-gstat .k-d {
  text-align: right;
}

/* Çanta araçları */
.k-bagtools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.k-full {
  color: #ff8a7a !important;
  -webkit-text-fill-color: #ff8a7a !important;
}

.k-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 12px 3px 4px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: #e6d3a0;
  background: linear-gradient(#2e2116, #140d08);
  border: 1px solid #8a6a3a;
}

.k-switch i {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: var(--r-sm);
  background: #000a;
  box-shadow: inset 0 0 0 1px #8a6a3a;
  transition: background 0.2s;
}

.k-switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #a8957a);
  transition: transform 0.2s;
}

.k-switch.on {
  border-color: var(--bronze-light);
  color: #fff6d8;
}

.k-switch.on i {
  background: linear-gradient(#4fc27a, #1e6a34);
}

.k-switch.on i::after {
  transform: translateX(14px);
}

.k-switch:disabled {
  opacity: 0.6;
}

.k-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.k-fchip {
  padding: 3px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: #e6d3a0;
  background: #0000004d;
  border: 1px solid #8a6a3a77;
}

.k-fchip small {
  color: #a8957a;
}

.k-fchip.on {
  color: #2a1606;
  background: linear-gradient(#fff1b0, #e0b04a 60%, #a87420);
  border-color: var(--bronze-light);
}

.k-fchip.on small {
  color: #5a3a10;
}

/* Çoklu seçim çubuğu: uzun çantada ekranın altına yapışır */
.k-pickbar {
  position: sticky;
  bottom: 8px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: #efe3c4;
  background: linear-gradient(#2c2016f2, #140d08f2);
  border: 1px solid var(--bronze-light);
  box-shadow: 0 0 0 1px #000, 0 8px 20px #000c;
}

.k-pickbar > span {
  margin-right: auto;
}

/* ---- Eşya kartı ---- */

.k-icard {
  --rc: rgb(241, 241, 241);
  display: grid;
  gap: 8px;
  color: #e6dcc8;
  font-size: 14px;
}

.k-icard-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.k-icard-title {
  min-width: 0;
}

.k-icard h3 {
  font-size: 17px;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000, 0 0 10px var(--rcs);
  overflow-wrap: anywhere;
}

.k-icard-meta {
  font-size: 12px;
  color: #c9b48a;
}

.k-icard-tags {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.k-tag {
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  color: #e6d3a0;
  background: #0000005a;
  border: 1px solid #8a6a3a;
}

.k-tag.on {
  color: #c8ffc0;
  border-color: #4fc27a;
}

.k-icard-warn {
  margin: 0;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: #ffb0a4;
  background: #461a1a99;
}

.k-icard-main,
.k-icard-aff {
  list-style: none;
  margin: 0;
  padding: 0;
}

.k-icard-main li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 84px;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid #f4d88a14;
}

.k-icard-main b {
  font-family: var(--ui);
  color: #ffe08a;
}

.k-icard-main .k-d {
  text-align: right;
}

.k-icard-aff li {
  padding: 2px 0;
  color: #9fd6ff;
}

.k-flawless {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2a1606;
  background: linear-gradient(#fff1b0, #e0b04a 60%, #a87420);
  box-shadow: 0 0 8px #f4d88a88;
}

.k-icard-none {
  margin: 0;
  font-size: 12px;
  color: #a8957a;
}

.k-icard-power {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: #0000004d;
  box-shadow: inset 0 0 0 1px var(--rcs);
}

.k-icard-power span {
  margin-right: auto;
  color: #c9b48a;
}

.k-icard-power b {
  font: 800 18px var(--ui);
  color: #ffe08a;
}

.k-icard-power .k-d {
  font-size: 13px;
}

.k-icard-vs,
.k-icard-azim {
  font-size: 12px;
  color: #c9b48a;
}

.k-icard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ---- Eşya kartı penceresi ---- */

.k-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #07050bcc;
}

.k-modal[hidden] {
  display: none;
}

/* Kart penceresi <dialog> olarak (gear-panels.js): showModal ile üst katmanda, açık panel pencerelerinin üstünde.
   Tarayıcının dialog kutusu sıfırlanır; karartma .k-modal'ın kendi arka planı */
dialog.k-modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  color: inherit;
}

dialog.k-modal:not([open]) {
  display: none;
}

dialog.k-modal::backdrop {
  background: transparent;
}

.k-modal-box {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #00000030, #00000090),
    var(--k-deri, linear-gradient(#2c2117, #18110b));
  background-size: auto, cover;
  border: 2px solid var(--bronze);
  box-shadow: 0 0 0 1px #000, inset 0 0 40px #000c, 0 20px 60px #000;
  animation: kPop 0.18s ease-out;
}

@keyframes kPop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
}

.k-x {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #e6d3a0;
  background: #0000005a;
}

/* Uzun başlık kapatma düğmesinin altına girmesin (yalnız pencerede; Pazar kartları etkilenmez) */
.k-modal-box .k-icard-head {
  padding-right: 34px;
}

/* ---- Demirci ---- */

.k-smith {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.k-anvil {
  --rc: rgb(241, 241, 241);
  display: grid;
  gap: 10px;
}

.k-anvil-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.k-anvil-item b {
  display: block;
  font-family: var(--ui);
  font-size: 17px;
  text-shadow: 0 1px 2px #000;
}

.k-anvil-item small {
  color: #c9b48a;
}

.k-upgrade {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font: 900 34px/1 var(--display);
  color: #ffe08a;
  text-shadow: 0 2px 2px #000;
}

.k-upgrade i {
  font-style: normal;
  font-size: 22px;
  color: #b8873a;
}

.k-upgrade .to {
  color: #fff6d8;
  text-shadow: 0 2px 2px #000, 0 0 14px var(--rc);
}

.k-mul {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: #c9b48a;
}

.k-costs {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.k-costs li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-family: var(--ui);
  font-weight: 700;
  color: #ffe9b0;
  background: #0000004d;
}

.k-costs li small {
  margin-left: auto;
  font: 12px var(--ui);
  color: #c9b48a;
}

.k-costs li.no {
  color: #ff8a7a;
  box-shadow: inset 0 0 0 1px #e3545c88;
}

.k-chance > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  color: #e6dcc8;
}

.k-chance b {
  font: 800 22px var(--display);
  color: #ffe08a;
}

.k-chance small {
  margin-left: auto;
  font-size: 12px;
  color: #b48cff;
}

.k-hammer {
  width: 100%;
  min-height: 46px;
  font-size: 17px;
}

.k-short {
  margin: 0;
}

.k-maxed {
  margin: 0;
  text-align: center;
  color: #e6d3a0;
}

.k-smith-result {
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  text-align: center;
  font-weight: 700;
}

.k-smith-result.ok {
  color: #c8ffc0;
  background: #163a2299;
  box-shadow: inset 0 0 0 1px #4fc27a;
}

.k-smith-result.fail {
  color: #ffb0a4;
  background: #461a1a99;
  box-shadow: inset 0 0 0 1px #e3545c;
}

.k-azim {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e6dcc8;
}

.k-azim .k-bar {
  margin: 0;
}

.k-azim .k-bar span {
  background: linear-gradient(90deg, #5a24b0, #b07bff, #f6eaff);
  box-shadow: 0 0 10px #b98cff88;
}

.k-azim b {
  font-family: var(--ui);
  color: #d8c2ff;
}

/* Sonuç parıltısı: başarıda altın ışık, başarısızlıkta kırmızı sarsıntı */
.k-anvil.fx-ok {
  animation: kForgeOk 1.4s ease-out;
}

.k-anvil.fx-ok .k-item.big {
  animation: kForgeItem 1.2s ease-out;
}

.k-anvil.fx-fail {
  animation: kForgeFail 0.5s ease-in-out;
}

@keyframes kForgeOk {
  0% {
    box-shadow: 0 0 0 1px #000, inset 0 0 40px #000c, 0 0 0 #f4d88a00;
  }
  25% {
    box-shadow: 0 0 0 1px #000, inset 0 0 60px #f4d88a88, 0 0 40px #f4d88acc;
  }
}

@keyframes kForgeItem {
  25% {
    transform: scale(1.18);
    filter: brightness(1.8) drop-shadow(0 0 12px #fff1b0);
  }
}

@keyframes kForgeFail {
  20%,
  60% {
    transform: translateX(-6px);
    box-shadow: 0 0 0 1px #000, inset 0 0 50px #e3545c66, 0 0 24px #e3545c88;
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

/* ---- Pazar ---- */

.k-shop-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #c9b48a;
}

.k-offers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.k-offer {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: #0000005a;
  border: 1px solid #8a6a3a;
  box-shadow: inset 0 0 20px #000a;
}

.k-offer.bought {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.k-offer-buy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #f4d88a22;
}

.k-price {
  font: 800 17px var(--ui);
  color: #ffe08a;
}

.k-price.no {
  color: #ff8a7a;
}

/* ---- Hazine ---- */

.k-vault {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.k-chestpanel {
  display: grid;
  justify-items: center;
  text-align: center;
}

.k-chestpanel h2 {
  width: 100%;
}

/* Büyük sandık (CSS çizimi) */
.k-bigchest {
  position: relative;
  width: 132px;
  height: 104px;
  margin: 10px 0 6px;
  filter: drop-shadow(0 10px 12px #000c);
}

.k-bigchest .body,
.k-bigchest .lid,
.k-bigchest .lock {
  position: absolute;
  display: block;
}

.k-bigchest .body {
  left: 0;
  right: 0;
  bottom: 0;
  height: 62px;
  border-radius: 4px 4px var(--r-sm) var(--r-sm);
  background:
    linear-gradient(90deg, transparent 12%, #d9ad45 12% 18%, transparent 18% 82%, #d9ad45 82% 88%, transparent 88%),
    linear-gradient(#a0602a, #6a3a14 60%, #3e200a);
  box-shadow: inset 0 2px 0 #ffffff33, inset 0 -6px 10px #0008, 0 0 0 2px #2a1606;
}

.k-bigchest .lid {
  left: 0;
  right: 0;
  top: 4px;
  height: 44px;
  border-radius: var(--radius) var(--radius) 4px 4px / var(--radius) var(--radius) 4px 4px;
  transform-origin: 50% 100%;
  background:
    linear-gradient(90deg, transparent 12%, #f4d88a 12% 18%, transparent 18% 82%, #f4d88a 82% 88%, transparent 88%),
    linear-gradient(#c07a36, #7a4318 70%, #4a260c);
  box-shadow: inset 0 3px 0 #ffffff44, 0 0 0 2px #2a1606;
}

.k-bigchest .lock {
  left: 56px;
  top: 38px;
  width: 20px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(#fff1b0, #d9ad45 50%, #8a5a10);
  box-shadow: 0 0 0 2px #2a1606, 0 0 10px #f4d88a88;
}

.k-bigchest.opening .lid {
  animation: kLid 1.2s ease-out both;
}

.k-bigchest.opening::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 20px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff6c8, #f4d88a88 40%, transparent 70%);
  animation: kBeam 1.4s ease-out both;
}

@keyframes kLid {
  30% {
    transform: rotate(-4deg);
  }
  45% {
    transform: rotate(4deg);
  }
  100% {
    transform: perspective(200px) rotateX(55deg) translateY(-10px);
  }
}

@keyframes kBeam {
  0%,
  30% {
    opacity: 0;
    transform: scale(0.4);
  }
  60% {
    opacity: 1;
    transform: scale(1.3);
  }
  100% {
    opacity: 0.4;
  }
}

.k-chestcount b {
  display: block;
  font: 900 40px/1 var(--display);
  background: linear-gradient(#fffbe8, #f6d070 50%, #b07a22);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 2px #000);
}

.k-chestcount span {
  color: #e6d3a0;
}

.k-chestbtns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin-top: 12px;
}

.k-chestbtns .k-btn {
  padding: 6px 4px;
}

.k-loot {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.k-loot-card {
  --rc: rgb(241, 241, 241);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 10px;
  border-radius: var(--radius);
  text-align: center;
  color: #e6dcc8;
  background: radial-gradient(circle at 50% 20%, var(--rcs), #0000005a 60%);
  border: 1px solid var(--rc);
  box-shadow: inset 0 0 20px #000a;
}

.k-loot-card .k-item {
  width: 70px;
}

.k-loot-card b {
  font-family: var(--ui);
  font-size: 14px;
  line-height: 1.2;
  text-shadow: 0 1px 2px #000;
}

.k-loot-card small {
  font-size: 12px;
  color: #c9b48a;
}

.k-loot-card .k-warn {
  margin: 0;
  padding: 2px 6px;
}

.k-loot-gain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  color: #ffe9b0;
}

/* Açılış: kartlar sırayla, kapak kalkar gibi belirir */
.k-loot.fresh .k-loot-card {
  animation: kReveal 0.7s var(--d, 0s) cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.k-loot-lid {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--radius);
  background: linear-gradient(#c07a36, #6a3a14);
  box-shadow: inset 0 0 0 2px #d9ad45;
  animation: kLidOff 0.5s calc(var(--d, 0s) + 0.35s) ease-in both;
  pointer-events: none;
}

@keyframes kReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.85);
  }
}

@keyframes kLidOff {
  to {
    opacity: 0;
    transform: translateY(-24px) rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .k-item.r4,
  .k-anvil.fx-ok,
  .k-anvil.fx-ok .k-item.big,
  .k-anvil.fx-fail,
  .k-bigchest.opening .lid,
  .k-bigchest.opening::after,
  .k-loot.fresh .k-loot-card,
  .k-doll-fig img {
    animation: none;
  }
  .k-loot-lid {
    display: none;
  }
}

/* ---- Telefon ---- */

@media (max-width: 860px) {
  .k-gear,
  .k-smith,
  .k-vault {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Telefonda üzerine gelme yok: Pazar vitrini gizlenir (gizli canvas kendi döngüsünü durdurur) */
  .k-shop-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .k-vitrin-box.shop {
    display: none;
  }
  .k-vitrin-box.smith {
    height: 200px;
  }
  /* Dar ekranda sahne üstte, levhalar altta yan yana (telefonda alt alta) */
  .k-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'stage stage'
      'prog prog'
      'power stats';
    gap: 14px;
  }
  .k-form-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .k-hist-sum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .k-days {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .k-page {
    padding: 10px;
  }
  .k-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'stage' 'prog' 'power' 'stats';
    padding: 14px 12px;
  }
  .k-figure {
    height: clamp(260px, 48vh, 380px);
  }
  .k-top {
    flex-wrap: wrap;
  }
  .k-res,
  .k-status {
    justify-content: flex-start;
  }
  .k-chip {
    padding: 4px 10px;
    font-size: 13px;
  }
  .k-chip em {
    display: none;
  }
  /* Üst çubuk cüzdanı telefonda üç sütunlu ızgara: altı bölme iki eşit satır, çizgiler ızgarayı çizer */
  .nav-res {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #4a3a26b3;
  }
  .nav-res .k-chip {
    justify-content: center;
    min-height: 38px;
    padding: 0 6px;
    font-size: 13px;
    border-left: 1px solid #4a3a26b3;
  }
  .nav-res .k-chip:nth-child(3n + 1) {
    border-left: 0;
  }
  .nav-res .k-chip:nth-child(n + 4) {
    border-top: 1px solid #4a3a26b3;
  }
  .nav-res .k-chip .ic {
    width: 18px;
    height: 18px;
  }
  .nav-res .k-chip.discord b {
    font-size: 15px;
  }
  .k-voice {
    font-size: 12px;
  }
  .k-tab {
    padding: 8px 14px 7px;
    font-size: 13px;
  }
  .k-card {
    grid-template-columns: 90px 1fr;
  }
  /* Sekmeler: telefonda alt alta sarılır, hepsi görünür */
  .k-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }
  .k-tab {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 7px 10px 6px;
    border-bottom: 1px solid var(--line);
    border-radius: var(--r-sm);
  }
  .k-body {
    padding-top: 10px;
  }
  .k-doll {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    gap: 4px;
  }
  .k-dslot,
  .k-doll-score {
    width: 62px;
  }
  .k-dslot .k-item {
    width: 56px;
  }
  .k-gstat {
    grid-template-columns: minmax(0, 1fr) auto 12px auto 64px;
    font-size: 13px;
  }
  .k-panel {
    padding: 14px 12px;
  }
  .k-baggrid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }
  .k-offers {
    grid-template-columns: minmax(0, 1fr);
  }
  .k-loot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .k-upgrade {
    font-size: 28px;
  }
  .k-modal {
    padding: 10px;
    align-items: end;
  }
  .k-modal-box {
    max-height: calc(100vh - 20px);
    padding: 16px 14px;
  }
}
