:root {
  color: #f8fafc;
  background: #07111f;
  font-family: Inter, Pretendard, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, #164e63 0, transparent 34rem),
    #07111f;
}

button {
  font: inherit;
}

.shell {
  width: min(70rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0;
}

.eyebrow {
  margin: 0;
  color: #67e8f9;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0.5rem 0 2rem;
  font-size: clamp(2rem, 6vw, 4rem);
}

.topbar,
.account,
.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth,
.my-picks {
  margin-bottom: 1rem;
}

.today-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.today-summary div {
  display: grid;
  gap: 0.35rem;
}

.today-summary small,
.muted,
.pick-card small,
.pick-meta dt {
  color: #94a3b8;
}

.today-summary strong {
  font-size: 1.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tabs button {
  white-space: nowrap;
}

.tabs button.selected {
  border-color: #22d3ee;
  background: #164e63;
}

.section-head,
.pick-card-main,
.pick-actions,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.segmented {
  display: flex;
  padding: 0.25rem;
  border-radius: 0.8rem;
  background: #07111f;
}

.segmented button {
  min-height: 2.75rem;
  border-color: transparent;
  background: transparent;
}

.segmented button.selected {
  border-color: #22d3ee;
  background: #164e63;
}

.empty-state {
  padding: 2rem 0;
  color: #94a3b8;
  text-align: center;
}

.pick-card {
  display: grid;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #1e3a4c;
}

.pick-card h3,
.pick-card p,
.pick-meta dd {
  margin: 0.35rem 0 0;
}

.status-badge {
  padding: 0.35rem 0.65rem;
  border: 1px solid #31516a;
  border-radius: 999px;
  color: #67e8f9;
  white-space: nowrap;
}

.status-badge[data-status='WON'] {
  border-color: #22c55e;
  color: #86efac;
}

.status-badge[data-status='LOST'],
.status-badge[data-status='VOID'] {
  border-color: #ef4444;
  color: #fda4af;
}

.status-badge[data-status='NORMAL'] {
  border-color: #22c55e;
  color: #86efac;
}

.status-badge[data-status='WARNING'] {
  border-color: #f59e0b;
  color: #fde68a;
}

.status-badge[data-status='CRITICAL'] {
  border-color: #ef4444;
  color: #fda4af;
}

.usage-panel {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid #1e3a4c;
  border-radius: 0.8rem;
  background: #0b1c2b;
}

.usage-panel h3 {
  margin: 0.35rem 0 0;
}

.usage-meter {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: #07111f;
}

.usage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22d3ee;
}

.provider-usage-warning {
  margin: 0;
  color: #fde68a;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.schedule-grid div,
.endpoint-list div {
  display: grid;
  gap: 0.3rem;
}

.schedule-grid small,
.schedule-grid span,
.endpoint-list dt {
  color: #94a3b8;
}

.endpoint-list {
  display: grid;
  gap: 0.5rem;
}

.endpoint-list div {
  grid-template-columns: 1fr auto;
}

.endpoint-list dd {
  margin: 0;
}

.pick-meta,
.confirmation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.pick-meta div,
.confirmation-list div {
  display: grid;
  gap: 0.25rem;
}

.pick-meta dd,
.confirmation-list dd {
  margin-left: 0;
}

.provider-status {
  border-color: #475569;
}

.provider-status.warning {
  border-color: #f59e0b;
  background: #422006;
}

.provider-status p {
  margin-bottom: 0.5rem;
}

.settings-panel form {
  display: grid;
  gap: 0.75rem;
}

.danger {
  border-color: #ef4444;
  color: #fecaca;
}

.leaderboard-head,
.rank-row {
  display: grid;
  align-items: center;
  gap: 1rem;
}

.leaderboard-head {
  grid-template-columns: 1fr auto;
}

.rank-row {
  grid-template-columns: 3rem 2fr 1fr 1fr;
  padding: 0.75rem 0;
  border-top: 1px solid #1e3a4c;
}

select {
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid #31516a;
  border-radius: 0.65rem;
  color: inherit;
  background: #10283a;
}

.result-detail {
  margin-bottom: 1rem;
}

.modal-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(2 6 23 / 78%);
}

.pick-modal {
  width: min(34rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.admin-panel article {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 0;
  border-top: 1px solid #1e3a4c;
}

.admin-panel pre {
  max-height: 14rem;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  border-radius: 0.5rem;
  background: #07111f;
  font-size: 0.75rem;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.page-stack {
  display: grid;
  gap: 1rem;
}

.season-history-row {
  align-items: center;
  border-top: 1px solid rgb(148 163 184 / 25%);
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.season-history-row div {
  display: grid;
  gap: 0.2rem;
}

.season-history-row div:last-child {
  text-align: right;
}

.season-schedule-form {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
  margin-bottom: 1.25rem;
}

@media (max-width: 720px) {
  .season-schedule-form {
    grid-template-columns: 1fr;
  }
}

.stats div {
  display: grid;
  gap: 0.35rem;
}

.stats small {
  color: #94a3b8;
}

.auth form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

input,
button {
  min-height: 2.75rem;
  border: 1px solid #31516a;
  border-radius: 0.65rem;
  color: inherit;
  background: #10283a;
}

input {
  padding: 0 0.85rem;
}

button {
  padding: 0.65rem 0.9rem;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.secondary,
.link {
  background: transparent;
}

.link {
  margin-top: 0.5rem;
  border: 0;
  color: #67e8f9;
}

.pick-row {
  padding: 0.5rem 0;
  border-top: 1px solid #1e3a4c;
}

.notice {
  color: #86efac;
}

.open {
  color: #86efac;
  font-size: 0.8rem;
}

.outcome {
  margin-left: 0.5rem;
  color: #67e8f9;
}

.event-grid {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1.25rem;
  border: 1px solid #1e3a4c;
  border-radius: 1rem;
  background: rgb(15 32 48 / 88%);
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 20%);
}

.event-meta {
  display: flex;
  justify-content: space-between;
  color: #94a3b8;
  font-size: 0.875rem;
}

h2 {
  margin: 0.75rem 0 1.5rem;
}

.market-title {
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 800;
}

.selections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.selections button {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid #31516a;
  border-radius: 0.65rem;
  color: inherit;
  background: #10283a;
  cursor: pointer;
}

.selections button:hover {
  border-color: #22d3ee;
}

.selections button.selected {
  border-color: #22d3ee;
  background: #164e63;
}

.selections button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.selections strong {
  color: #67e8f9;
}

.error {
  color: #fda4af;
}

.stale {
  margin-left: 0.5rem;
  color: #fda4af;
  font-weight: 500;
}

@media (max-width: 40rem) {
  .shell {
    padding: 2rem 0;
  }

  .selections {
    grid-template-columns: 1fr;
  }

  .topbar,
  .auth form,
  .stats,
  .section-head,
  .pick-card-main,
  .pick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
  }
}
