/* FolderLoft: one stylesheet for the public pages and the members' area. No external resources.
   Two looks, light and dark, are two sets of the same custom properties. The default follows the system's
   prefers-color-scheme; the button in the top bar sets data-theme="light" or "dark" on <html>, which wins. */
:root {
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
/* light look */
:root {
  --bg: #f4f6fa;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #edf0f6;
  --border: #d9dfe9;
  --border-2: #b9c3d2;
  --input-border: #7b8698;
  --text: #0f1722;
  --muted: #465366;
  --faint: #566275;
  --accent: #3a49c9;
  --accent-hi: #2c3aa8;
  --on-accent: #ffffff;
  --accent-2: #0d6e66;
  --win: #047857;
  --loss: #be123c;
  --warn: #a14a07;
  --on-warn: #ffffff;
  --topbar-bg: rgba(244, 246, 250, .9);
  --accent-soft: rgba(58, 73, 201, .09);
  --glow-1: rgba(58, 73, 201, .12);
  --glow-2: rgba(13, 110, 102, .08);
  --win-soft: rgba(4, 120, 87, .1);
  --loss-soft: rgba(190, 18, 60, .08);
  --alert-border: rgba(190, 18, 60, .35);
  --alert-bg: #fff1f2;
  --alert-text: #9f1239;
  --note-border: rgba(161, 74, 7, .35);
  --note-bg: #fff8e6;
  --note-text: #6f2d0c;
  --row-hover: rgba(15, 23, 42, .035);
  --ring: rgba(58, 73, 201, .25);
  --shadow: 0 10px 28px rgba(15, 23, 42, .08);
  --show-sun: none;
  --show-moon: block;
  color-scheme: light;
}
/* dark look: the system asks for it and the visitor has not chosen light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13;
    --bg-2: #0e131a;
    --surface: #131a23;
    --surface-2: #19222e;
    --border: #253142;
    --border-2: #34445a;
    --input-border: #66768d;
    --text: #e7edf4;
    --muted: #a3b0c2;
    --faint: #8794a8;
    --accent: #8ea2ff;
    --accent-hi: #aab9ff;
    --on-accent: #0a0e13;
    --accent-2: #5eead4;
    --win: #34d399;
    --loss: #fb7185;
    --warn: #fbbf24;
    --on-warn: #0a0e13;
    --topbar-bg: rgba(10, 14, 19, .88);
    --accent-soft: rgba(142, 162, 255, .12);
    --glow-1: rgba(142, 162, 255, .16);
    --glow-2: rgba(94, 234, 212, .08);
    --win-soft: rgba(52, 211, 153, .14);
    --loss-soft: rgba(251, 113, 133, .14);
    --alert-border: rgba(251, 113, 133, .45);
    --alert-bg: rgba(251, 113, 133, .1);
    --alert-text: #fecdd3;
    --note-border: rgba(251, 191, 36, .4);
    --note-bg: rgba(251, 191, 36, .08);
    --note-text: #fde68a;
    --row-hover: rgba(255, 255, 255, .03);
    --ring: rgba(142, 162, 255, .3);
    --shadow: 0 12px 32px rgba(0, 0, 0, .35);
    --show-sun: block;
    --show-moon: none;
    color-scheme: dark;
  }
}
/* dark look: the visitor chose it */
:root[data-theme="dark"] {
  --bg: #0a0e13;
  --bg-2: #0e131a;
  --surface: #131a23;
  --surface-2: #19222e;
  --border: #253142;
  --border-2: #34445a;
  --input-border: #66768d;
  --text: #e7edf4;
  --muted: #a3b0c2;
  --faint: #8794a8;
  --accent: #8ea2ff;
  --accent-hi: #aab9ff;
  --on-accent: #0a0e13;
  --accent-2: #5eead4;
  --win: #34d399;
  --loss: #fb7185;
  --warn: #fbbf24;
  --on-warn: #0a0e13;
  --topbar-bg: rgba(10, 14, 19, .88);
  --accent-soft: rgba(142, 162, 255, .12);
  --glow-1: rgba(142, 162, 255, .16);
  --glow-2: rgba(94, 234, 212, .08);
  --win-soft: rgba(52, 211, 153, .14);
  --loss-soft: rgba(251, 113, 133, .14);
  --alert-border: rgba(251, 113, 133, .45);
  --alert-bg: rgba(251, 113, 133, .1);
  --alert-text: #fecdd3;
  --note-border: rgba(251, 191, 36, .4);
  --note-bg: rgba(251, 191, 36, .08);
  --note-text: #fde68a;
  --row-hover: rgba(255, 255, 255, .03);
  --ring: rgba(142, 162, 255, .3);
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --show-sun: block;
  --show-moon: none;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip:focus { left: 16px; }
.muted { color: var(--muted); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar-bg); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--border-2); border-radius: 999px; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a:not(.btn) { color: var(--muted); font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav form { margin: 0; }
.theme-toggle { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: var(--show-sun); }
.theme-toggle .moon { display: var(--show-moon); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .95rem; font-weight: 600; line-height: 1.3; cursor: pointer; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-block { width: 100%; }

/* hero */
.hero { padding: 72px 0 64px; background: radial-gradient(900px 420px at 85% -10%, var(--glow-1), transparent 70%), radial-gradient(700px 360px at 0% 110%, var(--glow-2), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; margin-bottom: 14px; color: var(--accent-2); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.3rem); letter-spacing: -.025em; }
.lead { max-width: 38em; color: var(--muted); font-size: 1.125rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* hero preview: a match overview drawn with HTML and CSS */
.preview { margin: 0; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.preview-head { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .85rem; }
.preview-head span:last-child { margin-left: auto; }
.preview .score { margin: 6px 0 16px; font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.preview .score small { margin-left: 8px; color: var(--win); font-size: .9rem; font-weight: 600; }
.preview figcaption { margin-top: 14px; color: var(--faint); font-size: .8rem; }
.mini-strip { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 0; list-style: none; }
.mini-strip li { width: 12px; height: 22px; border-radius: 3px; background: var(--loss); opacity: .85; }
.mini-strip li.w { background: var(--win); }
.mini-strip li.half { margin-left: 8px; }
.meters { display: grid; gap: 10px; margin: 0; }
.meters div { display: grid; grid-template-columns: 8em 1fr 3.2em; gap: 10px; align-items: center; font-size: .85rem; }
.meters dt { color: var(--muted); }
.meters dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* sections */
.section { padding: 72px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature p { color: var(--muted); }
.icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ticks { margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; margin: 6px 0; padding-left: 22px; font-size: .95rem; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-2); }
.staff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.staff li { padding: 24px; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.staff li:nth-child(2) { border-top-color: var(--accent-2); }
.staff li:nth-child(3) { border-top-color: var(--win); }
.staff h3 { font-size: 1.05rem; }
.staff p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); counter-increment: step; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 12px; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.steps h3 { font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 36px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(135deg, var(--glow-1), var(--glow-2)); }
.callout > div { max-width: 46em; }
.callout > .btn { margin-left: auto; }
.callout p { margin: 0 0 .6em; color: var(--muted); }
.callout p:last-child { margin-bottom: 0; }

/* footer */
.footer { padding: 28px 0; border-top: 1px solid var(--border); color: var(--faint); font-size: .9rem; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.footer p { margin: 0 auto 0 0; }
.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--muted); }

/* sign-in */
.auth { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 140px); padding: 56px 16px; }
.panel { width: 100%; max-width: 420px; padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.panel h1 { font-size: 1.6rem; }
.field { display: grid; gap: 8px; margin: 22px 0; }
label { font-size: .95rem; font-weight: 600; }
input[type="password"] { width: 100%; padding: 12px 14px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 16px; }
input[type="password"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.alert { margin: 18px 0 0; padding: 10px 14px; border: 1px solid var(--alert-border); border-radius: 10px; background: var(--alert-bg); color: var(--alert-text); font-size: .95rem; }
.note { color: var(--muted); font-size: .9rem; }
.panel .note { margin: 18px 0 0; }
.back { margin: 22px 0 0; font-size: .9rem; }

/* members' area */
.app-main { padding-bottom: 48px; }
.demo-note { display: flex; align-items: center; gap: 10px; margin: 24px 0; padding: 10px 14px; border: 1px solid var(--note-border); border-radius: 10px; background: var(--note-bg); color: var(--note-text); font-size: .9rem; }
.demo-note::before { content: "i"; display: grid; flex: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--warn); color: var(--on-warn); font: 700 .75rem/1 var(--mono); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 8px 0 22px; }
.page-head h1 { margin: 0 auto 0 0; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.page-head p { margin: 0; color: var(--muted); }
.crumbs { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card h2 { margin: 0 0 8px; color: var(--muted); font-size: .85rem; font-weight: 600; letter-spacing: .02em; }
.card .value { margin: 0; font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card .sub { margin: 6px 0 0; color: var(--faint); font-size: .85rem; }
.box { margin-bottom: 24px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.box > h2 { font-size: 1.1rem; }
.box-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 12px; }
.box-head h2 { margin: 0 auto 0 0; font-size: 1.1rem; }
.box-head p { margin: 0; color: var(--faint); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.grid-2 > .box { margin-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
caption { padding: 0 0 10px; color: var(--faint); font-size: .85rem; text-align: left; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; }
.num { text-align: right; }
.vod { font-family: var(--mono); font-size: .85rem; }
tr.group th { padding-top: 14px; background: var(--surface-2); color: var(--text); font-size: .85rem; letter-spacing: .02em; text-transform: none; }
tr.half td, tr.half th { border-top: 2px solid var(--border-2); }
tr.current { background: var(--accent-soft); }
.badge { display: inline-block; min-width: 1.9em; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; text-align: center; }
.badge.w { background: var(--win-soft); color: var(--win); }
.badge.l { background: var(--loss-soft); color: var(--loss); }
.badge.pick { background: var(--accent-soft); color: var(--accent); }
.badge.ban { background: var(--surface-2); color: var(--muted); }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.facts div { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--loss-soft); color: var(--loss); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline li.w { background: var(--win-soft); color: var(--win); }
.timeline li.half { margin-left: 14px; }
.sub-title { margin: 22px 0 8px; font-size: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; color: var(--faint); font-size: .82rem; }
.insights { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.insights li { padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 8px; background: var(--surface-2); }
.insights strong { display: block; margin-bottom: 2px; }
.insights .meta { display: block; margin-top: 4px; color: var(--faint); font-size: .8rem; }
.timeline + .facts { margin: 18px 0 0; }
tr.total th, tr.total td { border-top: 1px solid var(--border-2); font-weight: 700; }

/* tournament bracket: one column per stage, each series a card with both teams */
.bracket-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bracket { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 0 28px; min-width: 600px; }
.stage { display: flex; flex-direction: column; }
.stage h3 { margin: 0 0 10px; color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.series-list { display: flex; flex: 1; flex-direction: column; justify-content: space-around; gap: 12px; margin: 0; padding: 0; list-style: none; }
.series { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.series span { display: flex; gap: 8px; padding: 6px 12px; }
.series span + span { border-top: 1px solid var(--border); }
.series b { margin-left: auto; font-variant-numeric: tabular-nums; }
.series .won { font-weight: 700; }
.series .you { color: var(--accent); }
.series.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.series small { display: block; padding: 4px 12px 6px; border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }

/* narrow screens */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .features, .steps { grid-template-columns: repeat(2, 1fr); }
  .staff { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 44px; }
  .section { padding: 52px 0; }
  .features, .steps { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav .wide { display: none; }
  .callout { padding: 24px; }
  .callout > .btn { margin-left: 0; }
  .panel { padding: 24px 20px; }
  .box { padding: 16px; }
  .timeline li { width: 27px; height: 27px; }
}
