:root {
  --bg1: #eff6fb;
  --bg2: #f9f4ec;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #5f6d7a;
  --brand: #4f79a7;
  --brand2: #6f9fc8;
  --accent: #6c9f84;
  --ok: #1e9b63;
  --status-bg: #edf2ff;
  --status-border: #ccd7ff;
  --danger-bg: #ffe9f1;
  --danger-border: #ffc5db;
  --surface-soft: #f8f9ff;
  --line: #e7e9f8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(139, 123, 255, 0.13), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(255, 92, 168, 0.13), transparent 28%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height: 100vh;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}
.container { width: min(1000px, 92vw); margin: 0 auto; }
.skip-link {
  position: absolute;
  left: -1000px;
  top: 0;
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand);
  border-radius: 8px;
  padding: .5rem .7rem;
  z-index: 100;
}
.skip-link:focus-visible { left: .6rem; top: .6rem; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid #ececff;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 0;
  flex-wrap: wrap;
}
.brand {
  font-family: "Montserrat", "Quicksand", Inter, sans-serif;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--brand);
  text-decoration: none;
  font-size: 1.03rem;
}
nav.primary-nav {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
nav.primary-nav > a,
.nav-more > summary {
  text-decoration: none;
  color: var(--muted);
  padding: .45rem .75rem;
  border-radius: 999px;
  transition: all .2s ease;
}
nav.primary-nav > a.active, nav.primary-nav > a:hover, .nav-more[open] > summary, .nav-more > summary:hover {
  color: white;
  background: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(69, 58, 168, .24);
}
main {
  padding: 1.4rem 0 2.6rem;
  flex: 1 0 auto;
}
.methodology-main { padding-top: 1rem; }
.card {
  padding: 1.1rem;
  animation: fadeSlide .24s ease;
}
.card.panel-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow: 0 12px 28px rgba(47, 62, 109, .12);
}
@keyframes fadeSlide { from {opacity:0; transform: translateY(8px);} to {opacity:1; transform: translateY(0);} }
.page-intro {
  margin: 0 0 1rem;
  padding: .25rem 0 .4rem;
  border-bottom: 1px solid #f0f1fb;
}
.page-intro h1,
.page-intro h2 {
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  line-height: 1.2;
  margin: .2rem 0 .45rem;
}
.page-intro p { margin: 0; color: var(--muted); max-width: 72ch; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: .65rem;
}
.section-head h2,
.panel-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
}
.onboarding {
  border: 1px solid #dde3ff;
  border-radius: 14px;
  padding: .8rem .95rem;
  background: linear-gradient(180deg, #f8f9ff 0%, #fdfdff 100%);
  margin-bottom: 1rem;
}
.onboarding h2 { margin: .1rem 0 .5rem; font-size: 1rem; }
.onboarding ol { margin: 0; padding-left: 1.1rem; color: #3f4b77; }
.onboarding li + li { margin-top: .28rem; }
.onboarding-note {
  margin: .65rem 0 0;
}
.dismissible-tip {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dismissible-tip:hover,
.dismissible-tip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(95, 82, 232, .1);
  border-color: #bfc8ff;
}
.dismiss-hint {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.status {
  display: none;
  border: 1px solid var(--status-border);
  background: var(--status-bg);
  color: #2e3e7c;
  border-radius: 10px;
  padding: .55rem .7rem;
  margin: .5rem 0 .85rem;
}
.status.show { display: block; }
.status.error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: #8d254d;
}
.status-floating {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 40;
  min-width: min(620px, 92vw);
  box-shadow: 0 10px 28px rgba(27, 36, 97, .22);
}
.slot-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.slot-tabs.compact {
  margin-bottom: 0;
}
.slot-dock-wrap {
  margin-top: .9rem;
  margin-bottom: .8rem;
}
.slot-dock {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 28px rgba(47, 62, 109, .12);
  padding: .65rem .75rem;
}
.slot-tabs button,
.pill,
.btn {
  border: none;
  background: #ecebff;
  color: #3f369e;
  border-radius: 999px;
  padding: .5rem .85rem;
  font-weight: 650;
  cursor: pointer;
  transition: all .18s ease;
}
.btn.mode-toggle {
  padding: .62rem 1rem;
  font-size: .98rem;
  font-weight: 760;
  border: 1px solid #d1dcff;
  background: linear-gradient(180deg, #e9efff 0%, #e4ecff 100%);
}
.slot-tabs button.active,
.pill.active,
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
}
.pill:hover, .btn:hover, .slot-tabs button:hover { transform: translateY(-1px); }
.btn:disabled, .pill:disabled, .slot-tabs button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.game-panel-head {
  margin-bottom: .6rem;
  padding: .6rem .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.game-panel-note { margin-bottom: .55rem; }
.metrics-panel,
.detail-panel,
.insights-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  margin-bottom: .85rem;
}
.detail-panel.play-surface {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.metric-grid,
.detail-list,
.insight-grid {
  display: grid;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.metric-chip,
.detail-list div,
.insight-card {
  border: 1px solid #e7e9fb;
  border-radius: 12px;
  background: #f9faff;
  padding: .7rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.metric-chip strong,
.detail-list strong,
.insight-card strong {
  font-size: 1.2rem;
}
.metric-chip span,
.detail-list span,
.insight-card span {
  color: var(--muted);
  font-size: .88rem;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  margin: .75rem 0 .45rem;
  flex-wrap: wrap;
}
.progress-row h3 {
  margin: 0;
  font-size: 1rem;
}
.progress-row .helper {
  margin: .2rem 0 0;
}
.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #edf0ff;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}
.metrics-panel .metric-grid {
  margin-top: .75rem;
}
.view-tabs {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.view-tabs button {
  border: none;
  border-radius: 999px;
  padding: .5rem .8rem;
  background: #f0efff;
  color: #3f369e;
  font-weight: 650;
  cursor: pointer;
}
.view-tabs button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: white;
}
.view-tabs button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.match-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: .85rem;
}
.match-column.stack {
  display: grid;
  gap: .85rem;
}
.floating-tip {
  margin-bottom: .8rem;
  border: 1px solid #dce5ff;
  border-radius: 14px;
  padding: .8rem .95rem;
  background: linear-gradient(180deg, #f5f8ff 0%, #fdfdff 100%);
}
.floating-tip strong {
  display: block;
  margin-bottom: .3rem;
}
.floating-tip p {
  margin: 0;
}
.name-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .95rem;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
  transition: transform .18s ease, box-shadow .18s ease;
}
.name-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(74, 63, 175, .12); }
.name-card.clickable {
  cursor: pointer;
}
.name-card.clickable:hover,
.name-card.clickable:focus-visible {
  border-color: #b8b7ff;
  box-shadow: 0 12px 28px rgba(95, 82, 232, .18);
  background: linear-gradient(180deg, #ffffff 0%, #f6f5ff 100%);
}
.name-card.incumbent {
  border-color: #ffdf8d;
  background: linear-gradient(180deg, #fffdf5 0%, #fff7df 100%);
}
.name-card.suggested-card {
  border-style: dashed;
}
.name-card-head {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  align-items: flex-start;
}
.name-card-head-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.card-badge {
  font-size: 1.2rem;
}
.card-note {
  display: inline-flex;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: #eef3ff;
  color: #35518f;
  font-size: .8rem;
  font-weight: 650;
}
.name-title {
  margin: .1rem 0 .35rem;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.name-title.size-short { font-size: clamp(2rem, 5vw, 2.8rem); }
.name-title.size-medium { font-size: clamp(1.8rem, 4.5vw, 2.4rem); }
.name-title.size-long { font-size: clamp(1.5rem, 4vw, 2rem); }
.meta { color: var(--muted); font-size: .92rem; }
.card-detail {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .9rem;
}
.actions { display: flex; gap: .45rem; margin-top: .55rem; flex-wrap: wrap; align-items: center; }
button.choose { background: var(--ok); color: white; }
.heart-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca4c6;
  padding: 0;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease;
}
.heart-toggle:hover,
.heart-toggle:focus-visible {
  transform: scale(1.08);
}
.heart-toggle.active {
  color: #ff5ca8;
}
.name-card.picking {
  animation: pickPulse .22s ease;
  border-color: #9ab2f8;
  box-shadow: 0 0 0 3px rgba(102, 130, 255, .22), 0 20px 30px rgba(40, 53, 119, .2);
}
@keyframes pickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.icon-heart {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}
a.link,
button.link { background: #edf5ff; color: #28508b; }
.grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.list-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem;
}
.ranking-panel {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #eef0fb;
}
.ranked-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .65rem;
}
.ranked-row {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: center;
  padding: .85rem .95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfbff 100%);
}
.ranked-stats {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
  justify-content: flex-end;
}
.leaderboard-list {
  counter-reset: leaderboard;
}
.leaderboard-row {
  padding-left: .75rem;
}
.leaderboard-rank {
  flex: 0 0 54px;
  font-weight: 800;
  color: var(--brand);
  font-size: 1.05rem;
}
.suggestion-blurb {
  margin-top: .65rem;
}
.ad-slot {
  margin-top: 1rem;
  border: 1px dashed #c9c6ef;
  border-radius: 12px;
  padding: .75rem;
  color: var(--muted);
  background: #fafaff;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.helper { color: var(--muted); font-size: .92rem; }
.empty-state {
  border: 1px dashed #d8dcf4;
  border-radius: 12px;
  padding: .8rem;
  background: #fbfbff;
}
input, select {
  width: 100%;
  border: 1px solid #d9ddf7;
  border-radius: 10px;
  padding: .65rem .7rem;
  margin-top: .3rem;
  background: #fff;
}
input:focus-visible,
select:focus-visible {
  border-color: #5e63f2;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #334ef5;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .pair,
  .match-layout,
  .form-grid,
  .metric-grid,
  .detail-list,
  .insight-grid { grid-template-columns: 1fr; }
  main { padding-top: 1rem; }
}


.prediction-modal {
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 520px;
  width: min(92vw, 520px);
  padding: 1rem;
}

.prediction-modal::backdrop {
  background: rgba(12, 18, 42, .42);
}

.prediction-modal .actions {
  justify-content: center;
}

.prediction-modal.fallback-open {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  z-index: 70;
  background: #fff;
}

body.modal-fallback-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 42, .42);
  z-index: 65;
}


.skip-row {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: .35rem 0 .9rem;
  flex-wrap: wrap;
}

.toggle-switch {
  border: 1px solid #cfdaff;
  background: #f3f7ff;
  color: #29406f;
  border-radius: 999px;
  padding: .42rem .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
}

.toggle-switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #cfd8ef;
  position: relative;
  transition: background .18s ease;
}

.toggle-switch-knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .18s ease;
}

.toggle-switch.active {
  background: #e8f6ee;
  border-color: #9fd2b4;
}

.toggle-switch.active .toggle-switch-track {
  background: #62b38a;
}

.toggle-switch.active .toggle-switch-knob {
  transform: translateX(16px);
}

.toggle-switch-state {
  font-size: .84rem;
  color: var(--muted);
}

.filter-bubble {
  display: inline-flex;
  align-items: center;
  padding: .34rem .62rem;
  border-radius: 999px;
  border: 1px solid #d3dcfb;
  background: #f4f7ff;
  color: #3d4d79;
  font-size: .84rem;
  font-weight: 650;
}


.nav-more {
  position: relative;
}

.nav-more > summary {
  list-style: none;
  cursor: pointer;
}

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

.nav-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(38, 54, 76, .12);
  padding: .35rem;
  display: grid;
  gap: .2rem;
}

.nav-more-menu a {
  text-decoration: none;
  color: var(--text);
  padding: .45rem .6rem;
  border-radius: 8px;
}

.nav-more-menu a:hover,
.nav-more-menu a:focus-visible {
  background: #eef5ff;
}

.control-center {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  margin-bottom: .85rem;
  padding: .75rem;
}

.compact-actions {
  display: flex;
  gap: .45rem;
}

.submit-helper.ok { color: #1f7a4a; }
.submit-helper.warn { color: #9a3959; }
.full-row { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .compact-actions { width: 100%; }
  .compact-actions .btn { flex: 1; }
  .nav-more-menu {
    right: auto;
    left: 0;
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  margin-top: auto;
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 0 1.2rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}
.footer-links a,
.copyright-note a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover,
.copyright-note a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.copyright-note {
  margin: 0;
  font-size: .92rem;
}
.legal-doc {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow: 0 12px 28px rgba(47, 62, 109, .12);
  padding: 1rem 1.1rem;
}
.legal-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  margin: .7rem 0 0;
  line-height: 1.55;
  color: var(--text);
}

.legal-section + .legal-section {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #edf0fb;
}

.legal-toc {
  border: 1px solid #e3e7fa;
  border-radius: 12px;
  background: #f8faff;
  padding: .8rem .9rem;
  margin: .6rem 0 1rem;
}

.legal-toc h2 {
  margin: 0 0 .45rem;
  font-size: 1rem;
}

.legal-toc ol {
  margin: 0;
  padding-left: 1.1rem;
}

.legal-toc a {
  color: #35518f;
}

.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: .8rem;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 1.2rem));
  z-index: 60;
  border: 1px solid #d8ddf3;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(33, 43, 87, .2);
}

.cookie-banner-content {
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .85rem;
  flex-wrap: wrap;
}

.cookie-banner p {
  margin: 0;
  color: #2f3958;
  flex: 1 1 480px;
}

.cookie-banner a {
  color: var(--brand);
  font-weight: 600;
}

.cookie-banner-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.cookie-settings-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.cookie-settings-link:hover,
.cookie-settings-link:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

@media (max-width: 760px) {
  .cookie-banner {
    bottom: .5rem;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .btn {
    flex: 1;
    text-align: center;
  }
}
