/* The look of Elite Class, taken from lichess.org/training/themes on 20 November 2026.

   Every value here was measured on the rendered lichess page (getComputedStyle and its own
   stylesheets), at 1440 by 900 in Chrome, dark and light. Nothing is copied from lichess
   but numbers: no logo, no icon, no font file. What the page is made of:

   - A warm near-black ground (hue 37), with a lighter band at the top that fades out
     over 116px.
   - Content sits on one box per page: radius 7px, a soft three-layer shadow, no border.
   - Type: Roboto Light (300) for headings, Noto Sans for reading text. The body is about
     13px. A page title is 30px, a section 24px, a row's title 22px.
   - A list of rows, not cards: an icon in grey at 80% opacity, a title, a count in a
     dimmer grey with letter-spacing -1px, one line below. A row lights blue on hover.
   - One green row at the top for what to do first.
   - Blue is for links and the main button, green for right and for the first thing to
     do, orange for the active mark, red for wrong.

   Colours live in the tokens below and nowhere else. Light is under [data-theme=light]. */

:root,
:root[data-theme="dark"] {
  --c-bg-page: hsl(37 10% 8%);
  --c-body-gradient: hsl(37 12% 16%);
  --c-bg-box: hsl(37 7% 14%);
  --c-bg-zebra: hsl(37 5% 19%);
  --c-bg-zebra2: hsl(37 5% 24%);
  --c-bg-low: hsl(37 7% 22%);
  --c-bg-input: hsl(37 10% 12%);
  --c-font: #bababa;
  --c-font-dim: #949494;
  --c-font-dimmer: hsl(0 0% 42%);
  --c-font-clear: hsl(0 0% 80%);
  --c-font-clearer: hsl(0 0% 89%);
  --c-font-page: #949494;
  --c-font-shadow: #2b2b2ba8;
  --c-primary: #3692e7;
  --c-link: #3692e7;
  --c-secondary: #629924;
  --c-good: #629924;
  --c-accent: #d64f00;
  --c-bad: #cc3333;
  --c-brag: hsl(37 74% 43%);
  --c-border: #404040;
  --c-shade: #4d4d4d;
  --c-over: #ffffff;
  --c-metal-top: hsl(37 7% 22%);
  --c-metal-bottom: hsl(37 5% 19%);
  --c-mistake: #e69d00;
  --c-blunder: #df5353;
  --c-last-move: rgba(155, 199, 0, 0.41);
  --c-dest: rgba(20, 85, 30, 0.5);
  --c-mask: #0009;
  --icon-filter-hover: brightness(1.4);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --c-bg-page: hsl(37 10% 92%);
  --c-body-gradient: hsl(37 12% 84%);
  --c-bg-box: #ffffff;
  --c-bg-zebra: hsl(37 12% 96.5%);
  --c-bg-zebra2: hsl(37 12% 92%);
  --c-bg-low: #e3e3e3;
  --c-bg-input: hsl(37 10% 97%);
  --c-font: #4d4d4d;
  --c-font-dim: #787878;
  --c-font-dimmer: hsl(0 0% 62%);
  --c-font-clear: hsl(0 0% 12%);
  --c-font-clearer: #000000;
  --c-font-page: hsl(0 0% 37%);
  --c-font-shadow: transparent;
  --c-primary: #1b78d0;
  --c-link: #1b78d0;
  --c-secondary: #629924;
  --c-good: #4f7d1c;
  --c-accent: #d64f00;
  --c-bad: #cc3333;
  --c-brag: hsl(37 74% 38%);
  --c-border: #d9d9d9;
  --c-shade: #d6d6d6;
  --c-over: #ffffff;
  --c-metal-top: #f5f5f5;
  --c-metal-bottom: #ededed;
  --c-mistake: #b37a00;
  --c-blunder: #c33;
  --c-last-move: rgba(155, 199, 0, 0.41);
  --c-dest: rgba(20, 85, 30, 0.5);
  --c-mask: #0006;
  --icon-filter-hover: brightness(0.8);
  color-scheme: light;
}

:root {
  --font-head: Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 7px;
  --box-shadow: 0 2px 2px #00000014, 0 3px 1px -2px #0000002e, 0 1px 5px #0000001a;
  --header-h: 60px;
  --gap: 15px;
  --box-pad: 50px;
  --main-max: 1300px;
  --menu-w: 160px;
}

@media (max-width: 1200px) {
  :root { --box-pad: calc(10px + 40 * (100vw - 320px) / 880); }
}
@media (max-width: 800px) {
  :root { --header-h: 48px; --gap: 10px; --box-pad: 16px; }
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
  margin: 0 0 var(--gap);
  min-height: 100vh;
  background: linear-gradient(var(--c-body-gradient), var(--c-bg-page) 116px) no-repeat, var(--c-bg-page);
  color: var(--c-font);
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-link); text-decoration: none; }
a:hover { color: color-mix(in oklab, white 25%, var(--c-link)); }

h1, h2, h3 { font-family: var(--font-head); font-weight: 300; margin: 0; }

button { font: inherit; color: inherit; }

/* The header: the site's name on the left, who is playing on the right. */
.top {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(var(--gap), calc((100vw - 1780px) / 2));
  position: sticky;
  top: 0;
  z-index: 50;
  user-select: none;
}
.top.scrolled { background: var(--c-bg-page); border-bottom: 1px solid var(--c-border); }
.site-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-font);
  font-size: 25px;
  text-shadow: 0 1px 0 var(--c-font-shadow);
  transform: translateY(-2px);
}
.site-title:hover { color: var(--c-font-clear); }
.site-title svg { width: 40px; height: 40px; flex: none; }
.site-title b { font-weight: 400; }
.site-title span { color: var(--c-font-dim); font-weight: 300; }
.top-right { display: flex; align-items: center; gap: 4px; height: 100%; }
.top-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 14px;
  color: var(--c-font);
  font-size: 1.05rem;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.top-link:hover { color: var(--c-font-clear); }
.top-link svg { width: 22px; height: 22px; }

/* The page: a menu on the left and one box. */
.wrap {
  display: grid;
  grid-template-columns: 1vw 1fr minmax(auto, var(--main-max)) 1fr 1vw;
  margin-top: 4px;
}
.page {
  grid-column: 3;
  display: grid;
  grid-template-columns: var(--menu-w) minmax(0, 1fr);
  align-items: start;
}
.page.wide { grid-template-columns: minmax(0, 1fr); }

.menu { margin-right: 10px; display: flex; flex-direction: column; position: sticky; top: calc(var(--header-h) + 4px); }
.menu a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 9px 10px;
  border-radius: var(--radius);
  color: var(--c-font-page);
  font-family: var(--font-head);
  font-size: 13px;
  text-shadow: 0 1px 0 var(--c-font-shadow);
  white-space: nowrap;
}
.menu a:hover { color: var(--c-font-clear); background: #80808012; }
.menu a.active { color: var(--c-font-clear); background: var(--c-bg-box); }
.menu .sep { height: 2em; }

.box {
  background: var(--c-bg-box);
  border-radius: var(--radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  min-width: 0;
}
.box__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 4vh var(--box-pad);
}
.box__top h1 { font-size: 30px; color: var(--c-font); }
.box__top .sub { color: var(--c-font-dim); font-size: 13px; width: 100%; margin-top: -0.6rem; }
.box__pad { padding: 0 var(--box-pad); }
.box > :last-child { margin-bottom: 4vh; }

.section-title {
  font-size: 24px;
  padding: 0 var(--box-pad);
  margin: 1em 0 0.5em;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-title small { font-family: var(--font-body); font-size: 13px; color: var(--c-font-dim); }

/* A list of rows: icon, title, count, one line. */
.rows {
  margin-inline: calc(var(--box-pad) / 2);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(40ch, 100%), 1fr));
  column-gap: 6.6px;
}
.row {
  display: flex;
  align-items: center;
  padding: 1.5em 1em 1.5em 1em;
  border-radius: var(--radius);
  color: var(--c-font);
  transition: background-color 0.15s, color 0.15s;
  min-width: 0;
}
.row:hover { background: color-mix(in oklab, var(--c-primary) 10%, var(--c-bg-box)); color: var(--c-link); }
.row .icon {
  flex: 0 0 6em;
  height: 4.5em;
  align-self: flex-start;
  opacity: 0.8;
  color: var(--c-font);
  transition: opacity 0.15s, filter 0.15s;
  display: flex;
  justify-content: center;
}
.row .icon svg { height: 100%; width: auto; }
.row:hover .icon { opacity: 1; filter: var(--icon-filter-hover); }
.row > span { flex: 1 1 100%; min-width: 0; padding-inline-start: 1em; }
.row h3 { display: block; font-size: 1.7em; font-weight: 400; line-height: 1em; margin-bottom: 0.2em; }
.row h3 em {
  font-style: normal;
  font-weight: 300;
  font-size: 0.8em;
  letter-spacing: -1px;
  color: var(--c-font-dimmer);
  margin-inline-start: 0.7ch;
}
.row .line { display: block; line-height: 1.45; }
.row .bar { display: block; height: 4px; margin-top: 0.7em; border-radius: 2px; background: var(--c-bg-zebra2); overflow: hidden; max-width: 28em; }
.row .bar i { display: block; height: 100%; background: var(--c-good); }
.row.done h3::after { content: " \2713"; color: var(--c-good); font-size: 0.8em; }
.row.locked { opacity: 0.55; pointer-events: none; }

/* The one thing to do first. */
.row--first {
  margin: 2em var(--box-pad) 2em calc(var(--box-pad) / 2);
  font-size: 1.2em;
  border: 1px solid var(--c-border);
  background: color-mix(in oklab, var(--c-secondary) 35%, var(--c-bg-box));
  color: var(--c-good);
  padding: 1.5em 1em;
}
.row--first:hover { background: color-mix(in oklab, var(--c-secondary) 25%, var(--c-bg-box)); color: var(--c-good); }
.row--first > span { color: var(--c-font); }
.row--first .icon { color: var(--c-good); }
.rows--single { display: block; margin: 0; }

/* Buttons, as lichess draws them. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.6em;
  border: 0;
  border-radius: var(--radius);
  background: var(--c-primary);
  color: var(--c-over);
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 1rem;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  user-select: none;
  text-shadow: 0.5px 0.5px 0 #000c;
  box-shadow: inset 0 1px 3px -2px hsl(from var(--c-primary) h s calc(l + 32)),
    inset 0 -4px 6pt -3pt hsl(from var(--c-primary) h s calc(l - 18)), 0 1px 3px 0 #0003;
  transition: all 0.15s;
}
.button:hover { color: var(--c-over); filter: brightness(1.15); }
.button-green {
  background: var(--c-secondary);
  box-shadow: inset 0 1px 3px -2px hsl(from var(--c-secondary) h s calc(l + 32)),
    inset 0 -4px 6pt -3pt hsl(from var(--c-secondary) h s calc(l - 12)), 0 1px 3px 0 #0003;
}
.button-metal {
  background: linear-gradient(to bottom, var(--c-metal-top), var(--c-metal-bottom));
  color: var(--c-font);
  text-shadow: none;
  box-shadow: inset 0 1px 3px -2px #737373, 0 1px 3px 0 #0003;
}
.button-metal:hover { color: var(--c-font-clear); }
.button-empty { background: none; box-shadow: none; color: var(--c-font-dim); text-shadow: none; }
.button-empty:hover { color: var(--c-font-clear); background: var(--c-bg-zebra); filter: none; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Plain tables (the class page). */
table.slist { width: 100%; border-collapse: collapse; }
.slist th { text-align: left; font-weight: 400; color: var(--c-font-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.8em 1em; border-bottom: 1px solid var(--c-border); }
.slist td { padding: 0.8em 1em; border-bottom: 1px solid var(--c-border); }
.slist tbody tr:nth-child(even) { background: var(--c-bg-zebra); }
.slist .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { color: var(--c-font-dim); padding: 1em var(--box-pad); line-height: 1.5; }

@media (max-width: 800px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .menu {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    margin: 0 0 var(--gap);
    gap: 3px;
    scrollbar-width: none;
  }
  .menu .sep { display: none; }
  .menu a.active { background: none; position: relative; }
  .menu a.active::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 4px;
    border-radius: 1em;
    background: var(--c-accent);
  }
  .site-title span { display: none; }
  .site-title { font-size: 19px; white-space: nowrap; gap: 0.5rem; }
  .site-title svg { width: 32px; height: 32px; }
  .top-link { padding: 0 8px; }
  .row h3 { font-size: 1.4em; }
  .row .icon { flex-basis: 3.6em; height: 3.2em; }
  .row--first { margin-inline: 0.5em; }
}
