/*
Theme Name: TrackEdge Racing Intelligence
Theme URI: https://trackedge.com.au
Author: TrackEdge
Author URI: https://trackedge.com.au
Description: Premium Australian horse racing tipping platform theme
Version: 1.0.0
License: Proprietary
Text Domain: trackedge
*/

/* ============================================================
   CSS VARIABLES — TrackEdge Brand System
   ============================================================ */
:root {
  --te-black:       #0D0D0F;
  --te-dark:        #121218;
  --te-card:        #1A1A24;
  --te-card-hover:  #21212E;
  --te-border:      #2A2A38;
  --te-border-glow: #FF6B0030;
  --te-orange:      #FF6B00;
  --te-orange-light:#FF8C00;
  --te-orange-dim:  #CC5500;
  --te-orange-bg:   #FF6B0015;
  --te-red:         #8B1A1A;
  --te-red-deep:    #5C0E0E;
  --te-white:       #FFFFFF;
  --te-grey-100:    #E8E8F0;
  --te-grey-200:    #B8B8CC;
  --te-grey-400:    #6B6B88;
  --te-grey-600:    #3A3A50;
  --te-green:       #00C851;
  --te-green-dim:   #00C85120;
  --te-yellow:      #FFD600;
  --te-yellow-dim:  #FFD60020;

  /* Rating colours */
  --rating-10:      #FF6B00;
  --rating-9:       #FF8C00;
  --rating-8:       #FFA500;
  --rating-7:       #FFD600;
  --rating-6:       #C8E000;
  --rating-5:       #7BC800;
  --rating-4:       #00C851;
  --rating-3:       #00B4D8;
  --rating-2:       #6B6B88;
  --rating-1:       #3A3A50;

  /* Typography */
  --font-display:   'Barlow Condensed', 'Impact', sans-serif;
  --font-body:      'DM Sans', 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Spacing */
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  /* Shadows */
  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-orange:  0 0 24px rgba(255,107,0,0.3);
  --shadow-hover:   0 8px 40px rgba(0,0,0,0.6);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--te-black);
  color: var(--te-white);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* NOTE: Do NOT set overflow-x: hidden on body — it breaks position:fixed
     (fixed elements get positioned relative to body scroll container, not viewport).
     Horizontal overflow is controlled by html above. */
  max-width: 100%;
}

a { color: var(--te-orange); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--te-orange-light); }

/* Accessibility: visible focus rings for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--te-orange);
  outline-offset: 3px;
}

/* Skip-to-content link */
.te-skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  background: var(--te-orange);
  color: #000;
  padding: 8px 16px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.te-skip-link:focus {
  left: 8px;
}

img { max-width: 100%; height: auto; }

/* Google Fonts are loaded via wp_enqueue_style('te-fonts') in functions.php — no @import needed here. */

/* ============================================================
   LAYOUT
   ============================================================ */
.te-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.te-container--narrow { max-width: 860px; }
.te-container--wide   { max-width: 1440px; }

.te-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.te-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.te-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

@media (max-width: 1024px) {
  .te-grid-4 { grid-template-columns: repeat(2,1fr); }
  .te-grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .te-grid-2, .te-grid-3, .te-grid-4 { grid-template-columns: 1fr; }
  /* Use (almost) full screen width on phones — trim the side gutters. */
  .te-container { padding: 0 10px; }
}
@media (max-width: 420px) {
  .te-container { padding: 0 6px; }
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.te-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13,13,15,0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--te-border);
  padding: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.te-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.te-header__logo img,
.te-header__logo svg {
  height: 44px;
  width: auto;
  max-width: 220px;
  display: block;
}
@media (max-width: 600px) {
  .te-header__logo img,
  .te-header__logo svg { height: 36px; max-width: 180px; }
}

.te-nav {
  display: flex;
  align-items: center;
  gap: 8px; /* gap fallback: use margin on children if needed for Safari 13 */
  list-style: none;
}

.te-nav a {
  color: var(--te-grey-200);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.te-nav a:hover,
.te-nav a.active {
  color: var(--te-orange);
  background: var(--te-orange-bg);
}

.te-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Hamburger toggle — fully retired; hidden always */
.te-nav-toggle { display: none !important; }

/* ── ACCOUNT / HAMBURGER MENU ──────────────────────────────── */
.te-account { position: relative; }

.te-account__toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #16161d;
  border: 1px solid #2a2a38;
  border-radius: 999px;
  color: var(--te-grey-200);
  padding: 4px 10px 4px 5px;
  height: 40px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
/* Logged-out (hamburger only) is a tidy square button */
.te-account__toggle:not(.te-account__toggle--user) {
  padding: 0;
  width: 40px;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.te-account__toggle:hover,
.te-account__toggle[aria-expanded="true"] {
  border-color: var(--te-orange);
  background: #1d1d26;
  color: var(--te-orange);
}
.te-account__toggle svg { display: block; }
.te-account__caret { transition: transform 0.2s; color: #8a8aa3; }
.te-account__toggle[aria-expanded="true"] .te-account__caret { transform: rotate(180deg); color: var(--te-orange); }

.te-account__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--te-orange), #ff8c3b);
  color: #0d0d0f;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── SLIDE-OUT DRAWER (racenet-style off-canvas menu) ──────── */
.te-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0,0,0,0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.te-drawer-backdrop.is-open { opacity: 1; }
.te-drawer-backdrop[hidden] { display: none; }

.te-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  height: 100dvh;
  width: 360px;
  max-width: 86vw;
  z-index: 4001;
  background: #0b0b11;
  border-left: 1px solid #26263a;
  box-shadow: -18px 0 50px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.te-drawer.is-open { transform: translateX(0); }
.te-drawer[hidden] { display: none; }

.te-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #1d1d28;
  flex-shrink: 0;
}
.te-drawer__logo { display: flex; align-items: center; }
.te-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #16161d;
  border: 1px solid #2a2a38;
  color: var(--te-grey-200);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.te-drawer__close:hover { color: var(--te-orange); border-color: var(--te-orange); background: #1d1d26; }

.te-drawer__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
}
.te-drawer__link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  color: #d7d7e6;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.te-drawer__link:hover { background: var(--te-orange-bg); color: var(--te-orange); padding-left: 22px; }
.te-drawer__link.is-active {
  color: var(--te-orange);
  background: var(--te-orange-bg);
  box-shadow: inset 3px 0 0 var(--te-orange);
}

.te-drawer__foot {
  flex-shrink: 0;
  border-top: 1px solid #1d1d28;
  background: #0e0e15;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.te-drawer__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 12px;
}
.te-drawer__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--te-orange), #ff8c3b);
  color: #0d0d0f;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.te-drawer__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.te-drawer__name { font-weight: 700; color: #fff; font-size: 0.98rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-drawer__plan { font-size: 0.74rem; color: var(--te-orange); letter-spacing: 0.3px; font-weight: 600; }

.te-drawer__action {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 9px;
  color: var(--te-grey-200);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.te-drawer__action:hover { background: var(--te-orange-bg); color: var(--te-orange); padding-left: 20px; }
.te-drawer__action--accent { color: var(--te-orange); }
.te-drawer__action--muted { color: #8a8aa3; }

/* ── DESKTOP NAV ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hide desktop nav on mobile — drawer + bottom nav handle navigation */
  #te-nav { display: none; }
  .te-header__actions .te-cta-desktop { display: none; }
  .te-header { width: 100%; }
  .te-header__inner { padding: 0 16px; }
  /* Push page content above fixed bottom nav */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ── MOBILE BOTTOM NAV ─────────────────────────────────────── */
.te-bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  .te-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #0d0d0f;
    border-top: 1px solid #2a2a3e;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  }

  .te-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    color: #6B6B88;
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 56px;
  }

  .te-bottom-nav__item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    flex-shrink: 0;
  }

  .te-bottom-nav__item:hover,
  .te-bottom-nav__item--active {
    color: #FF6B00;
  }

  .te-bottom-nav__item--active svg {
    filter: drop-shadow(0 0 6px rgba(255,107,0,0.5));
  }

  /* Premium item gets special styling */
  .te-bottom-nav__item:last-child {
    color: #d4a017;
  }
  .te-bottom-nav__item:last-child.te-bottom-nav__item--active,
  .te-bottom-nav__item:last-child:hover {
    color: #FF6B00;
  }
}

@media (max-width: 480px) {
  /* Live clock bar — stack on very narrow screens */
  .te-header .te-live-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .te-header__actions .te-btn--primary {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .te-header__inner {
    gap: 8px;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.te-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  touch-action: manipulation;
}

.te-btn--primary {
  background: var(--te-orange);
  color: #000;
}
.te-btn--primary:hover {
  background: var(--te-orange-light);
  color: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}

.te-btn--ghost {
  background: transparent;
  color: var(--te-white);
  border: 1px solid var(--te-border);
}
.te-btn--ghost:hover {
  border-color: var(--te-orange);
  color: var(--te-orange);
  background: var(--te-orange-bg);
}

.te-btn--outline-orange {
  background: transparent;
  color: var(--te-orange);
  border: 1.5px solid var(--te-orange);
}
.te-btn--outline-orange:hover {
  background: var(--te-orange);
  color: #000;
}

.te-btn--large { padding: 14px 36px; font-size: 1rem; }
.te-btn--small { padding: 6px 16px; font-size: 0.8rem; }
.te-btn--full  { width: 100%; }

.te-btn--premium {
  background: linear-gradient(135deg, var(--te-orange), var(--te-orange-light));
  color: #000;
  font-weight: 700;
}
.te-btn--premium:hover {
  box-shadow: 0 0 32px rgba(255,107,0,0.5);
  transform: translateY(-2px);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.te-hero {
  position: relative;
  overflow: hidden;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: var(--te-black);
}

.te-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, #3D0A0A 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 50%, #1A0A00 0%, transparent 60%),
    linear-gradient(180deg, #0D0D0F 0%, #1a0808 40%, #0D0D0F 100%);
  z-index: 0;
}

.te-hero__grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,107,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,0,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
}

.te-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 80px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.te-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--te-orange-bg);
  border: 1px solid var(--te-orange)40;
  color: var(--te-orange);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 32px;
}

.te-hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--te-orange);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.te-hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.te-hero__title .accent { color: var(--te-orange); }

/* Race Cards page — compact hero title */
.te-races-page .te-hero {
  min-height: 0 !important;
  padding: 24px 24px 16px !important;
}
.te-races-page .te-hero__title {
  font-size: clamp(1.6rem, 4vw, 2.2rem) !important;
  margin-bottom: 4px !important;
  line-height: 1.2 !important;
}
.te-races-page .te-hero__bg,
.te-races-page .te-hero__grid-overlay {
  display: none !important;
}

.te-hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--te-grey-200);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.te-hero__cta-group {
  display: flex;
  gap: 16px; /* gap fallback: use margin on children if needed for Safari 13 */
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.te-hero__stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}

.te-stat {
  text-align: center;
}

.te-stat__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--te-orange);
  line-height: 1;
}

.te-stat__label {
  font-size: 0.75rem;
  color: var(--te-grey-400);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.te-section {
  padding: 80px 0;
}

.te-section--dark {
  background: var(--te-dark);
  border-top: 1px solid var(--te-border);
  border-bottom: 1px solid var(--te-border);
}

.te-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.te-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--te-orange);
  margin-bottom: 12px;
}

.te-section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.5px;
}

.te-section-title .accent { color: var(--te-orange); }

/* ============================================================
   CARDS
   ============================================================ */
.te-card {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
}

.te-card:hover {
  border-color: var(--te-orange)50;
  box-shadow: var(--shadow-orange);
  transform: translateY(-2px);
}

/* ============================================================
   TIP CARDS
   ============================================================ */
.tip-card {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
}

.tip-card:hover {
  border-color: var(--te-orange)60;
  box-shadow: 0 8px 32px rgba(255,107,0,0.15);
  transform: translateY(-3px);
}

.tip-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--te-card-hover);
  border-bottom: 1px solid var(--te-border);
}

.tip-card__race-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tip-card__venue {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--te-white);
}

.tip-card__race-num {
  font-size: 0.75rem;
  color: var(--te-grey-400);
  letter-spacing: 0.5px;
}

.tip-card__time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--te-orange);
  background: var(--te-orange-bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--te-orange)30;
}

.tip-card__racelink {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--te-orange);
  background: var(--te-orange-bg);
  border: 1px solid var(--te-orange)40;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tip-card__racelink:hover { background: var(--te-orange); color: #0D0D0F; }
@media (max-width: 560px) {
  .tip-card__racelink { font-size: 0.72rem; padding: 4px 8px; }
}

/* AI Best of the Day banner */
.te-ai-bestbet {
  background: linear-gradient(135deg, #1A0A2A, #0D0D0F);
  border: 1px solid #FF6B0055;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 22px;
}
.te-ai-bestbet__tag {
  display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: #FF6B00; background: #FF6B0018;
  border: 1px solid #FF6B0040; border-radius: 999px; padding: 3px 12px; margin-bottom: 10px;
}
.te-ai-bestbet__horse {
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 900;
  color: #fff; line-height: 1.1;
}
.te-ai-bestbet__rating { color: #FF6B00; font-size: 1.1rem; font-weight: 800; }
.te-ai-bestbet__meta { color: #B8B8CC; font-size: 0.85rem; margin-top: 4px; }
.te-ai-bestbet__comment { color: #E8E8F0; font-size: 0.88rem; margin-top: 8px; line-height: 1.55; }
.te-ai-bestbet__link {
  display: inline-block; margin-top: 12px; font-size: 0.8rem; font-weight: 700;
  color: #FF6B00; text-decoration: none; border: 1px solid #FF6B0040;
  padding: 5px 12px; border-radius: var(--radius-sm); transition: background .15s, color .15s;
}
.te-ai-bestbet__link:hover { background: #FF6B00; color: #0D0D0F; }

.tip-card__body { padding: 18px; }

.tip-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--te-dark);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.tip-selection:last-child { margin-bottom: 0; }

.tip-selection::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--te-orange);
  border-radius: 2px 0 0 2px;
}

.tip-selection:hover {
  border-color: var(--te-orange)40;
  background: var(--te-card);
}

.tip-selection__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  padding-left: 8px;
}

.tip-selection__name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--te-white);
  letter-spacing: 0.2px;
}

.tip-selection__meta {
  font-size: 0.75rem;
  color: var(--te-grey-400);
}

.tip-selection__flags {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.flag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

.flag--gear    { background: #1A2A1A; color: #00C851; border: 1px solid #00C85140; }
.flag--form    { background: #2A1A0A; color: var(--te-orange); border: 1px solid var(--te-orange)40; }
.flag--wet     { background: #0A1A2A; color: #00B4D8; border: 1px solid #00B4D840; }
.flag--value   { background: #2A2A0A; color: var(--te-yellow); border: 1px solid var(--te-yellow)40; }
.flag--bounce  { background: #2A0A0A; color: #FF4444; border: 1px solid #FF444440; }
.flag--class   { background: #1A0A2A; color: #C084FC; border: 1px solid #C084FC40; }
.flag--pace    { background: #0A2A1A; color: #34D399; border: 1px solid #34D39940; }

/* Rating badge */
.rating-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid currentColor;
  position: relative;
}

.rating-badge__number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.rating-badge__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Dynamic rating colours */
.rating-10 { color: var(--rating-10); background: #FF6B0015; }
.rating-9  { color: var(--rating-9);  background: #FF8C0015; }
.rating-8  { color: var(--rating-8);  background: #FFA50015; }
.rating-7  { color: var(--rating-7);  background: #FFD60015; }
.rating-6  { color: var(--rating-6);  background: #C8E00015; }
.rating-5  { color: var(--rating-5);  background: #7BC80015; }
.rating-4  { color: var(--rating-4);  background: #00C85115; }
.rating-3  { color: var(--rating-3);  background: #00B4D815; }

/* ============================================================
   BEST BET OF DAY
   ============================================================ */
.best-bet-banner {
  background: linear-gradient(135deg, #2A0D00, #1A0800);
  border: 1px solid var(--te-orange)60;
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}

.best-bet-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(255,107,0,0.12), transparent 60%);
  pointer-events: none;
}

.best-bet-banner__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--te-orange);
  margin-bottom: 16px;
}

.best-bet-banner__label::before {
  content: '';
  font-size: 1rem;
}

.best-bet-banner__horse {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--te-white);
  margin-bottom: 8px;
}

.best-bet-banner__details {
  font-size: 0.9rem;
  color: var(--te-grey-200);
  margin-bottom: 16px;
}

.best-bet-banner__locked {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0,0,0,0.3);
  border: 1px dashed var(--te-orange)40;
  border-radius: var(--radius-md);
  margin-top: 16px;
}

/* ============================================================
   PREMIUM LOCK OVERLAY
   ============================================================ */
.te-premium-lock {
  position: relative;
}

.te-premium-lock__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(13,13,15,0.95) 40%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  z-index: 10;
}

.te-lock-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.te-lock-text {
  font-size: 0.9rem;
  color: var(--te-grey-200);
  text-align: center;
  margin-bottom: 16px;
}

/* ============================================================
   RACE MAP
   ============================================================ */
.race-map {
  background: var(--te-dark);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
}

.race-map__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.race-map__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--te-grey-400);
}

.pace-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.pace-hot    { background: #2A0A0A; color: #FF4444; border: 1px solid #FF444440; }
.pace-medium { background: #2A1A0A; color: var(--te-orange); border: 1px solid var(--te-orange)40; }
.pace-slow   { background: #0A2A1A; color: #00C851; border: 1px solid #00C85140; }

.race-map__runners {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.race-map__runner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.runner-barrier {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--te-grey-400);
  min-width: 20px;
}

.runner-name {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--te-white);
}

.runner-style {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 70px;
  text-align: center;
}

.style-leader   { background: #FF6B0020; color: var(--te-orange); border: 1px solid var(--te-orange)40; }
.style-onpace   { background: #FFD60020; color: var(--te-yellow); border: 1px solid var(--te-yellow)40; }
.style-midfield { background: #00B4D820; color: #00B4D8; border: 1px solid #00B4D840; }
.style-backmark { background: #C084FC20; color: #C084FC; border: 1px solid #C084FC40; }

.runner-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--te-border);
  border-radius: 999px;
  overflow: hidden;
}

.runner-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--te-orange), var(--te-orange-light));
  transition: width 0.8s ease;
}

/* ============================================================
   FILTER TABS
   ============================================================ */
.te-tabs {
  display: flex;
  gap: 4px;
  background: var(--te-dark);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--te-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.te-tabs::-webkit-scrollbar { display: none; }

.te-tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--te-grey-400);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.te-tab.active,
.te-tab:hover {
  background: var(--te-orange);
  color: #000;
}

/* ============================================================
   PRICING
   ============================================================ */
.pricing-card {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.pricing-card--featured {
  border-color: var(--te-orange);
  box-shadow: 0 0 48px rgba(255,107,0,0.2);
  transform: scale(1.03);
}

.pricing-card--featured::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--te-orange);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 4px 16px;
  border-radius: 999px;
}

.pricing-card__tier {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--te-grey-400);
  margin-bottom: 16px;
}

.pricing-card__price {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--te-white);
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-card__price span {
  font-size: 1.5rem;
  color: var(--te-grey-400);
}

.pricing-card--featured .pricing-card__price { color: var(--te-orange); }

.pricing-card__period {
  font-size: 0.85rem;
  color: var(--te-grey-400);
  margin-bottom: 32px;
}

.pricing-card__features {
  list-style: none;
  text-align: left;
  margin-bottom: 32px;
}

.pricing-card__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--te-border);
  font-size: 0.9rem;
  color: var(--te-grey-200);
}

.pricing-card__features li::before {
  content: '';
  color: var(--te-green);
  font-weight: 900;
  font-size: 1rem;
  min-width: 16px;
}

.pricing-card__features li.disabled {
  color: var(--te-grey-600);
}
.pricing-card__features li.disabled::before {
  content: '';
  color: var(--te-grey-600);
}

/* Pricing grid wrapper — mobile stacking */
.te-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 900px) {
  .te-pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pricing-card--featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .te-pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-card--featured {
    grid-column: auto;
    transform: none; /* remove scale to prevent bleed on narrow screens */
  }
  .pricing-card {
    padding: 24px 20px;
  }
}

/* Scrollable table wrapper for results and any data tables */
.te-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.te-table-scroll table {
  min-width: 540px;
}

/* ============================================================
   TIPS PAGE LAYOUT
   ============================================================ */
.tips-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  gap: 32px;
  padding: 40px 0;
}

.tips-sidebar {
  position: sticky;
  top: 84px;
  height: fit-content;
}

.tips-sidebar__date {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.tips-sidebar__date-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--te-grey-400);
  margin-bottom: 8px;
}

.tips-sidebar__date-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--te-orange);
  text-transform: uppercase;
}

.tips-sidebar__tracks {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tips-sidebar__track-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--te-border);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.tips-sidebar__track-item:last-child { border-bottom: none; }
.tips-sidebar__track-item:hover,
.tips-sidebar__track-item.active { background: var(--te-orange-bg); color: var(--te-orange); }

.track-race-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--te-border);
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--te-grey-400);
}

@media (max-width: 900px) {
  .tips-layout { grid-template-columns: 1fr; }
  .tips-sidebar { position: static; }
}

/* ============================================================
   RESPONSIBLE GAMBLING BANNER (NCPF mandatory)
   ============================================================ */
.te-rg-banner {
  background: #0A0A0C;
  border-top: 2px solid #FF6B00;
  padding: 14px 0;
}

.te-rg-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.te-rg-banner__tagline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.te-rg-banner__tagline-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #FF6B00;
  letter-spacing: 0.3px;
}

.te-rg-banner__support {
  font-size: 0.78rem;
  color: #6B6B88;
}

.te-rg-banner__phone {
  color: #FF6B00;
  font-weight: 700;
  text-decoration: none;
}
.te-rg-banner__phone:hover { text-decoration: underline; }

.te-rg-banner__link {
  color: #B8B8CC;
  font-weight: 600;
}
.te-rg-banner__link:hover { color: #FF6B00; }

.te-rg-banner__betstop {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.te-rg-banner__betstop-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #6B6B88;
  text-decoration: none;
  transition: color 0.2s;
}
.te-rg-banner__betstop-link:hover { color: #B8B8CC; }
.te-rg-banner__betstop-link strong { color: #B8B8CC; }

.te-rg-banner__betstop-icon { font-size: 0.9rem; }

.te-rg-banner__age {
  background: #FF6B00;
  color: #000;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .te-rg-banner__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .te-rg-banner__betstop { flex-wrap: wrap; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.te-footer {
  background: #0E0E16;
  border-top: 1px solid var(--te-border);
  padding: 56px 0 0;
  margin-top: 80px;
}

.te-footer__grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--te-border);
}

/* Brand column */
.te-footer__brand-desc {
  font-size: 0.83rem;
  color: var(--te-grey-400);
  line-height: 1.75;
  margin-bottom: 16px;
}

.te-footer__contact {
  margin-bottom: 12px;
}

.te-footer__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  color: var(--te-grey-200);
  text-decoration: none;
  transition: color 0.2s;
}
.te-footer__contact-link:hover { color: var(--te-orange); }
.te-footer__contact-link svg { color: var(--te-orange); flex-shrink: 0; }

.te-footer__flag {
  font-size: 0.72rem;
  color: var(--te-grey-600);
  letter-spacing: 0.5px;
}

/* Column headings */
.te-footer__heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--te-white);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--te-border);
}

/* Links */
.te-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.te-footer__links li a {
  font-size: 0.83rem;
  color: var(--te-grey-400);
  text-decoration: none;
  transition: color 0.2s;
  display: block;
}
.te-footer__links li a:hover { color: var(--te-orange); }

/* Full-width disclaimer block */
.te-footer__disclaimer-block {
  padding: 28px 0;
  border-bottom: 1px solid var(--te-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.te-footer__disclaimer-block p {
  font-size: 0.72rem;
  color: #3A3A52;
  line-height: 1.7;
}

.te-footer__disclaimer-block a {
  color: #4A4A62;
  text-decoration: underline;
}
.te-footer__disclaimer-block a:hover { color: var(--te-grey-400); }

.te-footer__disclaimer-block strong { color: #4A4A62; }

/* Bottom bar */
.te-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.te-footer__bottom-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.te-footer__copyright {
  font-size: 0.78rem;
  color: var(--te-grey-600);
  font-weight: 600;
}

.te-footer__entity {
  font-size: 0.72rem;
  color: #2E2E42;
  letter-spacing: 0.2px;
}
.te-footer__entity strong { color: #3A3A52; }

.te-footer__bottom-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.te-footer__legal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.te-footer__legal-nav a {
  font-size: 0.72rem;
  color: #2E2E42;
  text-decoration: none;
  transition: color 0.2s;
}
.te-footer__legal-nav a:hover { color: var(--te-grey-400); }

.te-footer__legal-nav span {
  color: #1E1E2E;
  font-size: 0.6rem;
}

.te-footer__age-badge {
  background: var(--te-border);
  color: var(--te-grey-400);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  border: 1px solid var(--te-grey-600);
  flex-shrink: 0;
}

/* Responsive footer */
@media (max-width: 1024px) {
  .te-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .te-footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .te-footer__bottom { flex-direction: column; align-items: flex-start; }
  .te-footer__bottom-right { justify-content: flex-start; }
}

/* ============================================================
   ADMIN PANEL STYLES
   ============================================================ */
.te-admin-wrap {
  background: var(--te-black);
  min-height: 100vh;
  padding: 32px;
  color: var(--te-white);
  font-family: var(--font-body);
}

.te-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--te-border);
}

.te-admin-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--te-orange);
}

.te-admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.te-admin-card {
  background: var(--te-card);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.te-admin-card__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--te-orange);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--te-border);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.te-field {
  margin-bottom: 16px;
}

.te-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--te-grey-200);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.te-field input,
.te-field select,
.te-field textarea {
  width: 100%;
  background: var(--te-dark);
  border: 1px solid var(--te-border);
  border-radius: var(--radius-md);
  color: var(--te-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.te-field input:focus,
.te-field select:focus,
.te-field textarea:focus {
  outline: none;
  border-color: var(--te-orange);
  box-shadow: 0 0 0 3px var(--te-orange-bg);
}

.te-field textarea { resize: vertical; min-height: 80px; }

.te-field select option { background: var(--te-dark); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-orange  { color: var(--te-orange); }
.text-muted   { color: var(--te-grey-400); }
.text-small   { font-size: 0.8rem; }
.text-upper   { text-transform: uppercase; letter-spacing: 1px; }
.text-center  { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

/* Divider */
.te-divider {
  height: 1px;
  background: var(--te-border);
  margin: 24px 0;
}

/* Premium badge */
.te-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #FF6B00, #FF8C00);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--te-dark); }
::-webkit-scrollbar-thumb { background: var(--te-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--te-orange); }

/* ============================================================
   MOBILE OVERFLOW SAFETY NET
   ============================================================ */

/* Prevent any element from breaking out of the viewport */
@media (max-width: 768px) {
  /* Admin grid stacks on mobile */
  .te-admin-grid { grid-template-columns: 1fr; }

  /* Minimum touch target for small buttons */
  .te-btn--small {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Hero stats wrap properly */
  .te-hero__stats { gap: 24px; }
  .te-stat__number { font-size: 2rem; }

  /* Section padding tightens up */
  .te-section { padding: 48px 0; }

  /* Containers honour padding on mobile */
  .te-container,
  .te-container--narrow,
  .te-container--wide {
    padding: 0 16px;
  }
}

/* ============================================================
   iOS INPUT ZOOM PREVENTION
   iOS Safari zooms in on inputs with font-size < 16px.
   ============================================================ */
input, select, textarea {
  font-size: 16px;
}
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ============================================================
   TASK 1 — TRIAL BADGE
   Visible to all visitors above the pricing grid.
   ============================================================ */
.te-trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2A1500, #1A0A00);
  border: 1px solid #FF6B0060;
  color: #FF6B00;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 12px 20px;
  border-radius: 12px;
  margin: 0 auto 28px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* ============================================================
   TASKS 2 & 3 — PRICING DISCLOSURE / REFUND LINES
   Small legal copy above checkout buttons in pricing cards.
   ============================================================ */
.te-pricing-disclosure,
.te-pricing-refund {
  font-size: 0.72rem;
  color: #9A9AB5;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 6px;
  margin-top: 0;
}

/* ============================================================
   TASK 5 — ACCESSIBLE GREY (replaces inaccessible #3A3A50)
   Use .te-text-muted-accessible wherever #3A3A50 was used on
   dark backgrounds. Contrast ~4.6:1 on #0D0D0F.
   ============================================================ */
.te-text-muted-accessible {
  color: #9A9AB5;
}

/* ============================================================
   TASK 7 — HERO ROI STRIP (compact, above-fold social proof)
   ============================================================ */
.te-hero__roi-strip {
  margin-top: 32px;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  /* Keep any inner te-roi-strip components compact */
}
.te-hero__roi-strip .te-roi-strip,
.te-hero__roi-strip [class*="roi"] {
  font-size: 0.82rem;
}

/* ============================================================
   TASK 9 — COOKIE CONSENT BANNER
   Styled inline in footer.php; media query for mobile here.
   ============================================================ */
@media (max-width: 600px) {
  #te-cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  #te-cookie-banner > div {
    width: 100%;
  }
  #te-cookie-banner > div button {
    flex: 1;
  }
}

/* ============================================================
   TASK 10 — PREMIUM TEASER CARD (blurred Best Bet upsell)
   ============================================================ */
.te-teaser-blur {
  filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
}

.te-premium-teaser-card {
  background: linear-gradient(135deg, #12091E, #0F0F18);
  border: 2px solid #FF6B0060;
  border-radius: var(--radius-xl);
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 0 48px rgba(255, 107, 0, 0.15);
}

.te-premium-teaser-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 107, 0, 0.06);
  border-bottom: 1px solid #FF6B0030;
  flex-wrap: wrap;
}

.te-premium-teaser-card__venue {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--te-white);
  letter-spacing: 0.5px;
}

.te-premium-teaser-card__race {
  font-size: 0.8rem;
  color: #9A9AB5;
}

.te-premium-teaser-card__body {
  padding: 24px 20px 16px;
}

.te-premium-teaser-card__horse {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--te-white);
  letter-spacing: 1px;
  line-height: 1;
  pointer-events: none;
}

.te-premium-teaser-card__footer {
  padding: 16px 20px 20px;
  border-top: 1px solid #FF6B0030;
  background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
  .te-premium-teaser-card { max-width: 100%; }
}

/* ============================================================
   FEED ENRICHMENT LOADING STATE
   Shown while Phase 2 cron hasn't yet populated race details.
   ============================================================ */
.te-enriching {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--te-muted, #6B6B88);
  font-size: 0.9rem;
  padding: 16px 0;
}

.te-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 107, 0, 0.25);
  border-top-color: #FF6B00;
  border-radius: 50%;
  animation: te-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes te-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   MOBILE ADAPTIVENESS PASS
   Goals: no sideways page scroll, and show more of the page on
   first load (esp. phones). Appended last so it wins on conflicts.
   ============================================================ */

/* 1) Race-card data tables — contain horizontal scroll to the table
   wrapper so the PAGE never widens. These wrappers previously had no
   overflow rule, so wide field/sectional tables pushed the whole page
   past the viewport edge (the main cause of sideways scrolling). */
.te-runners-scroll,
.te-sects-scroll,
.te-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  /* Always show a slim scrollbar so it's obvious the table scrolls sideways. */
  scrollbar-width: thin;
  scrollbar-color: #FF6B00 #1a1a24;
}
.te-runners-scroll::-webkit-scrollbar,
.te-sects-scroll::-webkit-scrollbar,
.te-table-scroll::-webkit-scrollbar { height: 8px; -webkit-appearance: none; }
.te-runners-scroll::-webkit-scrollbar-thumb,
.te-sects-scroll::-webkit-scrollbar-thumb,
.te-table-scroll::-webkit-scrollbar-thumb { background: #FF6B00; border-radius: 4px; }
.te-runners-scroll::-webkit-scrollbar-track,
.te-sects-scroll::-webkit-scrollbar-track,
.te-table-scroll::-webkit-scrollbar-track { background: #1a1a24; border-radius: 4px; }

/* 2) Tablet / large phone */
@media (max-width: 768px) {
  /* Hero shouldn't eat the entire first screen — let content show below it. */
  .te-hero { min-height: auto; }
  .te-hero__content { padding: 40px 18px 36px; }
  .te-hero__badge { margin-bottom: 18px; font-size: 0.72rem; letter-spacing: 1px; padding: 5px 12px; }
  .te-hero__cta-group { margin-bottom: 32px; gap: 10px; }
  .te-hero__cta-group .te-btn { width: 100%; }          /* stacked, full-width tap targets */
  .te-hero__stats { gap: 20px 28px; }

  /* Reclaim a little side gutter for content. */
  .te-container,
  .te-container--narrow,
  .te-container--wide { padding: 0 14px; }

  .te-section-header { margin-bottom: 28px; }

  /* Long horse names / IDs / URLs must not force the layout wider. */
  body { overflow-wrap: break-word; word-wrap: break-word; }
}

/* 3) Small phones (~≤430px) */
@media (max-width: 430px) {
  .te-hero__stats { gap: 14px 22px; }
  .te-stat__number { font-size: 1.7rem; }
  .te-section { padding: 40px 0; }
  .te-btn--large { width: 100%; }
}

/* ============================================================
   RECENT WINNERS STRIP (homepage social proof)
   ============================================================ */
.te-winners {
  background: linear-gradient(90deg, #07140d, #0b1f12);
  border-top: 1px solid #1f7a4440;
  border-bottom: 1px solid #1f7a4440;
  padding: 10px 0;
  overflow: hidden;
}
.te-winners__inner { display: flex; align-items: center; gap: 14px; overflow: hidden; }
.te-winners__label {
  flex: 0 0 auto; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: #34d27b;
}
/* Auto side-scrolling marquee (items duplicated in markup for seamless loop) */
.te-winners__track {
  display: flex; align-items: center; gap: 10px; flex: 1 1 auto;
  overflow: hidden; width: 100%;
}
.te-winners__lane {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  animation: te-winners-scroll 40s linear infinite;
  will-change: transform;
}
.te-winners:hover .te-winners__lane { animation-play-state: paused; }
@keyframes te-winners-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .te-winners__lane { animation: none; }
  .te-winners__track { overflow-x: auto; }
}
.te-winners__item {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(52,210,123,0.07); border: 1px solid #1f7a4455;
  border-radius: 999px; padding: 5px 12px; font-size: 0.85rem; color: #E8E8F0;
  white-space: nowrap;
}
.te-winners__tick { color: #34d27b; font-weight: 900; }
.te-winners__item strong { font-weight: 700; }
.te-winners__price {
  font-variant-numeric: tabular-nums; color: #34d27b; font-weight: 800;
}
.te-winners__meta { color: #6B6B88; font-size: 0.76rem; }
@media (max-width: 600px) {
  .te-winners__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .te-winners__label { padding: 0 4px; }
}

/* ============================================================
   BEST BET — hero emphasis (gold glow behind the section)
   ============================================================ */
.te-section.te-bestbet {
  position: relative;
}
.te-section.te-bestbet::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 30%, rgba(255,182,72,0.10), transparent 70%);
}
.te-section.te-bestbet > .te-container { position: relative; }
.te-section.te-bestbet .te-section-label { color: #ffb648; }

/* ============================================================
   TIPS — collapsible venue blocks (AI / free / premium pages)
   ============================================================ */
.te-tipv { border: 1px solid var(--te-border, #2A2A38); border-radius: 12px; margin-bottom: 16px; overflow: hidden; background: var(--te-card, #1A1A24); }
.te-tipv__hd { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; background: linear-gradient(135deg, #16161f, #12121a); user-select: none; }
.te-tipv__hd:hover { background: linear-gradient(135deg, #1b1b26, #15151f); }
.te-tipv__name { font-family: var(--font-display, 'Barlow Condensed', sans-serif); font-size: 1.2rem; font-weight: 800; text-transform: uppercase; color: #fff; letter-spacing: .5px; flex: 1; }
.te-tipv__count { font-size: .78rem; color: #8a8a9a; }
.te-tipv__chev { transition: transform .2s; color: var(--te-orange, #FF6B00); font-size: 1rem; }
.te-tipv.is-open .te-tipv__chev { transform: rotate(180deg); }
.te-tipv__bd { display: none; padding: 14px 16px; }
.te-tipv.is-open .te-tipv__bd { display: block; }

/* ============================================================
   NAV — "Tips" dropdown (Free / Premium / AI)
   ============================================================ */
.te-nav-has-sub { position: relative; }
.te-nav-sub {
  display: none; position: absolute; top: 100%; left: 0; min-width: 190px;
  background: #16161f; border: 1px solid var(--te-border, #2A2A38); border-radius: 10px;
  padding: 6px; margin-top: 6px; z-index: 1100; box-shadow: 0 12px 34px rgba(0,0,0,.55); list-style: none;
}
.te-nav-has-sub:hover > .te-nav-sub,
.te-nav-has-sub:focus-within > .te-nav-sub { display: block; }
.te-nav-sub li { list-style: none; }
.te-nav-sub a { display: block; padding: 9px 12px; border-radius: 6px; white-space: nowrap; color: var(--te-grey-200, #B8B8CC); font-size: 0.9rem; }
.te-nav-sub a:hover, .te-nav-sub a:focus { background: var(--te-orange-bg, #FF6B0015); color: var(--te-orange, #FF6B00); }
.te-nav-has-sub.active > .te-nav-sub-toggle { color: var(--te-orange, #FF6B00); background: var(--te-orange-bg, #FF6B0015); }
.te-nav-caret { font-size: 0.78em; opacity: .8; }
.te-drawer__group-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.5px; color: #6B6B88; padding: 12px 0 4px; }
.te-drawer__sublink { padding-left: 20px !important; }
@media (max-width: 600px) { .te-tipv__name { font-size: 1rem; } .te-tipv__bd { padding: 10px 10px; } }
