/* ════════════════════════════════════════════════════════════════════
   KAAHIN · KART ÇEKME (Daily Card Pull)
   Overlay + 3 mistik kart + flip animasyonu + tetikleyici buton
   ════════════════════════════════════════════════════════════════════ */

/* ─── TETİKLEYİCİ BUTON (chat header'ına entegre) ─────────────────
   v29.40 — Sol panel layoutu fixed buton'u kapatıyordu. Buton artık
   chat üst şeridinde "Sohbeti Temizle"nin yanında. */
.kc-chat-trigger {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.kc-chat-trigger i {
  /* mevcut .or-chat-action ile uyumlu kalsın; sadece ek glow */
  filter: drop-shadow(0 0 6px rgba(245, 232, 196, 0.45));
  color: #f5e8c4 !important;
}
.kc-chat-trigger:hover i {
  filter: drop-shadow(0 0 10px rgba(245, 232, 196, 0.8));
}
.kc-chat-trigger .kc-trigger-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5e8c4;
  box-shadow: 0 0 6px rgba(245, 232, 196, 0.9),
              0 0 12px rgba(245, 232, 196, 0.5);
  animation: kc-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes kc-pulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.35); }
}

/* ─── OVERLAY ─── */
.kc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.kc-overlay.is-open { display: flex; }

.kc-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,
              rgba(20, 10, 35, 0.86) 0%,
              rgba(0, 0, 0, 0.96) 70%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: kc-fade-in 0.5s ease-out;
}
@keyframes kc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── STAGE (kartların sahnesi) ─── */
.kc-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  max-width: 100%;
  perspective: 1500px;        /* 3D flip için */
  animation: kc-stage-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes kc-stage-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kc-stage-head {
  text-align: center;
  color: #f5e8c4;
}
.kc-stage-title {
  margin: 0 0 8px;
  font: 900 26px/1 'JetBrains Mono', 'Steelfish', monospace;
  letter-spacing: 0.32em;
  text-shadow: 0 0 24px rgba(245, 232, 196, 0.30);
}
.kc-stage-sub {
  margin: 0;
  font: 400 13px/1.4 Georgia, serif;
  color: rgba(220, 200, 160, 0.65);
  letter-spacing: 0.05em;
  font-style: italic;
}

.kc-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 232, 196, 0.10);
  border: 1px solid rgba(245, 232, 196, 0.30);
  color: rgba(245, 232, 196, 0.85);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.kc-close:hover {
  background: rgba(245, 232, 196, 0.22);
  color: #fff;
  transform: rotate(90deg);
}

/* ─── KARTLAR ─── */
.kc-cards {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.kc-card {
  --kc-color: #f5e8c4;
  --kc-glow: rgba(245, 232, 196, 0.55);
  position: relative;
  width: 200px;
  height: 320px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  perspective: 1200px;
  outline: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
  animation: kc-float 4.5s ease-in-out infinite;
}
.kc-card:nth-child(2) { animation-delay: 0.6s; }
.kc-card:nth-child(3) { animation-delay: 1.2s; }
@keyframes kc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.kc-card:hover:not(:disabled) {
  transform: translateY(-18px) scale(1.04);
  z-index: 10;
}
.kc-card:hover:not(:disabled) .kc-card-back {
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.7),
    0 0 50px var(--kc-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.kc-card.is-fading {
  opacity: 0.15;
  transform: scale(0.9);
  pointer-events: none;
}

.kc-card.is-disabled {
  pointer-events: none;
  animation-play-state: paused;
}

.kc-card.is-glow .kc-card-front {
  box-shadow:
    0 0 80px var(--kc-glow),
    0 0 160px var(--kc-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transform: rotateY(180deg) scale(1.08);
}

/* Kart iç wrapper — 3D flip için */
.kc-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.55, 0.05, 0.30, 1);
}
.kc-card.is-flipped .kc-card-inner {
  transform: rotateY(180deg);
}

.kc-card-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

/* ─── KART ARKASI (kapalı yüz) ─── */
.kc-card-back {
  background:
    linear-gradient(180deg, #1a0d22 0%, #0a0612 100%),
    radial-gradient(circle at center, rgba(245, 232, 196, 0.10), transparent 60%);
  border: 1px solid rgba(245, 232, 196, 0.35);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.55),
    0 0 30px var(--kc-glow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pattern (arkasındaki mistik desen) */
.kc-card-pattern {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(245, 232, 196, 0.25);
  border-radius: 8px;
  display: block;
}
.kc-card-pattern::before {
  /* iç ikinci çerçeve */
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(245, 232, 196, 0.12);
  border-radius: 4px;
}
.kc-card-rune {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kc-card-rune::before {
  content: '';
  width: 60px;
  height: 60px;
  border: 1.5px solid rgba(245, 232, 196, 0.55);
  border-radius: 50%;
  box-shadow:
    inset 0 0 12px rgba(245, 232, 196, 0.20),
    0 0 16px rgba(245, 232, 196, 0.25);
}
.kc-card-rune::after {
  /* iç küçük daire (göz bebeği) */
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: rgba(245, 232, 196, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(245, 232, 196, 0.9);
  animation: kc-rune-pulse 2.6s ease-in-out infinite;
}
@keyframes kc-rune-pulse {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

.kc-card-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(245, 232, 196, 0.55);
}
.kc-corner-tl { top: 18px;    left: 18px;
  border-top: 1.5px solid; border-left: 1.5px solid; }
.kc-corner-tr { top: 18px;    right: 18px;
  border-top: 1.5px solid; border-right: 1.5px solid; }
.kc-corner-bl { bottom: 18px; left: 18px;
  border-bottom: 1.5px solid; border-left: 1.5px solid; }
.kc-corner-br { bottom: 18px; right: 18px;
  border-bottom: 1.5px solid; border-right: 1.5px solid; }

.kc-card-back-label {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  font: 700 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.40em;
  color: rgba(245, 232, 196, 0.55);
}

/* ─── KART ÖNÜ (açık yüz) ─── */
.kc-card-front {
  background:
    radial-gradient(circle at 50% 35%, rgba(245, 232, 196, 0.18), transparent 60%),
    linear-gradient(180deg, #1f1230 0%, #0a0612 100%);
  border: 1.5px solid var(--kc-color);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.65),
    0 0 40px var(--kc-glow),
    inset 0 0 30px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  transform: rotateY(180deg);
}
.kc-card-idx {
  position: absolute;
  top: 18px;
  left: 18px;
  font: 700 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.20em;
  color: var(--kc-color);
  opacity: 0.65;
}
.kc-card-idx::before {
  content: '';
  position: absolute;
  top: 18px;
  right: -22px;
  width: 14px;
  height: 1px;
  background: var(--kc-color);
  opacity: 0.5;
}
.kc-card-icon {
  font-size: 64px;
  color: var(--kc-color);
  margin-bottom: 18px;
  text-shadow:
    0 0 24px var(--kc-glow),
    0 0 48px var(--kc-glow);
  animation: kc-icon-glow 3s ease-in-out infinite;
}
@keyframes kc-icon-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}
.kc-card-name {
  font: 900 22px/1 'JetBrains Mono', 'Steelfish', monospace;
  letter-spacing: 0.28em;
  color: var(--kc-color);
  margin-bottom: 8px;
  text-shadow: 0 0 16px var(--kc-glow);
}
.kc-card-sub {
  font: 400 11px/1.3 Georgia, serif;
  font-style: italic;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.05em;
  padding: 0 8px;
}

/* ─── ÇEKİLEN KART ROZETİ (chat header inline) ─── */
.kc-picked-badge {
  --kc-color: #f5e8c4;
  --kc-glow: rgba(245, 232, 196, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  margin-left: 8px;
  background: rgba(245, 232, 196, 0.06);
  border: 1px solid var(--kc-color);
  border-radius: 999px;
  color: var(--kc-color);
  box-shadow: 0 0 10px var(--kc-glow);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.kc-picked-badge.is-show {
  opacity: 1;
  transform: scale(1);
}
.kc-picked-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--kc-color);
  filter: drop-shadow(0 0 4px var(--kc-glow));
}
.kc-picked-name {
  font: 700 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.16em;
  color: var(--kc-color);
}
.kc-picked-redraw {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245, 232, 196, 0.10);
  border: 1px solid rgba(245, 232, 196, 0.25);
  color: rgba(245, 232, 196, 0.85);
  font-size: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.22s, transform 0.22s, color 0.22s;
}
.kc-picked-redraw:hover {
  background: rgba(245, 232, 196, 0.22);
  color: #fff;
  transform: rotate(180deg);
}

/* ─── MOBILE ─── */
@media (max-width: 720px) {
  .kc-cards { gap: 14px; flex-wrap: wrap; }
  .kc-card  { width: 150px; height: 240px; }
  .kc-card-icon { font-size: 48px; margin-bottom: 14px; }
  .kc-card-name { font-size: 18px; letter-spacing: 0.22em; }
  .kc-card-sub  { font-size: 10px; }
  .kc-card-rune::before { width: 50px; height: 50px; }
  .kc-stage-title { font-size: 20px; letter-spacing: 0.24em; }
  .kc-stage-sub   { font-size: 12px; }
  .kc-picked-name { font-size: 9px; letter-spacing: 0.12em; }
}

@media (max-width: 460px) {
  .kc-cards { gap: 10px; }
  .kc-card  { width: 100px; height: 160px; }
  .kc-card-icon { font-size: 32px; margin-bottom: 8px; }
  .kc-card-name { font-size: 13px; letter-spacing: 0.18em; }
  .kc-card-sub  { display: none; }
  .kc-card-idx  { font-size: 9px; top: 8px; left: 8px; }
  .kc-card-idx::before { display: none; }
  .kc-card-rune::before { width: 38px; height: 38px; }
  .kc-card-rune::after  { width: 10px; height: 10px; }
  .kc-card-back-label { font-size: 9px; bottom: 18px; letter-spacing: 0.30em; }
  .kc-card-corner { width: 12px; height: 12px; }
  .kc-corner-tl, .kc-corner-tr { top: 10px; }
  .kc-corner-bl, .kc-corner-br { bottom: 10px; }
  .kc-corner-tl, .kc-corner-bl { left: 10px; }
  .kc-corner-tr, .kc-corner-br { right: 10px; }
}

/* ─── PREFERS REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  .kc-card,
  .kc-card-icon,
  .kc-card-rune::after,
  .kc-chat-trigger .kc-trigger-dot,
  .kc-backdrop {
    animation: none !important;
  }
  .kc-card-inner { transition-duration: 0.4s; }
}
