/* World Cup Simulator — Dashboard design system */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f5f4ef;
  --line: #ebe9e3;
  --line-2: #e2dfd7;
  --ink: #1a1917;
  --ink-2: #3a3834;
  --ink-3: #6b6862;
  --ink-4: #9c9890;
  --ink-5: #c4bfb5;

  --accent: oklch(0.55 0.12 250);     /* model blue */
  --accent-soft: oklch(0.94 0.03 250);
  --pos: oklch(0.58 0.12 150);        /* value/edge positive */
  --pos-soft: oklch(0.94 0.035 150);
  --neg: oklch(0.58 0.15 28);         /* edge negative */
  --neg-soft: oklch(0.94 0.035 28);
  --warn: oklch(0.68 0.12 75);

  --radius: 6px;
  --radius-lg: 10px;

  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ff-serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ff-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

.mono { font-family: var(--ff-mono); font-feature-settings: "tnum"; }
.tnum { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--ff-serif); }

/* Generic artboard layout */
.wc-board {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
}

.wc-topbar {
  height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}

.wc-topbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.wc-topbar__mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
}

.wc-topbar__nav {
  display: flex;
  gap: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.wc-topbar__nav a {
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.wc-topbar__nav a[data-active="true"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
}
.wc-topbar__nav a:hover { color: var(--ink); }

.wc-topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-3);
}

.wc-topbar__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: var(--surface-2);
  border-radius: 100px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-2);
}
.wc-topbar__pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pos);
}

/* Main content area */
.wc-main {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.wc-grid {
  display: grid;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card__head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.card__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.card__subtitle {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--ff-mono);
}

.card__body {
  padding: 16px 18px;
}

/* Stat tile */
.stat__label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.stat__value {
  font-family: var(--ff-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.stat__delta {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
.stat__delta.pos { color: var(--pos); }
.stat__delta.neg { color: var(--neg); }

/* Flag chip — original circular mono chip, not any real crest */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.flag__chip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 600;
  color: white;
  letter-spacing: 0;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.08);
}
.flag__name { color: var(--ink); font-weight: 450; }
.flag--sm .flag__chip { width: 16px; height: 16px; font-size: 8px; }
.flag--lg .flag__chip { width: 28px; height: 28px; font-size: 10.5px; }

/* Tables */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }

.tbl__num {
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Prob bar */
.probbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 80px;
}
.probbar__track {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.probbar__fill {
  height: 100%;
  background: var(--ink-2);
  border-radius: 2px;
}
.probbar__num {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* Edge pill */
.edge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 100px;
}
.edge.pos { background: var(--pos-soft); color: var(--pos); }
.edge.neg { background: var(--neg-soft); color: var(--neg); }
.edge.neu { background: var(--surface-2); color: var(--ink-3); }

/* Divider label */
.labelrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Hair divider */
.hair { height: 1px; background: var(--line); width: 100%; }

/* Segmented control */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 7px;
  padding: 2px;
  font-size: 11.5px;
  font-family: var(--ff-mono);
}
.seg button {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--ink-3);
  font-family: inherit;
  font-size: inherit;
}
.seg button[data-active="true"] {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Sparkline svg helpers */
.spark { display: block; overflow: visible; }

/* Utility */
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 10.5px; color: var(--ink-4); }
.hline { flex: 1; height: 1px; background: var(--line); }

/* Scrollbars — subtle */
.wc-main::-webkit-scrollbar { width: 10px; height: 10px; }
.wc-main::-webkit-scrollbar-thumb { background: var(--line-2); border: 2px solid var(--bg); border-radius: 100px; }
.wc-main::-webkit-scrollbar-track { background: transparent; }
