* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  color: #fff;
  background:
    url("../assets/site-arka-plan.png") center center / cover fixed,
    linear-gradient(135deg, #0d0d1a, #1a1a2e);
  cursor: url("../assets/cursor.png"), auto;
}

/* ===== ÜST LOGO BANDI ===== */
#top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

#logo-img {
  height: 56px;
  object-fit: contain;
}

/* ===== ANA LAYOUT ===== */
#main-layout {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px 30px 30px 24px;
}

/* ===== SOL PANEL ===== */
#side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  width: 160px;
  padding-top: 6px;
  position: sticky;
  top: 90px;
}

/* Düz metin butonlar */
.side-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-align: center;
  cursor: url("../assets/cursor.png"), pointer;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}

.side-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,210,60,0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.side-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.side-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== KART ALANI ===== */
#pack_cont {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
  padding-left: 10px;
}

@media (max-width: 1300px) {
  #pack_cont { grid-template-columns: repeat(6, 1fr); gap: 12px; }
}
@media (max-width: 900px) {
  #main-layout { padding: 16px; gap: 12px; }
  #side-panel { width: 110px; }
  #pack_cont { grid-template-columns: repeat(4, 1fr); gap: 10px; padding-left: 4px; }
}
@media (max-width: 600px) {
  #pack_cont { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #side-panel { width: 85px; }
  #logo-img { height: 42px; }
}

/* ===== KART ===== */
.card {
  aspect-ratio: 2/3;
  perspective: 1200px;
  cursor: url("../assets/cursor.png"), pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.4, 0.64, 1);
  border-radius: 10px;
}

/* Kart açılırken hafif yükselme ve derinlik katma */
.card.flipping {
  z-index: 50;
  animation: card-anticipate 0.75s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes card-anticipate {
  0% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-14px) scale(1.08);
  }
  75% {
    transform: translateY(-4px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.card.open .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* --- KART ÖN YÜZÜ (kapalı) --- */
.card-front {
  background:
    url("../assets/card.jpg") center / cover no-repeat,
    url("../assets/kart-arka-plan.png") center / cover no-repeat,
    radial-gradient(ellipse at center, #1e2840 0%, #0d121d 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.65), 0 0 15px rgba(251, 191, 36, 0.25);
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* --- NUMARA ROZETI --- */
.card-number {
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;

  /* Kart ortasıyla uyumlu koyu cam */
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  /* Kart çerçevesiyle aynı altın/bronz halka */
  box-shadow:
    0 0 0 1.5px rgba(180, 120, 40, 0.85),
    0 0 0 3px rgba(100, 60, 10, 0.5),
    inset 0 1px 3px rgba(220,160,60,0.15),
    inset 0 -1px 3px rgba(0,0,0,0.5);

  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;

  /* Kart çerçevesiyle aynı sıcak altın */
  color: #c8900a;
  text-shadow:
    0 1px 0 rgba(0,0,0,0.95),
    0 0 6px rgba(200,130,10,0.4);
  z-index: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

/* --- KART ARKA YÜZÜ (ödül) --- */
.card-back {
  background: transparent;
  border: none;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* İsim görselin içinde zaten var — gizle */
.card-name {
  display: none;
}

/* Hover (kapalı kartlar) - Canlı Altın Enerji & Yanıp Sönme */
.card:not(.open):not(.shuffle-out):not(.flipping):hover {
  transform: translateY(-8px) scale(1.05);
  z-index: 20;
}

.card:not(.open):not(.shuffle-out):hover .card-front {
  border-color: #ffd242;
  animation: card-energy-pulse 1.1s ease-in-out infinite alternate;
}

/* Kartın üzerinde gezinirken akan ışık hüzmesi (Shimmer/Glint Efekti) */
.card-front::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 235, 160, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(28deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.card:not(.open):not(.shuffle-out):hover .card-front::after {
  opacity: 1;
  animation: card-shimmer 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes card-shimmer {
  0% {
    left: -70%;
  }
  100% {
    left: 140%;
  }
}

/* Yanıp sönen, nefes alan altın aura */
@keyframes card-energy-pulse {
  0% {
    border-color: rgba(255, 190, 40, 0.7);
    box-shadow:
      0 4px 15px rgba(0, 0, 0, 0.5),
      0 0 15px 2px rgba(255, 180, 0, 0.4),
      inset 0 0 10px rgba(255, 210, 80, 0.2);
  }
  100% {
    border-color: #fff099;
    box-shadow:
      0 8px 25px rgba(0, 0, 0, 0.6),
      0 0 32px 8px rgba(255, 200, 50, 0.85),
      0 0 50px 14px rgba(255, 140, 0, 0.4),
      inset 0 0 20px rgba(255, 220, 100, 0.45);
  }
}

.card:not(.open):not(.shuffle-out):hover .card-number {
  animation: badge-throb 0.7s ease-in-out infinite alternate;
  color: #ffffff;
}

@keyframes badge-throb {
  0% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 2px rgba(255, 230, 100, 1),
      0 0 0 4px rgba(120, 60, 0, 0.8),
      0 0 16px 4px rgba(255, 170, 0, 0.6),
      inset 0 2px 4px rgba(255, 255, 200, 0.5);
  }
  100% {
    transform: scale(1.15);
    box-shadow:
      0 0 0 2.5px #fff,
      0 0 0 5px rgba(255, 140, 0, 0.9),
      0 0 28px 10px rgba(255, 210, 50, 0.95),
      inset 0 2px 6px rgba(255, 255, 255, 0.8);
  }
}

/* Açılma anı: Parlama & Büyülü Halka Dalgası */
.card.just-opened .card-back {
  animation: magical-reveal 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes magical-reveal {
  0% {
    filter: brightness(1.6);
    box-shadow: 0 0 0px 0px rgba(255, 215, 0, 0);
  }
  35% {
    filter: brightness(1.4);
    box-shadow: 0 0 30px 10px rgba(255, 200, 50, 0.85), 0 0 60px 20px rgba(255, 150, 0, 0.45);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  }
}

/* ===== KARIŞTIRMA ANİMASYONU ===== */
.card.shuffle-out .card-inner {
  animation: shuffle-out 0.42s ease-in forwards;
}

.card.open.shuffle-out .card-inner {
  animation: shuffle-out-open 0.42s ease-in forwards;
}

@keyframes shuffle-out {
  0%   { transform: rotateY(0deg) scale(1); opacity: 1; }
  45%  { transform: rotateY(90deg) scale(0.8); opacity: 0.6; }
  100% { transform: rotateY(0deg) scale(0) translateY(-18px); opacity: 0; }
}

@keyframes shuffle-out-open {
  0%   { transform: rotateY(180deg) scale(1); opacity: 1; }
  45%  { transform: rotateY(90deg) scale(0.8); opacity: 0.6; }
  100% { transform: rotateY(0deg) scale(0) translateY(-18px); opacity: 0; }
}

.card.shuffle-in .card-inner {
  animation: shuffle-in 0.38s ease-out forwards;
}

@keyframes shuffle-in {
  0%   { transform: scale(0) translateY(18px); opacity: 0; }
  65%  { transform: scale(1.05) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===== OVERLAY ===== */
#shuffle-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

#shuffle-overlay.visible { display: flex; }

.overlay-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0c040;
  text-shadow: 0 0 20px rgba(240,192,64,0.7);
  letter-spacing: 3px;
  animation: pulse-text 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-text {
  from { opacity: 0.6; transform: scale(0.97); }
  to   { opacity: 1;   transform: scale(1.04); }
}

.overlay-dots {
  display: flex;
  gap: 10px;
}

.overlay-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f0c040;
  animation: dot-bounce 0.6s ease-in-out infinite alternate;
}

.overlay-dots span:nth-child(2) { animation-delay: 0.15s; }
.overlay-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes dot-bounce {
  from { transform: translateY(0); opacity: 0.4; }
  to   { transform: translateY(-10px); opacity: 1; }
}

/* ===== FOOTER ===== */
#footer {
  text-align: center;
  padding: 10px 0 0;
}

#footer-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
