:root {
  color-scheme: light;
  --bg: #eef1ec;
  --ink: #1c1b18;
  --muted: #827b70;
  --line: #2a2823;
  --soft-line: #d8d0c2;
  --panel: #fbf7ed;
  --panel-strong: #fffaf0;
  --gold: #c8a24a;
  --green: #17684f;
  --red: #a72a32;
  --blue: #244f80;
  --focus: #1f5eff;
  --shadow: 0 18px 42px rgba(34, 30, 23, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.masthead {
  text-align: center;
  padding: 12px 0 8px;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.masthead p,
.small,
.message,
.feed-status {
  color: var(--muted);
}

.masthead p {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 12px 0 18px;
}

.tab-set {
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logout-button {
  grid-column: 3;
  justify-self: end;
}

.tab,
.secondary-button,
.secondary-link,
.link-button,
#submitButton {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-weight: 850;
}

.tab {
  padding: 8px 16px;
  color: var(--ink);
  background: transparent;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.hidden {
  display: none !important;
}

.entrant,
.auth-card,
.actions,
.report-section,
.feed-status,
.pick-report {
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.entrant {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.auth-splash {
  display: grid;
  place-items: start center;
}

.auth-card {
  width: min(520px, 100%);
  padding: 22px;
}

.admin-page .masthead {
  padding-top: 28px;
}

.admin-login {
  margin-bottom: 18px;
}

.auth-panel {
  display: none;
  margin-top: 18px;
}

.auth-panel.active {
  display: block;
}

.auth-fields,
.login-auth-fields,
.create-auth-fields,
.reset-auth-fields,
.reset-confirm-fields {
  grid-template-columns: 1fr;
}

.primary-auth-button {
  width: 100%;
  justify-content: center;
  color: #fff;
  background: var(--line);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}

.reset-auth-fields {
  align-items: stretch;
}

.auth-message {
  margin: 12px 0 0;
  text-align: left;
}

.auth-message a {
  color: var(--green);
  font-weight: 900;
}

h2,
h3,
h4,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 4px;
}

.small {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.entry-badge {
  justify-self: start;
  min-width: 92px;
  padding: 8px 10px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.entry-badge.submitted {
  background: var(--green);
}

.entry-badge.locked {
  background: var(--red);
}

.fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: end;
  gap: 12px;
}

.entrant-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid #cfc5b4;
  border-radius: 6px;
}

input:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 94, 255, 0.25);
  outline-offset: 2px;
  border-color: var(--focus);
}

.secondary-button {
  padding: 8px 13px;
  color: var(--ink);
  background: #f6ecd7;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  color: var(--ink);
  background: #f6ecd7;
  text-decoration: none;
}

.link-button {
  margin-top: 10px;
  padding: 0;
  min-height: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scoring {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.score-chip {
  min-height: 68px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.score-chip strong,
.score-chip span {
  display: block;
}

.score-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.score-chip.bonus {
  border-color: rgba(200, 162, 74, 0.55);
}

.bracket {
  --match-card-h: 172px;
  --match-gap: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  scroll-snap-type: x proximity;
}

.round {
  position: relative;
  min-width: 0;
  padding: 0;
  scroll-snap-align: start;
}

.round-header,
.report-head,
.actions,
.pick-report-heading,
.pick-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.round-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 46px;
  margin-bottom: 12px;
  padding: 0 4px 9px 0;
  background: linear-gradient(180deg, var(--bg) 78%, rgba(238, 241, 236, 0));
  border-bottom: 2px solid rgba(200, 162, 74, 0.45);
}

.round-header h2,
.report-head h2 {
  margin-bottom: 0;
}

.round-header span,
.pick-report-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.matches {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--match-gap);
  height: auto;
  min-height: 0;
  align-content: start;
}

.round:nth-child(2) .matches {
  padding-top: calc((var(--match-card-h) + var(--match-gap)) / 2);
  gap: calc(var(--match-card-h) + (var(--match-gap) * 2));
}

.round:nth-child(3) .matches {
  padding-top: calc((var(--match-card-h) * 1.5) + (var(--match-gap) * 1.5));
  gap: calc((var(--match-card-h) * 3) + (var(--match-gap) * 4));
}

.round:nth-child(4) .matches {
  padding-top: calc((var(--match-card-h) * 3.5) + (var(--match-gap) * 3.5));
}

.match {
  position: relative;
  height: var(--match-card-h);
  padding: 9px 10px;
  background: rgba(255, 250, 240, 0.78);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(34, 30, 23, 0.08);
  overflow: hidden;
}

.match-title {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  line-height: 1.15;
}

.match-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick-teams {
  display: grid;
  gap: 5px;
}

.team-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
  align-items: stretch;
}

.team-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 33px;
  padding: 4px 7px;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid #cfc5b4;
  border-radius: 6px;
  font-size: 0.79rem;
  font-weight: 850;
  line-height: 1.05;
  text-align: left;
}

.team-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-button.selected {
  color: #fff;
  background: var(--green);
  border-color: #0f4d39;
}

.team-button.eliminated {
  opacity: 0.58;
}

.team-button.eliminated span {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.team-button.eliminated .flag-mini {
  filter: grayscale(1);
}

.team-button:disabled,
#submitButton:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.flag-mini {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(42, 40, 35, 0.28);
}

.score-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.score-input {
  display: block;
  position: relative;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.score-input span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.score-input input {
  min-height: 33px;
  padding: 4px 2px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 900;
}

.pen-toggle {
  display: flex;
  align-items: center;
  min-height: 26px;
  padding: 0 7px;
  color: var(--ink);
  background: #f6ecd7;
  border: 1px solid #cfc5b4;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
}

.pen-toggle input {
  width: auto;
  min-height: 0;
  margin: 0 6px 0 0;
}

.match-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.match-final span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-actual {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--soft-line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.match-actual span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-final strong {
  flex: none;
  color: var(--ink);
}

.waiting,
.empty-state {
  min-height: 46px;
  padding: 12px;
  color: var(--muted);
  background: #eee4d1;
  border-radius: 6px;
  font-weight: 850;
}

.actions {
  margin-top: 14px;
  padding: 14px;
  position: sticky;
  bottom: 10px;
  z-index: 5;
  backdrop-filter: blur(8px);
}

#submitButton {
  min-width: 150px;
  padding: 9px 16px;
  color: #fff;
  background: var(--red);
  border-color: #7e1d25;
}

.draft-button {
  min-width: 130px;
}

.draft-button:not(:disabled) {
  background: #e7f0ec;
  border-color: rgba(23, 104, 79, 0.55);
}

.message {
  margin-bottom: 0;
  font-weight: 800;
  text-align: right;
}

.message.error {
  color: #8d1f26;
}

.message.success {
  color: #0f5e44;
}

.report-head {
  margin: 4px 0 12px;
}

.feed-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 750;
}

.live-banner {
  margin: 14px 0;
  padding: 14px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.live-banner-head,
.live-banner-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.live-match-teams strong {
  text-align: center;
  white-space: nowrap;
}

.live-banner-head {
  margin-bottom: 12px;
}

.live-banner-head strong,
.live-banner-head span {
  display: block;
}

.live-banner-head span:not(.live-pill),
.live-banner-panel h3 {
  color: var(--muted);
}

.live-pill {
  padding: 6px 10px;
  color: #fffaf0;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.live-banner-grid {
  align-items: stretch;
}

.live-banner-panel {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px;
  background: rgba(246, 236, 215, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.live-banner-panel h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.live-score-row {
  min-height: 28px;
  padding: 4px 0;
  border-top: 1px solid var(--soft-line);
}

.live-score-row strong {
  font-weight: 400;
}

.live-standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.live-standings-table th {
  padding: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.live-standings-table .pts,
.live-standings-table .delta {
  text-align: right;
}

.live-standings-table td {
  padding: 4px 0;
  border-top: 1px solid var(--soft-line);
  font-weight: 400;
  white-space: nowrap;
}

.live-standings-table td.rank {
  color: var(--muted);
  width: 1%;
  padding-right: 6px;
}

.live-standings-table td.name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.live-standings-table td.pts {
  font-weight: 800;
  padding-left: 10px;
}

.live-standings-table td.delta {
  color: var(--muted);
  padding-left: 8px;
}

.prediction-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.prediction-comparison-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 9px 10px;
  background: rgba(246, 236, 215, 0.68);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.prediction-comparison-item strong {
  font-size: 1.2rem;
}

.prediction-comparison-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: right;
}

.predictions-table td:nth-child(5),
.predictions-table td:nth-child(6) {
  font-weight: 900;
}

.market-edge-chart {
  display: grid;
  gap: 7px;
  margin: 10px 0 16px;
  padding: 12px;
  background: rgba(246, 236, 215, 0.62);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.market-edge-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(160px, 1fr) 46px;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.market-edge-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-edge-track {
  position: relative;
  height: 18px;
  overflow: hidden;
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(37, 34, 29, 0.16);
  border-radius: 999px;
}

.market-edge-zero {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 2px;
  height: 24px;
  background: rgba(37, 34, 29, 0.38);
}

.market-edge-bar {
  position: absolute;
  top: 3px;
  height: 10px;
  border-radius: 999px;
}

.market-edge-row.ahead .market-edge-bar {
  background: var(--green);
}

.market-edge-row.behind .market-edge-bar {
  background: var(--red);
}

.market-edge-value {
  color: var(--ink);
  font-size: 0.84rem;
  text-align: right;
  white-space: nowrap;
}

.market-baseline-row {
  color: var(--muted);
}

.market-baseline-row .market-edge-name,
.market-baseline-row .market-edge-value {
  color: var(--muted);
}

.market-edge-market-label {
  position: absolute;
  left: calc(50% + 7px);
  top: 1px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.profile-chart-panel {
  margin: 10px 0 16px;
  padding: 12px;
  background: rgba(246, 236, 215, 0.62);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.profile-chart-note {
  max-width: 900px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.profile-scatter {
  position: relative;
  height: 320px;
  overflow: visible;
  background:
    linear-gradient(to right, rgba(37, 34, 29, 0.11) 1px, transparent 1px) 0 0 / 25% 100%,
    linear-gradient(to top, rgba(37, 34, 29, 0.11) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(37, 34, 29, 0.16);
  border-radius: 8px;
}

.profile-scatter::before,
.profile-scatter::after {
  content: "";
  position: absolute;
  background: rgba(37, 34, 29, 0.22);
}

.profile-scatter::before {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
}

.profile-scatter::after {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
}

.profile-axis-label,
.profile-quadrant {
  position: absolute;
  color: rgba(37, 34, 29, 0.56);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  pointer-events: none;
}

.profile-axis-y {
  left: 10px;
  top: 8px;
}

.profile-axis-x {
  right: 10px;
  bottom: 8px;
}

.profile-q-safe {
  right: 12px;
  top: 10px;
}

.profile-q-sharp {
  left: 12px;
  top: 34px;
}

.profile-q-chaos {
  left: 12px;
  bottom: 10px;
}

.profile-point {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, 50%);
}

.profile-dot {
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 950;
  border: 2px solid rgba(255, 250, 240, 0.94);
  border-radius: 999px;
  box-shadow: 0 9px 20px rgba(37, 34, 29, 0.18);
  cursor: default;
}

.profile-name-chip {
  max-width: 110px;
  overflow: hidden;
  padding: 3px 7px;
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(37, 34, 29, 0.16);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(37, 34, 29, 0.12);
}

.profile-dot.ahead,
.profile-dot-sample.ahead {
  background: var(--green);
}

.profile-dot.behind,
.profile-dot-sample.behind {
  background: var(--red);
}

.profile-dot-sample.neutral {
  background: var(--gold);
}

.profile-dot-sample.market {
  background: var(--gold);
  border-radius: 3px;
  transform: rotate(45deg);
}

.profile-market-point {
  z-index: 3;
}

.profile-market-diamond {
  width: 18px;
  height: 18px;
  background: var(--gold);
  border: 2px solid rgba(255, 250, 240, 0.94);
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(37, 34, 29, 0.18);
  transform: rotate(45deg);
}

.profile-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: none;
  min-width: 260px;
  max-width: min(320px, 80vw);
  padding: 10px 12px;
  background: #211f1b;
  color: #fff7e8;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  border: 1px solid rgba(255, 250, 240, 0.25);
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(37, 34, 29, 0.28);
  transform: translateX(-50%);
}

.profile-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  background: #211f1b;
  transform: translate(-50%, -5px) rotate(45deg);
}

.profile-tooltip strong,
.profile-tooltip span {
  display: block;
}

.profile-tooltip strong {
  margin-bottom: 6px;
  color: #fff7e8;
  font-size: 0.92rem;
}

.profile-tooltip span {
  color: rgba(255, 247, 232, 0.84);
}

.profile-point:hover,
.profile-point:focus-within {
  z-index: 8;
}

.profile-point:hover .profile-tooltip,
.profile-point:focus-within .profile-tooltip {
  display: block;
}

.profile-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.profile-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.profile-dot-sample {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.expected-timeline-panel {
  margin: 10px 0 16px;
  padding: 12px;
  background: rgba(246, 236, 215, 0.62);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.expected-timeline-chart {
  overflow-x: auto;
  padding-bottom: 4px;
}

.expected-timeline-svg {
  display: block;
  min-width: 820px;
  width: 100%;
  height: auto;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(37, 34, 29, 0.16);
  border-radius: 8px;
}

.expected-grid {
  stroke: rgba(37, 34, 29, 0.12);
  stroke-width: 1;
}

.expected-axis {
  stroke: rgba(37, 34, 29, 0.35);
  stroke-width: 1.2;
}

.expected-axis-text,
.expected-axis-label,
.expected-step-label,
.expected-line-label {
  fill: rgba(37, 34, 29, 0.58);
  font-size: 11px;
  font-weight: 850;
}

.expected-step-label {
  text-anchor: end;
}

.expected-line-label {
  font-size: 10px;
  font-weight: 950;
  dominant-baseline: middle;
}

.expected-line-label.market {
  font-style: italic;
}

.expected-line-label.overlay-label {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.62;
}

.expected-line-label.up {
  font-weight: 1000;
}

.expected-line-label.down {
  opacity: 0.76;
}

.expected-label-leader {
  stroke-width: 1.1;
  stroke-linecap: round;
  opacity: 0.42;
}

.expected-label-leader.overlay-label-leader {
  stroke-dasharray: 2 2;
  opacity: 0.3;
}

.expected-tick {
  stroke: rgba(37, 34, 29, 0.35);
  stroke-width: 1;
}

.expected-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.expected-line.market {
  stroke-dasharray: 7 5;
  stroke-width: 3;
}

.expected-dot {
  stroke: rgba(255, 250, 240, 0.95);
  stroke-width: 1.5;
}

.expected-dot.market {
  stroke-width: 2;
}

.expected-line.overlay-line {
  stroke-dasharray: 4 3;
  stroke-width: 1.8;
  opacity: 0.55;
}

.expected-dot.overlay-dot {
  opacity: 0.6;
  stroke-width: 1;
}

.expected-timeline-table {
  margin-top: 10px;
}

.expected-direction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 8px 0 10px;
}

.expected-direction-block {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.expected-direction-block strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.expected-direction-chip {
  padding: 3px 7px;
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid rgba(37, 34, 29, 0.14);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.expected-direction-chip.up,
.expected-trend.up {
  color: var(--green);
}

.expected-direction-chip.down,
.expected-trend.down {
  color: var(--red);
}

.expected-direction-chip.flat,
.expected-trend.flat {
  color: var(--muted);
}

.expected-direction-chip.gap {
  color: #8a5a12;
}

.expected-trend {
  font-weight: 950;
  white-space: nowrap;
}

.expected-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.expected-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.expected-legend-swatch {
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.expected-legend-swatch.market {
  height: 0;
  border-top: 4px dashed var(--gold);
  background: transparent !important;
}

.third-place-panel {
  margin: 14px 0;
  padding: 14px;
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.third-place-head,
.third-place-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.third-place-head {
  margin-bottom: 12px;
}

.third-place-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.third-place-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.third-place-controls {
  justify-content: flex-end;
}

.live-team {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  font-weight: 400;
}

.live-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-team-away {
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: right;
}

.live-team-flag {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(42, 40, 35, 0.28);
}

.live-match-teams.decided .live-team-winner span {
  color: var(--ink);
  font-weight: 900;
}

.live-match-teams.decided .live-team:not(.live-team-winner) span {
  color: var(--muted);
  font-weight: 400;
}

.live-match-pens {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.live-match-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-section {
  margin-top: 14px;
  padding: 16px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 0.92rem;
}

.winpct-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}

.winpct-cell span {
  font-weight: 800;
  flex: none;
}

.winbar {
  flex: 1;
  height: 8px;
  min-width: 40px;
  border-radius: 4px;
  background: rgba(42, 40, 35, 0.10);
  overflow: hidden;
}

.winbar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(200, 162, 74, 0.9), rgba(166, 112, 46, 0.95));
}

.rooting-game {
  margin: 12px 0 6px;
}

.rooting-game h4 {
  margin: 0 0 4px;
}

.rooting-table {
  font-size: 0.86rem;
}

.deploy-detail {
  margin: 4px 0 0;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  background: rgba(42, 40, 35, 0.06);
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
}

.leaderboard-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.report-chip {
  min-height: 68px;
  padding: 10px;
  background: rgba(246, 236, 215, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.report-chip strong,
.report-chip span {
  display: block;
}

.report-chip strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.report-chip span,
.report-note {
  color: var(--muted);
}

.report-note {
  margin: 0 0 10px;
}

.pick-report-list {
  display: grid;
  gap: 12px;
}

.version-entry {
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(246, 236, 215, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.version-entry:last-child {
  margin-bottom: 0;
}

.version-entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.version-entry-head strong {
  font-size: 1.05rem;
}

.version-entry-head span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.version-current-badge {
  padding: 2px 8px;
  color: #fffaf0;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.version-entry ul {
  margin: 0;
  padding-left: 18px;
}

.version-entry li {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.version-entry li:last-child {
  margin-bottom: 0;
}

.pick-report {
  padding: 14px;
  box-shadow: none;
}

.pick-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pick-round {
  padding: 10px;
  background: rgba(246, 236, 215, 0.72);
  border-radius: 8px;
}

.third-place-pick-round {
  border: 1px solid rgba(200, 162, 74, 0.42);
}

.pick-round h4 {
  margin-bottom: 8px;
}

.pick-line {
  align-items: start;
  padding: 6px 0;
  border-top: 1px solid rgba(42, 40, 35, 0.10);
  font-size: 0.86rem;
}

.pick-line span {
  color: var(--muted);
}

.pick-line strong {
  text-align: right;
}

.pick-line-detail {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 112px;
  text-align: right;
}

.pick-line-detail strong {
  max-width: 100%;
}

.eliminated-team {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.pick-points {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.pick-line-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.pick-line-tag {
  flex: none;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 42px;
}

.scoreline {
  min-width: 0;
}

.scoreline .scoreline-team {
  color: var(--ink);
}

.scoreline .scoreline-team.eliminated-team {
  color: var(--muted);
}

.scoreline .scoreline-score {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.scoreline .scoreline-pens {
  color: var(--muted);
  font-size: 0.86em;
}

.actual-scoreline .scoreline-team {
  font-weight: 700;
}

.pick-line-result {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 6px;
  font-size: 0.78rem;
}

.pick-line-result span {
  color: var(--muted);
}

.pick-line-result strong {
  flex: none;
  text-align: right;
}

.api-spec {
  line-height: 1.5;
}

.api-spec dl {
  display: grid;
  gap: 10px;
}

.api-spec dt {
  font-weight: 900;
}

.api-spec dd {
  margin: -6px 0 6px;
  color: var(--muted);
}

.admin-tool {
  margin: 10px 0 18px;
  padding: 12px;
  background: rgba(246, 236, 215, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.admin-panel {
  overflow-x: auto;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-tool h3 {
  margin-bottom: 10px;
}

.smtp-test-fields {
  grid-template-columns: minmax(0, 1fr) auto;
}

.now-override-fields {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.deploy-info:not(:empty) {
  margin-top: 10px;
}

.deploy-update strong {
  display: block;
  margin: 4px 0 6px;
}

.deploy-commits {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}

.deploy-commits li {
  font-size: 0.84rem;
  color: var(--muted);
}

.deploy-commits code {
  color: var(--ink);
}

.deploy-progress strong {
  display: block;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.small.deploy-warn {
  color: #a6472e;
  font-weight: 700;
}

.admin-message {
  margin-top: 10px;
  text-align: left;
}

.admin-table-section {
  margin-top: 18px;
}

.admin-table {
  min-width: 820px;
}

.user-agent-cell {
  max-width: 360px;
  word-break: break-word;
}

.admin-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.app-footer > *:nth-child(2)::before {
  content: "/";
  margin-right: 12px;
  color: rgba(130, 123, 112, 0.65);
}

.app-footer #appVersion {
  margin-top: 0;
}

.api-spec pre {
  overflow-x: auto;
  padding: 14px;
  background: #211f1b;
  color: #fff7e8;
  border-radius: 8px;
}

.api-spec code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stage {
  position: relative;
  width: min(92vmin, 980px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.stage svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.conn,
.center-line {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.1;
  stroke-linecap: round;
  opacity: 0.52;
}

.dot {
  fill: var(--line);
  opacity: 0.44;
}

.flag {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 7.2%;
  height: 7.2%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 4px 12px rgba(35, 31, 24, 0.22);
  background: #ddd;
}

.flag.r1,
.flag.r2,
.flag.r3,
.flag.r4 {
  width: 5.6%;
  height: 5.6%;
  border-color: var(--gold);
}

.flag.champ {
  width: 12%;
  height: 12%;
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(200, 162, 74, 0.22), 0 10px 26px rgba(35, 31, 24, 0.24);
}

.flag.eliminated {
  filter: grayscale(1);
  opacity: 0.4;
}

.flag.fallback {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--line);
  font-size: 0.72rem;
  font-weight: 900;
}

@media (max-width: 860px) {
  .entrant,
  .auth-fields,
  .edit-auth-fields,
  .reset-auth-fields,
  .reset-confirm-fields,
  .smtp-test-fields,
  .now-override-fields,
  .fields,
  .matches,
  .third-place-picks,
  .pick-report-grid {
    grid-template-columns: 1fr;
  }

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

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

  .live-banner-grid,
  .live-banner-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .bracket {
    grid-template-columns: 1fr;
    gap: 14px;
    overflow-x: visible;
    padding: 0;
  }

  .round {
    padding: 0;
  }

  .round-header {
    position: static;
    background: transparent;
  }

  .matches {
    height: auto;
    min-height: 0;
  }

  .round:nth-child(2) .matches,
  .round:nth-child(3) .matches,
  .round:nth-child(4) .matches {
    padding-top: 0;
    gap: var(--match-gap);
  }

  .match {
    height: auto;
    min-height: var(--match-card-h);
  }

  .actions {
    display: grid;
    position: static;
  }

  .message {
    text-align: left;
  }

  .leaderboard-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .profile-scatter {
    height: 260px;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 18px, 1180px);
  }

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

  .tab-set {
    grid-column: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logout-button {
    grid-column: auto;
    justify-self: stretch;
  }

  .tab {
    padding-inline: 8px;
  }

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

  .profile-chart-note {
    font-size: 0.8rem;
  }

  .profile-quadrant {
    display: none;
  }
}
