* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
}

/* 1. HAREKETLİ VE CANLI ARKA PLAN (Arabamon Mavisi & Lacivert) */
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body {
  background: linear-gradient(-45deg, #001f3f, #0056b3, #003366, #0b132b);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* 2. BUZLU CAM EFEKTİ (Glassmorphism) ANA KASA */
#game-container {
  width: 95%; 
  max-width: 450px;
  background: rgba(255, 255, 255, 0.08); /* Yarı saydam beyaz */
  backdrop-filter: blur(15px); /* Arkadaki hareketli renkleri bulandırır */
  -webkit-backdrop-filter: blur(15px);
  padding: 20px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Ses Aç/Kapat Butonu */
#mute-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 11;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 0.15s, background 0.2s;
}

#mute-btn:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.1); }
#mute-btn:active { transform: scale(0.92); }

/* Üst Taraf (HUD) */
#top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 25px;
  width: 100%;
}

/* 3. NEON PARLAYAN LOGO */
@keyframes neonPulse {
  0% { text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px #0056b3; }
  50% { text-shadow: 0 0 15px #fff, 0 0 30px #00aaff; }
  100% { text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px #0056b3; }
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.logo-img {
  height: 42px;
  width: auto;
  max-width: 100%;
  display: block;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
}

.logo-slogan {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #cfe3ff;
  text-shadow: 0 0 12px rgba(51, 153, 255, 0.5);
}

.text-navy {
  color: #3399ff; /* Koyu zeminde parlaması için açık lacivert/mavi tonu */
  text-shadow: 0 0 15px rgba(51, 153, 255, 0.5);
}

.text-white {
  color: #ffffff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Hesap Makinesi Görünümünden Kurtaran Kapsül Panel */
.stats-panel {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.3) 100%);
  border-radius: 50px; /* Tam yuvarlak kapsül uçları */
  padding: 12px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}


.stat-box {
  text-align: center;
  flex: 1;
  transition: transform 0.2s;
}

.stat-box:hover {
  transform: scale(1.1); /* Üzerine gelince hafif büyüsün */
}

.divider {
  width: 2px;
  height: 35px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.stat-box .label {
  display: block;
  font-size: 11px;
  color: #a0aec0;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.stat-box .value {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Oyun Tahtası */
#board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 6px; /* Kutular arası boşluğu biraz açtık */
  background: rgba(0, 0, 0, 0.25); 
  padding: 8px;
  border-radius: 16px;
  aspect-ratio: 1 / 1; 
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* 4. 3D JELİBON/BUTON HİSSİYATI VEREN KUTULAR */
.item {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%); 
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  cursor: grab;
  touch-action: none; /* Mobilde kaydırma jestlerinin tarayıcıyla çakışmasını önler */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 3px solid rgba(0, 0, 0, 0.3); /* 3D derinlik için alt gölge */
  box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Sekme animasyonu */
}

.item:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 100%); 
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.item:active {
  cursor: grabbing;
  transform: scale(0.9) translateY(2px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.3); /* Basılınca göçme efekti */
  box-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Animasyonlar */
@keyframes dropIn {
  0%   { transform: translateY(-110%) scaleY(1.15) scaleX(0.9); opacity: 0; }
  40%  { opacity: 1; }
  60%  { transform: translateY(0) scaleY(0.82) scaleX(1.12); } /* yere çarpınca ezilme */
  80%  { transform: translateY(-12%) scaleY(1.06) scaleX(0.97); } /* hafif sekme */
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.falling {
  animation: dropIn 0.32s cubic-bezier(0.34, 1.4, 0.5, 1);
}

/* Eşleşen taşların patlaması */
@keyframes pop {
  0%   { transform: scale(1); opacity: 1; }
  45%  { transform: scale(1.35) rotate(8deg); filter: brightness(1.6); }
  100% { transform: scale(0); opacity: 0; }
}

.popping {
  animation: pop 0.22s ease-in forwards;
  z-index: 4;
}

/* Oyun Bitti Ekranı */
#game-over {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 31, 63, 0.9); /* Lacivert blur */
  backdrop-filter: blur(10px);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 18px;
  overflow-y: auto; /* Küçük ekranlarda içerik taşarsa kaydırılabilsin */
  z-index: 10;
}

/* Kupon ekranındaki beyaz logo */
#go-logo {
  width: 65%;
  max-width: 220px;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

/* Uygulama indirme çağrısı */
.app-cta {
  color: #cfe3ff;
  font-size: 14px;
  line-height: 1.4;
  margin: 2px 0 16px;
  text-align: center;
  max-width: 85%;
}

/* App Store / Google Play butonları */
.store-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

.store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #000000;
  color: #ffffff;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

.store-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); }
.store-btn:active { transform: scale(0.97); }
.store-btn svg { flex-shrink: 0; }

.store-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
  font-size: 16px;
  font-weight: 700;
}

.store-text small {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hidden {
  display: none !important;
}

.coupon {
  background: linear-gradient(135deg, #ffffff 0%, #e6f0ff 100%);
  border: 3px dashed #0056b3;
  padding: 25px;
  margin: 25px 0;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 900;
  color: #0056b3;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.1);
  animation: neonPulse 3s infinite alternate;
}

#restart-btn {
  background: linear-gradient(135deg, #00aaff 0%, #0056b3 100%);
  color: #ffffff;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 5px 15px rgba(0, 86, 179, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#restart-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 86, 179, 0.7);
}

#restart-btn:active {
  transform: scale(0.95);
}

/* 📱 Mobilde Kapsülün Düzgün Durması İçin Güncelleme 📱 */
@media (max-width: 480px), (max-height: 750px) {
  .logo-img { height: 34px; }
  .logo-slogan { font-size: 11px; }
  .stats-panel { padding: 8px 10px; border-radius: 30px; }
  .stat-box .label { font-size: 9px; }
  .stat-box .value { font-size: 18px; }
  .divider { height: 25px; }
}
/* ------------------------------------------- */