* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', -apple-system, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #3b2a1a;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* App Container with Wooden Plank Background */
.screen {
  display: none;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding-bottom: 80px;
  background: repeating-linear-gradient(
    0deg,
    #d8a474,
    #d8a474 24px,
    #cf9867 24px,
    #cf9867 26px
  );
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* Top Bar Profile */
.top-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(80, 48, 25, 0.85);
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  border-bottom: 2px solid #5e3a1f;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #6a4223;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #8e5c35;
}

.airdrop-badge {
  background: #f77f00;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #ffd166;
}

/* Upper Cafe Room Stage */
.cafe-stage {
  position: relative;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(166, 114, 78, 0.4) 0%, rgba(216, 164, 116, 0) 100%);
  overflow: hidden;
}

.character-sprite {
  font-size: 64px;
  filter: drop-shadow(0 8px 4px rgba(0,0,0,0.25));
  z-index: 2;
}

.roaming-cats {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cat-wander {
  position: absolute;
  font-size: 28px;
  animation: floatCat 3s infinite ease-in-out alternate;
}

.cat-1 { left: 15%; bottom: 20%; animation-delay: 0s; }
.cat-2 { right: 20%; bottom: 30%; animation-delay: 1s; }
.cat-3 { left: 40%; top: 20%; animation-delay: 0.5s; }

@keyframes floatCat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.auth-status {
  position: absolute;
  bottom: 6px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
}

/* Middle Stats Capsule Bar (Exact Catizen Style) */
.stats-capsule-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
}

.capsule {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}

.coin-capsule {
  background: #fff3db;
  border: 2px solid #d4a373;
  color: #7b4b28;
}

.speed-capsule {
  background: #cbf3d2;
  border: 2px solid #58b368;
  color: #1e6e2f;
}

.rank-capsule {
  background: #fed9b7;
  border: 2px solid #e07a5f;
  color: #8c3b23;
  font-size: 12px;
}

/* 3x4 Wooden Merge Grid Arena */
.wooden-grid-frame {
  margin: 10px 14px;
  background: #8c5830;
  border: 6px solid #633e20;
  border-radius: 20px;
  padding: 10px;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.25);
}

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

/* Dynamic Cat Image Styling */
.pet-icon {
  width: 65%; /* FIX 4: 55px hata kar 65% kiya, ab cat dabbe ke hisaab se chhoti hogi */
  height: 65%;
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,0.15));
  pointer-events: none; 
  margin: auto;
}

.grid-slot.occupied {
  background: linear-gradient(145deg, #ffffff, #ffead2) !important; /* 3D Lighting effect */
  border: 3px solid #ff9f1c !important; /* Solid Orange Border */
  border-radius: 16px !important;
  box-shadow: inset 0 -4px 0 #fce5cd, 0 4px 8px rgba(0,0,0,0.1) !important; /* Niche se 3D pop aur shadow */
}

/* ================= ULTIMATE CAT SIZE FIX ================= */
.pet-icon {
  width: 60% !important;     /* !important JS ka inline style override karega */
  height: 60% !important;    
  max-width: 55px !important;
  max-height: 55px !important;
  object-fit: contain !important;
  margin: auto !important;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,0.15));
  pointer-events: none;
}

.pet-level {
  position: absolute;
  top: 4px;
  right: 6px;
  background: #f77f00;
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Bottom Action Area: Buy Miner Button */
.action-footer {
  padding: 10px 14px;
  margin-top: auto;
}

.catizen-buy-btn {
  width: 100%;
  background: linear-gradient(180deg, #ff9f1c 0%, #ed7b00 100%);
  border: 3px solid #fff;
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 5px 0 #a85700, 0 8px 15px rgba(0,0,0,0.3);
  cursor: pointer;
  color: white;
}

.catizen-buy-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #a85700, 0 4px 8px rgba(0,0,0,0.3);
}

.btn-left {
  position: relative;
  display: flex;
  align-items: center;
}

.buy-cat-icon {
  font-size: 32px;
}

.buy-lv-badge {
  background: #d62828;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid #fff;
  margin-left: -10px;
  margin-top: 18px;
}

.btn-center .btn-title {
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 2px rgba(0,0,0,0.3);
}

.btn-right {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.25);
  padding: 6px 12px;
  border-radius: 20px;
}

.price-val {
  font-size: 16px;
  font-weight: 800;
}

/* Sub-header and Empty cards for other tabs */
.sub-header {
  padding: 16px;
  color: #fff;
  text-align: center;
}

.empty-card {
  margin: 14px;
  padding: 30px;
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  text-align: center;
  color: #5e3a1f;
  font-weight: bold;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: #472b15;
  border-top: 2px solid #633e20;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 100;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #c9ab8d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  flex: 1;
}

.nav-item.active {
  color: #ff9f1c;
}

.nav-icon {
  font-size: 22px;
}

/* =========================================================
   AUTHENTICATION OVERLAY & ANIMATED FORMS
========================================================= */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(23, 20, 18, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  transition: opacity 0.3s ease;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff8f0;
  border: 4px solid #8c5830;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  color: #3b2a1a;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo {
  font-size: 48px;
  display: block;
}

.auth-header h2 {
  font-size: 22px;
  color: #633e20;
  margin-top: 4px;
}

.auth-header p {
  font-size: 13px;
  color: #7b5836;
}

/* Sliding Tab Container */
.auth-toggle-box {
  position: relative;
  display: flex;
  background: #ecdcc9;
  border-radius: 30px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid #c9ae92;
}

.tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #f77f00;
  border-radius: 26px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 800;
  color: #7b5836;
  z-index: 2;
  cursor: pointer;
  transition: color 0.3s ease;
}

.auth-tab.active {
  color: #ffffff;
}

/* Form Transitions & Animations */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: fadeInSlide 0.35s ease forwards;
}

.auth-form.active-form {
  display: flex;
}

@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  border: 2px solid #d4b494;
  border-radius: 12px;
  font-size: 14px;
  color: #3b2a1a;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #f77f00;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
  font-weight: bold;
}

.forgot-link {
  color: #d64000;
  cursor: pointer;
  text-decoration: underline;
}

.auth-submit-btn {
  background: linear-gradient(180deg, #ff9f1c 0%, #ed7b00 100%);
  color: white;
  border: 2px solid #fff;
  border-radius: 24px;
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #a85700;
  transition: transform 0.1s;
}

.auth-submit-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a85700;
}

.signup-btn {
  background: linear-gradient(180deg, #2ec4b6 0%, #1e9d91 100%);
  box-shadow: 0 4px 0 #15736a;
}

.signup-btn:active {
  box-shadow: 0 2px 0 #15736a;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: #8c6d53;
  font-size: 12px;
  font-weight: bold;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #d4b494;
}

.auth-divider span {
  padding: 0 10px;
}

.google-btn {
  width: 100%;
  background: #ffffff;
  border: 2px solid #d4b494;
  border-radius: 24px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #3b2a1a;
  cursor: pointer;
  box-shadow: 0 3px 0 #d4b494;
}

.google-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #d4b494;
}

.google-icon {
  background: #ea4335;
  color: white;
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.text-btn {
  background: none;
  border: none;
  color: #7b5836;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  margin-top: 6px;
}

.reset-desc {
  font-size: 13px;
  color: #633e20;
  text-align: center;
  margin-bottom: 8px;
}

.auth-error {
  margin-top: 12px;
  font-size: 12px;
  color: #d62828;
  font-weight: bold;
  text-align: center;
}

.profile-card-content {
  margin: 14px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  color: #5e3a1f;
}

.profile-card-content p {
  margin-bottom: 10px;
}

.logout-btn {
  margin-top: 16px;
  width: 100%;
  background: #d62828;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* ================= PHASE 6: DRAG & DROP EFFECTS ================= */
.grid-slot {
  background: rgba(140, 88, 48, 0.1) !important; /* Halka transparent glass effect */
  border: 2px dashed rgba(140, 88, 48, 0.4) !important; /* Premium Dashed Border */
  border-radius: 16px !important;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

/* Jab cat ko uthaya jayega */
.grid-slot.dragging {
  opacity: 0.5;
  transform: scale(0.9);
}

/* Jab cat kisi aur slot ke upar hogi */
.grid-slot.drag-over {
  background-color: #ffe8cc !important;
  border: 3px dashed #f77f00 !important;
  transform: scale(1.05);
}

/* ================= PREMIUM GAME ALERT POPUP ================= */
.custom-alert-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px); /* Piche ka game blur karne ke liye */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.custom-alert-overlay.hidden {
  display: none;
  opacity: 0;
}

.custom-alert-box {
  background: linear-gradient(145deg, #fffaf0, #ffecd2); /* Premium Cream Background */
  border: 3px solid #f77f00; /* Orange Border */
  width: 80%;
  max-width: 320px;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 0 15px rgba(255,255,255,0.7);
  text-align: center;
  transform: scale(1);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy Animation */
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.custom-alert-title {
  font-size: 22px;
  color: #d66c00;
  margin-bottom: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.custom-alert-message {
  font-size: 16px;
  color: #3b2a1a; /* Dark brown text for readability */
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: bold;
}

.custom-alert-actions {
  display: flex;
  justify-content: center; /* Button center mein */
}

/* 3D Game Style Button */
.custom-alert-btn {
  background: linear-gradient(to bottom, #ff9f43, #f77f00);
  border: 2px solid #cc6600;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 40px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 #cc6600, 0 8px 15px rgba(247,127,0,0.4); /* 3D pop effect */
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.1s;
}

.custom-alert-btn:active {
  transform: translateY(4px); /* Click karne par button dabega */
  box-shadow: 0 0 0 #cc6600, 0 4px 5px rgba(247,127,0,0.4);
}

/* ================= PHASE 11: PREMIUM WALLET & CLAIM UI ================= */
.mining-vault-card {
  background: linear-gradient(135deg, #2c3e50, #1a252f);
  border: 2px solid #34495e;
  border-radius: 16px;
  padding: 18px;
  color: white;
  text-align: center;
  margin: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
.mining-vault-card h4 {
  margin: 0; font-size: 12px; color: #bdc3c7; text-transform: uppercase; letter-spacing: 1px;
}
.live-mining-amount {
  font-size: 28px; font-weight: 900; color: #f1c40f; margin: 8px 0;
}
.claim-btn {
  width: 100%; padding: 12px; border-radius: 10px; border: none; font-weight: bold; font-size: 15px;
  background: #7f8c8d; color: #ecf0f1; cursor: not-allowed; transition: all 0.3s;
}
.claim-btn.ready {
  background: linear-gradient(to bottom, #f1c40f, #f39c12); color: #8B4513; cursor: pointer;
  box-shadow: 0 4px 0 #d68910, 0 8px 15px rgba(241,196,15,0.4);
}
.claim-btn.ready:active { transform: translateY(4px); box-shadow: 0 0 0 #d68910; }

.wallet-balance-card {
  background: linear-gradient(135deg, #f77f00, #d66c00);
  border-radius: 16px; padding: 24px; color: white; text-align: center; margin: 0 16px 16px 16px;
  box-shadow: 0 8px 20px rgba(247, 127, 0, 0.4);
}

/* ================= SCREEN OVERLAP FIX ================= */
.screen {
  display: none !important;
}

.screen.active {
  display: block !important;
  animation: fadeIn 0.2s ease-in-out;
}

#screen-home.active {
  display: flex !important;
  flex-direction: column !important;
}

/* ================= 3D ANIMATED TEXT FOR BOXES ================= */
.animated-text {
  font-weight: 900;
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
  animation: popPulse 1s infinite alternate ease-in-out;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loading-text {
  color: #8c5830;
  opacity: 0.7;
}

.buy-text {
  color: #d66c00;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

@keyframes popPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* Netlify Badge Remover */
a[href*="netlify.com"] {
    display: none !important;
}
