/* ============================================================
   Fantasy Grand Prix — visual style after fantasy.motogp.com
   black canvas · pink #e3137f accents · condensed italic type
   ============================================================ */
:root {
  --primary: #de1b81;
  --accent-text: #f5489f;
  --primary-btn: #d4137a;
  --primary-btn-hover: #a80f60;
  --booster: #e3137f;
  --on-primary: #fff;
  --bg: #0b0b0d;
  --header-bg: rgba(11,11,13,.92);
  --panel: #1d1d21;
  --panel-2: #151518;
  --carbon: #2c2c32;
  --graphite: #4d4d56;
  --line: #2c2c32;
  --row-hover: #26262d;
  --hover-bg: #3a3a43;
  --stripe: rgba(255,255,255,.025);
  --field-bg: #121216;
  --text: #fff;
  --text-soft: #dcdce2;
  --muted: #b3b3bd;
  --faint: #8c8c97;
  --success: #34d58a;
  --danger: #ff6b6b;
  --gold: #f0cd6b;
  --gold-deep: #c99a2e;
  --silver: #d6dae2;
  --silver-deep: #9096a2;
  --card-bg: radial-gradient(120% 90% at 50% 30%, #2a2a31 0%, #15151a 75%);
  --card-edge: #4d4d56;
  --card-inner: #15151a;
  --card-inner-2: #34343b;
  --card-fade: rgba(10,10,12,.96);
  --card-name: #fff;
  --card-muted: #b3b3bd;
  --empty-label: #6f6f7a;
  --pill-bg: #5f0f3a;
  --pill-fg: #e58ac0;
  --banner-bg: linear-gradient(90deg, #7a0f48 0%, #4a0a2c 100%);
  --banner-soft: #f2bcd8;
  --banner-lock: rgba(0,0,0,.32);
  --stat-val: #d0d0d8;
  --stat-key: #9a9aa5;
  --chip-bg: rgba(240,38,142,.18);
  --chip-fg: #ff9fcf;
  --thumb-bg: radial-gradient(circle at 50% 30%, #35353c, #15151a);
  --overlay: rgba(0,0,0,.75);
  --shadow: none;
  color-scheme: dark;
  --display: "Rubik", "Arial Rounded MT Bold", Arial, sans-serif;
  --body: "Barlow", Arial, sans-serif;
}

:root[data-theme="light"] {
  --primary: #d4137a;
  --accent-text: #c01070;
  --primary-btn: #d4137a;
  --primary-btn-hover: #a80f60;
  --bg: #f1f1f4;
  --header-bg: rgba(255,255,255,.94);
  --panel: #fff;
  --panel-2: #fff;
  --carbon: #e9e9ef;
  --graphite: #c2c2cc;
  --line: #e2e2e9;
  --row-hover: #fdeaf4;
  --hover-bg: #dcdce6;
  --stripe: rgba(20,20,40,.03);
  --field-bg: #fff;
  --text: #15151a;
  --text-soft: #2e2e36;
  --muted: #565662;
  --faint: #767683;
  --success: #0f8f55;
  --danger: #d12c2c;
  --gold: #946a0c;
  --gold-deep: #c99a2e;
  --silver: #4f5563;
  --silver-deep: #9aa0ad;
  --card-bg: radial-gradient(120% 90% at 50% 25%, #ffffff 0%, #e8e8ee 80%);
  --card-edge: #c2c2cc;
  --card-inner: #fff;
  --card-inner-2: #e2e2e9;
  --card-fade: rgba(255,255,255,.97);
  --card-name: #15151a;
  --card-muted: #565662;
  --empty-label: #8a8a96;
  --pill-bg: #f8d3e6;
  --pill-fg: #b01068;
  --banner-bg: linear-gradient(90deg, #d4137a 0%, #a80f60 100%);
  --banner-soft: #ffe0ef;
  --banner-lock: rgba(0,0,0,.22);
  --stat-val: #2e2e36;
  --stat-key: #6a6a76;
  --chip-bg: rgba(212,19,122,.1);
  --chip-fg: #a80f60;
  --thumb-bg: radial-gradient(circle at 50% 30%, #fff, #dcdce4);
  --overlay: rgba(20,20,30,.5);
  --shadow: 0 1px 3px rgba(20,20,40,.08), 0 6px 18px rgba(20,20,40,.06);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.35;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1360px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; user-select: none; }
.logo-fantasy {
  font-family: var(--display); font-weight: 700; 
  font-size: 30px; letter-spacing: 1px; line-height: .85;
  color: var(--text); 
}
.logo-moto {
  font-family: var(--display); font-weight: 700; 
  font-size: 13px; line-height: 1.05; color: var(--accent-text);
  letter-spacing: 2px;
  padding-left: 10px; position: relative;
}
.logo-moto::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--primary); }
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  font-family: var(--display); font-weight: 700;
  font-size: 15px; letter-spacing: 1px; padding: 9px 12px;
  color: var(--muted); position: relative;
  text-transform: uppercase; transition: color .15s;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--hover-bg); border-radius: 8px; }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px; background: var(--primary); }

.class-switch {
  margin-left: auto; display: flex; flex: none;
  border: 1px solid var(--graphite); border-radius: 999px; overflow: hidden;
  background: var(--panel-2);
}
.class-switch button {
  background: transparent; border: 0; color: var(--muted);
  font-family: var(--display); font-weight: 700;
  font-size: 14px; letter-spacing: .8px; padding: 9px 14px;
  white-space: nowrap;
  border-left: 1px solid var(--graphite); transition: background .15s, color .15s;
}
.class-switch button:first-child { border-left: 0; }
.class-switch button:not(.active):hover { color: var(--text); background: var(--hover-bg); }
.class-switch button.active { background: var(--primary); color: var(--on-primary); }
.lang-switch {
  display: flex; border: 1px solid var(--graphite); border-radius: 999px; overflow: hidden;
  background: var(--panel-2); flex: none;
}
.lang-switch button {
  background: transparent; border: 0; color: var(--muted);
  font-family: var(--display); font-weight: 700;
  font-size: 13px; letter-spacing: 1px; padding: 7px 12px;
  border-left: 1px solid var(--graphite); transition: background .15s, color .15s;
}
.lang-switch button:first-child { border-left: 0; }
.lang-switch button:not(.active):hover { color: var(--text); background: var(--hover-bg); }
.lang-switch button.active { background: var(--primary); color: var(--on-primary); }
.theme-toggle {
  background: transparent; border: 1px solid var(--graphite); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { border-color: var(--primary); background: var(--hover-bg); }
.account-btn {
  background: transparent; border: 1px solid var(--graphite); color: var(--muted);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: color .15s, border-color .15s, background .15s;
}
.account-btn:hover, .account-btn.active { color: var(--text); border-color: var(--primary); background: var(--hover-bg); }
.account-btn .avatar-initial {
  font-family: var(--display); font-weight: 800; font-size: 15px;
  color: var(--chip-fg); background: var(--chip-bg);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
}

/* ---------------- icons + flags ---------------- */
.icon { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.icon svg { display: block; }
img.flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; margin-right: 8px; vertical-align: -2px; }

/* ---------------- layout ---------------- */
.app-main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px 20px 60px; }

.view-title {
  font-family: var(--display); font-weight: 800; 
  text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px;
}
.view-title .chip {
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: var(--on-primary); background: var(--primary);
  padding: 3px 10px; 
}
.view-sub { color: var(--muted); margin-bottom: 18px; }

/* ---------------- GP / status bar ---------------- */
.gp-bar { box-shadow: var(--shadow);
  display: grid; grid-template-columns: 2.4fr 1fr 1fr 1fr 1fr;
  background: var(--panel); border-radius: 6px; overflow: hidden;
  margin-bottom: 28px; min-height: 112px;
}
.gp-cell { padding: 18px 22px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.gp-cell .k { font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--stat-key); }
.gp-cell .v { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: .5px; color: var(--stat-val); white-space: nowrap; }
.gp-cell .v.neg { color: var(--danger); }
.gp-cell.next {
  align-items: flex-start; text-align: left; position: relative;
  background: var(--banner-bg);
  display: grid; grid-template-columns: 1fr auto; column-gap: 18px; align-content: center;
}
.gp-cell.next .gp-circuit { grid-column: 1; font-size: 15px; color: var(--banner-soft); display: flex; align-items: center; gap: 10px; }
.gp-cell.next .flag { font-size: 24px; }
.gp-cell.next .gp-country { grid-column: 1; font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.gp-cell.next .gp-lock {
  grid-column: 2; grid-row: 1 / span 2; background: var(--banner-lock); border-radius: 6px;
  padding: 8px 16px; text-align: center;
}
.gp-cell.next .gp-lock .k { color: var(--banner-soft); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.gp-cell.next .gp-lock .v { font-size: 26px; color: #fff; }
.countdown { font-variant-numeric: tabular-nums; }
.countdown.locked { color: var(--danger) !important; }

/* ---------------- team board (gold | silver | aside) ---------------- */
.team-board {
  display: grid; gap: 34px; align-items: stretch;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.2fr);
  margin-bottom: 20px;
}
.board-col { min-width: 0; display: flex; flex-direction: column; }
.col-title {
  font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: .5px;
  text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.col-title .slashes { color: var(--accent-text); font-size: 18px; letter-spacing: -2px;  }
.col-cards { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(300px, 1fr); gap: 18px; }
.board-col.aside .col-title { font-size: 24px; margin-top: 0; }
.board-col.aside .col-title:not(:first-child) { margin-top: 24px; }
.board-col.aside .slot-card.entity { flex: 1; }

.slot-card {
  position: relative; min-height: 0;
  background: var(--card-bg);
  border: 2px solid var(--card-edge); border-radius: 16px;
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.slot-card.gold { border-color: var(--gold-deep); }
.slot-card.silver { border-color: var(--silver-deep); }
.slot-card.entity { min-height: 128px; }
.slot-card.empty { cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 12px 12px; gap: 10px; }
.slot-card.empty.entity { justify-content: center; padding: 18px 14px; }
.slot-card.empty:hover { border-color: var(--primary); transform: translateY(-2px); }
.silhouette-bg {
  position: absolute; inset: 8% 14% 34% 14%; opacity: .5;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23050506'%3E%3Cpath d='M12 2a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm0 10c4.4 0 8 2.2 8 5v3H4v-3c0-2.8 3.6-5 8-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.slot-card.empty .add-label {
  position: relative; font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.05;
  text-transform: uppercase; text-align: center; color: var(--empty-label);
}
.add-pill {
  position: relative; width: 100%; padding: 9px 0; display: grid; place-items: center;
  background: var(--pill-bg); color: var(--pill-fg); border-radius: 999px;
}
.slot-card.empty:hover .add-pill { background: var(--primary-btn); color: #fff; }
.slot-card.empty:hover .add-label { color: var(--text); }

.rider-card-inner { position: absolute; inset: 0; }
.slot-photo { position: absolute; inset: 14% 14% 38% 14%; display: flex; align-items: flex-end; justify-content: center; }
.slot-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.slot-photo .silhouette { width: 56px; height: 56px; }
.slot-head { position: absolute; top: 10px; left: 12px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; }
.slot-num { font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--accent-text); line-height: 1; text-shadow: 0 1px 4px var(--card-fade); }
.slot-remove {
  background: var(--panel); border: 1px solid var(--graphite); color: var(--muted); border-radius: 50%;
  width: 28px; height: 28px; display: grid; place-items: center; flex: none;
}
.slot-card.entity > .slot-remove { position: absolute; top: 10px; right: 10px; z-index: 2; }
.slot-remove:hover { color: var(--danger); border-color: var(--danger); background: var(--panel); }
.slot-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
  background: linear-gradient(0deg, var(--card-fade) 60%, transparent);
}
.slot-name { color: var(--card-name); font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 20px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-name .first { display: block; font-size: 12.5px; font-weight: 500; color: var(--card-muted); letter-spacing: 1px; }
.slot-meta { font-size: 12px; color: var(--card-muted); margin-top: 2px; min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-foot { margin-top: 6px; padding-top: 6px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.slot-cost { color: var(--card-name); font-family: var(--display); font-weight: 600; font-size: 18px; }
.slot-pts { font-size: 12px; color: var(--card-muted); }
.slot-badge {
  position: absolute; top: 46px; left: 12px; z-index: 2;
  font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 1px;
  padding: 2px 10px; background: var(--booster); color: #fff; border-radius: 999px;
}
.slot-card.entity.filled { padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.entity-main { display: flex; align-items: center; gap: 12px; padding-right: 30px; min-width: 0; }
.entity-text { min-width: 0; }
.entity-art { width: 76px; height: 52px; flex: none; background: #1c1c20; border-radius: 10px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.entity-art img { max-height: 100%; max-width: 100%; object-fit: contain; }
.entity-art:has(.art-text) { background: var(--carbon); padding: 4px; }
.entity-art .art-text { font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 1.1; text-transform: uppercase; text-align: center; color: var(--muted); overflow: hidden; }
.slot-card.entity.filled .slot-name { white-space: normal; font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-card.entity.filled .slot-foot { margin-top: 0; }
.slot-card.entity.filled .slot-meta { white-space: normal; min-height: 0; }

.slot-card.entity.filled .slot-foot { margin-top: auto; }

/* boosters active chip row */
.booster-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; }
.booster-chip {
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
  background: var(--chip-bg); border: 1px solid var(--primary); color: var(--chip-fg);
  padding: 3px 10px;
}

/* ---------------- action bar ---------------- */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 26px; }
.btn {
  font-family: var(--display); font-weight: 700; 
  letter-spacing: 1.5px; font-size: 15px; text-transform: uppercase;
  padding: 11px 22px; border: 1px solid var(--graphite);
  background: var(--carbon); color: var(--text);
  border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--hover-bg); border-color: var(--muted); }
.btn.primary { background: var(--primary-btn); border-color: var(--primary-btn); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-btn-hover); border-color: var(--primary-btn-hover); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; }

/* ---------------- pool (riders / constructors / teams) ---------------- */
.pool-panel { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.pool-tabs { display: flex; gap: 6px; padding: 14px 16px 0; }
.pool-tabs button {
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 14px;
  letter-spacing: 1px; text-transform: uppercase; padding: 9px 20px;
  transition: background .15s, color .15s;
}
.pool-tabs button:hover { background: var(--hover-bg); color: var(--text); }
.pool-tabs button.active { background: var(--primary); color: var(--on-primary); }
.pool-tools { display: flex; gap: 12px; padding: 14px 16px; align-items: center; flex-wrap: wrap; }
.pool-search {
  background: var(--field-bg); border: 1px solid var(--graphite); color: var(--text);
  font-family: var(--body); font-size: 15px; padding: 10px 18px; width: 360px; max-width: 100%; border-radius: 999px;
}
.pool-search::placeholder { color: var(--faint); }
.pool-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--chip-bg); }
.pool-note { color: var(--muted); font-size: 13px; margin-left: auto; }

.table-wrap { overflow-x: auto; }
table.pool { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; min-width: 860px; table-layout: fixed; }
table.pool th:nth-child(1) { width: auto; }
table.pool th:last-child { width: 108px; }
table.pool th .icon { margin-left: 4px; vertical-align: -2px; }
table.pool th {
  font-family: var(--display); font-weight: 500; font-size: 12px; letter-spacing: 1px;
  color: var(--faint); text-transform: uppercase; text-align: center; padding: 10px 8px;
  background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  white-space: nowrap; cursor: pointer; user-select: none; width: 96px;
}
table.pool th:hover { color: var(--text); }
table.pool th.sorted { color: var(--accent-text); font-weight: 700; }
table.pool th.txt, table.pool td.txt { text-align: left; padding-left: 16px; }
.pool-ident .rider-name { display: flex; align-items: center; }
table.pool td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-soft); }
table.pool tbody tr:nth-child(even) td { background: var(--stripe); }
table.pool tbody tr:hover td { background: var(--row-hover); }
table.pool tbody tr:last-child td { border-bottom: 0; }
table.pool td:nth-child(2) { color: var(--text); font-weight: 600; font-family: var(--display); }
.pool .rider-name { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; font-size: 16px; color: var(--text); }
.pool .rider-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; max-width: 460px; }
.pool .num-badge {
  display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px;
  background: var(--carbon); border-radius: 6px; color: var(--text);
  font-family: var(--display); font-weight: 700; font-size: 13px;
}
.pool-ident { display: flex; align-items: center; gap: 12px; }
.pool-ident > span:last-child { min-width: 0; }
.pool-thumb { width: 44px; height: 52px; flex: none; border-radius: 10px; background: var(--thumb-bg); overflow: hidden; }
.pool-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 4%; }
.pool-thumb.logo { width: 72px; height: 44px; background: #1c1c20; display: grid; place-items: center; }
.pool-thumb.logo img { object-fit: contain; padding: 8px 10px; }
.pool-thumb:empty { display: none; }
.pool-ident .num-badge { margin-right: 0; }
.price-diff { font-size: 12px; display: block; font-family: var(--body); font-weight: 600; }
.price-diff.up { color: var(--success); }
.price-diff.down { color: var(--danger); }
.price-diff.flat { color: var(--faint); }
.add-btn {
  background: var(--primary-btn); color: #fff; border: 0; border-radius: 50%;
  font-family: var(--display); font-weight: 600; font-size: 20px;
  width: 34px; height: 34px; line-height: 1; transition: background .15s, transform .15s;
}
.add-btn:hover:not(:disabled) { background: var(--primary-btn-hover); transform: scale(1.08); }
.add-btn:disabled { background: transparent; color: var(--faint); border: 1px solid var(--graphite); cursor: not-allowed; }
.row-selected td { background: var(--chip-bg) !important; box-shadow: none; }
.row-selected .rider-name { color: var(--accent-text); }
.muted { color: var(--muted); }

/* ---------------- stats view ---------------- */
.event-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.event-pill {
  background: var(--carbon); border: 1px solid var(--graphite); color: var(--muted);
  font-family: var(--display); font-weight: 700; 
  letter-spacing: 1px; font-size: 13px; padding: 6px 12px;
}
.event-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.event-pill:disabled { opacity: .35; cursor: not-allowed; }

.breakdown { border: 1px solid var(--graphite); background: var(--panel-2); }
.breakdown-row {
  display: grid; grid-template-columns: 46px 1.4fr 90px 110px 110px;
  gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.breakdown-row.head {
  font-family: var(--display); font-weight: 600;  font-size: 12px;
  letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase;
}
.breakdown-row .who { min-width: 0; }
.breakdown-row .who .nm {
  font-family: var(--display); font-weight: 700;  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.breakdown-row .who .sub { color: var(--muted); font-size: 12px; }
.breakdown-row .pts { font-family: var(--display); font-weight: 800;  font-size: 19px; text-align: right; }
.mult-badge { font-size: 11px; letter-spacing: 1px; text-align: center; padding: 2px 8px; border: 1px solid var(--graphite); color: var(--muted); text-transform: uppercase; }
.mult-badge.gold { color: var(--gold); border-color: var(--gold-deep); }
.mult-badge.silver { color: var(--silver); border-color: var(--silver-deep); }
.mult-badge.boost { color: var(--chip-fg); border-color: var(--primary); }
.breakdown-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--carbon);
}
.breakdown-total .lbl { font-family: var(--display); font-weight: 800;  letter-spacing: 2px; }
.breakdown-total .val { font-family: var(--display); font-weight: 800;  font-size: 34px; color: var(--primary); }
/* ---------------- toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(80px);
  background: var(--carbon); color: var(--text); border: 1px solid var(--primary);
  font-family: var(--display); font-weight: 600;  letter-spacing: .5px;
  padding: 12px 22px; opacity: 0; transition: all .25s ease; z-index: 200;
  border-radius: 999px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


.season-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin-top: 26px; padding: 0 4px; }
.season-bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.season-bar { background: linear-gradient(180deg, var(--primary), var(--primary-btn-hover)); min-height: 2px; position: relative; }
.season-bar.zero { background: var(--graphite); }
.season-bar-col .bar-lbl { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 4px; font-family: var(--display); letter-spacing: .5px; }
.season-bar-col .bar-val { font-size: 11px; text-align: center; color: var(--text); font-family: var(--display); font-weight: 700; margin-bottom: 2px; }

/* ---------------- rules view ---------------- */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 40px 56px; align-items: start; }
.rule-card { border-top: 1px solid var(--graphite); padding: 18px 0 0; }
.rule-card h3 {
  font-family: var(--display); font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  font-size: 17px; line-height: 1.25; margin-bottom: 12px; color: var(--text); text-wrap: balance;
}
.rule-card p, .rule-card li { color: var(--text-soft); font-size: 14px; margin-bottom: 6px; }
.rule-card ul { padding-left: 18px; }
.rule-card table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rule-card td { padding: 4px 6px; border-bottom: 1px solid var(--line); color: var(--text-soft); }
.rule-card td:last-child { text-align: right; color: var(--text); font-weight: 600; }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  border-radius: 20px;
  width: min(640px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--panel); padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.modal h2 {
  font-family: var(--display); font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; font-size: 26px; margin-bottom: 6px;
}
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.booster-row {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px 6px 6px;
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--panel-2);
  transition: border-color .15s, background .15s;
}
.booster-row:has(.booster-main:hover:not(:disabled)) { border-color: var(--primary); background: var(--chip-bg); }
.booster-row.armed { border-color: var(--primary); }
.booster-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; padding: 10px; border-radius: 10px; cursor: pointer;
}
.booster-main:disabled { cursor: default; }
.booster-row .ico {
  width: 52px; height: 52px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--chip-bg); color: var(--accent-text);
}
.booster-main:disabled:not(.armed) .ico { opacity: .7; }
.booster-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.booster-row .nm { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 17px; line-height: 1.2; }
.booster-row .ds { color: var(--muted); font-size: 14px; line-height: 1.35; }
.booster-row .why { color: var(--faint); font-size: 13px; }
.booster-row .left {
  font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--carbon);
  padding: 4px 12px; border-radius: 999px; white-space: nowrap; flex: none;
}
.booster-row.armed .btn { flex: none; padding: 9px 20px; font-size: 13px; }

/* ---------------- pick mode: banner, pickable and movable cards ---------------- */
.pick-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 12px 12px 12px 20px; border-radius: 14px;
  background: linear-gradient(var(--chip-bg), var(--chip-bg)), var(--bg); border: 1px solid var(--primary); position: sticky; top: 78px; z-index: 20;
}
.team-board, .pool-panel { scroll-margin-top: 150px; }
.pick-msg { font-size: 15px; font-weight: 600; line-height: 1.35; }
.pick-banner .btn { flex: none; padding: 9px 20px; font-size: 13px; }
.slot-card.pickable, .slot-card.move-target { cursor: pointer; outline: 2px solid var(--primary); outline-offset: 3px; }
.slot-card.pickable:hover, .slot-card.move-target:hover { transform: translateY(-3px); }
.slot-card.move-target.empty { border-style: dashed; }
.slot-card.moving { opacity: .55; cursor: pointer; }
.slot-card[draggable="true"] { cursor: grab; }
.slot-card.dragging { opacity: .45; }
.slot-card.drag-over { border-color: var(--primary); outline: 2px dashed var(--primary); outline-offset: 3px; }
.slot-actions { display: flex; gap: 6px; }
.choose-btn {
  background: var(--primary-btn); color: #fff; border: 0; border-radius: 999px; padding: 7px 18px;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .8px; text-transform: uppercase;
}
.choose-btn:hover:not(:disabled) { background: var(--primary-btn-hover); }
.choose-btn:disabled { background: transparent; color: var(--faint); border: 1px solid var(--graphite); cursor: not-allowed; }
.slot-move:hover { color: var(--accent-text); border-color: var(--primary); }
.modal-close { margin-top: 8px; width: 100%; }

.notice {
  border: 1px solid var(--primary); border-radius: 12px;
  background: var(--chip-bg); color: var(--text-soft); padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.notice.warn { border-color: var(--danger); background: transparent; }

/* ---------------- onboarding ---------------- */
.onboard-step { text-align: center; padding: 10px 6px; }
.onboard-step .big {
  font-family: var(--display); font-weight: 800; 
  font-size: 30px; text-transform: uppercase; line-height: 1.1;
}
.onboard-step p { color: var(--muted); margin-top: 10px; font-size: 15px; }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--graphite); padding: 18px 20px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.site-footer .fine { font-size: 11px; margin-top: 4px; color: var(--faint); }

/* ---------------- responsive ---------------- */
@media (max-width: 1020px) {
  .gp-bar { grid-template-columns: repeat(2, 1fr); } .gp-cell.next { grid-column: 1 / -1; }
  .team-board { grid-template-columns: 1fr 1fr; } .board-col.aside { grid-column: 1 / -1; }
}
@media (max-width: 1240px) {
  .header-inner { flex-wrap: wrap; gap: 10px 14px; }
  .class-switch { order: 5; margin-left: 0; flex: 1 1 auto; }
  .class-switch button { flex: 1; }
  .account-btn { order: 6; }
  .lang-switch { margin-left: auto; }
}
@media (max-width: 760px) {
  .site-header { position: static; }
  .header-inner { flex-wrap: wrap; gap: 10px 8px; padding: 10px 16px; }
  .logo { order: 0; }
  .logo-fantasy { font-size: 24px; }
  .lang-switch { order: 1; margin-left: auto; }
  .theme-toggle { order: 2; width: 34px; height: 34px; }
  .account-btn { order: 2; width: 34px; height: 34px; }
  .account-btn .avatar-initial { width: 22px; height: 22px; font-size: 13px; }
  .class-switch { order: 3; margin-left: 0; flex: 1 1 100%; }
  .class-switch button { flex: 1; padding: 8px 6px; font-size: 14px; }
  .main-nav { order: 4; flex: 1 1 100%; justify-content: space-between; gap: 0; }
  .main-nav a { font-size: 14px; letter-spacing: .6px; padding: 8px 6px; }
  .main-nav a.active::after { left: 6px; right: 6px; }
  .app-main { padding: 18px 16px 48px; }
    .gp-bar { grid-template-columns: repeat(2, 1fr); }
  .breakdown-row { grid-template-columns: 40px 1.2fr 70px 80px; }
  .breakdown-row .col-boost { display: none; }
  .team-board { grid-template-columns: 1fr; gap: 22px; }
  .col-cards { gap: 12px; }
  .gp-cell.next { grid-column: 1 / -1; }
  .slot-name { font-size: 17px; }

  /* pool: keep rider, price, total points and the add button; drop the secondary stats */
  table.pool { min-width: 0; table-layout: fixed; width: 100%; }
  table.pool th:nth-child(2) { width: 84px; }
  table.pool th:nth-child(3) { width: 58px; }
  table.pool th { white-space: normal; line-height: 1.15; font-size: 11px; letter-spacing: .5px; }
  .pool .rider-name img.flag { display: none; }
  .pool .rider-name { font-size: 14px; }
  table.pool td:nth-child(2) { font-size: 14px; }
  table.pool th:nth-child(n+4):not(:last-child), table.pool td:nth-child(n+4):not(:last-child) { display: none; }
  table.pool th, table.pool td { padding-left: 6px; padding-right: 6px; }
  table.pool th { width: auto; }
  table.pool th:last-child { width: 52px; }
  table.pool th.txt, table.pool td.txt { padding-left: 12px; }
  table.pool td.txt { white-space: normal; }
  .pool-ident { gap: 8px; }
  .pool-thumb { width: 36px; height: 44px; }
  .pool-thumb.logo { width: 56px; height: 40px; }
  .pool .num-badge { display: none; }
  .pool .rider-name { font-size: 15px; }
  .pool .rider-sub { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pool-ident > span:last-child { overflow: hidden; }
  .pool .rider-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pool-tools { padding: 12px; }
  .pool-search { width: 100%; }
  .pool-note { display: none; }
  .pool-tabs { padding: 12px 12px 0; overflow-x: auto; }
  .pool-tabs { gap: 2px; }
  .pool-tabs button { padding: 8px 11px; font-size: 12px; letter-spacing: .5px; white-space: nowrap; }
  .action-bar .btn { padding: 10px 16px; font-size: 13px; }
  .action-bar .btn.primary { flex: 1 1 100%; }
  .add-btn, .choose-btn { flex: none; }
  .pick-banner { top: 8px; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .modal { padding: 20px; }
  .booster-main { gap: 12px; padding: 8px; }
  .booster-row { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 6px 12px; }
  .booster-row .ico { width: 44px; height: 44px; }
  .booster-row .nm { font-size: 15px; }
  .booster-row .left, .booster-row.armed .btn { align-self: flex-start; margin-left: 64px; }
  .view-title { font-size: 28px; }
  .gp-cell.next { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
  .gp-cell .v { font-size: 22px; }
  .gp-cell { padding: 14px 10px; }
  #toast { width: calc(100% - 32px); border-radius: 16px; text-align: center; }
}

.slot-ico { color: var(--faint); display: grid; place-items: center; }
.slot-ico.gold { color: var(--gold); }
.slot-ico.silver { color: var(--silver); }

/* ---------------- cloud: account + leagues ---------------- */
.cloud-card {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel); padding: 22px; max-width: 560px; margin-top: 16px;
}
/* shadcn-style ui components — account page; palette mapped to theme vars */
.auth-wrap { display: flex; flex-direction: column; gap: 14px; align-items: center; padding-top: 28px; }
.auth-wrap > * { width: 100%; max-width: 400px; }
.ui-card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 32px rgba(0,0,0,.06);
}
html[data-theme="light"] .ui-card { box-shadow: 0 1px 2px rgba(20,20,40,.06), 0 10px 32px rgba(20,20,40,.08); }
.ui-card-header { padding: 24px 24px 0; }
.ui-card-title { font-family: var(--body); font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.ui-card-desc { font-size: 14px; color: var(--muted); line-height: 1.45; margin-top: 6px; }
.ui-card-content { padding: 20px 24px 24px; }
.ui-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: 10px; background: var(--carbon); margin-bottom: 20px;
}
.ui-tab {
  border: 0; background: transparent; color: var(--muted);
  font-family: var(--body); font-weight: 600; font-size: 14px;
  height: 32px; border-radius: 7px;
  transition: color .15s, background .15s, box-shadow .15s;
}
.ui-tab:hover:not(.active) { color: var(--text); }
.ui-tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.22); }
.ui-form { display: flex; flex-direction: column; gap: 16px; }
.ui-field { display: flex; flex-direction: column; gap: 6px; }
.ui-label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.ui-input {
  width: 100%; height: 38px; padding: 0 12px;
  font-family: var(--body); font-size: 15px; color: var(--text);
  background: var(--field-bg); border: 1px solid var(--graphite); border-radius: 9px;
  transition: border-color .15s, box-shadow .15s;
}
.ui-input::placeholder { color: var(--faint); }
.ui-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--chip-bg); }
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px; border-radius: 9px;
  font-family: var(--body); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.ui-btn.primary { background: var(--primary-btn); color: #fff; }
.ui-btn.primary:hover:not(:disabled) { background: var(--primary-btn-hover); }
.ui-btn.outline { background: transparent; border-color: var(--graphite); color: var(--text); }
.ui-btn.outline:hover:not(:disabled) { background: var(--hover-bg); }
.ui-btn:disabled { opacity: .55; cursor: not-allowed; }
.ui-alert {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid; border-radius: 10px; padding: 11px 14px;
  font-size: 14px; line-height: 1.45;
}
.ui-alert .icon { margin-top: 2px; }
.ui-alert[hidden] { display: none; }
.ui-alert.default { border-color: var(--line); background: var(--carbon); color: var(--text-soft); }
.ui-alert.destructive {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  color: var(--danger);
}
.ui-alert.ok {
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  background: color-mix(in srgb, var(--success) 9%, transparent);
  color: var(--success);
}
.ui-profile { display: flex; align-items: center; gap: 14px; }
.ui-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--chip-bg); color: var(--chip-fg);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 18px;
}
.ui-profile-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.ui-profile-mail { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ui-sep { border: 0; height: 1px; background: var(--line); margin: 18px 0; }
.cloud-err { color: var(--danger); font-size: 14px; }
.cloud-status { font-size: 14px; color: var(--text-soft); margin-top: 10px; }
.cloud-status.ok { color: var(--success); }
.cloud-muted { color: var(--muted); font-size: 14px; }
.cloud-signin a { color: var(--accent-text); font-weight: 600; }
.cloud-h2 {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 1px;
  font-size: 16px; color: var(--text-soft); margin: 26px 0 4px;
}
.cloud-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0; }
.cloud-joingroup { display: flex; gap: 8px; align-items: center; }
.cloud-input {
  background: var(--field-bg); border: 1px solid var(--graphite); color: var(--text);
  font-family: var(--body); font-size: 15px; padding: 10px 16px; border-radius: 999px;
}
.cloud-input::placeholder { color: var(--faint); }
.cloud-input:focus { outline: none; border-color: var(--booster); box-shadow: 0 0 0 3px var(--chip-bg); }
.league-card { max-width: 720px; }
.league-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.league-head h3 {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 1px;
  font-size: 18px; display: flex; gap: 10px; align-items: center;
}
.owner-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--pill-fg); background: var(--pill-bg); padding: 2px 8px; border-radius: 999px;
}
.league-actions { display: flex; gap: 8px; align-items: center; }
.copy-code {
  display: inline-flex; gap: 8px; align-items: center;
  background: var(--field-bg); border: 1px dashed var(--booster); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-family: var(--body); font-size: 13px; cursor: pointer;
}
.copy-code .code { font-family: var(--display); font-weight: 700; letter-spacing: 2px; color: var(--accent-text); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.cloud-classtabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.cloud-classtab {
  font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--graphite); background: transparent; color: var(--muted); cursor: pointer;
}
.cloud-classtab.active { color: #fff; background: var(--booster); border-color: var(--booster); }
.cloud-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cloud-table th {
  text-align: left; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--faint); padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.cloud-table td { padding: 9px 10px; }
.cloud-table tbody tr:nth-child(odd) td { background: var(--stripe); }
.cloud-table tr.me td { color: var(--chip-fg); font-weight: 600; }
.cloud-table td:last-child, .cloud-table th:last-child { text-align: right; }
