/* Baazigar Neo-Noir Bollywood Thriller Stylesheet */
:root {
  --bg-primary: #08090e;
  --bg-secondary: #10121a;
  --bg-card: rgba(20, 24, 36, 0.85);
  --bg-card-hover: rgba(30, 36, 54, 0.95);
  --crimson-glow: #e63946;
  --crimson-hot: #ff1e38;
  --gold: #f59e0b;
  --gold-glow: #fbbf24;
  --cyan: #06d6a0;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(245, 158, 11, 0.35);
  --border-crimson: rgba(230, 57, 70, 0.45);
  --font-serif: 'Cinzel', serif;
  --font-hindi: 'Noto Sans Devanagari', 'Outfit', sans-serif;
  --font-sans: 'Outfit', sans-serif;
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

.hindi-text, .quote-text-hindi, .cinematic-quote {
  font-family: var(--font-hindi);
}

/* Background Canvas for Noir Rain */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--crimson-hot), #800f2f);
  border: 1px solid var(--gold-glow);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.4);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 20%, var(--gold-glow) 70%, var(--crimson-hot));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}

.brand-subtitle {
  font-size: 0.7rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chip-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--border-gold);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-weight: 700;
  color: var(--gold-glow);
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* Quote Banner */
.quote-banner {
  background: linear-gradient(90deg, rgba(230, 57, 70, 0.15), rgba(16, 18, 26, 0.9) 50%, rgba(245, 158, 11, 0.15));
  border: 1px solid var(--border-crimson);
  border-radius: 14px;
  padding: 1.1rem 1.6rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.quote-banner::before {
  content: '“';
  position: absolute;
  left: 10px;
  top: -15px;
  font-size: 5rem;
  color: rgba(230, 57, 70, 0.2);
  font-family: serif;
}

.quote-text-hindi {
  font-family: var(--font-hindi) !important;
  font-size: 1.12rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: 0.5px;
}

.quote-text-english {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Game Arena Layout */
.game-arena {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.arena-board {
  background: radial-gradient(circle at center, #1b2030 0%, #0d0f17 100%);
  border: 2px solid var(--border-gold);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.5);
  position: relative;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Boss & Player HUDs */
.combat-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--border-subtle);
}

.hud-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-avatar {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gold);
}

.hud-details h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff;
}

.hud-details .hud-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.health-bar-container {
  width: 180px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06d6a0);
  transition: width 0.4s ease;
}

.health-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Baazigar Comeback Meter */
.meter-wrapper {
  margin: 1.25rem 0;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid var(--border-crimson);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.15);
}

.meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meter-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--crimson-hot);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 1px;
}

.baazigar-progress-bar {
  height: 18px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.baazigar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4d6d, var(--crimson-hot), #ffb703);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px var(--crimson-hot);
}

.baazigar-strike-btn {
  background: linear-gradient(135deg, var(--crimson-hot), #9d0208);
  border: 2px solid var(--gold-glow);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  animation: pulseAura 1.5s infinite;
  box-shadow: 0 0 25px rgba(230, 57, 70, 0.6);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.baazigar-strike-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 35px rgba(230, 57, 70, 0.9);
}

@keyframes pulseAura {
  0% { box-shadow: 0 0 15px rgba(230, 57, 70, 0.5); }
  50% { box-shadow: 0 0 30px rgba(255, 30, 56, 0.9), 0 0 10px var(--gold); }
  100% { box-shadow: 0 0 15px rgba(230, 57, 70, 0.5); }
}

/* Battle Table Center */
.clash-zone {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  margin: 1.5rem 0;
  min-height: 160px;
}

.card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.card-slot-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* Playing Card Styling */
.playing-card {
  width: 105px;
  height: 155px;
  background: linear-gradient(145deg, #1c2234, #121622);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.playing-card:hover {
  transform: translateY(-8px) scale(1.04);
  border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.35);
  z-index: 10;
}

.playing-card.special-card {
  background: linear-gradient(145deg, #2a1622, #180d15);
  border-color: var(--gold-glow);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
}

.card-center-symbol {
  font-size: 1.8rem;
}

.card-title-text {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--gold-glow);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.card-power-badge {
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Player Hand Deck */
.player-hand-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hand-cards-list {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* History Logs & Activity Box */
.history-feed {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-item {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--gold);
}

/* Action Controls & Bet Bar */
.game-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--crimson-glow), #9d0208);
  border: 1px solid var(--border-gold);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--crimson-hot), var(--crimson-glow));
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #d97706);
  border: 1px solid #fef08a;
  color: #000;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-glow), var(--gold));
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* Cinematic Overlay */
.cinematic-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  animation: cinematicFlash 0.5s ease;
}

@keyframes cinematicFlash {
  0% { background: #fff; opacity: 1; }
  15% { background: rgba(230, 57, 70, 0.9); }
  100% { background: rgba(0, 0, 0, 0.88); }
}

.cinematic-quote {
  font-family: var(--font-hindi) !important;
  font-size: 2.2rem;
  color: #fff;
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
  margin-bottom: 1rem;
  max-width: 800px;
  line-height: 1.3;
}

.cinematic-sub {
  font-size: 1.1rem;
  color: var(--gold-glow);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Header Help Button */
.help-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold-glow);
  font-weight: 600;
}

.help-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* App Footer */
.app-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--gold-glow);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.footer-link-btn:hover {
  color: #fff;
}

.footer-dot {
  color: var(--text-muted);
}

.footer-email-link {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-email-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 600px;
}

/* Instructions & Help Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #0f121b;
  border: 2px solid var(--border-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.2);
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(20, 24, 36, 0.6);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon {
  font-size: 1.8rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold-glow);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--crimson-hot);
  border-color: var(--crimson-hot);
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) rgba(0, 0, 0, 0.3);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(20, 24, 36, 0.6);
}

.help-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.help-heading {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 0.4rem;
}

.help-heading-icon {
  font-size: 1.2rem;
}

.help-text {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.help-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
}

.help-card-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.help-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.help-cards-table {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.help-special-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.special-badge {
  background: rgba(230, 57, 70, 0.2);
  border: 1px solid var(--crimson-glow);
  color: #ffb703;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.special-details {
  color: #e2e8f0;
  flex: 1;
}

/* Support Box */
.support-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(230, 57, 70, 0.08));
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 1.25rem;
}

.support-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.support-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.support-icon {
  font-size: 1.8rem;
}

.support-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.support-email-link {
  font-size: 1.05rem;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
  transition: all 0.2s ease;
}

.support-email-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.support-btn {
  text-decoration: none;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }
  .clash-zone {
    gap: 1.5rem;
  }
  .playing-card {
    width: 82px;
    height: 125px;
    padding: 0.5rem;
  }
  .card-center-symbol {
    font-size: 1.3rem;
  }
  .cinematic-quote {
    font-size: 1.5rem;
  }
  .modal-card {
    max-height: 92vh;
  }
  .help-special-row {
    flex-direction: column;
    gap: 0.4rem;
  }
  .support-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .support-btn {
    width: 100%;
    justify-content: center;
  }
}
