/* CS2 Demo Fixer */

@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/chakra-petch-thai-600-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/chakra-petch-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/chakra-petch-thai-700-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Chakra Petch"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/chakra-petch-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bai Jamjuree"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/bai-jamjuree-thai-400-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Bai Jamjuree"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/bai-jamjuree-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bai Jamjuree"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/bai-jamjuree-thai-600-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Bai Jamjuree"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/bai-jamjuree-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #E9EEF2;
  --surface: #FFFFFF;
  --ink: #16213A;
  --muted: #55617A;
  --line: #C3CDD8;
  --line-strong: #93A2B4;
  --yolk: #F5B700;
  --yolk-hover: #E3A800;
  --yolk-ink: #16213A;
  --yolk-wash: #FFF4CC;
  --comb: #C62828;
  --leaf: #0E7A5C;
  --code-bg: #DCE3EA;
  --signon: #A9BCD2;

  --chick-body: #FFFFFF;
  --chick-line: #16213A;
  --chick-comb: #D93A2B;
  --chick-beak: #F5A300;
  --chick-leg: #E08A00;

  --font-display: "Chakra Petch", "Leelawadee UI", "Thonburi", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "Bai Jamjuree", "Leelawadee UI", "Thonburi", "Noto Sans Thai", system-ui, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  --pad: 28px;        /* drop zone side padding */
  --signon-w: 34px;   /* width of the "load time" lane */
  --tick: 22px;       /* timeline tick spacing */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101826;
    --surface: #162134;
    --ink: #E7ECF3;
    --muted: #9AA7BC;
    --line: #2B3A52;
    --line-strong: #4A5F80;
    --yolk: #F7C531;
    --yolk-hover: #FFD45A;
    --yolk-wash: #2B2814;
    --comb: #FF7A6E;
    --leaf: #46CFA2;
    --code-bg: #22304A;
    --signon: #3A5884;
    --chick-body: #F4F6FA;
    --chick-line: #16213A;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
code {
  font-family: var(--font-code);
  font-size: .86em;
  background: var(--code-bg);
  padding: .12em .42em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
:focus-visible { outline: 3px solid var(--yolk); outline-offset: 3px; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { max-width: 760px; margin: 0 auto; padding: 20px 16px 56px; }

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 32px; }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.lang { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.lang a {
  font: 600 .9rem/1 var(--font-display);
  color: var(--muted);
  text-decoration: none;
  padding: 9px 13px;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.lang a:focus-visible { outline-offset: -3px; }

/* ---------- new feature notice */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 7px 6px 7px 10px;
  background: var(--yolk-wash);
  border: 1px solid var(--yolk);
  border-radius: 10px;
  font-size: .95rem;
  line-height: 1.45;
}
.notice-tag {
  flex: none;
  margin-top: 1px;
  padding: 1px 8px;
  background: var(--yolk);
  color: var(--yolk-ink);
  border-radius: 5px;
  font: 700 .82rem/1.45 var(--font-display);
}
.notice-text { flex: 1; min-width: 0; }
.notice code { background: var(--surface); }
.notice-close {
  flex: none;
  width: 26px;
  height: 26px;
  margin: -2px 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.notice-close:hover { color: var(--ink); background: var(--code-bg); }

/* ---------- hero */
.hero h1 {
  font-weight: 700;
  font-size: clamp(2.05rem, 1.2rem + 3.5vw, 3.35rem);
  line-height: 1.14;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.lede { margin-top: 14px; font-size: 1.12rem; color: var(--muted); max-width: 36em; }

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 30px;
  padding: 30px var(--pad) 0;
  background: var(--surface);
  border: 2px dashed var(--line-strong);
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
}
.drop:hover { border-color: var(--ink); }
.drop:focus-within { outline: 3px solid var(--yolk); outline-offset: 3px; }
.drop.is-over { border-style: solid; border-color: var(--yolk); background: var(--yolk-wash); }
.drop-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.8rem); line-height: 1.2; }
.drop-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.drop-or, .drop-note { color: var(--muted); }
.drop-note { font-size: .95rem; }
.rename { margin-top: 16px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  background: var(--line-strong);
  border-radius: 12px;
  transition: background .15s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform .15s ease;
}
.switch input:checked + .switch-track { background: var(--yolk); }
.switch input:checked + .switch-track::after { background: var(--yolk-ink); transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--yolk); outline-offset: 3px; }
/* csgo folder switch: its notes line up with the switch label (40px track + 10px gap) */
.gamedir { margin-top: 10px; }
.gamedir-hint, .gamedir-at { margin: 6px 0 0 50px; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.gamedir-hint.is-warning { color: var(--comb); }
.gamedir-hint a { color: var(--ink); font-weight: 600; }
.link-btn {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.job-download.is-saved::before {
  content: "";
  flex: none;
  width: 11px;
  height: 6px;
  margin-top: -3px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.job-download[aria-busy="true"] { opacity: .7; cursor: progress; }
.privacy { margin-top: 12px; color: var(--muted); font-size: .95rem; }
.tally { display: flex; align-items: center; gap: 8px; margin-top: 8px; font: 600 .95rem/1.3 var(--font-display); }
.tally-icon { flex: none; width: 26px; height: 26px; }

/* ---------- demo timeline (decorative strip + per-file progress) */
.lane-signon {
  flex: 0 0 var(--signon-w);
  height: 10px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: repeating-linear-gradient(135deg, var(--signon) 0 3px, transparent 3px 7px);
}
.lane-ticks, .lane-track {
  flex: 1;
  position: relative;
  height: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px var(--tick));
  overflow: hidden;
}
.chicken { position: absolute; display: block; }

.strip {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  height: 62px;
  margin: 10px calc(-1 * var(--pad)) 0;
  padding: 0 var(--pad) 16px;
  border-top: 1px solid var(--line);
}
.strip .chicken { width: 36px; height: 36px; left: calc(var(--pad) + var(--signon-w) + var(--tick) - 18px); bottom: 25px; }

/* ---------- jobs */
.jobs { margin-top: 34px; border-top: 1.5px solid var(--ink); }
.job { display: grid; gap: 12px; padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.job-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.job-meta { display: inline-flex; flex-wrap: wrap; gap: 0 14px; color: var(--muted); font-size: .95rem; }

.timeline { position: relative; display: flex; align-items: flex-end; height: 48px; padding-bottom: 2px; }
.lane-fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--yolk); transition: width .15s linear; }
.timeline .chicken { width: 30px; height: 30px; left: calc(var(--signon-w) + var(--tick) - 15px); bottom: 13px; }
.job.is-fixed .timeline .chicken { animation: hop .72s cubic-bezier(.25, .8, .35, 1) .15s both; }
.job.is-clean .timeline .chicken { visibility: hidden; }
.job.is-error .lane-fill { background: var(--comb); }
.job.is-error .timeline .chicken { opacity: .4; }
@keyframes hop {
  0%   { transform: translate(0, 0); }
  45%  { transform: translate(calc(-0.55 * var(--tick)), -18px) rotate(-10deg); }
  100% { transform: translate(calc(-1 * var(--tick) - 18px), 0); }
}

.job-status { font-family: var(--font-display); font-weight: 600; }
.job.is-fixed .job-status { color: var(--leaf); }
.job.is-error .job-status { color: var(--comb); }
.job-notes { margin: 0; padding-left: 1.15em; }
.job-notes:empty { display: none; }
.job-notes li + li { margin-top: 4px; }
.job-notes .is-warning { color: var(--comb); }
.job-result { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.job-file { color: var(--muted); font-size: .95rem; overflow-wrap: anywhere; }
.job-command { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.job-command-label { color: var(--muted); font-size: .95rem; }
.job-command-text { font-size: .95rem; padding: .38em .62em; }
/* "Download all", the first row of the list once there are two or more files */
.jobs-all { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.jobs-all-text { color: var(--muted); font-size: .95rem; }
.jobs-all-hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }

/* ---------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 1rem/1.2 var(--font-display);
  padding: 11px 18px;
  border: 2px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--yolk); border-color: var(--yolk); color: var(--yolk-ink); }
.btn-primary:hover { background: var(--yolk-hover); border-color: var(--yolk-hover); }
.btn-quiet { background: transparent; border-color: var(--line-strong); color: var(--ink); padding: 7px 12px; font-size: .92rem; }
.btn-quiet:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ---------- how to play */
.howto { margin-top: 60px; }
.howto h2, .faq h2 { font-size: 1.5rem; font-weight: 700; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 16px; margin: 20px 0 0; padding: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font: 700 1.05rem/1 var(--font-display);
  border: 2px solid var(--ink);
  border-radius: 6px;
}
.steps li > span { padding-top: 5px; }

/* ---------- questions */
.faq { margin-top: 60px; }
.faq h2 { margin-bottom: 14px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  list-style: none;
  cursor: pointer;
}
.faq summary h3 { font-size: 1.15rem; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq-body { display: grid; gap: 12px; padding-bottom: 24px; max-width: 40em; }
.faq-body h4 { font-size: 1rem; margin-top: 8px; }
.tech { font-size: .93rem; color: var(--muted); }

/* ---------- footer */
.foot { display: grid; gap: 6px; margin-top: 36px; color: var(--muted); font-size: .9rem; }
.foot p span + span::before { content: " "; }
.credit-link { color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.credit-link:hover span { text-decoration: underline; }
.credit-link .gh { width: 1em; height: 1em; margin-right: .3em; vertical-align: -.14em; fill: currentColor; }

@media (max-width: 560px) {
  :root { --pad: 18px; }
  body { font-size: 16px; }
  .top { padding-bottom: 24px; }
  .drop { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .job.is-fixed .timeline .chicken { transform: translate(calc(-1 * var(--tick) - 18px), 0); }
}
