:root {
  color-scheme: dark;
  --bg: #101213;
  --panel: #181c1f;
  --panel-soft: #20262a;
  --line: #334047;
  --text: #f4f7f8;
  --muted: #a9b5ba;
  --accent: #27d48f;
  --accent-strong: #65e6b4;
  --warn: #f0b84f;
  --danger: #f06464;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(39, 212, 143, 0.08), transparent 34%),
    radial-gradient(circle at 85% 15%, rgba(240, 184, 79, 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0;
}

.scoreboard {
  display: grid;
  gap: 12px;
}

.tables-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.topbar,
.controls,
.summary-grid,
.results-panel {
  background: rgba(24, 28, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-nav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-nav a.is-active {
  color: #07110d;
  background: var(--accent);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.7rem, 5vw, 3.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(240, 184, 79, 0.12);
}

.status-pill.ok .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(39, 212, 143, 0.14);
}

.status-pill.error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(240, 100, 100, 0.16);
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.3fr) 48px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 38px;
  color: var(--text);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 212, 143, 0.14);
}

.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #07110d;
  background: var(--accent);
  border-radius: 6px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  color: var(--accent-strong);
  background: transparent;
  font-weight: 800;
}

.text-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-button {
  min-height: 32px;
  color: var(--danger);
  padding: 0 2px;
}

.danger-button:hover:not(:disabled),
.danger-button:focus-visible:not(:disabled) {
  color: #ff8a8a;
}

.panel-count {
  min-width: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 8px;
  overflow: hidden;
}

.summary-grid > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.summary-grid > div:last-child {
  border-right: 0;
}

.summary-grid span {
  display: block;
  min-height: 26px;
  font-size: 1.35rem;
  font-weight: 900;
}

.summary-grid p,
.match-meta,
.match-date {
  color: var(--muted);
}

.q4-signal-panel,
.bet-log-panel,
.results-panel {
  border-radius: 8px;
  overflow: hidden;
}

.q4-signal-panel,
.bet-log-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel);
}

.compact-panel > summary.panel-head {
  cursor: pointer;
  list-style: none;
}

.compact-panel > summary.panel-head::-webkit-details-marker {
  display: none;
}

.compact-panel > summary.panel-head::after {
  content: "Abrir";
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-panel[open] > summary.panel-head::after {
  content: "Fechar";
}

.q4-signal-content {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

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

.q4-pattern-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.q4-pattern-strip span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(10, 15, 16, 0.3);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.q4-pattern-compact-list {
  display: grid;
  gap: 5px;
}

.q4-pattern-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 86px minmax(160px, 1.4fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 15, 16, 0.28);
}

.q4-pattern-row span,
.q4-pattern-row small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q4-pattern-row span {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.q4-pattern-row strong {
  font-size: 0.82rem;
  text-align: right;
}

.q4-pattern-row small {
  font-size: 0.7rem;
}

.q4-pattern-tile,
.q4-pattern-card,
.comeback-signal-card,
.q4-signal-card,
.points-line-card,
.handicap-matchup-card,
.handicap-edge-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.q4-pattern-tile {
  padding: 10px 12px;
}

.q4-pattern-tile span,
.q4-pattern-card span,
.comeback-signal-card span,
.q4-signal-card span,
.points-line-card span,
.handicap-matchup-card span,
.handicap-edge-alert span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.q4-pattern-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
}

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

.q4-pattern-card,
.comeback-signal-card,
.q4-signal-card,
.points-line-card,
.handicap-matchup-card,
.handicap-edge-alert {
  display: block;
  padding: 10px 12px;
}

.q4-pattern-card strong,
.comeback-signal-card strong,
.q4-signal-card strong,
.points-line-card strong,
.handicap-matchup-card strong,
.handicap-edge-alert strong {
  display: block;
  margin: 4px 0;
}

.points-line-card {
  margin: 8px 0;
}

.q4-signal-card.is-positive-handicap-line {
  border-color: rgba(39, 212, 143, 0.78);
  background: linear-gradient(180deg, rgba(39, 212, 143, 0.16), rgba(10, 15, 16, 0.34));
  box-shadow: inset 3px 0 0 var(--accent), 0 10px 24px rgba(39, 212, 143, 0.08);
}

.q4-signal-card.is-positive-handicap-line > span,
.q4-signal-card.is-positive-handicap-line .q4-signal-details.is-positive-line {
  color: var(--accent-strong);
}

.handicap-matchup-card {
  margin: 8px 0;
  border-color: rgba(101, 230, 180, 0.3);
  background: rgba(101, 230, 180, 0.06);
}

.handicap-matchup-card > span {
  color: var(--accent-strong);
}

.handicap-matchup-card.is-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.handicap-matchup-card.is-empty > span {
  color: var(--muted);
}

.handicap-matchup-market {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.handicap-matchup-market.is-empty {
  color: var(--muted);
}

.handicap-matchup-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.handicap-matchup-market-head strong {
  margin: 0;
  font-size: 0.78rem;
}

.handicap-matchup-market-head span {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.handicap-matchup-market > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}

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

.handicap-matchup-rates > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(10, 15, 16, 0.35);
}

.handicap-matchup-rates strong,
.handicap-matchup-rates small {
  display: block;
}

.handicap-matchup-rates strong {
  margin: 2px 0;
  font-size: 1rem;
}

.handicap-matchup-rates small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handicap-edge-alert {
  margin: 8px 0;
  border-color: rgba(240, 184, 79, 0.72);
  background: linear-gradient(180deg, rgba(240, 184, 79, 0.18), rgba(39, 212, 143, 0.08));
  box-shadow: inset 3px 0 0 var(--warn), 0 10px 28px rgba(240, 184, 79, 0.1);
}

.handicap-edge-alert span {
  color: #ffd891;
}

.handicap-edge-alert strong {
  color: #ffe7b0;
}

.handicap-scenario-alert {
  overflow: hidden;
  border: 1px solid rgba(101, 230, 180, 0.34);
  border-radius: 7px;
  background: rgba(101, 230, 180, 0.06);
}

.handicap-scenario-alert.is-demanding {
  border-color: rgba(240, 100, 100, 0.58);
  background: rgba(240, 100, 100, 0.08);
}

.handicap-scenario-alert.is-neutral {
  border-color: rgba(240, 184, 79, 0.58);
  background: rgba(240, 184, 79, 0.08);
}

.handicap-scenario-alert.has-positive-line {
  border-color: rgba(39, 212, 143, 0.72);
  background: linear-gradient(180deg, rgba(39, 212, 143, 0.16), rgba(101, 230, 180, 0.06));
  box-shadow: inset 3px 0 0 var(--accent);
}

.handicap-scenario-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.handicap-scenario-head span {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.handicap-scenario-head strong {
  font-size: 0.74rem;
  text-align: right;
}

.handicap-scenario-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.handicap-scenario-row {
  min-width: 0;
  padding: 8px 9px;
  border-right: 1px solid var(--line);
}

.handicap-scenario-row:last-child {
  border-right: 0;
}

.handicap-scenario-row span,
.handicap-scenario-row strong,
.handicap-scenario-row small {
  display: block;
}

.handicap-scenario-row span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.handicap-scenario-row strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.handicap-scenario-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.handicap-scenario-row.is-protected small {
  color: var(--accent-strong);
}

.handicap-scenario-row.is-neutral small {
  color: #ffd891;
}

.handicap-scenario-row.is-demanding small {
  color: #ffaaaa;
}

.handicap-scenario-row.is-positive-line {
  background: rgba(39, 212, 143, 0.09);
  box-shadow: inset 3px 0 0 var(--accent);
}

.handicap-scenario-row.is-positive-line span,
.handicap-scenario-row.is-positive-line small {
  color: var(--accent-strong);
}

.finished-entry-card {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.finished-entry-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.finished-entry-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.bet-section-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bet-eligibility {
  display: inline-block;
  margin: 4px 0;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bet-eligibility.is-eligible {
  border: 1px solid rgba(101, 230, 180, 0.34);
  color: var(--accent-strong);
  background: rgba(101, 230, 180, 0.08);
}

.bet-eligibility.is-blocked {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.points-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.points-line-values {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.points-line-head strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.points-line-head .live-points-line {
  color: var(--muted);
  font-size: 0.78rem;
}

.points-line-head .live-points-line.is-alert {
  color: #ffd88a;
}

.points-line-handicap-head {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.points-line-details {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.points-value-signal {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 185, 82, 0.5);
  border-radius: 7px;
  background: rgba(245, 185, 82, 0.12);
}

.points-value-signal span {
  color: #ffd88a;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.points-value-signal strong {
  color: var(--text);
  font-size: 0.95rem;
}

.manual-entry-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.manual-handicap-controls {
  margin-top: 10px;
}

.entry-choice,
.manual-handicap-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.entry-choice {
  cursor: pointer;
}

.entry-choice.is-active,
.manual-handicap-toggle:has(input:checked) {
  border-color: rgba(101, 230, 180, 0.55);
  color: var(--text);
  background: rgba(101, 230, 180, 0.12);
}

.entry-choice:disabled,
.manual-handicap-toggle input:disabled + span {
  cursor: wait;
  opacity: 0.6;
}

.manual-handicap-toggle input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--accent);
}

.over-line-field {
  display: grid;
  grid-template-columns: 96px minmax(92px, 150px);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
}

.over-line-field span {
  font-size: 0.72rem;
}

.over-line-field input {
  min-height: 32px;
  padding: 0 10px;
  font-weight: 900;
}

.handicap-line-field {
  grid-template-columns: 118px minmax(92px, 150px);
}

.comeback-signal-card {
  border-color: rgba(101, 230, 180, 0.72);
  background: linear-gradient(180deg, rgba(39, 212, 143, 0.2), rgba(10, 15, 16, 0.42));
  box-shadow: 0 0 0 1px rgba(101, 230, 180, 0.12), 0 10px 26px rgba(39, 212, 143, 0.12);
}

.comeback-signal-card strong {
  color: var(--accent-strong);
}

.q4-signal-card {
  border-color: rgba(240, 184, 79, 0.45);
  background: linear-gradient(180deg, rgba(240, 184, 79, 0.14), rgba(10, 15, 16, 0.4));
}

.q4-signal-card strong {
  color: #ffe0a3;
}

.q4-signal-details {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.bet-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  gap: 6px;
  padding: 10px 12px 0;
}

.bet-panel-body.is-hidden,
.bet-tab-panel.is-hidden {
  display: none;
}

.bet-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px 0;
  border-top: 1px solid var(--line);
}

.bet-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.bet-tab.is-active {
  border-color: rgba(101, 230, 180, 0.45);
  color: var(--text);
  background: rgba(101, 230, 180, 0.12);
}

.bet-summary-grid > div,
.summary-more-grid > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.summary-primary-card {
  min-height: 54px;
}

.bet-summary-more {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.24);
  overflow: hidden;
}

.bet-summary-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  list-style: none;
  text-transform: uppercase;
}

.bet-summary-more > summary::-webkit-details-marker {
  display: none;
}

.bet-summary-more > summary span {
  color: var(--muted);
  font-size: 0.64rem;
}

.summary-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}

.bet-summary-grid .confidence-profit-box,
.results-summary-grid .confidence-profit-box {
  border-color: rgba(240, 184, 79, 0.28);
  background: rgba(240, 184, 79, 0.07);
}

.bet-summary-grid .aceodds-profit-box,
.results-summary-grid .aceodds-profit-box,
.profit-day-head .aceodds-profit-box {
  border-color: rgba(101, 230, 180, 0.38);
  background: rgba(101, 230, 180, 0.09);
}

.bet-summary-grid .last10-profit-box,
.results-summary-grid .last10-profit-box,
.profit-day-head .last10-profit-box {
  border-color: rgba(102, 181, 255, 0.38);
  background: rgba(102, 181, 255, 0.09);
}

.bet-summary-grid .version1-profit-box,
.results-summary-grid .version1-profit-box,
.profit-day-head .version1-profit-box {
  border-color: rgba(219, 139, 255, 0.38);
  background: rgba(219, 139, 255, 0.09);
}

.version1-signal-card {
  border-color: rgba(219, 139, 255, 0.45);
  background: linear-gradient(180deg, rgba(219, 139, 255, 0.13), rgba(10, 15, 16, 0.4));
}

.version1-signal-card strong {
  color: #edc6ff;
}

.bet-summary-grid .codex-profit-box,
.results-summary-grid .codex-profit-box,
.profit-day-head .codex-profit-box {
  border-color: rgba(255, 143, 102, 0.4);
  background: rgba(255, 143, 102, 0.09);
}

.bet-summary-grid .q4-edge-profit-box,
.results-summary-grid .q4-edge-profit-box,
.profit-day-head .q4-edge-profit-box {
  border-color: rgba(120, 219, 255, 0.42);
  background: rgba(120, 219, 255, 0.09);
}

.bet-summary-grid .time-profit-box,
.results-summary-grid .time-profit-box,
.profit-day-head .time-profit-box {
  border-color: rgba(126, 231, 135, 0.42);
  background: rgba(126, 231, 135, 0.09);
}

.bet-summary-grid .points-profit-box,
.results-summary-grid .points-profit-box,
.profit-day-head .points-profit-box {
  border-color: rgba(245, 185, 82, 0.42);
  background: rgba(245, 185, 82, 0.09);
}

.bet-summary-grid .value-profit-box,
.results-summary-grid .value-profit-box,
.summary-more-grid .value-profit-box,
.profit-day-head .value-profit-box {
  border-color: rgba(255, 215, 115, 0.42);
  background: rgba(255, 215, 115, 0.1);
}

.profit-day-head .value-profit-panel {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(86px, 0.85fr) minmax(0, 1.5fr);
  gap: 8px;
  align-items: stretch;
  padding: 8px;
}

.value-profit-main {
  min-width: 0;
}

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

.value-profit-splits span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  text-transform: none;
}

.value-profit-splits b {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1;
  text-transform: uppercase;
}

.value-profit-splits em {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.1;
}

.value-profit-splits small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
}

.codex-signal-card {
  border-color: rgba(255, 143, 102, 0.48);
  background: linear-gradient(180deg, rgba(255, 143, 102, 0.14), rgba(10, 15, 16, 0.4));
}

.codex-signal-card strong {
  color: #ffc1a8;
}

.q4-edge-signal-card {
  border-color: rgba(120, 219, 255, 0.5);
  background: linear-gradient(180deg, rgba(120, 219, 255, 0.13), rgba(10, 15, 16, 0.4));
}

.q4-edge-signal-card strong {
  color: #b8edff;
}

.time-signal-card {
  border-color: rgba(126, 231, 135, 0.5);
  background: linear-gradient(180deg, rgba(126, 231, 135, 0.13), rgba(10, 15, 16, 0.4));
}

.time-signal-card strong {
  color: #d2ffd6;
}

.bet-summary-grid span {
  display: block;
  font-size: 0.92rem;
  font-weight: 900;
}

.bet-summary-grid p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.18;
  text-transform: uppercase;
}

.bet-summary-more > summary span {
  display: inline;
  color: var(--muted);
  font-size: 0.64rem;
}

.bet-log-list {
  display: grid;
  gap: 5px;
  padding: 10px 12px 12px;
}

.bet-indications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  align-items: start;
}

.bet-indication-column {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.bet-indication-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.bet-indication-head strong {
  font-size: 0.78rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.bet-indication-head span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  white-space: nowrap;
}

.bet-indication-list {
  display: grid;
  gap: 4px;
  padding: 6px;
}

.value-method-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-top: 6px;
  border: 1px solid rgba(101, 230, 180, 0.18);
  border-radius: 8px;
  background: rgba(9, 18, 18, 0.42);
  overflow: hidden;
}

.value-method-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(101, 230, 180, 0.12);
  background: rgba(101, 230, 180, 0.055);
}

.value-method-head > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.value-method-head strong {
  font-size: 0.82rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.value-method-head span,
.value-method-list-title span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.value-method-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.value-method-stats span {
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  white-space: nowrap;
}

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

.value-method-list-block {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.value-method-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.value-method-list-title strong {
  font-size: 0.72rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.value-method-list-block .bet-indication-list {
  max-height: 420px;
  overflow: auto;
}

.empty-state-compact {
  padding: 10px 8px;
  font-size: 0.76rem;
}

.manual-entries-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.handicap-analysis-list {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.manual-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.manual-summary-grid > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.manual-summary-grid span {
  display: block;
  font-weight: 900;
}

.manual-summary-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profit-results-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.results-page {
  gap: 12px;
}

.results-filter-panel,
.results-history-panel,
.results-summary-grid {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(24, 28, 31, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.results-filter-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.market-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 6px;
  padding: 10px 12px 0;
}

.market-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(10, 15, 16, 0.34);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.market-filter.is-active {
  border-color: rgba(101, 230, 180, 0.55);
  color: var(--text);
  background: rgba(101, 230, 180, 0.12);
}

.results-filter-controls {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
}

.results-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0;
}

.results-summary-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.results-summary-grid > div:last-child {
  border-right: 0;
}

.results-summary-grid span {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
}

.results-summary-grid p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bet-results-table {
  display: grid;
  padding: 10px 12px 12px;
}

.bet-result-head,
.bet-result-row {
  display: grid;
  grid-template-columns: 132px minmax(220px, 1.45fr) minmax(150px, 1fr) 96px 86px;
  gap: 8px;
  align-items: center;
}

.bet-result-head {
  padding: 0 8px 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bet-result-row {
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 15, 16, 0.34);
}

.bet-result-row + .bet-result-row {
  margin-top: 5px;
}

.bet-result-row.is-won {
  border-color: rgba(101, 230, 180, 0.42);
}

.bet-result-row.is-lost {
  border-color: rgba(240, 100, 100, 0.42);
}

.bet-result-row.is-pending {
  border-color: rgba(245, 185, 82, 0.34);
}

.bet-result-cell {
  min-width: 0;
}

.bet-result-cell span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.bet-result-cell strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-result-cell.is-profit {
  text-align: right;
}

.results-profit-head {
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
}

.profit-day-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
  overflow: hidden;
}

.profit-day-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.profit-day-head span,
.profit-result-row span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.profit-day-head strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
}

.profit-result-rows {
  display: grid;
}

.profit-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, 72px);
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.profit-result-row + .profit-result-row {
  border-top: 1px solid var(--line);
}

.bet-record {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.bet-record span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bet-record strong {
  display: block;
  margin-top: 4px;
}

.bet-record-compact {
  grid-template-columns: 88px minmax(108px, 0.95fr) minmax(130px, 1.15fr) 86px minmax(160px, 1.45fr);
  grid-template-areas: "status market pick result game";
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  min-height: 44px;
}

.bet-record-compact strong {
  margin-top: 0;
  font-size: 0.82rem;
  line-height: 1.2;
}

.bet-record-compact span {
  font-size: 0.64rem;
  line-height: 1.2;
}

.bet-status-chip {
  grid-area: status;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}

.bet-record.is-won .bet-status-chip {
  border-color: rgba(101, 230, 180, 0.5);
  color: var(--accent-strong);
  background: rgba(101, 230, 180, 0.1);
}

.bet-record.is-lost .bet-status-chip {
  border-color: rgba(240, 100, 100, 0.5);
  color: #ff9a9a;
  background: rgba(240, 100, 100, 0.1);
}

.bet-record.is-pending .bet-status-chip {
  border-color: rgba(245, 185, 82, 0.42);
  color: #ffd891;
  background: rgba(245, 185, 82, 0.08);
}

.bet-record-market,
.bet-record-pick,
.bet-record-result,
.bet-record-game {
  min-width: 0;
}

.bet-record-market {
  grid-area: market;
}

.bet-record-pick {
  grid-area: pick;
}

.bet-record-result {
  grid-area: result;
}

.bet-record-game {
  grid-area: game;
}

.bet-record-market span,
.bet-record-pick span,
.bet-record-result span,
.bet-record-game span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bet-record-market strong,
.bet-record-pick strong,
.bet-record-result strong,
.bet-record-game strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-handicap-line-chip {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 22px;
  margin: 3px 0 2px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.74rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.value-handicap-line-chip.is-plus {
  border-color: rgba(101, 230, 180, 0.68);
  color: #9ff2cf !important;
  background: rgba(39, 212, 143, 0.13);
}

.value-handicap-line-chip.is-minus {
  border-color: rgba(240, 100, 100, 0.7);
  color: #ffb0a8 !important;
  background: rgba(240, 100, 100, 0.14);
}

.value-handicap-line-chip.is-neutral {
  color: var(--muted) !important;
  background: rgba(255, 255, 255, 0.05);
}

.bet-record-result {
  text-align: right;
}

.bet-indication-list .bet-record-compact {
  grid-template-columns: 58px minmax(0, 1fr) 64px;
  grid-template-areas:
    "status pick result"
    "game game game";
  gap: 2px 5px;
  min-height: 44px;
  padding: 4px 5px;
  border-radius: 6px;
}

.bet-indication-list .bet-record-compact strong {
  font-size: 0.7rem;
  line-height: 1.08;
}

.bet-indication-list .bet-record-compact span {
  font-size: 0.55rem;
  line-height: 1.08;
}

.bet-indication-list .bet-status-chip {
  justify-self: stretch;
  min-height: 18px;
  padding: 0 3px;
}

.bet-indication-list .bet-record-market {
  display: none;
}

.bet-indication-list .bet-record-game span {
  display: none;
}

.bet-indication-list .bet-record-game strong {
  color: var(--muted);
  font-size: 0.62rem;
}

.bet-record.is-won {
  border-color: rgba(101, 230, 180, 0.45);
}

.bet-record.is-lost {
  border-color: rgba(240, 100, 100, 0.45);
}

.bet-record.is-pending {
  border-color: rgba(245, 185, 82, 0.38);
}

.manual-entry-record {
  margin-top: 0;
}

.handicap-analysis-section {
  display: grid;
  gap: 8px;
}

.handicap-analysis-section h3 {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.handicap-analysis-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.handicap-analysis-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.handicap-analysis-card strong {
  display: block;
  margin-top: 4px;
}

.profit-positive {
  color: var(--accent-strong);
}

.profit-negative {
  color: var(--danger);
}

.profit-neutral {
  color: var(--muted);
}

.history-page {
  gap: 12px;
}

.history-toolbar,
.history-summary-grid,
.history-player-panel,
.history-detail-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(24, 28, 31, 0.9);
  box-shadow: var(--shadow);
}

.history-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.history-summary-card {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.history-summary-card:last-child {
  border-right: 0;
}

.history-summary-card span,
.history-stat-card span,
.history-player-row small,
.history-recent-row span,
.history-table small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.history-summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.22rem;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.history-player-panel,
.history-detail-panel {
  overflow: hidden;
}

.history-player-search {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 16, 0.28);
}

.history-player-search label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-player-search input {
  width: 100%;
  min-height: 38px;
}

.history-player-list {
  display: grid;
  max-height: calc(100vh - 285px);
  overflow: auto;
  padding: 10px;
  gap: 7px;
}

.history-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(10, 15, 16, 0.34);
  text-align: left;
  cursor: pointer;
}

.history-player-row:hover,
.history-player-row.is-active {
  border-color: rgba(101, 230, 180, 0.55);
  background: rgba(101, 230, 180, 0.1);
}

.history-player-row strong {
  display: block;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-metric {
  text-align: right;
}

.history-detail-panel {
  min-height: 420px;
}

.history-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.history-detail-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.history-detail-head > span {
  padding: 5px 9px;
  border: 1px solid rgba(101, 230, 180, 0.36);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.history-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.history-stat-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.34);
}

.history-stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.history-stat-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-section {
  display: grid;
  border-top: 1px solid var(--line);
}

.history-table-wrap {
  overflow-x: auto;
  padding: 10px 12px 12px;
}

.history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.history-table th {
  padding: 0 9px 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.history-table td {
  padding: 8px 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 16, 0.34);
  font-size: 0.84rem;
  font-weight: 800;
}

.history-table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 7px 0 0 7px;
}

.history-table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
}

.history-table td strong {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-recent-list {
  display: grid;
  gap: 7px;
  padding: 10px 12px 12px;
}

.history-recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.9fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 15, 16, 0.34);
}

.history-recent-row strong {
  display: block;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-recent-row > div:last-child {
  text-align: right;
}

.history-empty {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.is-positive {
  color: var(--accent-strong);
}

.is-negative {
  color: var(--danger);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.results-list {
  display: grid;
}

.finished-panel .results-list {
  max-height: min(760px, calc(100vh - 240px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(101, 230, 180, 0.42) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.finished-results-table {
  display: grid;
  overflow-x: auto;
}

.finished-table-head,
.finished-result-row {
  display: grid;
  grid-template-columns: 68px minmax(140px, 1.45fr) 64px 104px minmax(78px, 0.82fr) minmax(92px, 0.95fr);
  align-items: center;
  gap: 8px;
  min-width: 700px;
}

.finished-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(10, 15, 16, 0.96);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.finished-result-row {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.finished-result-row:hover {
  background: rgba(101, 230, 180, 0.045);
}

.finished-cell {
  min-width: 0;
}

.finished-cell > span {
  display: none;
}

.finished-cell strong {
  display: block;
  min-width: 0;
}

.finished-matchup span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.finished-matchup strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finished-matchup em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.finished-score strong {
  color: var(--accent-strong);
  font-size: 1rem;
  text-align: center;
}

.finished-q4 {
  align-self: stretch;
}

.q4-winner-badge {
  display: grid;
  min-height: 46px;
  align-content: center;
  justify-items: center;
  gap: 1px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  line-height: 1.05;
  text-align: center;
}

.q4-winner-badge.is-home {
  border-color: rgba(101, 230, 180, 0.58);
  background: linear-gradient(180deg, rgba(101, 230, 180, 0.2), rgba(101, 230, 180, 0.07));
  box-shadow: inset 0 0 0 1px rgba(101, 230, 180, 0.08);
}

.q4-winner-badge.is-away {
  border-color: rgba(128, 207, 255, 0.58);
  background: linear-gradient(180deg, rgba(128, 207, 255, 0.2), rgba(128, 207, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(128, 207, 255, 0.08);
}

.q4-winner-badge.is-draw,
.q4-winner-badge.is-muted {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.q4-winner-badge.is-handicap-decided {
  outline: 1px solid rgba(245, 185, 82, 0.34);
  outline-offset: -3px;
}

.q4-winner-side {
  font-size: 0.92rem;
  font-weight: 950;
  text-transform: uppercase;
}

.q4-winner-badge.is-home .q4-winner-side {
  color: var(--accent-strong);
}

.q4-winner-badge.is-away .q4-winner-side {
  color: #9edcff;
}

.q4-winner-score {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
}

.q4-winner-note {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.q4-winner-badge.is-handicap-decided .q4-winner-note {
  color: #ffd88a;
}

.result-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
  font-weight: 900;
}

.result-badge.is-home,
.result-badge.is-away,
.result-badge.is-confirmed {
  border-color: rgba(101, 230, 180, 0.32);
  color: var(--accent-strong);
  background: rgba(101, 230, 180, 0.08);
}

.result-badge.is-handicap {
  border-color: rgba(245, 185, 82, 0.34);
  color: #ffd88a;
  background: rgba(245, 185, 82, 0.1);
}

.result-badge.is-corrected {
  border-color: rgba(245, 185, 82, 0.5);
  color: #ffd88a;
}

.result-badge.is-pending,
.result-badge.is-muted,
.result-badge.is-draw {
  color: var(--muted);
}

.finished-result-row .finished-entry-summary {
  margin: 0;
  gap: 6px;
}

.finished-entry-summary small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finished-result-detail {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 16, 0.34);
}

.finished-period-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.finished-period-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.74rem;
  font-weight: 800;
}

.finished-period-summary b {
  color: var(--text);
}

.finished-period-summary .is-total {
  border-color: rgba(101, 230, 180, 0.22);
  color: var(--accent-strong);
}

.match-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 180ms ease, border-color 180ms ease;
}

.match-card:last-child {
  border-bottom: 0;
}

.match-card.is-new {
  background: rgba(39, 212, 143, 0.1);
  border-color: rgba(39, 212, 143, 0.35);
}

.match-card.has-handicap-edge {
  background: linear-gradient(90deg, rgba(240, 184, 79, 0.12), rgba(24, 28, 31, 0.88) 42%);
  box-shadow: inset 4px 0 0 var(--warn);
}

.match-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.match-content {
  min-width: 0;
}

.team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team.away {
  justify-content: flex-end;
}

.team strong {
  overflow-wrap: anywhere;
}

.team.is-q4-edge-pick {
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: 8px;
  outline: 1px solid rgba(120, 219, 255, 0.72);
  background: linear-gradient(180deg, rgba(120, 219, 255, 0.22), rgba(31, 112, 168, 0.18));
  box-shadow: 0 0 0 1px rgba(120, 219, 255, 0.12), 0 8px 20px rgba(36, 145, 214, 0.18);
}

.team.is-q4-edge-pick strong {
  color: #d9f5ff;
}

.team.is-time-pick {
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: 8px;
  outline: 1px solid rgba(101, 230, 180, 0.72);
  background: linear-gradient(180deg, rgba(101, 230, 180, 0.22), rgba(22, 139, 104, 0.18));
  box-shadow: 0 0 0 1px rgba(101, 230, 180, 0.12), 0 8px 20px rgba(39, 212, 143, 0.18);
}

.team.is-time-pick strong {
  color: #d8ffef;
}

.team.is-q4-edge-pick.is-time-pick {
  outline-color: rgba(120, 219, 255, 0.72);
  background:
    linear-gradient(90deg, rgba(101, 230, 180, 0.26), transparent 5px),
    linear-gradient(180deg, rgba(120, 219, 255, 0.22), rgba(31, 112, 168, 0.18));
  box-shadow:
    inset 4px 0 0 rgba(101, 230, 180, 0.78),
    0 0 0 1px rgba(120, 219, 255, 0.12),
    0 8px 20px rgba(36, 145, 214, 0.18);
}

.team.is-q4-edge-pick.is-time-pick strong {
  color: #effff8;
}

.team img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.score-stack {
  display: grid;
  gap: 4px;
  min-width: 124px;
}

.score {
  padding: 8px 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #111719, #0a0f10);
  border: 1px solid rgba(101, 230, 180, 0.2);
  text-align: center;
  font-weight: 900;
  font-size: 1.15rem;
}

.points-under-live-alert:empty {
  display: none;
}

.points-under-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(101, 230, 180, 0.28);
  border-radius: 5px;
  background: rgba(9, 18, 18, 0.72);
  color: rgba(216, 255, 239, 0.92);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.points-under-pill strong {
  color: #f4fff9;
  font-size: 0.76rem;
  line-height: 1;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.points-under-pill span {
  color: rgba(154, 230, 202, 0.78);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.match-meta {
  grid-column: 2;
  display: grid;
  gap: 7px;
  text-align: left;
  line-height: 1.35;
}

.match-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.match-meta-line > span {
  font-size: 0.76rem;
  font-weight: 800;
}

.match-accordion {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 15, 16, 0.22);
  overflow: hidden;
}

.match-accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  list-style: none;
  text-transform: uppercase;
}

.match-accordion > summary::-webkit-details-marker {
  display: none;
}

.match-accordion > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 0.92rem;
}

.match-accordion[open] > summary::after {
  content: "-";
}

.match-accordion > summary strong {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-align: center;
  font-size: 0.68rem;
}

.match-accordion-body,
.match-signal-list {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.match-signal-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.match-signal-list .q4-signal-card,
.match-signal-list .comeback-signal-card {
  margin: 0;
  padding: 7px 8px;
}

.match-signal-list .q4-signal-card span,
.match-signal-list .comeback-signal-card span {
  font-size: 0.62rem;
}

.match-signal-list .q4-signal-card strong,
.match-signal-list .comeback-signal-card strong {
  margin: 2px 0;
  font-size: 0.78rem;
}

.match-signal-list .q4-signal-details {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.68rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.market-accordion .points-line-card,
.market-accordion .handicap-matchup-card {
  margin: 0;
}

.match-compact-note {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  font-weight: 800;
}

.match-details-link {
  width: fit-content;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.handicap-winner {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 8px;
  border-radius: 6px;
  color: #07110d;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 22px rgba(39, 212, 143, 0.18);
}

.period-board {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(10, 15, 16, 0.42);
}

.period-row {
  display: grid;
  grid-template-columns: minmax(108px, 1.4fr) repeat(7, minmax(36px, 0.42fr));
  min-width: 410px;
  align-items: center;
}

.period-row span {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 5px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 800;
}

.period-row span[hidden] {
  display: none !important;
}

.period-row span:first-child {
  justify-items: start;
  color: var(--text);
  font-weight: 800;
}

.period-row span:last-child {
  border-right: 0;
}

.period-row:last-child span {
  border-bottom: 0;
}

.period-head span {
  min-height: 26px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.period-row .period-total {
  color: var(--accent-strong);
  background: rgba(39, 212, 143, 0.08);
}

.period-row .period-leader {
  color: #07110d;
  background: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.period-row .period-total.period-leader {
  color: #07110d;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
}

.period-row .period-empty {
  color: var(--muted);
  font-weight: 700;
}

.period-average {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
}

.period-average strong {
  color: var(--accent-strong);
  font-size: 0.86rem;
}

.period-average small {
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-average .period-q4-player-average {
  flex-basis: 100%;
  margin-left: 0;
  color: var(--accent-strong);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.period-average-empty {
  color: var(--muted);
}

.empty-state {
  padding: 28px 20px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .app-nav,
  .status-pill {
    width: 100%;
  }

  .app-nav a {
    justify-content: center;
    flex: 1;
  }

  .controls,
  .results-filter-controls,
  .q4-pattern-grid,
  .q4-pattern-list,
  .bet-summary-grid,
  .manual-summary-grid,
  .bet-record,
  .value-method-lists,
  .handicap-analysis-card,
  .profit-day-head,
  .tables-grid,
  .match-card,
  .history-toolbar,
  .history-summary-grid,
  .history-layout,
  .history-stat-grid {
    grid-template-columns: 1fr;
  }

  .profit-result-row {
    grid-template-columns: 1fr 82px;
  }

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

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

  .bet-summary-more {
    grid-column: 1 / -1;
  }

  .results-summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bet-result-head {
    display: none;
  }

  .bet-result-row {
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-areas:
      "time profit"
      "game game"
      "pick status";
    gap: 5px 8px;
  }

  .bet-result-cell.is-time {
    grid-area: time;
  }

  .bet-result-cell.is-game {
    grid-area: game;
  }

  .bet-result-cell:nth-child(3) {
    grid-area: pick;
  }

  .bet-result-cell:nth-child(4) {
    grid-area: status;
    text-align: right;
  }

  .bet-result-cell.is-profit {
    grid-area: profit;
  }

  .bet-record-compact {
    grid-template-columns: 76px minmax(0, 1fr) 72px;
    grid-template-areas:
      "status pick result"
      "market game game";
    gap: 5px 8px;
    min-height: 64px;
    padding: 7px 8px;
  }

  .bet-status-chip {
    justify-self: stretch;
    min-height: 22px;
    padding: 0 5px;
  }

  .bet-record-result {
    text-align: right;
  }

  .bet-record-market strong,
  .bet-record-game strong {
    font-size: 0.76rem;
  }

  .bet-indications-grid {
    grid-template-columns: 1fr;
  }

  .bet-indication-list .bet-record-compact {
    grid-template-columns: 58px minmax(0, 1fr) 64px;
    min-height: 44px;
  }

  .match-main {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .team.away,
  .match-meta {
    grid-column: auto;
    justify-content: flex-start;
    text-align: left;
  }

  .score {
    width: 100%;
  }

  .finished-table-head {
    display: none;
  }

  .finished-result-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    padding: 12px;
  }

  .finished-matchup,
  .finished-entry-summary {
    grid-column: 1 / -1;
  }

  .finished-cell > span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .finished-score strong {
    text-align: left;
  }

  .finished-result-detail {
    padding: 10px 12px 12px;
  }

  .history-summary-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-summary-card:last-child {
    border-bottom: 0;
  }

  .history-player-list {
    max-height: 360px;
  }

  .history-recent-row {
    grid-template-columns: 1fr;
  }

  .history-recent-row > div:last-child {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 16px, 1280px);
    padding: 8px 0;
  }

  .topbar,
  .controls,
  .summary-grid > div,
  .match-card {
    padding: 12px;
  }

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

  .summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid > div:last-child {
    border-bottom: 0;
  }
}
