/* ==========================================================================
   STEMMER MARKETS - RESPONSIVE HOMEPAGE STYLESHEET
   Stemmer Markets Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES & RESET
   -------------------------------------------------------------------------- */
:root {
  --stemmer-violet: #7980FA;
  --stemmer-violet-hover: #676ef8;
  --stemmer-violet-light: rgba(121, 128, 250, 0.12);
  --stemmer-dark: #09090B;
  --stemmer-black: #0f172a;
  
  --bg-page: #fff;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-focus: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --color-yes: #16a34a;
  --color-yes-bg: rgba(34, 197, 94, 0.14);
  --color-no: #ef4444;
  --color-no-bg: rgba(239, 68, 68, 0.12);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-logo: 'Cinzel', 'Playfair Display', Georgia, serif;
  
  --header-height: 64px;
  --container-max-width: 1240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 14px 24px -4px rgba(0, 0, 0, 0.09), 0 6px 10px -4px rgba(0, 0, 0, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
}

/* ==========================================================================
   SVG ICON UTILITY & AUTOMATIC FALLBACK SYSTEM
   Ensures icons render even if backend strips SVG paths
   ========================================================================== */
.svg-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

/* Fallback for empty Hamburger Menu icon */
.btn-mobile-menu-trigger svg:empty,
.btn-mobile-menu svg:empty {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.btn-mobile-menu-trigger svg:empty::before,
.btn-mobile-menu svg:empty::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background-color: currentColor;
  box-shadow: 0 -5px 0 0 currentColor, 0 5px 0 0 currentColor;
}

/* Fallback for empty Close (X) icon */
.drawer-close-btn svg:empty::before,
.modal-close-btn svg:empty::before {
  content: "✕";
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
}

/* Fallback for empty Search magnifying glass icon */
.search-icon svg:empty::before {
  content: "🔍";
  font-size: 13px;
  line-height: 1;
}

/* Fallback for empty Category icons */
.category-pill svg:empty::before {
  content: "🏛️";
  font-size: 13px;
  line-height: 1;
}

/* ==========================================================================
   UNIVERSAL CONTAINER CLASS (.page-width)
   Use anywhere to standardize max-width, centering, and responsive padding
   ========================================================================== */
.page-width {
  max-width: var(--container-max-width, 1240px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* --------------------------------------------------------------------------
   2. PURE HTML/CSS LOGO (NO IMAGES)
   Exact match to Stemmer Markets branding:
   - "STEMMER" in light periwinkle/violet (#7980FA)
   - "MARKETS" in solid deep black (#09090B)
   - High-contrast bold Roman serif typeface (Cinzel / Playfair Display)
   -------------------------------------------------------------------------- */
.stemmer-logo-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.stemmer-logo-brand:hover {
  opacity: 0.9;
}

.stemmer-logo-text {
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 25px);
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  gap: 0.35em;
}

.stemmer-logo-text .word-stemmer {
  color: var(--stemmer-violet); /* #7980FA */
}

.stemmer-logo-text .word-markets {
  color: var(--stemmer-dark); /* #09090B */
}

/* --------------------------------------------------------------------------
   3. TOP NAVIGATION HEADER (Stemmer Markets Style)
   -------------------------------------------------------------------------- */
.stemmer-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.header-container {
  max-width: var(--container-max-width);
  width: 100%;
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.header-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.header-nav-link:hover,
.header-nav-link.active {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

.header-nav-link.active {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Main Navigation Bar (Categories Bar - Image 1)
   -------------------------------------------------------------------------- */
.stemmer-main-categories-bar {
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  box-sizing: border-box;
}

.main-categories-container {
  max-width: var(--container-max-width);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 6px 20px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.main-categories-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
  width: 100%;
  min-width: 0;
  flex: 1 1 0%;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.main-categories-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  font-family: inherit;
  outline: none;
}

.category-pill:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.category-pill.active {
  color: var(--text-primary);
  background-color: #f1f5f9;
  font-weight: 600;
  border-color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   Secondary Sub-Nav Bar (Below Header on Click / Active Category - Image 2)
   -------------------------------------------------------------------------- */
.header-secondary-subnav {
  width: 100%;
  max-width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: calc(var(--header-height, 64px) + 43px);
  z-index: 890;
  transition: max-height 0.25s ease, opacity 0.2s ease, border-color 0.2s ease;
  max-height: 48px;
  opacity: 1;
  overflow: hidden;
  box-sizing: border-box;
}

.header-secondary-subnav.collapsed {
  max-height: 0;
  opacity: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}

.subnav-container {
  max-width: var(--container-max-width);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 0 20px;
  height: 42px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.subnav-scroll-list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
  width: 100%;
  min-width: 0;
  flex: 1 1 0%;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.subnav-scroll-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.subnav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background-color: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  outline: none;
  text-decoration: none;
  flex-shrink: 0;
}

.subnav-pill:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.subnav-pill.active {
  background-color: #f1f5f9;
  color: #09090b;
  font-weight: 600;
  border-color: #e2e8f0;
}

@media (max-width: 900px) {
  .header-container {
    padding: 0 16px;
    gap: 14px;
  }
  .subnav-container {
    padding: 0 16px;
  }
  .header-search {
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .header-search {
    display: none !important;
  }
  .header-container {
    padding: 0 12px;
    gap: 10px;
  }
  .subnav-container {
    padding: 0 12px;
  }
  .header-nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 10px;
  }
  .subnav-container {
    padding: 0 10px;
  }
  .subnav-pill {
    padding: 4px 10px;
    font-size: 12px;
  }
  .btn-auth-login {
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  .btn-auth-signup {
    padding: 5px 12px !important;
    font-size: 12px !important;
  }
}

/* Global Search Bar */
.header-search {
  flex: 1;
  max-width: 560px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 46px 0 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #f8fafc;
  font-size: 13.5px;
  color: var(--text-primary);
  transition: all 0.15s ease;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--stemmer-violet);
  box-shadow: 0 0 0 3px var(--stemmer-violet-light);
}

.search-hotkey {
  position: absolute;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1;
  pointer-events: none;
}

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-auth-login,
.btn-auth-login-top {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-auth-login:hover,
.btn-auth-login-top:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--border-subtle);
}

.btn-auth-signup,
.btn-auth-signup-top {
  background-color: var(--stemmer-violet);
  color: #ffffff;
  border: none;
  padding: 7px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(121, 128, 250, 0.28);
  transition: all 0.15s ease;
}

.btn-auth-signup:hover,
.btn-auth-signup-top:hover {
  background-color: var(--stemmer-violet-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(121, 128, 250, 0.35);
}

.btn-mobile-menu {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. CATEGORY SUB-NAV BAR (Horizontal Scroll)
   -------------------------------------------------------------------------- */
.stemmer-subnav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: var(--header-height);
  z-index: 900;
}

.subnav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.category-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 2px 0;
}

.category-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.category-pill:hover {
  color: var(--text-primary);
  background-color: #f1f5f9;
}

.category-pill.active {
  color: var(--text-primary);
  background-color: #f1f5f9;
  font-weight: 600;
  border-color: #cbd5e1;
}

/* Subnav Filter & Sort Dropdown */
.subnav-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 28px 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 0.15s ease;
}

.filter-select:hover,
.filter-select:focus {
  border-color: #cbd5e1;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   5. FEATURED SPOTLIGHT / HERO BANNER
   -------------------------------------------------------------------------- */
.stemmer-hero {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 24px auto 0 auto;
  padding: 0 20px;
}

.featured-banner {
  background: linear-gradient(135deg, #09090b 0%, #1e1b4b 60%, #312e81 100%);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.15);
  position: relative;
  overflow: hidden;
}

.featured-banner::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(121, 128, 250, 0.25) 0%, rgba(121, 128, 250, 0) 70%);
  pointer-events: none;
}

.featured-left {
  flex: 1;
  max-width: 680px;
  z-index: 1;
}

.featured-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 9999px;
}

.featured-meta {
  font-size: 13px;
  color: #cbd5e1;
}

.featured-title {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #ffffff;
}

.featured-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #94a3b8;
}

.featured-stat-value {
  color: #ffffff;
  font-weight: 600;
}

.featured-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 1;
  min-width: 240px;
}

.featured-probability {
  text-align: right;
}

.probability-number {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  color: #4ade80;
}

.probability-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 4px;
}

.featured-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.btn-hero-yes {
  flex: 1;
  background-color: #16a34a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.btn-hero-yes:hover {
  background-color: #15803d;
  transform: translateY(-1px);
}

.btn-hero-no {
  flex: 1;
  background-color: #ef4444;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.btn-hero-no:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   6. MAIN CARDS GRID SECTION
   -------------------------------------------------------------------------- */
.stemmer-main-content,
#explore-markets {
  max-width: var(--container-max-width);
  width: 100%;
  margin: 28px auto 60px auto;
  padding: 0 20px;
  flex: 1;
  scroll-margin-top: 135px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--stemmer-violet);
  background-color: var(--stemmer-violet-light);
  padding: 2px 8px;
  border-radius: 12px;
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-md);
}

.section-tab-btn {
  background: transparent;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.section-tab-btn.active {
  background-color: #ffffff;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Responsive Cards Grid Layout */
.cards-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}

@media (min-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

@media (max-width: 1080px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (max-width: 680px) {
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* Ensure all grid children stretch cleanly and prevent grid blowout */
.cards-grid > * {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
}

/* Individual Card Container Wrapper */
.card-wrapper,
.stemmer-card,
.cards-grid article {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: relative;
  z-index: 1;
  box-sizing: border-box !important;
}

.card-wrapper:hover,
.card-wrapper:focus-within,
.stemmer-card:hover,
.stemmer-card:focus-within,
.cards-grid article:hover,
.cards-grid article:focus-within {
  z-index: 50;
}

/* --------------------------------------------------------------------------
   7. PROVEN CARD STYLES (FROM MILESTONE 1)
   -------------------------------------------------------------------------- */
.stemmer-card,
.stemmer-btc-card,
.stemmer-esports-card {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 185px;
  position: relative;
  box-sizing: border-box;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stemmer-card:hover,
.stemmer-btc-card:hover,
.stemmer-esports-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.stemmer-card:hover .stemmer-card-title,
.stemmer-card-header-link:hover .stemmer-card-title,
.stemmer-outcome-label-link:hover .stemmer-outcome-title,
.stemmer-btc-card:hover .stemmer-card-title {
  text-decoration: underline;
}

.stemmer-team-row:hover .stemmer-team-name {
  text-decoration: underline;
}

/* Card title & outcome overflow safeguards */
.stemmer-card-title,
.cards-grid .stemmer-card-title {
  max-width: 100% !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.stemmer-outcome-label-link {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.stemmer-outcome-title {
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Common Icon Buttons */
.stemmer-icon-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #71717a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  width: 28px;
  height: 28px;
}

.stemmer-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

.stemmer-bookmark-btn .bookmark-filled {
  display: none;
  color: var(--stemmer-violet);
}

.stemmer-bookmark-btn.active .bookmark-outline {
  display: none;
}

.stemmer-bookmark-btn.active .bookmark-filled {
  display: block;
}

/* Multi-Outcome Card Action Buttons */
.stemmer-btn {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

.stemmer-btn:active {
  transform: scale(0.97);
}

.stemmer-btn-default,
.stemmer-btn-hover {
  transition: opacity 0.15s ease, color 0.15s ease;
}

/* Ensure default text ("Yes" / "No") stays visible and turns white on hover */
.stemmer-btn .stemmer-btn-default {
  opacity: 1 !important;
  display: inline-block;
  line-height: 1;
}

.stemmer-btn:hover .stemmer-btn-default {
  opacity: 1 !important;
  color: #ffffff !important;
}

.stemmer-btn-yes:hover {
  background-color: var(--color-yes, #16a34a) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.stemmer-btn-yes:hover .stemmer-btn-default {
  color: #ffffff !important;
}

.stemmer-btn-no:hover {
  background-color: var(--color-no, #ef4444) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.stemmer-btn-no:hover .stemmer-btn-default {
  color: #ffffff !important;
}

/* Only swap to hover element IF a non-empty .stemmer-btn-hover element exists */
.stemmer-btn:has(.stemmer-btn-hover:not(:empty)):hover .stemmer-btn-default {
  opacity: 0 !important;
}

.stemmer-btn:has(.stemmer-btn-hover:not(:empty)):hover .stemmer-btn-hover {
  opacity: 1 !important;
  color: #ffffff !important;
}

/* Multi-Outcome Rewards Popover */
.stemmer-popover-wrapper {
  position: relative;
  display: inline-block;
}

.stemmer-rewards-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -10px;
  width: 250px;
  background-color: #ffffff;
  border: 1.5px solid var(--stemmer-violet);
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(121, 128, 250, 0.2), 0 8px 16px -6px rgba(0, 0, 0, 0.08);
  z-index: 200;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.stemmer-popover-wrapper.open-down .stemmer-rewards-popover {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateY(-6px);
}

.stemmer-popover-wrapper:hover .stemmer-rewards-popover,
.stemmer-popover-wrapper:focus-within .stemmer-rewards-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.stemmer-popover-wrapper::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  height: 14px;
  display: block;
}

.stemmer-popover-wrapper.open-down::before {
  bottom: auto;
  top: 100%;
}

.stemmer-btn-add-rewards {
  width: 100%;
  height: 36px;
  background-color: var(--stemmer-violet);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(121, 128, 250, 0.25);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.stemmer-btn-add-rewards:hover {
  background-color: var(--stemmer-violet-hover);
}

.stemmer-btn-add-rewards:active {
  transform: scale(0.98);
}

/* BTC Speedometer Card */
.stemmer-trade-btn {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.stemmer-trade-btn:active {
  transform: scale(0.98);
}

.stemmer-btn-up {
  background-color: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.stemmer-btn-up:hover {
  background-color: #16a34a;
  color: #ffffff;
}

.stemmer-btn-down {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.stemmer-btn-down:hover {
  background-color: #ef4444;
  color: #ffffff;
}

/* Esports Card Styles */
.stemmer-team-btn {
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.stemmer-team-btn:active {
  transform: scale(0.98);
}

.stemmer-btn-geng {
  background-color: rgba(162, 129, 32, 0.10);
  color: rgb(162, 129, 32);
}

.stemmer-btn-geng:hover {
  background-color: rgb(162, 129, 32);
  color: #ffffff;
}

.stemmer-btn-geng:hover .stemmer-btn-text-geng {
  color: #ffffff;
}

.stemmer-btn-hanwha {
  background-color: rgba(223, 96, 32, 0.10);
  color: rgb(223, 96, 32);
}

.stemmer-btn-hanwha:hover {
  background-color: rgb(223, 96, 32);
  color: #ffffff;
}

.stemmer-btn-hanwha:hover .stemmer-btn-text-hanwha {
  color: #ffffff;
}

/* Live Ping Animation */
@keyframes livePing {
  0% { transform: scale(1); opacity: 0.8; }
  75%, 100% { transform: scale(2.3); opacity: 0; }
}

.animate-live-ping {
  animation: livePing 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Floating Live Activity Prices */
@keyframes liveActivityFloat {
  0% { transform: translateY(12px); opacity: 0; }
  25% { transform: translateY(0px); opacity: 1; }
  75% { transform: translateY(-12px); opacity: 1; }
  100% { transform: translateY(-24px); opacity: 0; }
}

.live-activity-item {
  position: absolute;
  white-space: nowrap;
  font-weight: 600;
  font-size: 12px;
  pointer-events: none;
  animation: liveActivityFloat 3.2s ease-in-out infinite;
}

.delay-1 { animation-delay: 1s; }
.delay-2 { animation-delay: 2s; }

/* --------------------------------------------------------------------------
   8. AUTH MODALS (LOGIN & SIGN UP)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-logo {
  margin-bottom: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #ffffff;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus {
  border-color: var(--stemmer-violet);
  box-shadow: 0 0 0 3px var(--stemmer-violet-light);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 20px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.forgot-link {
  color: var(--stemmer-violet);
  font-weight: 600;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-form-submit {
  width: 100%;
  height: 44px;
  background-color: var(--stemmer-violet);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(121, 128, 250, 0.3);
  transition: all 0.15s ease;
}

.btn-form-submit:hover {
  background-color: var(--stemmer-violet-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(121, 128, 250, 0.35);
}

.modal-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-footer a {
  color: var(--stemmer-violet);
  font-weight: 600;
}

.modal-footer a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. FOOTER & COMPLIANCE SECTION
   -------------------------------------------------------------------------- */
.stemmer-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 48px 0 32px 0;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand-col {
  max-width: 320px;
}

.footer-tagline {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 14px;
  line-height: 1.5;
}

.footer-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin-bottom: 24px;
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. MOBILE NAVIGATION DRAWER & BREAKPOINTS (Exact Match to Homepage)
   -------------------------------------------------------------------------- */
.btn-mobile-menu-trigger {
  display: none;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-md);
  width: 38px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-mobile-menu-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.active,
.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  max-width: 380px;
  width:100%;
  background: #ffffff;
  z-index: 1101;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  overflow-y: auto;
}

.mobile-nav-drawer.active,
.mobile-nav-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.drawer-close-btn:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 0;
  flex: 1;
}

.drawer-nav-item {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.drawer-nav-item:hover,
.drawer-nav-item.active {
  color: var(--text-primary);
  background-color: rgba(121, 128, 250, 0.08);
  font-weight: 600;
}

.drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.drawer-btn-login {
  width: 100%;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.drawer-btn-login:hover {
  background-color: rgba(0, 0, 0, 0.04);
  border-color: var(--stemmer-slate);
}

.drawer-btn-signup {
  width: 100%;
  height: 42px;
  background: var(--stemmer-violet);
  border: 1px solid var(--stemmer-violet);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(121, 128, 250, 0.25);
  transition: background-color 0.15s ease;
}

.drawer-btn-signup:hover {
  background: var(--stemmer-violet-hover);
}

@media (max-width: 860px) {
  .btn-auth-login-top,
  .btn-auth-signup-top {
    display: none !important;
  }
  .btn-mobile-menu-trigger {
    display: inline-flex !important;
  }
}

@media (max-width: 900px) {
  .btn-mobile-menu {
    display: block;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stemmer-logo-text {
    font-size: 17px !important;
  }
  .page-width {
    padding-left: 12px;
    padding-right: 12px;
  }
  .btn-auth-login,
  .btn-auth-login-top,
  .btn-auth-signup,
  .btn-auth-signup-top {
    display: none !important;
  }
  .header-search {
    display: none; /* Can be opened via mobile search icon or drawer */
  }
  .featured-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .featured-right {
    align-items: flex-start;
    width: 100%;
  }
  .featured-probability {
    text-align: left;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .page-width {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .cards-grid {
    gap: 12px !important;
  }
  .cards-grid .card-wrapper,
  .cards-grid .stemmer-card,
  .cards-grid article {
    padding: 12px 12px 10px 12px !important;
    border-radius: 12px !important;
  }
  .stemmer-card-title {
    font-size: 14px !important;
  }
  .stemmer-outcome-title {
    font-size: 13px !important;
  }
  .stemmer-btn {
    height: 26px !important;
    width: 36px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 360px) {
  .page-width {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .cards-grid {
    gap: 10px !important;
  }
  .cards-grid .card-wrapper,
  .cards-grid .stemmer-card,
  .cards-grid article {
    padding: 10px 10px 8px 10px !important;
  }
  .stemmer-btn {
    height: 25px !important;
    width: 34px !important;
    font-size: 11.5px !important;
  }
}
