/* ================================================================
   TaleNPlay — Global Brand CSS
   /css/global.css
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800;900&family=Literata:ital,opsz,wght@0,7..72,300;0,7..72,400;0,7..72,600;1,7..72,400&family=Noto+Sans+Devanagari:wght@400;600;700;800&display=swap');

/* ===== HINDI / DEVANAGARI FONT ===== */
:lang(hi), .lang-hi {
  font-family: 'Noto Sans Devanagari', sans-serif !important;
}

/* ===== BRAND TOKENS ===== */
:root {
  --ember-glow: #FF8C42;
  --ember-deep: #E85520;
  --gold: #FFB830;
  --gold-light: #FFD166;
  --jungle: #1A3A2A;
  --jungle-mid: #2D5A40;
  --jungle-light: #4A8C5C;
  --jungle-pale: #6BBF7A;
  --ink: #0F1A14;
  --ink-soft: #1C2E22;
  --parchment: #FDF6EC;
  --parchment2: #F5EDD8;
  --text: #1C1C1C;
  --text-soft: #7A7060;
  --border: #EDE6D8;
  --green: #4CAF50;
  --blue: #4D96FF;
  --purple: #C77DFF;
  --pink: #FF6B9D;
  --red: #E63946;
  --card-shadow: 0 4px 16px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 10px 32px rgba(0,0,0,0.14);
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; }
body {
  font-family: 'Literata', Georgia, serif;
  background: var(--ink);
  color: var(--text);
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, .display {
  font-family: 'Baloo 2', cursive;
  font-weight: 800;
}
.mono { font-family: 'Baloo 2', cursive; }

/* ===== LOGO ===== */
.tnp-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.tnp-logo-mark {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--ember), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  box-shadow: 0 4px 16px rgba(255,107,43,0.45);
  flex-shrink: 0;
}
.tnp-logo-text {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.tnp-logo-text .t { color: white; }
.tnp-logo-text .n { color: var(--gold); }
.tnp-logo-text .p { color: var(--ember-glow); }
.tnp-logo-tag {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  font-family: 'Baloo 2', cursive;
  margin-top: 1px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 18px;
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-full { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 18px; }
.btn-md { padding: 12px 20px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--ember), var(--ember-glow));
  color: white;
  box-shadow: 0 8px 24px rgba(255,107,43,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(255,107,43,0.5); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--ember-glow));
  color: white;
  box-shadow: 0 8px 24px rgba(255,184,48,0.4);
}
.btn-gold:hover { transform: translateY(-2px); }
.btn-green {
  background: linear-gradient(135deg, #6BCB77, #4CAF50);
  color: white;
  box-shadow: 0 8px 24px rgba(107,203,119,0.4);
}
.btn-green:hover { transform: translateY(-2px); }
.btn-ghost {
  background: #F5F5F5;
  color: var(--text-soft);
}
.btn-ghost:hover { background: #EBEBEB; }
.btn-dark {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-dark:hover { background: rgba(255,255,255,0.18); }

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

/* ===== LOADING SPINNER ===== */
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(255,107,43,0.2);
  border-top-color: var(--ember);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text {
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
}

/* ===== TOAST ===== */
#tnp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: white;
  padding: 10px 18px;
  border-radius: 18px;
  font-family: 'Baloo 2', cursive;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
  max-width: 330px;
  text-align: center;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
#tnp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== COIN OVERLAY ===== */
.coin-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%);
}
.coin-overlay.show { display: flex; }
.coin-overlay-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
}
.coin-popup {
  background: linear-gradient(135deg, var(--ink), #2D2D5E);
  border-radius: 28px;
  padding: 36px 32px;
  text-align: center;
  position: relative; z-index: 2;
  max-width: 300px; width: 90%;
  border: 2px solid rgba(255,184,48,0.3);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from{opacity:0;transform:scale(0.7);} to{opacity:1;transform:scale(1);} }
.cp-emoji { font-size: 72px; display: block; margin-bottom: 10px; animation: cpBounce 1.5s infinite; }
@keyframes cpBounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.cp-title { font-family: 'Baloo 2',cursive; font-size: 26px; font-weight: 900; color: var(--gold); margin-bottom: 5px; }
.cp-amount { font-family: 'Baloo 2',cursive; font-size: 48px; font-weight: 900; color: white; display: block; margin-bottom: 5px; }
.cp-sub { font-size: 13px; color: rgba(255,255,255,0.5); font-family:'Baloo 2',cursive; margin-bottom: 22px; line-height: 1.5; }
.cp-total { font-family:'Baloo 2',cursive; font-size: 13px; font-weight: 800; color: rgba(255,255,255,0.35); margin-bottom: 18px; }
.cp-total span { color: var(--gold); }

/* ===== CONFETTI ===== */
.confetti-wrap {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  max-width: 430px; left: 50%;
  transform: translateX(-50%);
}
.conf-dot {
  position: absolute; top: -10px;
  animation: confDrop linear forwards;
}
@keyframes confDrop { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ===== SCROLLBARS — hide globally ===== */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from{opacity:0;transform:translateY(14px);} to{opacity:1;transform:translateY(0);} }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes slideUp { from{transform:translateY(100%);} to{transform:translateY(0);} }
@keyframes bounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
@keyframes floatAnim { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-7px);} }
@keyframes shimmer { 0%,100%{opacity:0.5;} 50%{opacity:1;} }

.animate-fadeup { animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.animate-bounce { animation: bounce 2s ease-in-out infinite; }
.animate-float { animation: floatAnim 2.5s ease-in-out infinite; }

/* ===== UTILITY ===== */
.mt8{margin-top:8px;} .mt12{margin-top:12px;} .mt16{margin-top:16px;} .mt20{margin-top:20px;}
.px18{padding-left:18px;padding-right:18px;}
.text-gold{color:var(--gold);}
.text-ember{color:var(--ember);}
.text-white{color:white;}
.text-soft{color:var(--text-soft);}
.font-display{font-family:'Baloo 2',cursive;}
.hidden{display:none!important;}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 20px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
  z-index: 200;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; padding: 6px 0;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-item-icon { font-size: 20px; transition: transform 0.2s; }
.nav-item.active .nav-item-icon { transform: scale(1.15); }
.nav-item-label {
  font-family: 'Baloo 2', cursive;
  font-size: 9px; font-weight: 800;
  color: #C5B99A; letter-spacing: 0.5px;
}
.nav-item.active .nav-item-label { color: var(--ember); }
.nav-pip {
  width: 4px; height: 4px;
  background: var(--ember); border-radius: 50%;
  display: none;
}
.nav-item.active .nav-pip { display: block; }

/* ===== ERROR STATES ===== */
.error-box {
  background: #FFEBEE;
  border: 1.5px solid #EF5350;
  border-radius: 16px;
  padding: 16px;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  font-weight: 700;
  color: #C62828;
  text-align: center;
  margin: 16px 0;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-emoji { font-size: 56px; display: block; margin-bottom: 14px; }
.empty-state-title { font-family:'Baloo 2',cursive; font-size: 20px; font-weight: 800; color: white; margin-bottom: 8px; }
.empty-state-sub { font-size: 14px; color: rgba(255,255,255,0.45); font-style: italic; }
