:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg2: #f5f5f7;
  --bg3: #fbfbfd;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #86868b;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, 0.08);
  --panel: #ffffff;
  --field: #ffffff;
  --accent: #0071e3;
  --accent-strong: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.10);
  --grad: linear-gradient(110deg, #ff5e3a, #ff2d55 40%, #bf5af2);
  --ok: #30d158;
  --warn: #d93a2b;
  --warn-soft: rgba(217, 58, 43, 0.10);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.10);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-snappy: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg2);
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-nav {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  max-width: 100%;
  height: 52px;
  padding: 0 8px 0 18px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  transition: background 240ms var(--ease), box-shadow 240ms var(--ease), border-color 240ms var(--ease);
}

.site-nav.scrolled .nav-pill {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--hair);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand img {
  width: 21px;
  height: 26px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 28px);
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 980px;
  background: linear-gradient(160deg, #ff5e57, #e0322c);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(224, 50, 44, 0.26);
  transition: filter 180ms var(--ease), transform 180ms var(--ease-snappy), box-shadow 180ms var(--ease);
}

.nav-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(224, 50, 44, 0.3);
}

.app-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 46px) clamp(16px, 4vw, 40px) 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.video-hero,
.schedule-panel,
.workspace,
.groups-panel {
  width: 100%;
}

html {
  scroll-behavior: smooth;
}

#video,
#schedule,
#predict,
#groups {
  scroll-margin-top: 88px;
}

/* video hero */
.video-stage {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7;
  border-radius: 22px;
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(120deg, #0a2a5e, #103a86 45%, #0a2a5e);
  box-shadow: var(--shadow);
}

.video-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.16;
}

.video-poster img {
  width: 180px;
  height: auto;
  filter: brightness(0) invert(1);
}

.video-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.10), transparent 60%);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  transition: transform 220ms var(--ease-snappy);
}

.video-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent var(--accent);
}

.video-stage:hover .video-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.video-meta {
  position: absolute;
  left: clamp(20px, 4vw, 36px);
  bottom: clamp(20px, 4vw, 30px);
  display: grid;
  gap: 6px;
  color: #ffffff;
  z-index: 1;
}

.video-tag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 980px;
  background: #ff3b30;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.video-meta strong {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.video-meta small {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
}

/* schedule */
.schedule-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 28px);
}

.schedule-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.schedule-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.schedule-nav {
  display: flex;
  gap: 8px;
}

.sched-arrow {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.sched-arrow:hover {
  background: var(--bg2);
  border-color: #c7c7cc;
  transform: none;
}

.sched-arrow[disabled] {
  opacity: 0.32;
  cursor: default;
  background: var(--bg);
  border-color: var(--line);
}

.schedule-track {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 248px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: thin;
  cursor: grab;
}

.schedule-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}

.schedule-track.is-dragging .sched-card {
  pointer-events: none;
}

.schedule-track::-webkit-scrollbar {
  height: 7px;
}

.schedule-track::-webkit-scrollbar-thumb {
  background: #c7c7cc;
  border-radius: 7px;
}

.sched-card {
  scroll-snap-align: start;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg3);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}

.sched-card:hover {
  transform: translateY(-4px);
  border-color: #c7c7cc;
  box-shadow: var(--shadow-hover);
}

.sched-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.sched-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sched-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.team-badge.sched-team {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.team-badge.sched-team .flag {
  width: 40px;
  height: 28px;
}

.sched-score {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.sched-stage {
  font-size: 11px;
  color: var(--soft);
  font-weight: 500;
  white-space: nowrap;
}

.sched-score strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sched-replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border-radius: 980px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.sched-replay::before {
  content: "▶";
  font-size: 10px;
}

.sched-replay:hover {
  background: var(--accent);
  color: #ffffff;
}

.sched-book {
  min-height: 38px;
  height: 38px;
  border-radius: 980px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.sched-book::before {
  content: "📅 ";
}

.sched-book:hover {
  background: var(--accent-strong);
  transform: none;
}

.sched-count {
  text-align: center;
  font-size: 12px;
  color: var(--soft);
  margin-top: -4px;
}

.sched-card.is-soon .sched-score strong {
  color: var(--accent);
  letter-spacing: 0.02em;
}

.sched-all {
  align-content: center;
  justify-items: center;
  text-align: center;
  background: var(--bg);
  text-decoration: none;
  gap: 6px;
}

.sched-all-icon {
  font-size: 26px;
}

.sched-all strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.sched-all small {
  font-size: 13px;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.match-panel,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.match-panel {
  position: sticky;
  top: 72px;
  padding: 26px;
}

.result-panel {
  padding: clamp(22px, 4vw, 34px);
}

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.brand-logo {
  width: 64px;
  height: 94px;
  object-fit: contain;
  border-radius: 16px;
  background: var(--bg3);
  border: 1px solid var(--hair);
  padding: 8px;
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  max-width: 300px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 16px;
  font-weight: 400;
}

h2 {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.status {
  flex: 0 0 auto;
  min-width: 70px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--bg3);
  padding: 7px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.status.busy {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.32);
  background: var(--accent-soft);
}

.status.error {
  color: var(--warn);
  border-color: rgba(217, 58, 43, 0.32);
  background: var(--warn-soft);
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.signal-strip span {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg3);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
}

.controls {
  display: grid;
  gap: 18px;
}

.quick-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 0 16px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
  flex: 0 1 auto;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    transform 180ms var(--ease-snappy);
}

.chip:hover {
  background: var(--bg2);
  border-color: #c7c7cc;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

label > span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  padding: 13px 15px;
  outline: none;
  font-weight: 400;
  font-size: 16px;
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

select {
  appearance: none;
  padding-right: 42px;
  font-weight: 500;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--soft);
  border-bottom: 2px solid var(--soft);
  pointer-events: none;
  transform: translateY(-62%) rotate(45deg);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}

.select-shell:hover::after,
.select-shell:focus-within::after {
  border-color: var(--accent);
}

.select-shell:focus-within::after {
  transform: translateY(-40%) rotate(225deg);
}

textarea {
  min-height: 104px;
  resize: vertical;
  font-weight: 400;
  line-height: 1.5;
}

textarea::placeholder {
  color: var(--soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c7c7cc;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg3);
  padding: 14px;
}

.match-preview > span {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  min-width: 36px;
  height: 36px;
  border-radius: 980px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}

.ts-widget {
  min-height: 0;
}

.ts-widget.is-active {
  min-height: 65px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 24px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 180ms var(--ease),
    transform 180ms var(--ease-snappy),
    opacity 180ms var(--ease);
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.985);
}

#submit-button {
  background: linear-gradient(160deg, #ff5e57, #e0322c);
  box-shadow: 0 10px 24px rgba(224, 50, 44, 0.24);
}

#submit-button:hover {
  background: linear-gradient(160deg, #ff6b64, #e8392f);
  filter: brightness(1.02);
}

#submit-button:disabled {
  filter: saturate(0.85);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.30);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.4;
  transform: none;
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  box-shadow: none;
}

button.secondary:hover {
  background: var(--bg2);
  border-color: #c7c7cc;
}

.method-card,
.contract-panel,
.weights-panel,
.groups-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg3);
}

.method-card {
  margin-top: 20px;
  padding: 18px;
}

.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.method-grid span {
  min-height: 40px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.result-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.result-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.result-header a {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--bg);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  box-shadow: none;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 180ms var(--ease-snappy);
}

.result-header a:hover {
  background: var(--bg2);
  border-color: #c7c7cc;
  transform: translateY(-1px);
}

.result-header a:active {
  transform: scale(0.98);
}

.brief-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg3);
  padding: 18px;
  margin-bottom: 18px;
}

.brief-panel h2 {
  color: var(--ink);
}

.brief-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 400;
}

.brief-panel.is-error {
  border-color: rgba(217, 58, 43, 0.28);
  background: var(--warn-soft);
}

.brief-panel.is-error p {
  color: var(--warn);
}

.scoreline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.scoreline > div,
.metrics > div {
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  padding: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}

.scoreline > div:hover,
.metrics > div:hover,
.player:hover {
  border-color: #c7c7cc;
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.scoreline span,
.metrics span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--ink);
  font-weight: 600;
}

.team-badge .flag {
  width: 38px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--hair);
  border-radius: 6px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.team-badge.stacked {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.team-badge.stacked .flag {
  width: 68px;
  height: 46px;
}

.team-badge.compact {
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.team-badge.compact span:last-child,
.team-badge.group-team span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreline strong {
  display: block;
  color: var(--ink);
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.score {
  background: linear-gradient(160deg, #ff5e57, #e0322c) !important;
  border-color: rgba(224, 50, 44, 0.4) !important;
  box-shadow: 0 14px 30px rgba(224, 50, 44, 0.22) !important;
}

.score #predicted-score {
  color: #ffffff;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
}

.score small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}

.metrics > div {
  min-height: 84px;
}

.metrics strong {
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contract-panel,
.weights-panel {
  padding: 18px;
  margin-top: 16px;
}

.contract-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  border-radius: 980px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.check.ok {
  background: rgba(48, 209, 88, 0.14);
  border-color: rgba(48, 209, 88, 0.24);
  color: #1c7a3a;
}

.check.warn {
  background: var(--warn-soft);
  border-color: rgba(217, 58, 43, 0.24);
  color: var(--warn);
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}

.weight-row:first-of-type {
  border-top: 0;
}

.weight-row span {
  color: var(--muted);
}

.weight-row strong {
  min-width: 48px;
  border-radius: 980px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 5px 10px;
  text-align: center;
  font-weight: 600;
}

.content-block {
  border-top: 1px solid var(--hair);
  padding-top: 20px;
  margin-top: 20px;
}

.content-block h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-block h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 980px;
  background: var(--accent);
}

ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

li {
  position: relative;
  padding-left: 20px;
  line-height: 1.6;
}

li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 980px;
  background: var(--accent);
}

li + li {
  margin-top: 8px;
}

#analysis {
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
}

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

.player {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-soft);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}

.player strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 600;
}

.player span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.groups-panel {
  grid-column: 2 / 3;
  padding: clamp(22px, 4vw, 30px);
  box-shadow: var(--shadow);
  background: var(--panel);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.group-card {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg3);
  padding: 16px;
  box-shadow: none;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}

.group-card:hover {
  border-color: #c7c7cc;
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.group-card strong {
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-card strong::after {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 980px;
  background: var(--accent);
}

.group-team-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.team-badge.group-team {
  min-width: 0;
  width: 100%;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.group-card:hover .team-badge.group-team {
  background: var(--bg);
  color: var(--ink);
}

.team-badge.group-team .flag {
  width: 30px;
  height: 22px;
}

/* result reveal on generate */
@keyframes resultUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.result-panel.show-result .scoreline,
.result-panel.show-result .metrics,
.result-panel.show-result .contract-panel,
.result-panel.show-result .content-block {
  animation: resultUp 0.55s var(--ease) both;
}

.result-panel.show-result .metrics {
  animation-delay: 0.06s;
}

.result-panel.show-result .contract-panel {
  animation-delay: 0.12s;
}

.result-panel.show-result .content-block {
  animation-delay: 0.18s;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

  .match-panel {
    position: static;
  }

  .groups-panel {
    grid-column: 1 / -1;
  }

  .groups-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .nav-links {
    display: none;
  }

  .topbar {
    display: grid;
  }

  .brand-lockup {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .brand-logo {
    width: 56px;
    height: 82px;
  }

  h1 {
    font-size: 30px;
  }

  .subtitle {
    font-size: 15px;
  }

  .signal-strip {
    grid-template-columns: 1fr;
  }

  .team-grid,
  .players,
  .metrics,
  .scoreline {
    grid-template-columns: 1fr;
  }

  .match-preview {
    grid-template-columns: 1fr;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .method-grid,
  .groups-grid {
    grid-template-columns: 1fr;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
