:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-strong: #eef8f0;
  --text: #14211b;
  --muted: #66736d;
  --line: #dce5df;
  --green: #0f7a48;
  --green-dark: #075737;
  --yellow: #facc15;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 18px 48px rgba(20, 33, 27, .12);
}

.statistics-head {
  border-bottom: 1px solid rgba(15, 122, 72, .14);
  padding-bottom: 1rem;
}

.statistics-view {
  background: rgba(250, 253, 251, .96);
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .8rem;
}

.stat-card {
  --stat-accent: #0f7a48;
  position: relative;
  grid-column: span 4;
  min-width: 0;
  min-height: 150px;
  border: 1px solid rgba(15, 122, 72, .16);
  border-top: 4px solid var(--stat-accent);
  border-radius: 8px;
  padding: .9rem;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 20px rgba(20, 33, 27, .06);
  animation: stat-card-in .46s cubic-bezier(.2, .75, .25, 1) both;
  animation-delay: calc(var(--stat-index, 0) * 55ms);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.stat-card:hover {
  border-color: color-mix(in srgb, var(--stat-accent) 35%, #dce5df);
  box-shadow: 0 15px 30px rgba(20, 33, 27, .12);
  transform: translateY(-3px);
}

.stat-card.is-champion,
.stat-card.is-third {
  grid-column: span 6;
}

.stat-card.is-champion {
  --stat-accent: #d99a06;
  background: #fffbeb;
}

.stat-card.is-third {
  --stat-accent: #b45309;
  background: #fff7ed;
}

.stat-card.is-expert {
  --stat-accent: #0f7a48;
  background: #f0fdf4;
}

.stat-card.is-penalties {
  --stat-accent: #be185d;
  background: #fdf2f8;
}

.stat-card.is-surprise {
  --stat-accent: #2563eb;
  background: #eff6ff;
}

.stat-card.is-match {
  --stat-accent: #0f766e;
  background: #f0fdfa;
}

.stat-card.is-hardest {
  --stat-accent: #dc2626;
  background: #fef2f2;
}

.stat-card.is-final {
  --stat-accent: #475569;
  background: #f8fafc;
}

.stat-card p {
  margin: .65rem 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.stat-card p strong {
  color: #13251d;
}

.stat-meter {
  width: 100%;
  height: 6px;
  margin-top: .75rem;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(100, 116, 139, .14);
}

.stat-meter span {
  display: block;
  width: var(--stat-percent, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--stat-accent);
  transform: scaleX(1);
  transform-origin: left;
  animation: stat-meter-in .72s cubic-bezier(.2, .75, .25, 1) both;
  animation-delay: calc(.18s + var(--stat-index, 0) * 55ms);
}

.stat-card .stat-label {
  margin: 0 0 .55rem;
  color: var(--stat-accent);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.stat-main {
  min-width: 0;
  color: #10231a;
  font-size: 1.45rem;
  font-weight: 1000;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.stat-main > strong {
  font-size: 2rem;
}

.stat-team {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .5rem;
  vertical-align: middle;
}

.stat-team-flag {
  display: inline-block;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 1.45rem;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 4px;
  background: #fff;
}

.stat-team-flag.has-flag {
  background: var(--flag-bg);
}

.stat-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .5rem;
  align-items: center;
}

.stat-match span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stat-match span:last-child {
  text-align: right;
}

.stat-match strong {
  border-radius: 6px;
  padding: .3rem .45rem;
  color: #fff;
  background: #0b5f3d;
  font-size: 1rem;
}

.stat-final-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.stat-final-pair > span:not(.stat-team) {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
}

.dreamer-stat {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 180px;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid rgba(3, 78, 162, .24);
  border-radius: 8px;
  padding: 1.4rem 1.6rem 1.4rem 2rem;
  color: #082f49;
  background: #fffdf0;
  box-shadow: 0 16px 34px rgba(3, 78, 162, .13);
  animation: dreamer-arrive .7s cubic-bezier(.16, .8, .24, 1) both;
}

.dreamer-stat::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .76) 48%, transparent 62%);
  content: "";
  pointer-events: none;
  transform: translateX(-130%);
  animation: dreamer-shine 4.8s ease-in-out 1s infinite;
}

.dreamer-flag {
  position: absolute;
  inset: 0 auto 0 0;
  width: .8rem;
  background: linear-gradient(to bottom, #ffdd00 0 50%, #034ea2 50% 75%, #ed1c24 75%);
  animation: dreamer-flag-pulse 2.4s ease-in-out infinite;
}

.dreamer-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  min-width: 0;
}

.dreamer-copy .eyebrow {
  margin: 0 0 .3rem;
  color: #034ea2;
}

.dreamer-copy h3 {
  margin: 0;
  color: #102a43;
  font-size: 2rem;
  line-height: 1;
}

.dreamer-copy > p:last-child {
  margin: .65rem 0 0;
  color: #334e68;
  font-size: 1.05rem;
  font-weight: 750;
}

.dreamer-copy .stat-team {
  color: #034ea2;
  font-weight: 1000;
}

.dreamer-team {
  position: relative;
  z-index: 2;
  display: flex;
  width: 12rem;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  flex-direction: column;
  border-top: .65rem solid #ffdd00;
  border-bottom: .34rem solid #ed1c24;
  color: #fff;
  background: #034ea2;
  transform: rotate(-2deg);
  animation: dreamer-team-float 2.8s ease-in-out infinite;
}

.dreamer-team span {
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: 0;
}

.dreamer-team strong {
  margin-top: .2rem;
  color: #ffdd00;
  font-size: 1.35rem;
}

.dreamer-confetti span {
  position: absolute;
  z-index: 1;
  top: -1rem;
  left: var(--dream-x);
  width: .42rem;
  height: .8rem;
  background: var(--dream-color);
  opacity: 0;
  animation: dreamer-confetti-fall 3.1s linear var(--dream-delay) infinite;
}

.fun-facts {
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: 1rem;
  color: #fff;
  background: #064e3b;
  box-shadow: 0 16px 34px rgba(6, 78, 59, .18);
}

.fun-facts-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  padding-bottom: .75rem;
}

.fun-facts-head .eyebrow {
  margin: 0;
  color: #fef08a;
}

.fun-facts-head h3 {
  margin: 0;
  font-size: 1.25rem;
}

.fun-facts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .75rem;
}

.fun-fact {
  position: relative;
  min-width: 0;
  min-height: 135px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  padding: .8rem;
  background: rgba(255, 255, 255, .08);
  animation: stat-card-in .46s cubic-bezier(.2, .75, .25, 1) both;
  animation-delay: calc(var(--stat-index, 0) * 55ms);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.fun-fact:hover {
  border-color: rgba(254, 240, 138, .46);
  background: rgba(255, 255, 255, .12);
  transform: translateY(-3px);
}

.fun-fact-index {
  position: absolute;
  top: .3rem;
  right: .55rem;
  color: rgba(255, 255, 255, .13);
  font-size: 2.5rem;
  font-weight: 1000;
  line-height: 1;
}

.fun-fact p {
  position: relative;
  margin: 0 0 .45rem;
  color: #fef08a;
  font-size: .7rem;
  font-weight: 1000;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.fun-fact > strong {
  position: relative;
  display: block;
  max-width: calc(100% - 1.6rem);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.fun-fact small {
  position: relative;
  display: block;
  margin-top: .55rem;
  color: rgba(255, 255, 255, .76);
  line-height: 1.35;
}

.fun-fact .stat-team {
  color: #fff;
}

.fun-score {
  font-size: 1.8rem !important;
}

@keyframes stat-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stat-meter-in {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes dreamer-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dreamer-shine {
  0%, 62% {
    transform: translateX(-130%);
  }

  86%, 100% {
    transform: translateX(130%);
  }
}

@keyframes dreamer-flag-pulse {
  0%, 100% {
    width: .8rem;
  }

  50% {
    width: 1rem;
  }
}

@keyframes dreamer-team-float {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-5px) rotate(1deg);
  }
}

@keyframes dreamer-confetti-fall {
  0% {
    opacity: 0;
    transform: translateY(-1rem) rotate(0deg);
  }

  14%, 72% {
    opacity: .8;
  }

  100% {
    opacity: 0;
    transform: translateY(12rem) rotate(300deg);
  }
}

@media (max-width: 1100px) {
  .stat-card,
  .stat-card.is-champion,
  .stat-card.is-third {
    grid-column: span 6;
  }

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

}

@media (max-width: 760px) {
  .statistics-grid {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .stat-card.is-champion,
  .stat-card.is-third {
    grid-column: 1;
    min-height: 0;
    padding: .8rem;
  }

  .stat-main {
    font-size: 1.22rem;
  }

  .stat-main > strong {
    font-size: 1.7rem;
  }

  .dreamer-stat {
    grid-template-columns: 1fr;
    min-height: 230px;
    padding: 1.25rem 1rem 1rem 1.5rem;
  }

  .dreamer-copy h3 {
    font-size: 1.7rem;
  }

  .dreamer-team {
    width: 100%;
    min-height: 5.3rem;
    margin-top: 1rem;
    transform: none;
  }

  .fun-facts {
    padding: .8rem;
  }

  .fun-facts-head {
    align-items: start;
    flex-direction: column;
    gap: .25rem;
  }

  .fun-facts-grid {
    grid-template-columns: 1fr;
  }

  .fun-fact,
  .fun-fact:last-child {
    grid-column: 1;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card,
  .fun-fact,
  .stat-meter span,
  .dreamer-stat,
  .dreamer-stat::after,
  .dreamer-flag,
  .dreamer-team,
  .dreamer-confetti span {
    animation: none;
    transition: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(250, 204, 21, .22), transparent 22rem),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, .13), transparent 24rem),
    linear-gradient(180deg, #f7fbf7, var(--bg));
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}

button:hover {
  background: var(--green-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem .75rem;
  background: #fff;
  color: var(--text);
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(250, 204, 21, .25), transparent 24rem),
    linear-gradient(135deg, var(--green), var(--green-dark));
}

.login-shell {
  width: min(100%, 480px);
  padding: 1.25rem;
}

.login-panel {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: .2rem 0 1.5rem;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: .95;
  letter-spacing: 0;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form label {
  display: grid;
  gap: .4rem;
  color: var(--muted);
  font-weight: 700;
}

.login-error {
  margin: 0;
  border: 1px solid rgba(220, 38, 38, .25);
  border-radius: 8px;
  padding: .75rem;
  color: var(--red);
  background: rgba(220, 38, 38, .08);
}

.landing-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(250, 204, 21, .26), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgba(59, 130, 246, .22), transparent 22rem),
    linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
}

.landing-stage {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  isolation: isolate;
  padding: 2rem;
  touch-action: none;
}

.landing-stage::before {
  position: absolute;
  inset: 8vh 6vw;
  z-index: -2;
  content: "";
  border: 3px solid rgba(255, 255, 255, .35);
  border-radius: 24px;
  background:
    linear-gradient(90deg, transparent calc(50% - 1.5px), rgba(255, 255, 255, .35) 0 calc(50% + 1.5px), transparent 0),
    radial-gradient(circle at 50% 50%, transparent 0 6.8rem, rgba(255, 255, 255, .35) 6.9rem 7.1rem, transparent 7.2rem),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 9vw);
  opacity: .82;
}

.landing-stage::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, .08) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 2px, transparent 2px);
  background-size: 9rem 9rem;
  mask-image: radial-gradient(circle, rgba(0, 0, 0, .95), transparent 72%);
}

.landing-message {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  text-align: center;
  text-shadow: 0 12px 32px rgba(0, 0, 0, .36);
}

.landing-message .eyebrow {
  margin: 0 0 1rem;
  color: #fef08a;
  font-size: clamp(.9rem, 2vw, 1.1rem);
}

.landing-message h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(3.1rem, 12vw, 8.8rem);
  line-height: .92;
  letter-spacing: 0;
}

.landing-message h1 span {
  display: block;
}

.landing-login-form {
  display: flex;
  align-items: end;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
  width: min(100%, 760px);
  margin: 1.5rem auto 0;
  text-align: left;
  text-shadow: none;
}

.landing-login-form label {
  display: grid;
  gap: .25rem;
  width: min(100%, 190px);
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
}

.landing-login-form input {
  min-height: 36px;
  border-color: rgba(255, 255, 255, .45);
  border-radius: 7px;
  padding: .45rem .6rem;
  background: rgba(255, 255, 255, .94);
}

.landing-login-form button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 7px;
  padding: .45rem .95rem;
  color: #073f29;
  background: #fef08a;
  font-weight: 900;
  text-decoration: none;
}

.landing-login-form button:hover,
.primary-link:hover {
  background: #fde047;
}

.landing-login-form .login-error {
  flex-basis: 100%;
  width: min(100%, 600px);
  margin: 0 auto .2rem;
  color: #fecaca;
  background: rgba(127, 29, 29, .6);
}

.session-panel {
  display: inline-grid;
  gap: .8rem;
  min-width: min(100%, 360px);
  margin-top: 1.5rem;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  padding: .95rem;
  background: rgba(7, 63, 41, .72);
  text-shadow: none;
  backdrop-filter: blur(10px);
}

.session-panel p {
  margin: 0;
  font-weight: 800;
}

.session-actions {
  display: flex;
  justify-content: center;
  gap: .65rem;
}

.session-actions form {
  margin: 0;
}

.session-actions .ghost-button {
  min-height: 36px;
  border-color: rgba(255, 255, 255, .45);
  padding: .45rem .95rem;
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.landing-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.landing-confetti span {
  position: absolute;
  left: calc(var(--x) * 1vw);
  top: -1.5rem;
  width: .78rem;
  height: 1.15rem;
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 18px rgba(255, 255, 255, .25);
  transform: rotate(var(--r));
  animation: landing-fall 5.8s linear infinite;
  animation-delay: var(--d);
}

.landing-confetti span:nth-child(3n) {
  width: .45rem;
  height: .45rem;
  border-radius: 999px;
}

.landing-confetti span:nth-child(4n) {
  width: 1.1rem;
  height: .38rem;
}

.physics-ball {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  width: clamp(3rem, 8vw, 5.8rem);
  height: clamp(3rem, 8vw, 5.8rem);
  min-height: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 1.25rem 1.8rem rgba(0, 0, 0, .28));
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translate3d(var(--ball-x, 0), var(--ball-y, 0), 0) rotate(var(--ball-rot, 0deg));
  will-change: transform;
}

.physics-ball:hover {
  background: transparent;
}

.physics-ball:active {
  cursor: grabbing;
}

.physics-ball-three {
  width: clamp(2.4rem, 6vw, 4.6rem);
  height: clamp(2.4rem, 6vw, 4.6rem);
  font-size: clamp(2rem, 5.2vw, 4rem);
}

@keyframes landing-fall {
  0% {
    translate: 0 -8vh;
    rotate: 0deg;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  100% {
    translate: var(--drift, 1rem) 110vh;
    rotate: 540deg;
    opacity: .1;
  }
}

.app-shell {
  width: min(100%, 1520px);
  margin: 0 auto;
  padding: 1.25rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0 1.25rem;
}

.topbar h1 {
  margin: .1rem 0 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: .9;
  letter-spacing: 0;
}

.topbar form {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .75rem;
  color: var(--muted);
  background: #fff;
  white-space: nowrap;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}

.ghost-button:hover {
  background: var(--panel-strong);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: .5rem;
  padding: .9rem 0;
  background: rgba(245, 247, 244, .92);
  backdrop-filter: blur(12px);
}

.tab {
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

.tab.is-active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.section-head h2 {
  margin: 0 0 .35rem;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.section-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

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

.group-card,
.match-card,
.third-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(20, 33, 27, .05);
}

.group-card {
  padding: 1rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.card-head h3,
.round-column h3 {
  margin: 0;
}

.card-head span {
  color: var(--muted);
  font-size: .9rem;
}

.rank-list {
  display: grid;
  gap: .65rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  align-items: center;
  gap: .6rem;
}

.rank-row span {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.thirds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .85rem;
}

.third-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem .75rem;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
}

.third-card input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.third-card span {
  color: var(--muted);
  font-weight: 800;
}

.third-card strong {
  grid-column: 2;
}

.third-card.is-selected {
  border-color: rgba(15, 122, 72, .45);
  background: var(--panel-strong);
}

.third-note {
  grid-column: 1 / -1;
  margin: .25rem 0 0;
  color: var(--red);
  font-weight: 800;
}

.third-note.is-ok {
  color: var(--green);
}

.knockout-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.round-column {
  display: grid;
  min-width: 260px;
  gap: .75rem;
}

.match-card {
  display: grid;
  gap: .75rem;
  padding: .85rem;
}

.match-title {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.match-teams {
  display: grid;
  gap: .5rem;
}

.team-row {
  display: grid;
  gap: .25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .65rem;
  background: #fafcfb;
}

.team-row span,
.winner-picker span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.team-row strong {
  min-height: 1.4rem;
}

.team-row.is-winner {
  border-color: rgba(15, 122, 72, .45);
  background: var(--panel-strong);
}

.third-assignment {
  margin-top: .35rem;
}

.winner-picker {
  display: grid;
  gap: .35rem;
}

.save-status {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .65rem .9rem;
  color: var(--muted);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.save-status.is-saving {
  color: var(--blue);
}

.save-status.is-ok {
  color: var(--green);
}

.save-status.is-error {
  color: var(--red);
}

.predictor-shell {
  --sidebar-width: 280px;
  --sidebar-rail: 54px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 14%, rgba(250, 204, 21, .18), transparent 22rem),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, .16), transparent 24rem),
    linear-gradient(135deg, #19834d, #075737);
  color: #fff;
  overflow: hidden;
  transition: none;
}

.is-panel-collapsed .predictor-shell {
  grid-template-columns: var(--sidebar-rail) minmax(0, 1fr);
}

.predictor-shell::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, .08) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 2px, transparent 2px),
    linear-gradient(90deg, transparent calc(50% - 1.5px), rgba(255, 255, 255, .26) 0 calc(50% + 1.5px), transparent 0);
  background-size: 8rem 8rem, 8rem 8rem, 100% 100%;
}

.side-panel,
.predictor-main {
  position: relative;
  z-index: 1;
}

.side-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, .22);
  padding: 1rem;
  background: rgba(6, 62, 38, .78);
  box-shadow: 18px 0 42px rgba(0, 0, 0, .18);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transform: translateX(0);
  transition: none;
}

.is-panel-collapsed .side-panel {
  padding-inline: .375rem;
  transform: none;
}

.is-panel-collapsed .side-brand,
.is-panel-collapsed .side-nav,
.is-panel-collapsed .side-user {
  display: none;
}

.side-brand {
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  padding: 0 3.1rem 1rem 0;
  transition: opacity .14s ease, visibility .14s ease;
}

.side-brand .eyebrow,
.mobile-topbar .eyebrow,
.view-head .eyebrow {
  color: #0f7a48;
}

.side-brand .eyebrow,
.mobile-topbar .eyebrow {
  color: #fef08a;
}

.side-brand h1 {
  margin: .25rem 0 0;
  color: #fff;
  font-size: 1.65rem;
  line-height: .95;
  letter-spacing: 0;
}

.side-nav {
  display: grid;
  flex: 1;
  align-content: start;
  gap: .45rem;
  grid-auto-rows: max-content;
  margin: 1rem 0;
  min-height: 0;
  overflow-y: auto;
  transition: opacity .14s ease, visibility .14s ease;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: .75rem 1rem;
  color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .08);
  text-align: left;
}

.side-link:hover {
  background: rgba(255, 255, 255, .14);
}

.side-link:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.side-link:disabled:hover {
  background: rgba(255, 255, 255, .08);
}

.side-link.is-active {
  border-color: rgba(255, 255, 255, .48);
  color: #fff;
  background: #0b5f3d;
}

.side-link small {
  border-radius: 999px;
  padding: .15rem .42rem;
  color: inherit;
  background: rgba(255, 255, 255, .18);
  font-weight: 900;
}

.side-user {
  display: grid;
  flex: 0 0 auto;
  gap: .75rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: 1rem;
  color: rgba(255, 255, 255, .86);
  transition: opacity .14s ease, visibility .14s ease;
}

.side-user .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}

.predictor-main {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: auto;
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  padding: .85rem 1rem;
  background: rgba(7, 87, 55, .78);
  backdrop-filter: blur(14px);
}

.mobile-topbar h1 {
  margin: .15rem 0 0;
  color: #fff;
  font-size: 1.35rem;
  line-height: .95;
  letter-spacing: 0;
}

.panel-toggle {
  position: absolute;
  top: 1rem;
  right: .5rem;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.mobile-menu-toggle {
  display: none;
}

.view-root {
  padding: 1.2rem;
}

.view-card {
  min-height: calc(100vh - 5.8rem);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: rgba(255, 255, 255, .92);
  color: var(--text);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .18);
  animation: view-in .24s ease both;
}

.view-card.no-animate {
  animation: none;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-head h2 {
  margin: .25rem 0 .35rem;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.view-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.group-picker-title {
  margin: .2rem 0 .3rem;
}

.group-picker {
  width: auto;
  min-width: 230px;
  max-width: 100%;
  min-height: 50px;
  border-color: rgba(11, 95, 61, .28);
  padding: .35rem 2.2rem .35rem .75rem;
  color: #063e26;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(20, 33, 27, .08);
  font: inherit;
  font-weight: 950;
  line-height: 1;
}

.bracket-grid {
  --bracket-card-offset: 2.25rem;
  --bracket-row-step: 74px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 164px);
  gap: 1.45rem;
  overflow-x: auto;
  padding: .25rem 1.5rem 1rem 0;
  align-items: start;
}

.bracket-column {
  position: relative;
  display: block;
  z-index: 1;
  min-width: 164px;
  height: calc(var(--bracket-card-offset) + 15 * var(--bracket-row-step) + 5.4rem);
}

.bracket-column h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  border-radius: 8px;
  padding: .5rem .62rem;
  color: #fff;
  background: #0b5f3d;
  font-size: .95rem;
  line-height: 1;
}

.bracket-match {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  z-index: 1;
  top: calc(var(--bracket-card-offset) + var(--row) * var(--bracket-row-step));
  gap: .22rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .32rem;
  background: #fff;
  box-shadow: 0 6px 14px rgba(20, 33, 27, .06);
}

.bracket-match:focus-within,
.bracket-match.has-tie-picker {
  z-index: 5;
}

.bracket-match.has-match-points {
  z-index: 3;
}

.bracket-match.has-match-points:focus-within,
.bracket-match.has-match-points.has-tie-picker {
  z-index: 5;
}

.bracket-match.is-third-place-card {
  transform: translateY(-.35rem);
}

.bracket-match.is-final-card {
  z-index: 2;
  border: 2px solid rgba(250, 204, 21, .92);
  background:
    radial-gradient(circle at 85% 20%, rgba(250, 204, 21, .22), transparent 34%),
    linear-gradient(135deg, #fffdf0, #fff 52%, #ecfdf5);
  box-shadow:
    0 0 0 4px rgba(250, 204, 21, .18),
    0 18px 36px rgba(6, 95, 70, .18);
  transform: scale(1.13);
  transform-origin: center;
}

.bracket-match.is-final-card.has-match-points {
  z-index: 4;
}

.bracket-match.has-connector::after {
  content: none;
}

.bracket-match.has-connector::before {
  content: none;
}

.bracket-lines {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.bracket-line {
  fill: none;
  stroke: rgba(11, 95, 61, .46);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bracket-score-row {
  display: grid;
  gap: .18rem;
}

.bracket-match > .match-point-badge {
  position: absolute;
  top: 50%;
  right: -1.55rem;
  z-index: 6;
  min-width: 1.42rem;
  min-height: .9rem;
  border-radius: 4px;
  padding: 0 .2rem;
  transform: translateY(calc(-50% + var(--match-point-y, 0rem)));
  font-size: .54rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .94), 0 3px 8px rgba(6, 78, 59, .14);
}

.bracket-match.is-final-card > .match-point-badge {
  right: -1.65rem;
  min-width: 1.55rem;
  min-height: 1rem;
  font-size: .58rem;
}

.bracket-team {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: .14rem;
  align-items: center;
  border: 1px solid #e6eee8;
  border-radius: 5px;
  padding: .18rem .24rem;
  background: #fafcfb;
  transition: border-color .18s ease, background .18s ease;
}

.qualification-badge {
  position: absolute;
  top: -.42rem;
  right: -.35rem;
  z-index: 2;
  display: grid;
  min-width: 1.55rem;
  min-height: 1.1rem;
  place-items: center;
  border: 1px solid rgba(15, 122, 72, .28);
  border-radius: 999px;
  padding: 0 .24rem;
  color: #064e3b;
  background: #dcfce7;
  box-shadow: 0 4px 10px rgba(6, 78, 59, .14);
  font-size: .55rem;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

.qualification-badge.is-miss {
  border-color: rgba(220, 38, 38, .28);
  color: #7f1d1d;
  background: #fee2e2;
  box-shadow: 0 4px 10px rgba(127, 29, 29, .12);
}

.bracket-team span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .54rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.bracket-team strong {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: .7rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team input {
  min-height: 21px;
  height: 21px;
  padding: 0 .1rem;
  text-align: center;
  font-size: .68rem;
  font-weight: 900;
}

.bracket-team.is-win {
  border-color: rgba(22, 163, 74, .45);
  background: rgba(22, 163, 74, .12);
}

.bracket-team.is-loss {
  border-color: rgba(220, 38, 38, .38);
  background: rgba(220, 38, 38, .1);
}

.bracket-team.is-draw {
  border-color: rgba(234, 179, 8, .55);
  background: rgba(250, 204, 21, .14);
}

.bracket-team.has-flag,
.team-score.has-flag {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .72)),
    var(--flag-bg, #fff);
}

.bracket-team.has-flag.is-win,
.team-score.has-flag.is-win {
  border-color: rgba(22, 163, 74, .7);
  box-shadow: inset 0 0 0 2px rgba(22, 163, 74, .35);
}

.bracket-team.has-flag.is-loss,
.team-score.has-flag.is-loss {
  border-color: rgba(220, 38, 38, .65);
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, .26);
}

.team-score.has-flag.is-draw {
  border-color: rgba(234, 179, 8, .78);
  box-shadow: inset 0 0 0 2px rgba(234, 179, 8, .28);
}

.bracket-team.has-flag.is-draw {
  border-color: rgba(234, 179, 8, .78);
  box-shadow: inset 0 0 0 2px rgba(234, 179, 8, .24);
}

.bracket-match.is-final-card .bracket-team {
  grid-template-columns: 40px minmax(0, 1fr) 34px;
  min-height: 36px;
  padding: .28rem .34rem;
}

.bracket-match.is-final-card .bracket-team strong {
  font-size: .82rem;
}

.bracket-match.is-final-card .bracket-team input {
  min-height: 26px;
  height: 26px;
  font-size: .82rem;
}

.tie-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .32rem;
  align-items: center;
  border: 1px dashed rgba(11, 95, 61, .35);
  border-radius: 7px;
  padding: .25rem;
  background: rgba(236, 253, 245, .84);
}

.tie-picker > span {
  color: #0b5f3d;
  font-size: .6rem;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tie-picker select {
  min-width: 0;
  border: 1px solid rgba(11, 95, 61, .18);
  border-radius: 6px;
  padding: .18rem .28rem;
  background: rgba(255, 255, 255, .9);
  color: #063e26;
  font-size: .66rem;
  font-weight: 900;
  line-height: 1.1;
}

.leaderboard-panel,
.rules-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 24px rgba(20, 33, 27, .07);
}

.leaderboard-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(236, 253, 245, .94)),
    #fff;
}

.leaderboard-panel h3,
.rules-panel h3 {
  margin: 0 0 .85rem;
  color: #063e26;
}

.leaderboard-empty {
  border: 1px solid rgba(234, 179, 8, .34);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  color: #713f12;
  background: rgba(254, 240, 138, .36);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.leaderboard-empty.is-quiet {
  border-color: rgba(15, 122, 72, .22);
  color: #0b5f3d;
  background: rgba(236, 253, 245, .65);
}

.pool-prize {
  border: 1px solid rgba(217, 119, 6, .32);
  border-radius: 8px;
  margin: 1rem 0;
  padding: 1rem;
  color: #422006;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(253, 230, 138, .78)),
    #fffbeb;
  box-shadow: 0 14px 34px rgba(146, 64, 14, .12);
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
}

.pool-prize-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin-top: .65rem;
  color: rgba(66, 32, 6, .78);
  font-size: clamp(.86rem, 2.5vw, 1.1rem);
  font-weight: 850;
  letter-spacing: .02em;
  line-height: 1.25;
  text-transform: none;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 .5rem;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 0;
  padding: .78rem .7rem;
  text-align: left;
}

.leaderboard-table td {
  background: #f7fbf8;
}

.leaderboard-table td:first-child {
  border-radius: 8px 0 0 8px;
}

.leaderboard-table td:last-child {
  border-radius: 0 8px 8px 0;
}

.leaderboard-table th:last-child,
.leaderboard-table td:last-child,
.leaderboard-table th:nth-child(3),
.leaderboard-table td.leaderboard-score {
  text-align: right;
}

.leaderboard-table th {
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.leaderboard-table td:first-child {
  width: 3.4rem;
}

.leaderboard-table td:first-child span {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #0b5f3d;
  font-weight: 1000;
}

.leaderboard-table td:nth-child(2) {
  display: grid;
  gap: .14rem;
}

.leaderboard-user-button {
  width: fit-content;
  border: 0;
  padding: 0;
  color: #063e26;
  background: transparent;
  font: inherit;
  font-weight: 1000;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .18rem;
  cursor: pointer;
}

.leaderboard-user-button:hover,
.leaderboard-user-button:focus-visible {
  color: #0f7a48;
}

.leaderboard-table td:nth-child(2) span {
  color: var(--muted);
  font-size: .82rem;
}

.leaderboard-table td.leaderboard-score {
  color: #063e26;
  font-size: 1.05rem;
  font-weight: 1000;
}

.leaderboard-table td.leaderboard-prize {
  color: #063e26;
  font-size: 1.28rem;
  font-weight: 1000;
}

.leaderboard-table tr.rank-gold td {
  background: linear-gradient(90deg, rgba(254, 243, 199, .96), rgba(255, 251, 235, .94));
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .2);
}

.leaderboard-table tr.rank-gold td:first-child span {
  color: #422006;
  background: linear-gradient(135deg, #f59e0b, #fde68a);
}

.leaderboard-table tr.rank-silver td {
  background: linear-gradient(90deg, rgba(241, 245, 249, .98), rgba(248, 250, 252, .94));
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .18);
}

.leaderboard-table tr.rank-silver td:first-child span {
  color: #1f2937;
  background: linear-gradient(135deg, #94a3b8, #e2e8f0);
}

.leaderboard-table tr.rank-bronze td {
  background: linear-gradient(90deg, rgba(254, 235, 200, .86), rgba(255, 247, 237, .94));
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, .16);
}

.leaderboard-table tr.rank-bronze td:first-child span {
  color: #431407;
  background: linear-gradient(135deg, #b45309, #fdba74);
}

.participant-view {
  display: grid;
  gap: 1.2rem;
}

.participant-back-button {
  min-height: 38px;
  border-radius: 8px;
  padding: .55rem .9rem;
  font-weight: 900;
}

.participant-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.participant-summary-strip div {
  border: 1px solid rgba(15, 122, 72, .18);
  border-radius: 8px;
  padding: .75rem .85rem;
  background: rgba(236, 253, 245, .72);
}

.participant-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.participant-summary-strip strong {
  display: block;
  margin-top: .2rem;
  color: #063e26;
  font-size: 1.35rem;
  font-weight: 1000;
}

.participant-section {
  display: grid;
  gap: .8rem;
}

.participant-section > h3 {
  margin: 0;
  color: #063e26;
  font-size: 1.3rem;
}

.participant-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: .85rem;
}

.participant-group-card {
  display: grid;
  gap: .7rem;
  border: 1px solid rgba(15, 122, 72, .18);
  border-radius: 8px;
  padding: .8rem;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 20px rgba(20, 33, 27, .06);
}

.participant-group-card > h3 {
  margin: 0;
  color: #0b5f3d;
  font-size: 1rem;
}

.participant-fixtures {
  display: grid;
  gap: .4rem;
}

.participant-fixture {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: .45rem;
  align-items: center;
}

.participant-fixture-meta {
  display: grid;
  justify-items: start;
  gap: .12rem;
}

.participant-fixture-meta span {
  border-radius: 999px;
  padding: .13rem .38rem;
  color: #fff;
  background: var(--green);
  font-size: .72rem;
  font-weight: 900;
}

.participant-fixture-meta small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}

.participant-score-row {
  gap: .28rem;
}

.participant-score-row.has-match-points {
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 32px;
}

.participant-score-row .team-score {
  grid-template-columns: minmax(2rem, 1fr) 2.15rem;
  gap: .18rem;
  padding: .28rem .32rem;
}

.participant-score-row .team-score label {
  font-size: .82rem;
}

.readonly-score {
  display: grid;
  box-sizing: border-box;
  place-items: center;
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  color: #063e26;
  background: rgba(255, 255, 255, .86);
  font-weight: 1000;
}

.team-score .readonly-score {
  min-height: 34px;
  height: 34px;
  font-size: 1rem;
}

.participant-score-row .readonly-score {
  min-height: 30px;
  height: 30px;
  font-size: .9rem;
}

.bracket-team .readonly-score {
  min-height: 21px;
  height: 21px;
  font-size: .68rem;
}

.bracket-match.is-final-card .bracket-team .readonly-score {
  min-height: 26px;
  height: 26px;
  font-size: .82rem;
}

.participant-standings {
  padding: .7rem;
}

.participant-standings h3 {
  font-size: .84rem;
}

.participant-standings th,
.participant-standings td {
  padding: .32rem .28rem;
  font-size: .78rem;
}

.participant-bracket-grid {
  border: 1px solid rgba(15, 122, 72, .14);
  border-radius: 8px;
  padding: .75rem 1.5rem 1rem .75rem;
  background: rgba(255, 255, 255, .72);
}

.rules-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.rules-columns h4 {
  margin: 0 0 .55rem;
  color: #0b5f3d;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  border-bottom: 1px solid rgba(209, 220, 214, .75);
  padding: .48rem 0;
}

.rule-row span {
  min-width: 0;
  color: #23342b;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.rule-row strong {
  display: grid;
  flex: 0 0 auto;
  min-width: 2.2rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #0b5f3d;
}

.rules-notes {
  display: grid;
  gap: .4rem;
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-weight: 700;
}

.official-progress {
  border-top: 1px solid var(--line);
  margin: 1rem 0 0;
  padding-top: .8rem;
  color: #0b5f3d;
  font-weight: 900;
}

.completion-notice,
.lock-notice {
  border: 1px solid rgba(234, 179, 8, .34);
  border-radius: 8px;
  margin: 0 0 1rem;
  padding: .65rem .8rem;
  color: #713f12;
  background: rgba(254, 240, 138, .34);
  font-weight: 850;
}

.completion-notice.is-complete,
.lock-notice {
  border-color: rgba(22, 163, 74, .28);
  color: #0b5f3d;
  background: rgba(220, 252, 231, .7);
}

.finalize-dialog {
  width: min(420px, calc(100vw - 2rem));
  border: 1px solid rgba(11, 95, 61, .26);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.finalize-dialog::backdrop {
  background: rgba(3, 28, 18, .58);
  backdrop-filter: blur(3px);
}

.finalize-dialog form {
  display: grid;
  gap: .8rem;
  padding: 1.1rem;
}

.finalize-dialog h3 {
  margin: 0;
  color: #063e26;
}

.finalize-dialog p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
}

.group-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: .85rem;
  align-items: start;
}

.fixture-list {
  display: grid;
  gap: .55rem;
}

.fixture-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .65rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 16px rgba(20, 33, 27, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.fixture-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(20, 33, 27, .1);
}

.fixture-meta {
  display: grid;
  gap: .12rem;
}

.fixture-meta span {
  width: fit-content;
  border-radius: 999px;
  padding: .13rem .42rem;
  color: #fff;
  background: var(--green);
  font-size: .78rem;
  font-weight: 900;
}

.fixture-meta strong {
  font-size: .85rem;
  line-height: 1.1;
}

.fixture-meta small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.1;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: .35rem;
  align-items: center;
}

.score-row.has-match-points {
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 34px;
}

.match-point-badge {
  display: grid;
  box-sizing: border-box;
  min-width: 2rem;
  max-width: 100%;
  min-height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(15, 122, 72, .25);
  border-radius: 999px;
  padding: 0 .34rem;
  color: #063e26;
  background: rgba(236, 253, 245, .95);
  font-size: .78rem;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.match-point-badge[hidden] {
  display: none !important;
}

.match-point-badge.is-exact {
  border-color: rgba(22, 163, 74, .45);
  color: #052e16;
  background: linear-gradient(135deg, #bbf7d0, #f0fdf4);
}

.match-point-badge.is-result {
  border-color: rgba(20, 184, 166, .42);
  color: #064e3b;
  background: linear-gradient(135deg, #ccfbf1, #ecfdf5);
}

.match-point-badge.is-miss {
  border-color: rgba(100, 116, 139, .18);
  color: #475569;
  background: rgba(248, 250, 252, .94);
}

.team-score {
  display: grid;
  grid-template-columns: minmax(2.35rem, 1fr) minmax(2.25rem, 2.7rem);
  align-items: center;
  gap: .3rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .38rem .42rem;
  background: #f8fbf9;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.team-score label {
  overflow: hidden;
  font-weight: 900;
  font-size: .9rem;
  letter-spacing: .04em;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-score input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: .2rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
}

.team-score.is-win {
  border-color: rgba(22, 163, 74, .45);
  background: rgba(22, 163, 74, .12);
}

.team-score.is-loss {
  border-color: rgba(220, 38, 38, .38);
  background: rgba(220, 38, 38, .1);
}

.team-score.is-draw {
  border-color: rgba(234, 179, 8, .5);
  background: rgba(250, 204, 21, .16);
}

.versus {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.standings-card {
  position: sticky;
  top: 5.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 33, 27, .08);
}

.standings-card h3 {
  margin: 0 0 .75rem;
}

.standings-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.standings-card th,
.standings-card td {
  border-bottom: 1px solid var(--line);
  padding: .55rem .35rem;
  text-align: right;
}

.standings-card th:first-child,
.standings-card td:first-child {
  text-align: left;
}

.standings-card td:first-child {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 900;
}

.standings-card td span {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-size: .78rem;
}

.standings-card tr.is-qualified td span {
  background: var(--green);
}

.standings-card tr.is-third td span {
  background: #d97706;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: .9rem;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar form,
  .tabs {
    overflow-x: auto;
  }

  .section-head button {
    width: 100%;
  }

  .landing-stage {
    padding: 1.25rem;
  }

  .landing-message {
    min-width: 0;
    width: 100%;
  }

  .landing-message h1 {
    font-size: clamp(2.1rem, 9.4vw, 3.2rem);
    line-height: .96;
  }

  .landing-stage::before {
    inset: 5vh 5vw;
    border-radius: 18px;
  }

  .landing-login-form {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 260px);
    max-width: calc(100vw - 4rem);
    margin-top: 1.1rem;
  }

  .landing-login-form label {
    width: 100%;
  }

  .session-actions {
    flex-direction: column;
  }

  .session-actions .primary-link,
  .session-actions .ghost-button {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .predictor-shell {
    --sidebar-width: 250px;
  }

  .side-panel {
    width: 100%;
  }

  .group-layout {
    grid-template-columns: 1fr;
  }

  .standings-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .predictor-shell {
    --sidebar-width: 100vw;
    grid-template-columns: 1fr;
  }

  .is-panel-collapsed .predictor-shell {
    grid-template-columns: 1fr;
  }

  .predictor-main {
    grid-column: 1 / -1;
    width: 100%;
  }

  .side-panel {
    position: fixed;
    inset: 0;
    z-index: 40;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    border-right: 0;
    padding: 1rem clamp(1rem, 5vw, 1.35rem);
    background: rgba(6, 62, 38, .96);
    box-shadow: 22px 0 60px rgba(0, 0, 0, .28);
    transform: translateX(0);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1), visibility .28s ease;
  }

  .is-panel-collapsed .side-panel {
    padding-inline: clamp(1rem, 5vw, 1.35rem);
    transform: translateX(-100%);
    visibility: hidden;
  }

  .side-brand,
  .side-nav,
  .side-user {
    transition: opacity .16s ease;
  }

  .is-panel-collapsed .side-brand,
  .is-panel-collapsed .side-nav,
  .is-panel-collapsed .side-user {
    display: grid;
    opacity: 0;
    pointer-events: none;
  }

  .mobile-topbar {
    display: flex;
    padding-left: .8rem;
  }

  .mobile-menu-toggle {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .24);
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
  }

  .is-mobile-menu-open .mobile-menu-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .panel-toggle {
    top: 1rem;
    right: 1rem;
    width: 44px;
    min-height: 44px;
  }

  .view-root {
    padding: .8rem;
  }

  .is-panel-collapsed .view-root {
    padding-left: .8rem;
  }

  .is-panel-collapsed .view-card {
    width: 100%;
  }

  .view-head {
    align-items: stretch;
    flex-direction: column;
  }

  .leaderboard-grid,
  .rules-columns {
    grid-template-columns: 1fr;
  }

  .leaderboard-panel {
    padding: .75rem;
    overflow: hidden;
  }

  .leaderboard-table,
  .leaderboard-table tbody,
  .leaderboard-table tr,
  .leaderboard-table td {
    display: block;
  }

  .leaderboard-table {
    border-spacing: 0;
  }

  .leaderboard-table thead {
    display: none;
  }

  .leaderboard-table tbody {
    display: grid;
    gap: .55rem;
  }

  .leaderboard-table tr {
    display: grid;
    grid-template-columns: 2.7rem minmax(0, 1fr) minmax(4.2rem, auto);
    grid-template-areas:
      "rank user score"
      "rank user prize";
    align-items: center;
    border: 1px solid rgba(15, 122, 72, .12);
    border-radius: 8px;
    overflow: hidden;
    background: #f7fbf8;
  }

  .leaderboard-table tr.rank-gold {
    border-color: rgba(217, 119, 6, .22);
    background: linear-gradient(90deg, rgba(254, 243, 199, .96), rgba(255, 251, 235, .94));
  }

  .leaderboard-table tr.rank-silver {
    border-color: rgba(100, 116, 139, .2);
    background: linear-gradient(90deg, rgba(241, 245, 249, .98), rgba(248, 250, 252, .94));
  }

  .leaderboard-table tr.rank-bronze {
    border-color: rgba(180, 83, 9, .18);
    background: linear-gradient(90deg, rgba(254, 235, 200, .86), rgba(255, 247, 237, .94));
  }

  .leaderboard-table td {
    min-width: 0;
    border-radius: 0 !important;
    padding: .55rem .5rem;
    background: transparent !important;
    box-shadow: none !important;
  }

  .leaderboard-table td:first-child {
    grid-area: rank;
    width: auto;
    padding: .55rem .2rem .55rem .55rem;
  }

  .leaderboard-table td:first-child span {
    width: 2rem;
    height: 2rem;
  }

  .leaderboard-table td:nth-child(2) {
    grid-area: user;
    padding-left: .25rem;
  }

  .leaderboard-user-button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .leaderboard-table td:nth-child(2) span {
    overflow-wrap: anywhere;
  }

  .leaderboard-table td.leaderboard-score {
    grid-area: score;
    align-self: end;
    padding-bottom: .12rem;
    font-size: 1rem;
    text-align: right;
  }

  .leaderboard-table td.leaderboard-score::before {
    content: "Pts";
    display: block;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .leaderboard-table td.leaderboard-prize {
    grid-area: prize;
    align-self: start;
    padding-top: .12rem;
    font-size: .95rem;
    text-align: right;
    white-space: nowrap;
  }

  .participant-summary-strip,
  .participant-groups-grid {
    grid-template-columns: 1fr;
  }

  .participant-group-card {
    padding: .65rem;
  }

  .participant-fixture {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .participant-score-row.has-match-points {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 30px;
  }

  .group-picker {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    font-size: 1.75rem;
  }

  .fixture-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: .35rem;
    padding: .45rem;
  }

  .fixture-meta span {
    font-size: .7rem;
  }

  .fixture-meta strong {
    font-size: .76rem;
  }

  .fixture-meta small {
    display: none;
  }

  .score-row {
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
    gap: .16rem;
  }

  .score-row.has-match-points {
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 28px;
  }

  .score-row .match-point-badge {
    min-width: 1.65rem;
    min-height: 1.45rem;
    padding: 0 .2rem;
    font-size: .68rem;
  }

  .versus {
    font-size: .62rem;
    text-align: center;
  }

  .team-score {
    grid-template-columns: minmax(1.6rem, 1fr) 34px;
    gap: .12rem;
    padding: .24rem;
  }

  .team-score label {
    font-size: .72rem;
  }

  .team-score input {
    min-height: 30px;
    height: 30px;
    font-size: .88rem;
  }

  .bracket-grid {
    grid-template-columns: repeat(6, 164px);
    gap: 1rem;
  }
}
