/* ================= GLOBAL RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  color: #222;
  line-height: 1.5;
  overflow-x: hidden;
  font-size: 15px;
}

/* ================= CONTAINER ================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ================= HEADER ================= */
.top-bar {
  background: linear-gradient(90deg, #4a1c1c, #6b2626, #8a3a3a);
  color: #fff;
  text-align: center;
  padding: 16px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  width: 100%;
  margin-bottom: 10px;
}

/* ================= AD CONTAINERS ================= */
.ad-top, .ad-inline, .ad-footer {
  width: 100%;
  text-align: center;
  margin: 10px 0;
}

.ad-inline { display: block; }
.ad-footer { margin-top: 20px; }

/* ================= MATCH SELECTOR ================= */
.match-cards-wrap {
  margin: 15px 0;
}

.match-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.match-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.match-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  cursor: pointer;
  transition: all 0.25s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.match-card.active {
  border: 2px solid #006a4e;
  background: #f0fff8;
}

.match-name {
  font-weight: 700;
  font-size: 14px;
}

.match-meta {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.match-time {
  font-size: 12px;
  margin-top: 6px;
  color: #006a4e;
  font-weight: 600;
}

/* ================= COUNTDOWN ================= */
.countdown {
  font-size: 20px;
  font-weight: bold;
  color: #6b2626;
  margin-bottom: 10px;
}

/* ================= TOTAL BOXES ================= */
.total-prob {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  justify-content: center;
}

.total-box {
  min-width: 250px;
  padding: 20px;
  border-radius: 12px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.total-box:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.toss-total,
.match-total {
  background: linear-gradient(135deg, #4a1c1c, #8a3a3a);
}

.total-box h4 {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
}

.sub-text {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 6px;
}

.prob-value {
  font-size: 30px;
  font-weight: bold;
  letter-spacing: .5px;
  animation: pop .4s ease;
}

.team { font-weight: 700; }

.glow {
  box-shadow:
    0 0 15px rgba(138,58,58,.8),
    0 0 30px rgba(74,28,28,.6);
}

.arrow {
  margin-left: 6px;
  font-size: 22px;
}

@keyframes pop {
  0% { transform: scale(.85); opacity: .5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ================= MATCH CARD ================= */
.match-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  width: 100%;
}

/* ================= GRID SYSTEM ================= */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  justify-items: center;
  width: 100%;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  width: 100%;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ================= TOSS CARD ================= */
.toss-card .toss-box {
  background: linear-gradient(90deg, #4a1c1c, #8a3a3a);
  color: #fff;
  font-weight: bold;
  font-size: 18px;
  padding: 14px;
  border-radius: 6px;
  text-align: center;
  transition: transform .5s ease;
}

/* ================= WIN PROBABILITY ================= */
.probability-bar {
  display: flex;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
  width: 100%;
}

.probability-bar span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  background: linear-gradient(90deg, #4a1c1c, #8a3a3a);
  transition: transform 0.5s ease;
}

.confidence-bar {
  width: 100%;
  height: 14px;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}

#confidenceFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a1c1c, #8a3a3a);
  transition: width 0.5s ease;
}

/* ================= FINAL RESULT ================= */
.final-result-card {
  text-align: center;
  width: 100%;
}

.final-result-card .result-box {
  font-size: 24px;
  font-weight: bold;
  color: #6b2626;
  margin-top: 10px;
}

/* ================= MOMENTUM BAR ================= */
.momentum-card {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.momentum-card h2 {
  text-align: center;
  margin-bottom: 14px;
}

.momentum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.8;
}

.momentum-bar {
  position: relative;
  height: 14px;
  border-radius: 20px;
  background: linear-gradient(to right, #ff4d4d, #f1c40f, #2ecc71);
  margin: 14px 0;
}

.momentum-dot {
  position: absolute;
  top: -6px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255,255,255,0.9);
  transition: left 0.6s ease;
}

.momentum-stats {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.momentum-text {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.ai-insight {
  margin-top: 15px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  font-size: 14px;
}

/* ================= INNINGS SCORE PREDICTOR ================= */
.innings-predictor {
  background: #fff;
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  max-width: 520px;
  margin: 25px auto;
  text-align: center;
}

.innings-predictor h3 {
  font-size: 22px;
  color: #4a1c1c;
  margin-bottom: 15px;
  font-weight: 800;
}

.innings-predictor label.section-title {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 700;
  color: #6b2626;
}

/* ===== Radio button -> pill buttons ===== */
.innings-predictor input[type="radio"] {
  display: none;
}

.innings-predictor .radio-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.innings-predictor .radio-group label {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #bbb;
  cursor: pointer;
  font-weight: 600;
  background: #f7f7f7;
  transition: .25s ease;
}

.innings-predictor input[type="radio"]:checked + label {
  background: linear-gradient(135deg,#4a1c1c,#8a3a3a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}

/* ===== Sliders ===== */
.innings-predictor input[type="range"] {
  width: 100%;
  margin: 6px 0 2px;
}

.innings-predictor .range-value {
  font-weight: bold;
  color: #4a1c1c;
}

/* ===== Predict Button ===== */
.predict-score-btn {
  margin-top: 18px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg,#4a1c1c,#8a3a3a);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: .3s ease;
}

.predict-score-btn:hover {
  transform: translateY(-2px);
  opacity: .9;
}

/* ===== Result Box ===== */
.score-result {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #f9f1f1;
  font-size: 20px;
  font-weight: 800;
  color: #4a1c1c;
  animation: fadeUp .4s ease;
}

.score-result small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: .8;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= HERO BAR ================= */
.hero-bar {
  width: 100%;
  padding: 40px 20px;
  background: linear-gradient(90deg, #4a1c1c, #6b2626, #8a3a3a);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  animation: heroPulse 2.5s infinite alternate;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden; /* prevent overflow */
}

.hero-content {
  max-width: 95%; /* ensure text does not overflow */
}

.hero-content h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.3);
  word-wrap: break-word;
  line-height: 1.2;
}

.hero-content p {
  font-size: 20px;
  font-weight: 500;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
  word-wrap: break-word;
  line-height: 1.4;
  max-width: 95%;
}

/* Hero pulse animation */
@keyframes heroPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ================= HERO RESPONSIVE ================= */
@media(max-width:900px){
  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 16px; }
}

@media(max-width:600px){
  .hero-bar {
    padding: 30px 15px;
  }
  .hero-content h1 { font-size: 24px; }
  .hero-content p { font-size: 14px; }
}

@media(max-width:400px){
  .hero-bar {
    padding: 20px 10px;
  }
  .hero-content h1 { font-size: 20px; }
  .hero-content p { font-size: 12px; }
}

/* ================= RESPONSIVE ================= */
@media(max-width:900px){
  body { font-size: 14px; }

  .top-bar { font-size: 20px; padding: 12px; }

  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 16px; }

  .total-box { padding: 15px; }
  .match-card, .card, .innings-predictor { padding: 18px; }
}

@media(max-width:600px){
  .total-prob { flex-direction: column; align-items: center; }
  #matchSelect { width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .btn { width: 100%; padding: 10px; font-size: 14px; }

  .total-box:hover { transform: translateY(-1px) scale(1); box-shadow: 0 3px 6px rgba(0,0,0,0.12); }
}

@media(max-width:500px){
  body { font-size: 13px; }
  .top-bar { font-size: 18px; padding: 10px; }
  .hero-content h1 { font-size: 22px; }
  .hero-content p { font-size: 14px; }
  .total-box { min-width: 200px; padding: 12px; }
  .match-card, .card, .innings-predictor { padding: 15px; }
}

/* Optional Zoom-Out for very small screens */
@media(max-width:400px){
  .container { transform: scale(0.95); transform-origin: top center; }
}
