:root {
  /* Color palette */
  --color-bg: #c2c2c2;
  --color-text: #111;
  --color-header: royalblue;
  --color-footer: royalblue;
  --color-subfooter: #4a8fd8;
  --color-stripe-green: #4fff4f;
  --color-stripe-yellow: #f4e409;
  --color-stripe-orange: #ff9800;
  --color-table-bg: #aaaaaa;
  --color-table-header: #a0ff4f;
  --color-win: #4fff4f;
  --color-loss: #ff4f4f;
  --color-accent: #f9a825;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  transition: background 0.3s, color 0.3s;
}

.dark-mode {
  --color-bg: #1f1f1f;
  --color-text: #e0e0e0;
  --color-header: #2a2a2a;
  --color-footer: #2a2a2a;
  --color-subfooter: #3a3a3a;
  --color-table-bg: #2d2d2d;
  --color-table-header: #f0c000;
}

header {
  background-color: var(--color-header);
  padding: 1rem;
  text-align: center;
  position: relative;
}

.header-stripes {
  height: 6px;
  background: linear-gradient(to right,
    var(--color-stripe-green),
    var(--color-stripe-yellow),
    var(--color-stripe-orange));
}

.button {
  background: #4a8fd8;
  color: #fff;
  padding: 8px 16px;
  margin: 0 8px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
}
.button:hover {
  background: #2a68b8;
}

.nav-back-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  animation: fadeSlideIn 0.6s ease-out;
}

.back-button {
  background: linear-gradient(135deg, #2e74d5, #4a8fd8);
  color: #ffffff;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.back-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.floating-nav {
  position: sticky;
  top: 0;
  z-index: 99;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

.title-block {
  text-align: center;
  margin: 2rem auto 1rem auto;
  padding: 1rem;
  animation: fadeSlideIn 0.6s ease-out;
}

.title-block h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  color: #ffffff;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 8px rgba(160, 255, 79, 0.6);
}

.title-block h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: #ddd;
  margin-top: 0;
}

.card, .motd-card, .upcoming-card, .match-history {
  color: #e0e0e0;
}

.card h3, .motd-card h2, .match-history h3 {
  color: #ffffff;
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.match-logo-row.horizontal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem auto;
  font-size: 1.1rem;
}

.match-logo-row.horizontal .team-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.match-logo-row.horizontal .team-name {
  font-weight: bold;
  font-size: 1rem;
}

.match-win {
  position: relative;
  background-color: rgba(0, 128, 0, 0.1); /* light green */
  animation: winGlow 1s ease-in-out;
}

@keyframes winGlow {
  0% { box-shadow: 0 0 0 rgba(0,255,0,0.3); }
  50% { box-shadow: 0 0 16px rgba(0,255,0,0.5); }
  100% { box-shadow: 0 0 0 rgba(0,255,0,0.3); }
}

.vs-text {
  font-weight: bold;
  color: #ccc;
  font-size: 1.1rem;
  margin: 0 0.5rem;
}

.status-text {
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  margin-top: 0.5rem;
  color: #f4e409;
}

.status-text.live {
  color: #4fff4f;
}

.status-text.delayed {
  color: #ff4f4f;
}

.status-text.final {
  color: #ccc;
}

.status-cell {
  padding: 0.4rem;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
}

.status-home-win {
  background-color: #006400;  /* dark green */
  color: #fff;
}

.status-away-win {
  background-color: #90ee90;  /* light green */
  color: #000;
}

.status-home-loss {
  background-color: #ff4f4f;  /* red */
  color: #fff;
}

.status-away-loss {
  background-color: #ffc0cb;  /* pink */
  color: #000;
}

.status-not-started {
  background-color: #ccc;
  color: #000;
}

.match-meta,
.team-name,
.vs-text,
.card p {
  color: #cccccc;
  font-weight: 400;
  text-align: center;
  font-size: 0.9rem;
}

.team-name.small {
  color: #bbbbbb;
  font-size: 0.85em;
}

.match-meta {
  font-size: 0.9em;
  margin: 0.2rem 0;
}

.ipl-banner {
  text-align: center;
  margin: 1.5rem auto;
  padding: 0.5rem;
  animation: fadeIn 0.8s ease-in;
}

.ipl-logo {
  width: 90%;
  max-width: 400px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
  transition: transform 0.3s ease-in-out;
  animation: slideGlowIn 1.2s ease-out forwards;
}

.ipl-logo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 0 16px #f4e409);
}

.ipl-logo-wrapper {
  position: relative;
  display: inline-block;
}

@keyframes slideGlowIn {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(0.98);
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 12px rgba(244, 228, 9, 0.7));
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ipl-stripes {
  height: 6px;
  width: 160px;
  margin: 1rem auto;
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.ipl-stripes::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right,
    #0f47af 0%,        /* Royal Blue */
    #f4e409 33%,       /* Yellow */
    #4fff4f 66%,       /* Green */
    #ff9800 100%       /* Orange */
  );
  animation: stripeSlide 3s linear infinite;
}

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

.usage-bar {
  background: #333;
  border-radius: 10px;
  height: 14px;
  overflow: hidden;
  max-width: 300px;
  margin: 0.5rem auto;
  box-shadow: inset 0 0 3px #000;
}

.usage-fill {
  height: 100%;
  transition: width 0.5s ease-in-out;
}

.usage-low {
  background-color: #a0ff9c;  /* light green */
}

.usage-ok {
  background-color: #4fff4f;  /* darker green */
}

.usage-warn {
  background-color: #f0c000;  /* yellow */
}

.usage-high {
  background-color: #ff9800;  /* orange */
}

.usage-critical {
  background-color: #e74c3c;  /* red */
}

.pulse {
  animation: pulseFill 1s infinite;
}

.usage-fill.pulse {
  animation: pulseFill 1s infinite;
}

@keyframes pulseFill {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.cricket-ball {
  display: inline-block;
  animation: bounceBall 2s ease-in-out infinite;
  margin-left: 0.4rem;
}

@keyframes bounceBall {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cricket-ball-roll {
  text-align: center;
  margin-top: 0.5rem;
  height: 30px;
  overflow: hidden;
  position: relative;
}

.rolling-ball {
  display: inline-block;
  font-size: 1.5rem;
  animation: rollAcross 4s linear infinite, bounceY 1s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes rollAcross {
  0% {
    transform: translateX(-200%) rotate(0deg);
  }
  50% {
    transform: translateX(50%) rotate(180deg);
  }
  100% {
    transform: translateX(200%) rotate(360deg);
  }
}
@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.sparkle-trail {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.2) 0px,
    rgba(255, 255, 255, 0.4) 2px,
    rgba(255, 255, 255, 0.05) 4px
  );
  filter: blur(1px);
  animation: trailScroll 1.2s linear infinite;
  z-index: 1;
  opacity: 0.8;
  border-radius: 4px;
}

@keyframes trailScroll {
  0% { background-position: 0 0; }
  100% { background-position: 100% 0; }
}

body.dark-mode .floating-nav {
  background: rgba(30, 30, 30, 0.8);
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.motd-card {
  max-width: 640px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: #2d2d2d;
  border-radius: 14px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: transform 0.3s ease;
  animation: pulseCard 2.5s ease-in-out infinite;
}

@keyframes pulseCard {
  0%, 100% {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.6);
  }
}

.motd-card:hover {
  transform: translateY(-4px);
}

.team-logo.big {
  height: 50px;
}
.team-logo.small {
  height: 36px;
}

.upcoming-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto;
}

.upcoming-card {
  flex: 1 1 280px;
  min-width: 280px;
  max-width: 300px;
  padding: 1rem;
  background-color: #2d2d2d;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  text-align: center;
  transition: transform 0.3s ease;
}
.upcoming-card:hover {
  transform: translateY(-3px);
}

.match-history {
  min-width: 400px;
  max-width: 500px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: #252525;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  text-align: center;
}
.match-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #ccc;
}

.floating-trophy {
  position: absolute;
  top: -10px;  /* adjust as needed */
  right: -30px; /* adjust to tuck it near top right of the logo */
  font-size: 2.5rem;
  animation: floatyTrophy 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
  z-index: 10;
  pointer-events: none;
}

@media (max-width: 650px) {
  .floating-trophy {
    right: -10px;
    top: -5px;
    font-size: 2rem;
  }
}

@keyframes floatyTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 6px gold; }
  50% { text-shadow: 0 0 12px gold, 0 0 20px #f4e409; }
}

#theme-transition {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--transition-color, #111); /* dark mode default */
  z-index: 9999;
  transition: left 0.6s ease-in-out;
  pointer-events: none;
}
body.theme-transitioning #theme-transition {
  left: 0;
}

#theme-swipe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--swipe-color, #000);
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#theme-swipe-overlay.active {
  opacity: 0.4;
  transform: scale(1);
}

body.dark-mode {
  --swipe-color: #fff;
}
body:not(.dark-mode) {
  --swipe-color: #000;
}

.footer {
  background-color: var(--color-footer);
  color: --color-stripe-yellow; /* Bright yellow */
  padding: 1rem 0;
  text-align: center;
  border-top: 3px solid #a0ff4f;
  font-family: 'Orbitron', sans-serif;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.footer-logo {
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 6px limegreen;
}

.footer-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.powered-by {
  font-weight: bold;
  font-size: 1.3rem;
  text-shadow: 1px 1px 3px #000;
}

.domain {
  color: #4fff4f;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
}

.copyright {
  font-size: 0.95rem;
  color: #ffffff;
}

.api-footer {
  background-color: var(--color-subfooter);
  padding: 1rem 0;
  text-align: center;
  border-top: 1px solid #444;
  box-shadow: inset 0 1px 4px rgba(255,255,255,0.05);
}

.api-footer h4 {
  color: var(--color-accent);
}

.api-footer p {
  color: #ccc;
  font-size: 0.95em;
  margin: 0.3rem 0;
}

main {
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
  background-color: var(--color-bg);
}

/* Table styles */
.schedule table,
.standings {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: var(--color-table-bg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.schedule th,
.standings th {
  background-color: var(--color-table-header);
  color: #0f0f0f;
  text-transform: uppercase;
}

.schedule td,
.standings td {
  padding: 10px;
  text-align: center;
  border: 1px solid #ccc;
}

.schedule tr:nth-child(even),
.standings tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.03);
}

.standings .wins {
  color: var(--color-win);
  font-weight: bold;
}

.standings .losses {
  color: var(--color-loss);
  font-weight: bold;
}

.standings .playoff-divider {
  border-top: 3px solid gold;
}

.wins {
  color: #2ecc71; /* Vibrant green that pops on both light & dark */
  font-weight: bold;
}

.losses {
  color: #e74c3c; /* Bright red for both themes */
  font-weight: bold;
}

.points {
  color: #f4e409;
  font-weight: bold;
}

.nrr {
  color: #4a8fd8;
  font-weight: bold;
}

.label {
  color: var(--color-text);
  font-weight: 500;
}

.tiny-logo {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 50%;
}

/* Logo styles */
.logo-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.logo-bar img {
  height: 50px;
  border-radius: 50%;
  background-color: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-bar a:hover img {
  transform: scale(1.1);
  box-shadow: 0 0 12px var(--color-stripe-green);
}

/* Light/Dark toggle (optional styles) */
.toggle-theme {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s, transform 0.6s ease;
  z-index: 100;
  text-shadow: 0 0 6px #f4e409;
}

@keyframes togglePulse {
  0%, 100% {
    text-shadow: 0 0 6px #f4e409, 0 0 10px #ff9800;
  }
  50% {
    text-shadow: 0 0 14px #fff, 0 0 28px #ffeb3b, 0 0 40px #ff9800;
  }
}

.rotate-right {
  transform: rotate(360deg);
  animation: togglePulse 1.2s ease-in-out;
}

.rotate-left {
  transform: rotate(-360deg);
  animation: togglePulse 1.2s ease-in-out;
}

.sparkle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleBurst 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes sparkleBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x, 0px), var(--y, 0px)) scale(2);
  }
}

body.dark-mode .toggle-theme {
  color: #f9a825;
}

/* Responsive tweaks */
@media screen and (max-width: 600px) {
  .logo-bar img {
    height: 40px;
  }

  .schedule table,
  .standings {
    font-size: 0.85em;
  }
}
