/* =========================================================
   SPORTS SCHEDULE TV DASHBOARD - MODERN BROADCAST UI
   Optimized for 1080p & 4K TV Displays & Digital Signage
   ========================================================= */

:root {
  --bg-main: #070a12;
  --bg-card: rgba(18, 24, 40, 0.75);
  --bg-card-hover: rgba(26, 35, 60, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.4);
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-gold: #f59e0b;
  --accent-live: #ef4444;
  --accent-live-glow: rgba(239, 68, 68, 0.45);
  --accent-green: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Chakra Petch', 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(30, 58, 138, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(14, 116, 144, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.5) 0%, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
  user-select: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ================= HEADER SECTION ================= */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
  font-size: 1.8rem;
}

.brand-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

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

.clock-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.digital-time {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.date-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 1rem;
}

.date-day {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.date-tz {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

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

.btn-icon.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* ================= RUNNING TICKER ================= */
.ticker-bar {
  background: linear-gradient(90deg, #1e1b4b, #0f172a);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  height: 44px;
  overflow: hidden;
  position: relative;
}

.ticker-label {
  background: var(--accent-live);
  color: #fff;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
}

.ticker-content {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.ticker-text {
  display: inline-block;
  padding-left: 100%;
  animation: tickerScroll 35s linear infinite;
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ================= MAIN CONTAINER ================= */
.main-wrapper {
  max-width: 1800px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

/* Notice Bar (API Alert / Offline) */
.notice-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

/* League Selector Bar */
.league-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.league-tabs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.league-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.league-tab-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.league-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.league-tab-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.8), rgba(37, 99, 235, 0.8));
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.4);
}

.league-count-badge {
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-weight: 700;
}

.rotation-status {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rotate-progress {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
}

.rotate-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.1s linear;
}

/* ================= SECTION HEADINGS ================= */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-icon {
  font-size: 1.3rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-live-pulse {
  background: var(--accent-live);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 0 12px var(--accent-live-glow);
  animation: pulseLive 1.8s infinite;
}

@keyframes pulseLive {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* ================= LIVE MATCH CARDS ================= */
.live-section {
  margin-bottom: 2.75rem;
}

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

.card-live {
  background: linear-gradient(135deg, rgba(20, 29, 52, 0.85), rgba(12, 18, 33, 0.95));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(239, 68, 68, 0.12);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: transform 0.25s ease;
}

.card-live::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ef4444, #f97316, #ef4444);
}

.card-live:hover {
  transform: translateY(-3px);
}

.card-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.league-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.league-meta img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.live-match-timer {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.25rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.match-body-live {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.team-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.team-crest-wrapper {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.team-crest-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.team-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-box-live {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
  flex-shrink: 0;
}

.score-display {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-divider {
  color: var(--text-dim);
  font-size: 2rem;
}

.card-footer-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.venue-info {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.venue-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-pill {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.2));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ================= UPCOMING MATCHES SECTION ================= */
.upcoming-section {
  margin-bottom: 2.5rem;
}

.date-group {
  margin-bottom: 2.25rem;
}

.date-group-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-left: 4px solid var(--primary);
  padding-left: 0.75rem;
}

.upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 1.35rem;
}

.card-match {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.card-match:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.card-match.hot-border {
  border-left: 4px solid var(--accent-gold);
}

.hot-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.match-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.league-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
}

.league-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-tag img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-main-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 1.1rem;
  gap: 0.5rem;
}

.team-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
}

.team-crest-sm {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  padding: 8px;
  flex-shrink: 0;
}

.team-crest-sm img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.team-name-sm {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.vs-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.5rem;
  flex-shrink: 0;
}

.time-box-badge {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.vs-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 0.35rem;
  text-transform: uppercase;
}

.match-footer-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ================= MODAL SETTINGS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-active);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  padding: 2rem;
}

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

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.btn-close:hover {
  color: #fff;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.toggle-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.modal-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast Notifications */
.toast-box {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #fff;
  border-left: 4px solid var(--accent-green);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  gap: 0.75rem;
  z-index: 2000;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ================= COMPREHENSIVE RESPONSIVE DESIGN ================= */

/* League tabs touch scrollbar hide */
.league-tabs {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
.league-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* 4K or Extra Large Screens (>= 1920px) */
@media (min-width: 1920px) {
  .brand-title { font-size: 2.1rem; }
  .digital-time { font-size: 2.6rem; }
  .team-name { font-size: 1.45rem; }
  .score-display { font-size: 3.5rem; }
  .time-box-badge { font-size: 1.6rem; }
  .upcoming-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

/* Laptops & Standard Desktops (<= 1200px) */
@media (max-width: 1200px) {
  .app-header {
    padding: 1rem 1.5rem;
  }
  .brand-title {
    font-size: 1.45rem;
  }
  .digital-time {
    font-size: 1.7rem;
  }
  .main-wrapper {
    padding: 1.5rem;
  }
  .upcoming-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

/* Tablets Landscape & Portrait (<= 992px) */
@media (max-width: 992px) {
  .app-header {
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
  }
  .brand-wrapper {
    order: 1;
  }
  .header-center {
    order: 2;
  }
  .header-actions {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 0.75rem;
    overflow-x: auto;
  }
  .btn-icon {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
  .live-grid {
    grid-template-columns: 1fr;
  }
  .upcoming-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
  }
}

/* Smartphones & Small Tablets (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand clock"
      "actions actions";
    gap: 0.65rem 0.75rem;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .brand-wrapper {
    grid-area: brand;
    gap: 0.65rem;
    min-width: 0;
  }
  .brand-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.35rem;
    flex-shrink: 0;
  }
  .brand-info {
    min-width: 0;
  }
  .brand-title {
    font-size: 1.2rem;
    line-height: 1.1;
    letter-spacing: 0.03em;
  }
  .brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }
  .header-center {
    grid-area: clock;
    display: flex;
    align-items: center;
    justify-self: end;
  }
  .clock-card {
    padding: 0.3rem 0.65rem;
    gap: 0.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
  }
  .digital-time {
    font-size: 1.35rem;
    letter-spacing: 0.04em;
  }
  .date-badge {
    padding-left: 0.5rem;
  }
  .date-day {
    font-size: 0.75rem;
  }
  .date-tz {
    font-size: 0.62rem;
  }
  .header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
  }
  .btn-icon {
    padding: 0.45rem 0.2rem;
    border-radius: 8px;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-width: 0;
  }
  .btn-icon .btn-text {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Running Ticker Mobile */
  .ticker-bar {
    height: 36px;
  }
  .ticker-label {
    padding: 0 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .ticker-text {
    font-size: 0.82rem;
  }

  /* Main Container Mobile */
  .main-wrapper {
    padding: 1rem 0.85rem;
  }
  .section-header {
    margin-bottom: 0.85rem;
    gap: 0.5rem;
  }
  .section-title {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
  }
  .date-group-header {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    padding-left: 0.6rem;
    border-left-width: 3px;
  }
  .date-group {
    margin-bottom: 1.5rem;
  }

  /* League Tabs Mobile */
  .league-nav-container {
    margin-bottom: 1.25rem;
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
  }
  .league-tabs {
    width: 100%;
    gap: 0.45rem;
    padding: 2px 0 6px 0;
    overflow-x: auto;
    display: flex;
  }
  .league-tab-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 20px;
  }
  .rotation-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: 0 0.25rem;
  }
  .rotate-progress {
    width: 80px;
    height: 4px;
  }

  /* Live Match Card Mobile */
  .card-live {
    padding: 1rem;
    border-radius: 14px;
  }
  .card-top-meta {
    margin-bottom: 0.85rem;
  }
  .league-meta {
    font-size: 0.78rem;
  }
  .live-match-timer {
    font-size: 0.8rem;
    padding: 0.18rem 0.5rem;
  }
  .match-body-live {
    grid-template-columns: 1fr auto 1fr;
    margin-bottom: 0.9rem;
    gap: 0.35rem;
  }
  .team-crest-wrapper {
    width: 54px;
    height: 54px;
    padding: 6px;
  }
  .team-name {
    font-size: 0.88rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    max-height: 2.4em;
  }
  .score-box-live {
    padding: 0 0.4rem;
  }
  .score-display {
    font-size: 1.9rem;
    gap: 0.3rem;
  }
  .score-divider {
    font-size: 1.4rem;
  }
  .card-footer-meta {
    padding-top: 0.75rem;
    font-size: 0.75rem;
  }
  .channel-pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
  }

  /* Upcoming Cards Mobile */
  .upcoming-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .card-match {
    padding: 0.9rem 1rem;
    border-radius: 14px;
  }
  .match-header-row {
    margin-bottom: 0.75rem;
  }
  .league-tag {
    font-size: 0.78rem;
  }
  .league-tag img {
    width: 16px;
    height: 16px;
  }
  .hot-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }
  .match-main-row {
    grid-template-columns: 1fr auto 1fr;
    margin-bottom: 0.85rem;
    gap: 0.35rem;
  }
  .team-crest-sm {
    width: 48px;
    height: 48px;
    padding: 6px;
  }
  .team-name-sm {
    font-size: 0.88rem;
    line-height: 1.2;
  }
  .vs-time-col {
    padding: 0 0.35rem;
  }
  .time-box-badge {
    font-size: 1.15rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
  }
  .vs-label {
    font-size: 0.68rem;
  }
  .match-footer-row {
    padding-top: 0.65rem;
    font-size: 0.74rem;
  }
  .venue-info {
    font-size: 0.72rem;
  }
  .channel-pill {
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
  }

  /* Modal Mobile */
  .modal-card {
    padding: 1.25rem;
    max-height: 92vh;
    border-radius: 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .app-header {
    padding: 0.7rem 0.75rem;
  }
  .brand-title {
    font-size: 1.1rem;
  }
  .brand-subtitle {
    display: none;
  }
  .digital-time {
    font-size: 1.2rem;
  }
  .date-tz {
    display: none;
  }
  .header-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
  }
  .team-crest-sm {
    width: 42px;
    height: 42px;
  }
  .time-box-badge {
    font-size: 1.05rem;
    padding: 0.2rem 0.45rem;
  }
  .score-display {
    font-size: 1.7rem;
  }
}

