:root {
  color-scheme: dark;
  --ink: #effffc;
  --muted: rgba(220, 249, 245, 0.72);
  --subtle: rgba(220, 249, 245, 0.52);
  --glass: rgba(5, 18, 25, 0.72);
  --glass-strong: rgba(8, 31, 40, 0.84);
  --stroke: rgba(190, 255, 245, 0.19);
  --stroke-bright: rgba(205, 255, 247, 0.48);
  --cyan: #4ed7df;
  --aqua: #67dbc8;
  --mint: #baf5d9;
  --coral: #ff8c7f;
  --blue: #83b3ff;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(1, 8, 12, 0.82), rgba(2, 22, 28, 0.64)),
    url("./assets/liquid-glass-dark.png") center / cover fixed;
  background-size: cover;
  animation: backgroundDrift 28s ease-in-out infinite alternate;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 18rem),
    radial-gradient(circle at 20% 20%, rgba(103, 219, 200, 0.13), transparent 18rem),
    radial-gradient(circle at 82% 16%, rgba(78, 215, 223, 0.11), transparent 16rem),
    radial-gradient(circle at 64% 92%, rgba(131, 179, 255, 0.10), transparent 20rem);
}

body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background: rgba(1, 8, 12, 0.30);
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  animation: appEnter 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  display: none;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 980px;
  font-size: clamp(2.45rem, 5.8vw, 5.7rem);
  line-height: 0.9;
  letter-spacing: 0;
  background: linear-gradient(110deg, #ffffff, #d8fff8 42%, #8de6ed 72%, #e8fff1);
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 48px rgba(78, 215, 223, 0.18);
}

h2 {
  min-height: 2.2em;
  display: flex;
  align-items: center;
  font-size: clamp(1.35rem, 3vw, 2.45rem);
  line-height: 1.05;
}

h3 {
  font-size: 1rem;
  text-transform: uppercase;
}

.glass-surface {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.024)),
    linear-gradient(315deg, rgba(103, 219, 200, 0.065), rgba(131, 179, 255, 0.035)),
    var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(24px) saturate(1.28);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.glass-surface::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 28%, rgba(255, 255, 255, 0.035) 58%, transparent 78%);
  opacity: 0.68;
}

.glass-surface:hover {
  border-color: rgba(205, 255, 247, 0.32);
  box-shadow: 0 34px 96px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(7, 25, 33, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 30px rgba(0, 0, 0, 0.2);
  font-weight: 800;
  animation: pillFloat 3.6s ease-in-out infinite;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(183, 243, 215, 0.13), 0 0 24px rgba(126, 231, 208, 0.62);
  animation: pulseGlow 1.8s ease-in-out infinite;
}

.match-panel {
  z-index: 1;
  min-height: 104px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 48px 1fr auto;
  gap: 14px;
  align-items: end;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    rgba(5, 20, 28, 0.78);
}

.team-selector {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

label {
  color: var(--subtle);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 52px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(4, 22, 30, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 24px rgba(0, 0, 0, 0.18);
  font: inherit;
  font-weight: 760;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

select:focus {
  outline: none;
  border-color: rgba(186, 245, 217, 0.72);
  box-shadow: 0 0 0 4px rgba(103, 219, 200, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

option {
  color: #092532;
}

button {
  font: inherit;
  font-weight: 850;
  border: 0;
  cursor: pointer;
}

.icon-button,
.primary-button {
  position: relative;
  z-index: 1;
  min-height: 52px;
  border-radius: 8px;
}

.icon-button {
  width: 48px;
  color: var(--ink);
  border: 1px solid var(--stroke);
  background: rgba(7, 28, 37, 0.66);
  font-size: 1.3rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-button {
  min-width: 132px;
  padding: 0 24px;
  color: #061219;
  background: linear-gradient(135deg, #8cefe1, #56d6dd 54%, #d9ffd7);
  box-shadow: 0 18px 34px rgba(0, 174, 194, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button::after {
  position: absolute;
  inset: -40% -60%;
  content: "";
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.46), transparent 65%);
  transform: translateX(-45%);
  transition: transform 520ms ease;
}

.primary-button:hover::after {
  transform: translateX(45%);
}

.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.insight-card {
  z-index: 1;
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.016)),
    rgba(4, 18, 25, 0.64);
}

.insight-card span {
  color: var(--subtle);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card strong {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1;
}

.team-side,
.result-orb,
.probability-panel,
.score-panel,
.expected-panel {
  z-index: 1;
  padding: 20px;
}

.team-side {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.018)),
    linear-gradient(315deg, rgba(103, 219, 200, 0.055), transparent),
    rgba(5, 20, 28, 0.70);
}

.winner-card {
  border-color: rgba(186, 245, 217, 0.42);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(186, 245, 217, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.winner-card::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 22%, rgba(186, 245, 217, 0.18), transparent 34%),
    linear-gradient(120deg, rgba(186, 245, 217, 0.10), transparent 44%);
  opacity: 0.92;
}

.group-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  color: #dffdf7;
  background: rgba(126, 231, 208, 0.12);
  border: 1px solid rgba(126, 231, 208, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-grid div {
  min-height: 68px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(220, 255, 250, 0.12);
  transition: transform 180ms ease, background 180ms ease;
}

.metric-grid div:hover,
.score-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.075);
}

.metric-grid span,
.panel-heading span,
.score-item span,
.goal-values {
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.result-orb {
  --confidence: 0%;
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(103, 219, 200, 0.10), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.018)),
    rgba(6, 20, 27, 0.74);
}

.result-orb::before {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) var(--confidence), rgba(255, 255, 255, 0.10) 0);
  box-shadow: 0 0 22px rgba(103, 219, 200, 0.20);
  animation: meterEnter 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.orb-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(100%, 236px);
  padding: 8px 10px 0;
}

.orb-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

#topPick {
  width: 100%;
  margin-top: 10px;
  font-size: clamp(1.28rem, 2.05vw, 1.72rem);
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

#scorePick {
  margin-top: 10px;
  color: var(--mint);
  font-size: 1.06rem;
  font-weight: 900;
  text-shadow: 0 0 18px rgba(186, 245, 217, 0.34);
}

.confidence-meter {
  width: min(100%, 148px);
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.confidence-meter span {
  display: block;
  width: var(--confidence);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--mint));
  box-shadow: 0 0 18px rgba(103, 219, 200, 0.36);
  transform-origin: left center;
  animation: barReveal 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prediction-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.probability-bars {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 13px;
}

.prob-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 62px;
  gap: 12px;
  align-items: center;
}

.prob-label,
.prob-value {
  font-weight: 900;
}

.bar-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 18px rgba(88, 216, 223, 0.28);
  transform-origin: left center;
  animation: barReveal 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prob-row:nth-child(2) .bar-fill {
  animation-delay: 70ms;
}

.prob-row:nth-child(3) .bar-fill {
  animation-delay: 140ms;
}

.draw .bar-fill {
  background: linear-gradient(90deg, rgba(220, 255, 250, 0.58), var(--mint));
}

.win_b .bar-fill {
  background: linear-gradient(90deg, var(--coral), #ffd3cb);
  box-shadow: 0 0 18px rgba(255, 140, 127, 0.20);
}

.score-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.score-item {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(220, 255, 250, 0.13);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.score-item strong {
  font-size: 1.45rem;
}

.goal-meter,
.goal-split {
  position: relative;
  z-index: 1;
  height: 34px;
  overflow: hidden;
  border-radius: 999px;
}

.goal-meter {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.085);
}

.goal-split {
  width: 50%;
  background: linear-gradient(90deg, var(--aqua), var(--cyan));
  animation: barReveal 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prediction-ready .team-side,
.prediction-ready .result-orb,
.prediction-ready .probability-panel,
.prediction-ready .score-panel,
.prediction-ready .expected-panel,
.prediction-ready .insight-card {
  animation: cardRefresh 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prediction-ready .result-orb {
  animation-delay: 50ms;
}

.prediction-ready .probability-panel,
.prediction-ready .score-panel,
.prediction-ready .expected-panel {
  animation-delay: 90ms;
}

.is-loading .result-orb,
.is-loading .probability-panel,
.is-loading .score-panel,
.is-loading .expected-panel {
  filter: saturate(0.82) brightness(0.86);
}

.is-loading .primary-button {
  pointer-events: none;
  filter: saturate(0.92) brightness(0.94);
}

.goal-values {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-panel,
  .scoreboard,
  .prediction-grid,
  .detail-grid,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .icon-button,
  .primary-button {
    width: 100%;
  }

  .score-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prob-row {
    grid-template-columns: 82px minmax(0, 1fr) 56px;
  }
}

@keyframes appEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardRefresh {
  from {
    opacity: 0.72;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes barReveal {
  from {
    transform: scaleX(0);
    filter: saturate(0.8);
  }
  to {
    transform: scaleX(1);
    filter: saturate(1);
  }
}

@keyframes meterEnter {
  from {
    opacity: 0;
    transform: scaleX(0.72);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 6px rgba(183, 243, 215, 0.12), 0 0 22px rgba(126, 231, 208, 0.50);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(183, 243, 215, 0.18), 0 0 32px rgba(126, 231, 208, 0.74);
  }
}

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

@keyframes backgroundDrift {
  from {
    background-position: center center;
  }
  to {
    background-position: 52% 48%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
