:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #617083;
  --line: #d9e1e8;
  --paper: #f6f8f5;
  --panel: #ffffff;
  --green: #0f7a57;
  --teal: #128090;
  --gold: #c88724;
  --red: #c0473d;
  --blue: #245b9b;
  --shadow: 0 18px 50px rgba(28, 45, 64, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 122, 87, 0.08), transparent 32%),
    linear-gradient(225deg, rgba(200, 135, 36, 0.13), transparent 30%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--green);
  color: var(--green);
}

.shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 24px;
  align-items: stretch;
  min-height: 260px;
  padding: 36px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 26, 35, 0.95), rgba(15, 84, 79, 0.72) 58%, rgba(198, 133, 34, 0.32)),
    radial-gradient(circle at 78% 32%, rgba(255, 216, 120, 0.58), transparent 22%),
    radial-gradient(circle at 72% 86%, rgba(28, 158, 120, 0.5), transparent 26%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='430' viewBox='0 0 1200 430'%3E%3Crect width='1200' height='430' fill='%230b3d37'/%3E%3Cg opacity='.34' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M60 360h1080M120 310h960M190 260h820M270 210h660M370 160h460'/%3E%3Cpath d='M760 60c120 36 211 117 260 245M686 80c102 58 174 136 218 235M610 112c82 69 136 142 168 220'/%3E%3Ccircle cx='930' cy='210' r='84'/%3E%3Ccircle cx='930' cy='210' r='8' fill='%23fff'/%3E%3C/g%3E%3Cg opacity='.5' stroke='%23ffd46b' stroke-width='3'%3E%3Cpath d='M745 122l58 34 74-10 60 46 88 2' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
}

.trophy-visual {
  position: absolute;
  right: 36px;
  top: 26px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: rgba(255, 240, 190, 0.86);
  text-align: center;
  pointer-events: none;
}

.trophy-visual span {
  font-size: 12px;
  font-weight: 800;
}

.trophy-cup {
  width: 74px;
  height: 104px;
  background:
    radial-gradient(circle at 50% 18%, #fff3b1 0 11px, transparent 12px),
    radial-gradient(circle at 35% 30%, #ffd463 0 22px, transparent 23px),
    radial-gradient(circle at 65% 30%, #ffd463 0 22px, transparent 23px),
    linear-gradient(90deg, transparent 0 20px, #d7a633 20px 66px, transparent 66px),
    linear-gradient(#f7c956, #b57820);
  clip-path: polygon(24% 0, 76% 0, 88% 38%, 66% 56%, 61% 78%, 75% 78%, 83% 100%, 17% 100%, 25% 78%, 39% 78%, 34% 56%, 12% 38%);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}

.mascot-strip {
  position: absolute;
  right: 28px;
  bottom: 18px;
  display: flex;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(3, 20, 26, 0.28);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.mascot {
  position: relative;
  display: grid;
  place-items: end center;
  width: 44px;
  height: 48px;
  padding-bottom: 5px;
  border-radius: 8px;
  color: #fff;
  font-size: 9px;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.mascot::before {
  content: "";
  position: absolute;
  top: 8px;
  width: 22px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}

.mascot::after {
  position: absolute;
  top: 10px;
  font-size: 17px;
}

.maple {
  background: linear-gradient(#9b6b3d, #4b7b57);
}

.maple::after {
  content: "🫎";
}

.zayu {
  background: linear-gradient(#d69a29, #2e8b57);
}

.zayu::after {
  content: "🐆";
}

.clutch {
  background: linear-gradient(#315f9e, #c3423f);
}

.clutch::after {
  content: "🦅";
}

.eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 920px;
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.subcopy {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.6;
}

.hero-panel {
  align-self: end;
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.hero-panel span,
.hero-panel small {
  color: rgba(255, 255, 255, 0.78);
}

.hero-panel strong {
  font-size: 30px;
}

.controls,
.stats,
.intel-board,
.workspace,
.sources {
  margin-top: 18px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(18, 128, 144, 0.18);
  border-color: var(--teal);
}

.stats {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(240px, 0.62fr);
  gap: 12px;
  align-items: stretch;
}

.stat-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat-summary > div {
  min-width: 0;
}

.stat-summary span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stat-summary strong {
  font-size: 30px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.matches {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-meta {
  color: var(--muted);
  font-size: 13px;
}

.match-list,
.intel-list {
  display: grid;
  gap: 12px;
}

.empty,
.intel-card,
.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(35, 53, 70, 0.07);
}

.empty {
  padding: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.intel-board {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.stats .intel-board {
  margin-top: 0;
  min-height: 100%;
  padding: 14px;
}

.stats .section-title {
  margin-bottom: 8px;
}

.stats .section-title h2 {
  font-size: 16px;
}

.stats .section-title button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.summary-only .intel-list {
  display: none;
}

.summary-only {
  min-height: 92px;
}

.intel-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 18, 28, 0.58);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: min(1120px, 100%);
  max-height: min(82vh, 860px);
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-content .intel-list {
  display: grid;
}

.modal-content .intel-list {
  max-height: 60vh;
}

.intel-card {
  padding: 14px;
}

.intel-card strong {
  display: block;
  margin-bottom: 7px;
}

.intel-card small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.intel-card a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.intel-card a:hover {
  text-decoration: underline;
}

.match-card {
  position: relative;
  padding: 18px;
}

.match-head {
  position: sticky;
  top: var(--sticky-offset, 0);
  z-index: 5;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  margin-inline: -18px;
  margin-top: -18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.match-head h3 {
  margin: 6px 0;
  font-size: 22px;
  line-height: 1.2;
}

.meta,
.venue {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15, 122, 87, 0.1);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.badge.watch {
  background: rgba(97, 112, 131, 0.12);
  color: var(--muted);
}

.badge.hot {
  background: rgba(200, 135, 36, 0.16);
  color: #9a6114;
}

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

.prob {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7f8;
}

.prob b {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfe8eb;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.prob:nth-child(1) .bar i {
  background: var(--green);
}

.prob:nth-child(2) .bar i {
  background: var(--gold);
}

.prob:nth-child(3) .bar i {
  background: var(--blue);
}

.markets,
.score-row,
.ratings,
.technical,
.review,
.manual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef3f3;
  color: var(--ink);
  font-size: 13px;
}

.pill.warn {
  background: rgba(192, 71, 61, 0.12);
  color: var(--red);
}

.analysis-box,
.review-box {
  flex: 1 1 260px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fa;
  color: var(--muted);
  line-height: 1.55;
}

.analysis-box strong,
.review-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.review-box.done {
  border-left: 4px solid var(--green);
}

.rating-control {
  display: grid;
  grid-template-columns: 1fr 76px;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.rating-control input {
  min-height: 34px;
}

.manual input {
  width: min(220px, 100%);
  min-height: 36px;
}

.sources {
  padding: 16px;
  border-left: 4px solid var(--gold);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.6;
}

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

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

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

  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1420px);
    padding-top: 10px;
  }

  .hero {
    padding: 24px;
    min-height: 360px;
  }

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

  .stat-summary {
    grid-template-columns: 1fr;
  }

  h1 {
    white-space: normal;
  }

  .match-head {
    display: grid;
    top: 0;
  }

  .trophy-visual {
    display: none;
  }

  .mascot-strip {
    position: static;
    justify-content: flex-start;
    width: max-content;
    margin-top: 18px;
  }
}
