:root {
  --bg: #f7f4ee;
  --bg-strong: #ece4d6;
  --ink: #1f1b16;
  --muted: #6b5f56;
  --accent: #e25d38;
  --accent-dark: #b4472a;
  --mint: #2f8f83;
  --card: #fffaf2;
  --line: #eadfce;
  --shadow: 0 20px 60px rgba(23, 16, 10, 0.15);
  --radius: 18px;
  --radius-lg: 26px;
  --font-title: "Space Grotesk", "Sora", "Fira Sans", sans-serif;
  --font-body: "Fira Sans", "Sora", "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.65;
  mix-blend-mode: multiply;
}

.glow-a {
  background: radial-gradient(circle at 30% 30%, #ffe1b8, transparent 70%);
  top: -120px;
  left: -160px;
}

.glow-b {
  background: radial-gradient(circle at 30% 30%, #c7f0e7, transparent 70%);
  bottom: -160px;
  right: -120px;
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

.hero {
  padding: 48px 6vw 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-title);
  letter-spacing: 1px;
}

.brand-title {
  font-weight: 700;
  font-family: var(--font-title);
  font-size: 18px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
}

.nav-actions {
  display: flex;
  gap: 12px;
}

button,
.cta {
  border: none;
  background: none;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 250, 242, 0.8);
}

.primary,
.cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(226, 93, 56, 0.25);
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero-text h1 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 18px;
}

.hero-text p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.15);
  color: var(--mint);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(234, 223, 206, 0.8);
  animation: floatIn 0.8s ease forwards;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
  color: var(--muted);
}

.match-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.status {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(226, 93, 56, 0.1);
  color: var(--accent-dark);
  font-size: 0.8rem;
}

.card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
}

.stat span {
  font-size: 0.75rem;
  color: var(--muted);
}

.stat strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
}

.card-footer {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 6vw 64px;
}

.section-title {
  margin-bottom: 24px;
}

.section-title h2 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin-bottom: 6px;
}

.section-title p {
  color: var(--muted);
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.agent-card {
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(31, 27, 22, 0.08);
}

.agent-card.active {
  border-color: rgba(226, 93, 56, 0.5);
  background: linear-gradient(135deg, #fff5eb 0%, #fffaf2 100%);
}

.agent-card.muted {
  opacity: 0.8;
}

.agent-name {
  font-weight: 700;
  font-family: var(--font-title);
  margin-bottom: 6px;
}

.agent-tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.12);
  color: var(--mint);
}

.matchs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.matchs-list {
  display: grid;
  gap: 16px;
}

.match-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(31, 27, 22, 0.08);
}

.match-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-teams {
  font-weight: 600;
}

.match-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.match-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.match-actions button {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: #fff;
  font-size: 0.85rem;
}

.analysis {
  position: sticky;
  top: 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.analysis-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 143, 131, 0.15);
  color: var(--mint);
  font-size: 0.8rem;
}

.analysis-body {
  display: grid;
  gap: 18px;
}

.analysis-block.highlight {
  border: 1px solid rgba(226, 93, 56, 0.35);
  background: #fff4ea;
  border-radius: 14px;
  padding: 12px;
}

.analysis-block h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.prob-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.prob-grid div,
.detail-grid div {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--line);
}

.prob-grid span,
.detail-grid span {
  font-size: 0.7rem;
  color: var(--muted);
}

.prob-grid strong,
.detail-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

#expertText {
  white-space: pre-wrap;
  font-size: 0.9rem;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  max-height: 220px;
  overflow: auto;
}

.expert-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.expert-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(31, 27, 22, 0.06);
}

.expert-card h5 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}

.expert-card p {
  font-size: 0.88rem;
}

.expert-empty {
  font-size: 0.9rem;
  color: var(--muted);
}

.warnings {
  display: none;
}

.warnings ul {
  padding-left: 18px;
  color: #a04a32;
  font-size: 0.85rem;
}

.footer {
  padding: 32px 6vw;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.method {
  margin-top: 64px;
}

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

.method-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31, 27, 22, 0.08);
}

.method-card h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  margin-bottom: 8px;
}

.method-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .matchs-layout {
    grid-template-columns: 1fr;
  }

  .analysis {
    position: static;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .card-body {
    grid-template-columns: 1fr;
  }

  .prob-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
