:root {
  /* Colors */
  --bg-color: #0b0f19;
  --panel-bg: rgba(22, 28, 45, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #2dd4bf; /* Teal */
  --accent-hover: #14b8a6;
  --danger-color: #ef4444;
  --success-color: #22c55e;
  /* Specific colors for metrics */
  .metric-corners .m-icon { color: #4facfe; }
  .metric-on-target .m-icon { color: #00f2fe; }
  .metric-off-target .m-icon { color: #94a3b8; }
  --card-bg: rgba(30, 41, 59, 0.7);

  /* Typography */
  --font-family: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  background-image: radial-gradient(circle at top right, rgba(45, 212, 191, 0.1), transparent 400px),
                    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.1), transparent 400px);
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  overscroll-behavior-y: contain;
}

/* Utilities */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}

.hidden {
  display: none !important;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  margin: 16px;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Space out brand and close button */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
  font-size: 24px;
  color: var(--accent-color);
}

.sidebar-header h2 {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0; /* Enable internal scrollable containment */
  margin-top: 16px;
  margin-bottom: 16px;
}

.sidebar-menu h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.sidebar-menu ul {
  list-style: none;
  flex-grow: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}

.sidebar-menu li {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-menu li:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-menu li.active {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-color);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
}

/* Main Content */
.main-content {
  flex-grow: 1;
  padding: 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.top-bar-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-control label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.glass-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glass-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.2);
}

.glass-select option {
    background: #1e293b;
    color: #fff;
}

.top-bar h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.top-bar-content {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-grow: 1;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 6px 14px;
  width: 200px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(79, 172, 254, 0.2);
  width: 260px;
}

.search-wrapper .search-icon {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-right: 8px;
  pointer-events: none;
  transition: color 0.2s;
}

.search-wrapper:focus-within .search-icon {
  color: var(--accent-color);
}

.search-wrapper .glass-input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
  outline: none;
  padding: 0;
}

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

.search-wrapper .clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.search-wrapper .clear-search-btn:hover {
  color: #ef4444;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.3);
  padding: 6px 12px;
  border-radius: 20px;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Match Grid */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

/* Match Card */
.match-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.match-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 600;
  gap: 12px;
}

.match-league {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.match-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.match-time {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.15);
  padding: 4px 8px;
  border-radius: 4px;
  animation: flash 2s infinite;
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.teams-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: white;
  border-radius: 50%;
  padding: 2px;
}

.team-name {
  font-weight: 600;
  font-size: 16px;
}

.team-score {
  font-size: 24px;
  font-weight: 700;
}

.live-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Revert back to 3 items */
    gap: 12px;
}

.match-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
  margin-bottom: 16px;
}

.stat-box {
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 4px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.match-stats .stat-box:nth-child(-n+3) {
  grid-column: span 2;
}

.match-stats .stat-box:nth-child(n+4) {
  grid-column: span 3;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 0.03em;
  font-family: 'Outfit', sans-serif;
}

.stat-box.danger .stat-sub {
  color: rgba(239, 68, 68, 0.6);
}

.stat-box.highlight-penalty .stat-sub {
  color: rgba(234, 179, 8, 0.6);
}

.stat-box.danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-box.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.stat-box.danger .stat-value {
  color: var(--danger-color);
}

.stat-box.highlight-penalty {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.stat-box.highlight-penalty:hover {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.3);
}

.stat-box.highlight-penalty .stat-value {
  color: #eab308;
}

.chart-container {
  height: 80px;
  width: 100%;
  margin-top: 10px;
}

/* Modals & States */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

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

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
}

.icon-btn:hover {
  color: white;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--panel-border);
  padding: 10px 12px;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.form-group small {
  font-size: 11px;
  color: var(--text-secondary);
}

.form-group small a {
  color: var(--accent-color);
  text-decoration: none;
}

.btn {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-color);
  color: #0b0f19;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

.btn-help {
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent-color);
  border: 1px solid rgba(45, 212, 191, 0.25);
  margin-bottom: 8px;
}

.btn-help:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.15);
}

.loading-state, .error-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-grow: 1;
  color: var(--text-secondary);
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

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

.error-state i {
  font-size: 48px;
  color: var(--danger-color);
}

.empty-state i {
  font-size: 48px;
  opacity: 0.3;
}

.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    z-index: 1001;
    transition: left 0.3s ease;
    margin: 0;
    height: 100vh;
    border-radius: 0;
  }
  .sidebar.mobile-active {
    left: 0;
  }
  
  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-only {
    display: block;
  }
  
  .top-bar {
    align-items: center;
    gap: 16px;
  }
  
  .main-content {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .match-grid {
    grid-template-columns: 1fr;
  }
  
  .top-bar h1 {
    font-size: 20px;
  }

  .top-bar-content {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  
  .search-wrapper {
    width: 130px;
    padding: 4px 10px;
  }
  
  .search-wrapper:focus-within {
    width: 160px;
  }
  
  .status-indicator {
    display: none;
  }
  
  body {
      overflow: auto;
  }
  
  .app-container {
      height: auto;
      overflow: visible;
  }
}

/* --- Live Statistics Styles (Global-Premium) --- */
.live-stats-row {
    margin-top: 18px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(79, 172, 254, 0.15);
    box-shadow: inset 0 0 15px rgba(79, 172, 254, 0.05);
}

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

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #00f2fe;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.live-badge i {
    font-size: 0.8rem;
    animation: icon-pulse 1.5s infinite;
}

@keyframes icon-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.live-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.live-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 5px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, background 0.2s ease;
}

.live-metric:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.m-icon {
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: rgba(0, 242, 254, 0.8);
}

.m-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.m-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
}

.m-sub {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    margin-top: 3px;
    letter-spacing: 0.03em;
    font-family: 'Outfit', sans-serif;
}

/* Specific colors for metrics */
.metric-corners .m-icon { color: #4facfe; }
.metric-on-target .m-icon { color: #00f2fe; }
.metric-off-target .m-icon { color: #94a3b8; }

/* Mobile responsive adjustments for live stats */
@media (max-width: 480px) {
    .live-metrics {
        gap: 5px;
    }
    .m-value {
        font-size: 0.95rem;
    }
}

/* Mobile responsive adjustments for sorting */
@media (max-width: 1024px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .top-bar-controls {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .sort-control {
        width: 100%;
        margin-top: 5px;
    }
    
    .sort-control label {
        /* Restored visibility on mobile */
    }
    
    .glass-select {
        flex: 1;
        font-size: 0.75rem;
    }
    
    .history-control {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
    }
    
    .history-control label {
        /* Restored visibility on mobile */
    }
}

/* --- History Range Slider Styles --- */
.history-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-control label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

#history-slider-val {
    color: var(--accent-color);
    font-weight: 700;
}

.glass-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.glass-slider:focus {
    background: rgba(255, 255, 255, 0.2);
}

/* Chrome/Safari/Opera/Edge slider thumb */
.glass-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--bg-color);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.glass-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    background: var(--accent-hover);
}

/* Firefox slider thumb */
.glass-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--bg-color);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.glass-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
    background: var(--accent-hover);
}

/* Settings modal range slider layout */
#settings-modal .glass-slider {
    width: 100%;
    margin-top: 8px;
    height: 8px;
}

#settings-modal #history-slider-modal-val {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1rem;
    margin-left: 4px;
}

.slider-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Passcode Authorization Styles --- */
.error-msg {
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

/* --- High Value Greenish Card Highlight --- */
.match-card.highlight-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(22, 28, 45, 0.8) 100%) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.06), inset 0 0 12px rgba(34, 197, 94, 0.05) !important;
}

.match-card.highlight-green:hover {
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 12px 40px rgba(34, 197, 94, 0.15), inset 0 0 16px rgba(34, 197, 94, 0.1) !important;
}

/* Sleek badge container inline inside header right */
.high-value-badge-container {
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.value-badge-tag {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid rgba(34, 197, 94, 0.45);
    letter-spacing: 0.05em;
    animation: pulseHighlight 2s infinite ease-in-out;
}

.value-badge-hint {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

@keyframes pulseHighlight {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

/* --- High Tension Reddish Card Highlight (Penalties & Cards) --- */
.match-card.highlight-red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(22, 28, 45, 0.8) 100%) !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.04), inset 0 0 12px rgba(239, 68, 68, 0.03) !important;
}

.match-card.highlight-red:hover {
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.12), inset 0 0 16px rgba(239, 68, 68, 0.06) !important;
}

/* Red version for cards and penalties badges */
.highlight-red .value-badge-tag {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    animation: pulseRedHighlight 2s infinite ease-in-out;
}

.highlight-red .value-badge-hint {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

@keyframes pulseRedHighlight {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

/* --- Head-to-Head Averages Styles (Purple-Premium Glassmorphism) --- */
.h2h-stats-row {
    margin-top: 14px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(236, 72, 153, 0.04) 100%);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.03);
}

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

.h2h-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #c084fc;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.h2h-badge.no-h2h {
    color: var(--text-secondary);
    text-shadow: none;
}

.h2h-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.h2h-metrics.no-h2h {
    display: block;
}

.h2h-no-data {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 4px 0;
    font-style: italic;
}

.h2h-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 2px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, background 0.2s ease;
}

.h2h-metric:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
}

.h-label {
    font-size: 0.58rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
    white-space: nowrap;
}

.h-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.h2h-badge i {
    font-size: 0.75rem;
}

/* Mobile responsive adjustments for H2H */
@media (max-width: 480px) {
    .h2h-metrics {
        gap: 5px;
    }
    .h-value {
        font-size: 0.8rem;
    }
}

/* --- Probability Slider Control --- */
.probability-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.probability-control label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

#prob-slider-val {
    color: var(--accent-color);
    font-weight: 700;
}

/* Mobile responsive adjustments for probability slider */
@media (max-width: 640px) {
    .probability-control {
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
    }
    
    .probability-control label {
        /* Restored visibility on mobile */
    }
}

/* --- Live xG Row --- */
.live-xg-row {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.xg-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.xg-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.xg-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 32px;
}

.xg-team.home {
    align-items: flex-start;
}

.xg-team.away {
    align-items: flex-end;
}

.xg-team .xg-label {
    font-size: 0.52rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.xg-team .xg-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.xg-bar-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.xg-bar.home {
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    height: 100%;
}

.xg-bar.away {
    background: linear-gradient(90deg, #f02fc2, #6094ea);
    height: 100%;
}

/* --- Premium Bet Tips Section --- */
.premium-tips-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #f472b6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(244, 114, 182, 0.3);
}

.tips-header i {
    animation: fire-flicker 1.5s infinite alternate;
}

@keyframes fire-flicker {
    0% { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 2px #ef4444); }
    100% { transform: scale(1.15) rotate(5deg); filter: drop-shadow(0 0 6px #f472b6); }
}

.tips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tip-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tip-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(45, 212, 191, 0.4) !important; /* Premium Teal accented border on hover */
    transform: translateX(2px);
    box-shadow: 0 4px 20px rgba(45, 212, 191, 0.05);
}

/* --- Teal Glassmorphic Odds Pill Badge --- */
.tip-badges-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-odds-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid rgba(45, 212, 191, 0.35); /* teal accent border */
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.odds-bookie {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.3), rgba(79, 172, 254, 0.2));
    color: #5eead4;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.60rem;
    font-weight: 800;
    border-right: 1px solid rgba(45, 212, 191, 0.3);
    text-shadow: 0 0 8px rgba(45, 212, 191, 0.6);
}

.odds-value {
    background: rgba(15, 23, 42, 0.65); /* dark translucent block */
    color: #fff;
    padding: 2px 6px;
    letter-spacing: 0.02em;
}

/* Hover highlights on tip card trigger odds pill glow */
.tip-chip:hover .tip-odds-badge {
    border-color: rgba(45, 212, 191, 0.8);
    box-shadow: 0 0 14px rgba(45, 212, 191, 0.4);
    transform: scale(1.02);
}

.tip-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tip-type {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
}

.tip-prob-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
}

/* Color coding for probability */
.tip-prob-badge.high {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.tip-prob-badge.medium {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.tip-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.tips-placeholder {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    text-align: center;
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
}

/* --- Late Goals Telemetry Row & Bars --- */
.late-goals-telemetry {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.late-goal-item {
    display: flex;
    flex-direction: column;
}
.late-goal-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-bottom: 3px;
}
.late-goal-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.late-goal-bar-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}
.late-goal-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.late-goal-value {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    min-width: 38px;
    text-align: right;
}

/* --- High Probability Orange Alert Styles (>= 80%) --- */
.late-goal-label.high-prob-orange {
    color: #ff9f43 !important;
    text-shadow: 0 0 8px rgba(255, 159, 67, 0.4);
    font-weight: 800;
}
.late-goal-value.high-prob-orange {
    color: #ff9f43 !important;
    text-shadow: 0 0 12px rgba(255, 159, 67, 0.85);
    font-weight: 900;
    animation: pulse-orange 1.5s infinite alternate ease-in-out;
}
.late-goal-bar-fill.high-prob-orange {
    background: linear-gradient(90deg, #ff6b6b, #ff9f43, #feca57) !important;
    box-shadow: 0 0 12px rgba(255, 159, 67, 0.7), 0 0 4px rgba(254, 202, 87, 0.5);
}

.tip-chip.high-prob-orange {
    border-color: rgba(255, 159, 67, 0.5) !important;
    background: rgba(255, 159, 67, 0.04) !important;
    box-shadow: 0 0 15px rgba(255, 159, 67, 0.1) !important;
}

.tip-chip.high-prob-orange:hover {
    border-color: rgba(255, 159, 67, 0.85) !important;
    background: rgba(255, 159, 67, 0.08) !important;
    box-shadow: 0 0 20px rgba(255, 159, 67, 0.25) !important;
}

.tip-prob-badge.high-prob-orange {
    background: rgba(255, 159, 67, 0.25) !important;
    color: #ff9f43 !important;
    border: 1px solid rgba(255, 159, 67, 0.5) !important;
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.3) !important;
}

@keyframes pulse-orange {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.06); filter: brightness(1.2); }
}

/* =============================================
   HELP MODAL
   ============================================= */

.modal-help {
  max-width: 620px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.modal-help .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.help-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-modal-title i {
  font-size: 20px;
  color: var(--accent-color);
}

.help-modal-title h2 {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #2dd4bf, #4facfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tabs */
.help-tabs {
  display: flex;
  gap: 2px;
  padding: 12px 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

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

.help-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 8px 14px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: 6px 6px 0 0;
}

.help-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.help-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  background: rgba(45, 212, 191, 0.07);
}

/* Body */
.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.help-body::-webkit-scrollbar { width: 4px; }
.help-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Panels */
.help-panel { display: none; }
.help-panel.active { display: block; }

/* Sections */
.help-section {
  margin-bottom: 24px;
}

.help-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section h4 i {
  color: var(--accent-color);
}

.help-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Hero Block */
.help-hero {
  text-align: center;
  padding: 20px 16px 8px;
}

.help-hero-icon {
  font-size: 40px;
  color: var(--accent-color);
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(45, 212, 191, 0.5));
}

.help-hero h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #2dd4bf, #4facfe, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.help-hero p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto;
}

/* Help Items (numbered / icon list) */
.help-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.help-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: background 0.2s;
}

.help-item:hover {
  background: rgba(255,255,255,0.06);
}

.help-item.compact {
  padding: 8px 12px;
}

.help-item strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.help-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Badges */
.help-badge {
  flex-shrink: 0;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 6px;
  white-space: nowrap;
}

.badge-teal {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.badge-blue {
  background: rgba(79, 172, 254, 0.15);
  color: #4facfe;
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-pink {
  background: rgba(244, 114, 182, 0.15);
  color: #f472b6;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

/* Callout boxes */
.help-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-top: 10px;
}

.help-callout i {
  margin-top: 2px;
  flex-shrink: 0;
}

.callout-teal {
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.25);
  color: #a7f3d0;
}

.callout-teal i { color: #2dd4bf; }

.callout-orange {
  background: rgba(255, 159, 67, 0.08);
  border: 1px solid rgba(255, 159, 67, 0.25);
  color: #fed7aa;
}

.callout-orange i { color: #ff9f43; }

.callout-purple {
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: #ddd6fe;
}

.callout-purple i { color: #a78bfa; }

/* Mobile responsiveness */
@media (max-width: 600px) {
  .modal-help { max-width: 100vw; max-height: 92vh; }
  .help-tab { font-size: 0.72rem; padding: 7px 10px 9px; gap: 4px; }
  .help-tab i { display: none; }
  .help-body { padding: 16px; }
}

/* --- Premium tab special styling --- */
.help-tab-premium {
  color: #fbbf24;
  position: relative;
}

.help-tab-premium i {
  color: #fbbf24;
}

.help-tab-premium:hover {
  color: #f59e0b;
  background: rgba(251, 191, 36, 0.06);
}

.help-tab-premium.active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

/* Premium Hero */
.premium-hero {
  text-align: center;
  padding: 16px 16px 4px;
}

.premium-crown-icon {
  font-size: 36px;
  color: #fbbf24;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.55));
  animation: crown-pulse 2.5s ease-in-out infinite alternate;
}

@keyframes crown-pulse {
  0%  { filter: drop-shadow(0 0 10px rgba(251,191,36,0.4)); }
  100%{ filter: drop-shadow(0 0 22px rgba(251,191,36,0.8)); }
}

.premium-hero h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #fbbf24, #f472b6, #fbbf24);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.premium-hero p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Comparison Table */
.premium-table {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.8rem;
}

.premium-table-header {
  display: grid;
  grid-template-columns: 1fr 70px 80px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.premium-table-header .col-free  { color: #94a3b8; text-align: center; }
.premium-table-header .col-free i { color: #94a3b8; }
.premium-table-header .col-premium { color: #fbbf24; text-align: center; }
.premium-table-header .col-premium i { color: #fbbf24; }
.premium-table-header .col-feature { color: var(--text-secondary); }

.premium-row {
  display: grid;
  grid-template-columns: 1fr 70px 80px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: center;
  transition: background 0.15s;
}

.premium-row:last-child { border-bottom: none; }

.premium-row:hover { background: rgba(255,255,255,0.03); }

.premium-row-highlight {
  background: rgba(251, 191, 36, 0.03);
}

.premium-row-highlight:hover {
  background: rgba(251, 191, 36, 0.06);
}

.col-feature {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-free, .col-premium {
  text-align: center;
  font-size: 1rem;
}

.col-free.check  { color: #4ade80; }
.col-free.cross  { color: rgba(148,163,184,0.35); }
.col-premium.check { color: #fbbf24; }

/* =============================================
   PREMIUM ACTIVATION MODAL
   ============================================= */

/* Sidebar premium button */
.btn-premium {
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.08));
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
  margin-bottom: 8px;
  position: relative;
  transition: all 0.25s ease;
}

.btn-premium:hover {
  background: linear-gradient(135deg, rgba(251,191,36,0.22), rgba(245,158,11,0.16));
  border-color: rgba(251,191,36,0.6);
  box-shadow: 0 0 20px rgba(251,191,36,0.2);
}

.btn-premium-active {
  background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.18)) !important;
  border-color: rgba(251,191,36,0.7) !important;
  box-shadow: 0 0 16px rgba(251,191,36,0.25) !important;
}

.premium-sidebar-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0b0f19;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 8px;
  line-height: 1;
  box-shadow: 0 0 8px rgba(251,191,36,0.6);
}

/* Modal container */
.modal-premium {
  max-width: 680px;
  width: 95vw;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.modal-premium .modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.premium-modal-title {
  background: linear-gradient(90deg, #fbbf24, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 18px;
  font-weight: 700;
}

.premium-modal-body {
  overflow-y: auto;
  padding: 20px 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.premium-modal-body::-webkit-scrollbar { width: 4px; }
.premium-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.premium-modal-subtitle {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

.premium-modal-subtitle strong { color: var(--accent-color); }

/* Subscription tier cards */
.sub-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.sub-tier {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sub-tier:hover {
  border-color: rgba(251,191,36,0.3);
  box-shadow: 0 0 20px rgba(251,191,36,0.07);
}

/* Featured (Annual) card */
.sub-tier-featured {
  background: rgba(251,191,36,0.05);
  border-color: rgba(251,191,36,0.35);
  box-shadow: 0 0 24px rgba(251,191,36,0.1);
}

.sub-tier-featured:hover {
  border-color: rgba(251,191,36,0.6);
  box-shadow: 0 0 30px rgba(251,191,36,0.2);
}

.sub-tier-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #0b0f19;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(251,191,36,0.5);
}

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

.sub-tier-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-tier-icon { font-size: 1.1rem; }

.sub-tier-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
}

.price-period {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.sub-tier-saving {
  font-size: 0.7rem;
  color: #4ade80;
  font-weight: 600;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-block;
}

.sub-tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-grow: 1;
}

.sub-tier-features li {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-tier-features li i {
  color: #4ade80;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.sub-tier-code {
  font-size: 0.67rem;
  color: rgba(148,163,184,0.6);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
  margin-top: auto;
}

.sub-tier-code code {
  background: rgba(45,212,191,0.1);
  color: var(--accent-color);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Code entry section */
.premium-code-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px;
}

.premium-code-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.premium-code-label i { color: #fbbf24; }

.premium-code-row {
  display: flex;
  gap: 10px;
}

.premium-code-input {
  flex-grow: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}

.premium-code-input:focus {
  outline: none;
  border-color: rgba(251,191,36,0.5);
  box-shadow: 0 0 0 2px rgba(251,191,36,0.12);
}

.btn-activate-premium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0b0f19;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 0 16px rgba(251,191,36,0.3);
}

.btn-activate-premium:hover {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 0 24px rgba(251,191,36,0.5);
  transform: translateY(-1px);
}

.btn-activate-premium:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status message */
.premium-status-msg {
  font-size: 0.8rem;
  margin-top: 10px;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.5;
}

.premium-status-msg.status-active {
  color: #4ade80;
}

.premium-status-msg.status-active i { color: #4ade80; }

.premium-status-msg.status-error {
  color: #f87171;
}

.premium-status-msg.status-error i { color: #f87171; }

/* Mobile */
@media (max-width: 580px) {
  .sub-tiers { grid-template-columns: 1fr; }
  .modal-premium { max-width: 100vw; max-height: 92vh; }
  .premium-code-row { flex-direction: column; }
  .btn-activate-premium { width: 100%; justify-content: center; }
}

/* --- Premium H2H Recent Matches List Widget --- */
.h2h-recent-matches {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(168, 85, 247, 0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInH2H 0.3s ease-out;
}

.h2h-recent-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: #c084fc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
    margin-bottom: 2px;
}

.h2h-match-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.h2h-match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 10px;
}

.h2h-match-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(168, 85, 247, 0.25);
    transform: translateX(2px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.04);
}

.h2h-match-season-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 52px;
    flex-shrink: 0;
}

.h2h-match-season {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.h2h-badge-tag {
    font-size: 0.52rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
    white-space: nowrap;
}

.h2h-badge-tag.badge-mundial {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.h2h-badge-tag.badge-euro {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.h2h-badge-tag.badge-friendly {
    background: rgba(156, 163, 175, 0.15);
    color: #d1d5db;
    border: 1px solid rgba(156, 163, 175, 0.25);
}

.h2h-badge-tag.badge-ucl {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.h2h-badge-tag.badge-uel {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.h2h-badge-tag.badge-cup {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.h2h-match-teams-vertical {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.h2h-team {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h2h-team.win {
    color: #34d399 !important; /* Emerald Neon Win State */
    font-weight: 700;
}

.h2h-match-scores-cols {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.h2h-score-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 20px;
}

.h2h-score-col.ft {
    font-weight: 800;
    color: #fff;
    font-size: 0.76rem;
    font-family: 'Outfit', sans-serif;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.h2h-score-col.ht {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Outfit', sans-serif;
    padding: 3px 0;
}

.h2h-score-val {
    line-height: 1.1;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeInH2H {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .h2h-match-item {
        padding: 8px 8px;
        gap: 8px;
    }
    .h2h-team {
        font-size: 0.68rem;
    }
    .h2h-match-season {
        font-size: 0.62rem;
        width: 30px;
    }
    .h2h-match-scores-cols {
        gap: 10px;
    }
}

/* ==========================================
   DYNAMIC VOLATILITY TELEMETRY ROW
   ========================================== */
.telemetry-weights-row {
    margin-top: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.18);
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.03), 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.telemetry-weights-row:hover {
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.05), 0 6px 25px rgba(6, 182, 212, 0.08);
}

.telemetry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.telemetry-badge-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #06b6d4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.pulse-neon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: neonGlowPulse 2s infinite ease-in-out;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #ef4444;
    animation: pulseDotAnim 1s infinite alternate;
}

.stable-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.telemetry-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.telemetry-team-col {
    display: flex;
    flex-direction: column;
}

.telemetry-team-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telemetry-metrics-grid {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.telemetry-metric-item {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.telemetry-metric-item .t-label {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.telemetry-metric-item .t-value {
    font-size: 0.72rem;
    color: #f8fafc;
    font-weight: 700;
}

.telemetry-weight-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.telemetry-weight-bar {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.t-bar-label {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.t-bar-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.t-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.t-bar-fill.general {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.4);
}

.t-bar-fill.recent {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.t-bar-fill.h2h {
    background: linear-gradient(90deg, #10b981, #3b82f6);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.telemetry-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0) 100%);
}

@keyframes neonGlowPulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(239, 68, 68, 0.2), inset 0 0 4px rgba(239, 68, 68, 0.1);
        border-color: rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.5), inset 0 0 8px rgba(239, 68, 68, 0.25);
        border-color: rgba(239, 68, 68, 0.6);
    }
}

@keyframes pulseDotAnim {
    from { transform: scale(0.9); opacity: 0.7; }
    to { transform: scale(1.3); opacity: 1; }
}



/* --- Premium Lock Overlay --- */
.premium-locked {
    position: relative;
}
.premium-locked > *:not(.telemetry-header):not(.h2h-header):not(.xg-badge):not(.tips-header) {
    filter: blur(4px) grayscale(50%);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}
.premium-locked::after {
    content: '?? Premium';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: auto;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
}

/* --- Header Refresh Button --- */
.header-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex-shrink: 0;
}

.header-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-color);
  color: white;
  box-shadow: 0 0 12px rgba(79, 172, 254, 0.3);
}

.header-refresh-btn:active {
  transform: scale(0.92);
}

/* Spin animation during refresh */
.header-refresh-btn.refreshing i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Pull to Refresh Indicator --- */
.ptr-indicator {
  position: fixed;
  top: -60px; /* Hidden off-screen initially */
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 10px rgba(79, 172, 254, 0.2);
  color: white;
  pointer-events: none;
  transition: transform 0.1s ease-out, opacity 0.2s ease;
  opacity: 0;
}

.ptr-indicator.active {
  opacity: 1;
}

.ptr-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptr-spinner i {
  font-size: 16px;
  transition: transform 0.1s linear;
}

.ptr-indicator.refreshing .ptr-spinner i {
  animation: spin 1.2s linear infinite;
}

.ptr-indicator.pull-ready .ptr-spinner i {
  color: var(--accent-color);
}

/* --- Goal Scorers Styles --- */
.team-name-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.team-scorers {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
}

.scorer-icon {
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.65;
}

.match-card.second-half-greyed {
  opacity: 0.35;
  filter: grayscale(80%);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.match-card.second-half-greyed:hover {
  opacity: 0.75;
  filter: grayscale(20%);
}

/* AdMob Layout Spacing */
.has-ad-banner .main-content {
  padding-bottom: 80px !important;
}


/* Premium & Trial Modal Buttons */
.activate-premium-btn {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #000;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.activate-premium-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
}

.activate-premium-btn:active {
  transform: translateY(1px);
}

.premium-modal-title {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

