/* Typography — overrides Midone Roboto (loaded after /midone/css/app.css) */
:root {
  --xstat-font-sans: var(--font-space-grotesk), ui-sans-serif, system-ui, sans-serif;
  --xstat-font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    monospace;
  /* successpredict pitch, matching the public site. */
  --color-theme-1: 12 61 46;
  --color-theme-2: 7 40 30;
  --color-primary: 12 61 46;
}

.dark {
  --color-theme-1: 7 40 30;
  --color-theme-2: 4 17 12;
  --color-primary: 20 128 74;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body,
.rubick,
.rubick *,
.xstat-login-page,
.xstat-modal-panel,
.xstat-modal-panel *,
input,
select,
textarea,
button {
  font-family: var(--xstat-font-sans);
}

body {
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.55;
}

.side-nav,
.side-nav *,
.mobile-menu,
.mobile-menu * {
  font-family: var(--xstat-font-sans);
}

.font-mono,
code,
pre,
kbd,
samp {
  font-family: var(--xstat-font-mono);
}

@keyframes xstat-login-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Simple login (Midone — no full Tailwind) */
.xstat-login-page {
  min-height: 100vh;
  font-family: var(--xstat-font-sans);
  background: linear-gradient(
    180deg,
    rgb(var(--color-theme-1, 12 61 46)),
    rgb(var(--color-theme-2, 7 40 30))
  );
}

.xstat-login-simple {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.xstat-login-simple__card {
  width: 100%;
  max-width: 24rem;
  background: #fff;
  border-radius: 1.1rem;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(4, 16, 12, 0.35);
  animation: xstat-login-in 0.3s ease-out;
}

.xstat-login-simple__brand {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(34, 197, 94, 0.22), transparent 55%),
    #071910;
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 3px solid #22c55e;
}

.xstat-login-simple__brand img {
  display: block;
  height: 4.25rem;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.xstat-login-simple__brand p {
  margin: 0;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

.xstat-login-simple__body {
  padding: 1.4rem 1.4rem 1.5rem;
}

.xstat-login-simple__head {
  text-align: left;
  margin-bottom: 1.15rem;
}

.xstat-login-simple__head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0c3d2e;
}

.xstat-login-simple__head p {
  margin: 0.3rem 0 0;
  font-size: 0.84rem;
  color: #64748b;
}

.xstat-login-error {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--color-danger, 220 38 38));
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.xstat-login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.xstat-login-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0c3d2e;
  margin-bottom: 0.4rem;
}

.xstat-login-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.95rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  border: 1px solid #d7e3dc;
  background: #f4f7f5;
  color: #0f172a;
}

.xstat-login-input:focus {
  outline: none;
  border-color: rgb(var(--color-primary, 12 61 46));
  box-shadow: 0 0 0 2px rgba(var(--color-primary, 12 61 46), 0.2);
}

.xstat-login-input:disabled {
  opacity: 0.6;
  background: #f8fafc;
}

.xstat-login-submit {
  margin-top: 0.25rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  cursor: pointer;
  background: rgb(var(--color-primary, 12 61 46));
}

.xstat-login-submit:disabled {
  opacity: 0.75;
  cursor: wait;
}

.xstat-login-submit svg {
  width: 1rem;
  height: 1rem;
  animation: xstat-login-spin 0.8s linear infinite;
}

@keyframes xstat-login-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes xstat-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xstat-scale-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes xstat-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.xstat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 2rem;
  background: rgba(15, 23, 42, 0.45);
  animation: xstat-fade-in 0.18s ease-out;
}

.xstat-modal-panel {
  width: min(46rem, 100%);
  max-height: calc(100vh - 6rem);
  overflow: auto;
  animation: xstat-scale-in 0.2s ease-out;
}

.xstat-modal-panel.is-wide {
  width: min(58rem, 100%);
}

.xstat-modal-section {
  border-radius: 0.75rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.65);
  padding: 1rem 1.15rem;
}

.xstat-modal-section--flush {
  padding: 0;
  border: none;
  background: transparent;
}

.xstat-modal-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.xstat-sync-log {
  width: 100%;
  max-height: 9.5rem;
  margin: 0.35rem 0 0;
  overflow: auto;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: #0f172a;
  color: #bbf7d0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.xstat-market-odds__toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.7rem 0.7rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.xstat-market-odds__toggle:hover {
  border-color: rgb(var(--color-primary, 12 61 46));
  background: #f8fafc;
}

.xstat-market-odds__title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
  white-space: nowrap;
}

.xstat-market-odds__count {
  margin-left: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #64748b;
}

.xstat-market-odds__updated {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-size: 0.75rem;
  color: #94a3b8;
}

.xstat-market-odds__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  transition: transform 0.15s ease;
}

.xstat-market-odds__chevron.is-open {
  transform: rotate(180deg);
}

.xstat-market-odds__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.xstat-market-odds__chip.is-static {
  cursor: default;
}

.xstat-market-odds__chip.is-static:hover {
  border-color: #e2e8f0;
  box-shadow: none;
}

.xstat-market-odds__chip:hover {
  border-color: rgb(var(--color-primary, 12 61 46));
  box-shadow: 0 0 0 2px rgba(var(--color-primary, 12 61 46), 0.12);
}

.xstat-fixture-list td:nth-child(2) {
  width: 22rem;
  max-width: 26rem;
  vertical-align: middle;
}

.xstat-pred-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.xstat-pred-row {
  display: grid;
  grid-template-columns: 0.45rem minmax(0, 1.15fr) minmax(0, 1fr) 2.4rem;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.xstat-pred-row__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
}

.xstat-pred-row__type,
.xstat-pred-row__tip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xstat-pred-row__type {
  color: #64748b;
  font-weight: 600;
}

.xstat-pred-row__tip {
  color: #0f172a;
  font-weight: 600;
}

.xstat-pred-row__odds {
  color: #475569;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.75rem;
}

.xstat-pred-list__more {
  align-self: flex-start;
  margin-top: 0.15rem;
  border: 0;
  background: transparent;
  padding: 0;
  color: #0c3d2e;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.xstat-pred-list__more:hover {
  text-decoration: underline;
}

.xstat-fixture-modal-preview {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.xstat-fixture-modal-preview.is-compact {
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
}

.xstat-predictions-form {
  max-height: min(70vh, 36rem);
  display: flex;
  flex-direction: column;
}

.xstat-pred-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  padding: 0.15rem 0.25rem 0.15rem 0;
}

@media (max-width: 767px) {
  .xstat-fixture-filters > * {
    flex: 1 1 100%;
  }

  .xstat-fixture-list {
    overflow: visible;
  }

  .xstat-fixture-list table {
    min-width: 0 !important;
    border-spacing: 0 0.75rem;
  }

  .xstat-fixture-list thead {
    display: none;
  }

  .xstat-fixture-list tr {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
  }

  .xstat-fixture-list td {
    display: block;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .xstat-fixture-list td + td {
    border-top: 1px solid #f1f5f9;
  }

  .xstat-fixture-list td:nth-child(2) {
    width: auto;
    max-width: none;
  }

  .xstat-fixture-list td:nth-child(2)::before {
    content: "Predictions";
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
  }

  .xstat-pred-row {
    grid-template-columns: 0.45rem minmax(0, 1.15fr) minmax(0, 1fr) 2.6rem;
  }

  .xstat-pred-fieldset__row {
    grid-template-columns: 1fr;
  }

  .xstat-modal-overlay {
    padding: 0.5rem;
    align-items: stretch;
  }

  .xstat-modal-panel,
  .xstat-modal-panel.is-wide {
    width: 100%;
    max-height: calc(100vh - 1rem);
  }
}

@media (min-width: 640px) {
  .xstat-pred-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (min-width: 900px) {
  .xstat-modal-panel.is-wide .xstat-pred-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.xstat-pred-fieldset {
  margin: 0;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 0.5rem 0.65rem 0.6rem;
  background: #fff;
}

.xstat-pred-fieldset__legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1e293b;
}

.xstat-pred-fieldset__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.xstat-pred-fieldset__body {
  margin-top: 0.3rem;
}

.xstat-pred-fieldset__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  gap: 0.45rem;
  align-items: end;
}

.xstat-pred-fieldset__row input,
.xstat-pred-fieldset__row select {
  width: 100%;
  box-sizing: border-box;
}

.xstat-pred-fieldset__tip,
.xstat-pred-fieldset__odds {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.xstat-pred-fieldset__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.xstat-tip-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.xstat-tip-field__custom {
  font-size: 0.75rem;
}

.xstat-markets-collapse summary {
  list-style: none;
}

.xstat-markets-collapse summary::-webkit-details-marker {
  display: none;
}

.xstat-markets-collapse summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s;
}

.xstat-markets-collapse[open] summary::before {
  transform: rotate(90deg);
}

.xstat-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.xstat-toast-item {
  min-width: 16rem;
  animation: xstat-fade-in 0.2s ease-out;
}

.xstat-row-in {
  animation: xstat-row-in 0.28s ease-out;
}

/* Mobile chrome. Midone's built CSS has no translate/z-index utilities, so the
   drawer must be omitted until opened and positioned here. */
.xstat-mobile-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 70px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgb(var(--color-theme-1, 12 61 46));
}

.xstat-shell-body {
  margin-top: 4.7rem;
}

.xstat-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
}

.xstat-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: min(270px, 86vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: rgb(var(--color-primary, 12 61 46));
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.28);
}

.xstat-mobile-drawer__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  padding: 0;
}

@media (min-width: 768px) {
  .xstat-mobile-bar,
  .xstat-mobile-backdrop,
  .xstat-mobile-drawer {
    display: none !important;
  }

  .xstat-shell-body {
    margin-top: 0;
  }
}
