:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-soft: #f0f3f7;
  --line: #d9dee7;
  --text: #18212f;
  --muted: #667385;
  --strong: #0b5f75;
  --accent: #db5b35;
  --green: #117b4b;
  --red: #b53632;
  --shadow: 0 8px 24px rgba(25, 38, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 74px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 246, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-inner,
.content {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar-inner {
  padding: 12px 14px 10px;
}

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

.title {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

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

.filters {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.filters input,
.filters select {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
}

.date-filter {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 6px;
  min-width: 0;
}

.date-filter input {
  width: 100%;
}

.date-filter button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
}

.content {
  padding: 12px 12px 0;
}

.status {
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #16202d;
}

.auth-card {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.auth-card h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.auth-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
}

.auth-error {
  border-radius: 8px;
  background: #fff0ea;
  color: var(--accent);
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.auth-submit {
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card,
.section,
.parlay-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.match-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  width: 100%;
}

.timebox {
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.time {
  font-size: 17px;
  font-weight: 800;
}

.league {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teams {
  min-width: 0;
}

.team-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.odd-chip {
  min-width: 66px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--strong);
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.odd-chip small {
  display: inline-block;
  margin-right: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.signal {
  width: 82px;
  display: grid;
  gap: 5px;
}

.signal-item {
  padding: 5px 6px;
  border-radius: 6px;
  background: #f7f1ed;
  color: var(--accent);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.detail-head {
  background: #16202d;
  color: #fff;
  padding: 14px 14px 12px;
}

.detail-head .topbar-inner {
  padding: 0;
}

.back-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.back-btn,
.primary-btn,
.ghost-btn,
.pick-btn,
.remove-btn {
  border-radius: 8px;
  min-height: 36px;
  padding: 0 11px;
  font-weight: 750;
}

.back-btn,
.ghost-btn {
  background: var(--panel-soft);
  color: var(--text);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.detail-title {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.detail-team {
  font-size: 18px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.vs {
  color: #b9c6d6;
  font-size: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.score-row span {
  color: #b9c6d6;
  font-size: 12px;
}

.score-row span:last-child {
  text-align: right;
}

.score-row b {
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.metric {
  padding: 9px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.metric b {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.metric span {
  margin-top: 4px;
  display: block;
  color: #b9c6d6;
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 18px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--text);
  color: #fff;
}

.detail-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.section {
  padding: 12px;
}

.section.compact-heading {
  padding: 10px 12px;
}

.section.compact-heading .section-title {
  margin-bottom: 0;
}

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

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

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

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

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

.kv {
  min-height: 56px;
  padding: 9px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.kv .label {
  color: var(--muted);
  font-size: 11px;
}

.kv .value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.tag.hot {
  background: #fff0e8;
  color: var(--accent);
}

.tag.good {
  background: #eaf7f0;
  color: var(--green);
}

.play-stack {
  display: grid;
  gap: 8px;
}

.play-card {
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.play-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.play-head b {
  font-size: 14px;
}

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

.play-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.play-odds-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.play-odd,
.option-odd {
  min-width: 0;
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.play-odd span,
.option-odd span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-odd b,
.option-odd b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.notice.compact {
  padding: 8px;
}

.intel-block {
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
}

.intel-block.good {
  background: #eaf7f0;
  color: var(--green);
}

.intel-block.bad {
  background: #fff0e8;
  color: var(--accent);
}

.intel-block > b {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.intel-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.intel-list li {
  margin: 0 0 7px;
  line-height: 1.42;
  font-size: 13px;
}

.mini-panel {
  min-width: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.mini-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.player-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.player-pill {
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.score-cell {
  white-space: nowrap;
}

.goal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.goal-icon.big {
  background: var(--red);
}

.goal-icon.small {
  background: var(--green);
}

.goal-icon.push {
  background: var(--muted);
}

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

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

.handicap-side,
.handicap-conclusion,
.trend-card {
  min-width: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.handicap-side span,
.handicap-conclusion span,
.trend-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.handicap-side b,
.handicap-conclusion b,
.trend-card b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.handicap-conclusion {
  margin-top: 8px;
}

.handicap-conclusion b {
  font-size: 15px;
}

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

.trend-card.wide b {
  font-size: 15px;
  line-height: 1.35;
}

.market-strategy,
.market-prob-grid {
  display: grid;
  gap: 8px;
}

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

.market-main,
.market-note,
.market-prob {
  min-width: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.market-note {
  grid-column: 1 / -1;
}

.market-main span,
.market-note span,
.market-prob span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-main b,
.market-note b,
.market-prob b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.market-main b,
.market-prob b {
  font-size: 18px;
}

.market-note b {
  font-size: 15px;
}

.market-prob-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.market-prob em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.intel-summary-grid {
  display: grid;
  gap: 8px;
}

.intel-summary-card {
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.intel-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.intel-summary-card b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.intel-summary-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.notice {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-btn {
  height: 44px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
}

.nav-btn.active {
  background: var(--text);
  color: #fff;
}

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

.parlay-calc {
  display: grid;
  gap: 12px;
}

.parlay-panel {
  padding: 12px;
}

.section-hint {
  margin: -4px 0 10px;
}

.leg-stack {
  display: grid;
  gap: 8px;
}

.leg-card {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}

.leg-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dfe5ee;
  color: var(--muted);
  font-weight: 850;
}

.leg-index.done {
  background: var(--strong);
  color: #fff;
}

.leg-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.leg-main b,
.leg-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-main span {
  color: var(--muted);
  font-size: 12px;
}

.leg-odd {
  color: var(--strong);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.add-leg-btn,
.generate-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 8px;
  font-weight: 850;
}

.add-leg-btn {
  background: rgba(11, 95, 117, 0.1);
  color: var(--strong);
}

.generate-btn {
  background: var(--strong);
  color: #fff;
}

.generate-btn.secondary {
  background: rgba(11, 95, 117, 0.1);
  color: var(--strong);
}

.generate-btn:disabled {
  background: var(--panel-soft);
  color: var(--muted);
  cursor: default;
}

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

.result-box div {
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  display: grid;
  gap: 5px;
}

.result-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-box b {
  color: var(--strong);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.parlay-disclaimer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 0 2px 10px;
}

.match-pick-list,
.play-select-list,
.result-options {
  display: grid;
  gap: 8px;
}

.match-pick-item,
.play-select,
.result-option {
  width: 100%;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}

.match-pick-item {
  padding: 11px 12px;
  display: grid;
  gap: 4px;
}

.match-pick-item span {
  color: var(--muted);
  font-size: 12px;
}

.selected-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selected-match-head div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.selected-match-head span {
  color: var(--muted);
  font-size: 12px;
}

.selected-match-head b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-match-head button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(11, 95, 117, 0.1);
  color: var(--strong);
  font-weight: 850;
}

.play-select {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.play-select span {
  color: var(--muted);
  font-size: 12px;
}

.play-select.selected {
  background: var(--strong);
  color: #fff;
}

.play-select.selected span {
  color: rgba(255, 255, 255, 0.78);
}

.result-options {
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.result-option {
  min-height: 54px;
  padding: 7px 8px;
  display: grid;
  place-items: center;
  gap: 3px;
  text-align: center;
}

.result-option span {
  font-size: 12px;
  font-weight: 850;
}

.result-option b {
  color: var(--strong);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.result-option.selected {
  background: var(--accent);
  color: #fff;
}

.result-option.selected b {
  color: #fff;
}

.pick-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pick-match-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.pick-plays {
  display: grid;
  gap: 8px;
}

.pick-play {
  display: grid;
  gap: 6px;
}

.pick-play-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pick-play-title span {
  font-weight: 750;
}

.pick-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 6px;
}

.pick-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 5px 6px;
  background: var(--panel-soft);
  color: var(--strong);
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  gap: 1px;
  line-height: 1.05;
}

.pick-btn span {
  font-size: 11px;
  font-weight: 850;
}

.pick-btn b {
  font-size: 14px;
}

.pick-btn.selected {
  background: var(--accent);
  color: #fff;
}

.slip-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.remove-btn {
  background: #f7e9e7;
  color: var(--red);
  min-height: 32px;
}

.stake {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  margin: 10px 0;
}

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

  .filters input[type="search"] {
    grid-column: 1 / -1;
  }

  .match-card {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .signal {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-2,
  .parlay-grid {
    grid-template-columns: 1fr;
  }

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

  .kv {
    min-width: 0;
    padding: 8px 6px;
  }

  .kv .value {
    font-size: 14px;
  }

  .summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric {
    min-width: 0;
    padding: 8px 5px;
  }

  .metric b {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .pick-row {
    grid-template-columns: 1fr repeat(3, 62px);
  }

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