:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #15181d;
  --muted: #59616d;
  --line: #e1e4e9;
  --accent: #e5322d;
  --accent-text: #ffffff;
  --bad: #c62828;
  --current: #3451e0; /* the TrulyTools hub's "current tab" blue */
  --soon: #8b939e;    /* and its "not available" gray */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px rgba(16, 24, 40, 0.05);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --text: #e7e9ec;
    --muted: #9aa3ae;
    --line: #29303a;
    --accent: #ff4a3d;
    --bad: #ff8a80;
    --current: #5b74ff;
    --soon: #6f7782;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.top, main, .foot { max-width: 960px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* The top bar, the same on every page: the brand, one tab per tool, then Support. */
.top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { flex: none; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--accent);
  vertical-align: 1px;
}

.tabs { display: flex; flex: 1 1 auto; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tab {
  flex: none;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--current); }
.tab.soon { color: var(--soon); }
.tab[aria-current] { background: var(--current); color: #ffffff; }

.menu { position: relative; flex: none; }
.menu > summary {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
  vertical-align: 2px;
}
.menu > summary:hover { color: var(--current); }
.menu.current > summary { box-shadow: inset 0 -2px 0 var(--current); }
.menu[open] > summary { background: var(--surface); box-shadow: var(--shadow); }
.menu-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.18);
}
.menu-list a { padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.menu-list a:hover { background: var(--bg); color: var(--current); }
.menu-list a[aria-current] { color: var(--current); }

/* The frame every tool page shares: name, status, the tool's own menu, then the page. */
.tool-head { padding: 32px 0 4px; }
.tool-head .kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.tool-head h1 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.5px; }
.pill {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  vertical-align: 6px;
}
.pill.soon { background: var(--soon); color: #ffffff; }
.tool-menu {
  display: flex;
  gap: 4px;
  margin: 16px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.tool-menu a {
  flex: none;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tool-menu a:hover { color: var(--text); }
.tool-menu a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--current); }
.lead p { max-width: 62ch; color: var(--muted); font-size: 1.08rem; }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { padding: 14px 16px; font-weight: 600; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--current); font-weight: 800; }
.faq details[open] summary::before { content: "-"; }
.faq details p { margin: 0; padding: 0 16px 14px calc(16px + 1.2em); color: var(--muted); }

main { padding-bottom: 40px; }
section { margin: 0 0 32px; }
h2 { margin: 0 0 12px; font-size: 1.3rem; }

.hero { padding: 36px 0 8px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.15; letter-spacing: -0.5px; }
.hero p { max-width: 62ch; margin: 0 0 12px; color: var(--muted); font-size: 1.08rem; }
.hero .kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card {
  display: block;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
}
a.card:hover { color: inherit; border-color: var(--accent); }
.card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.card.soon { opacity: 0.7; box-shadow: none; }
.tag {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { color: var(--accent-text); filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button.ghost:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.button.small { padding: 4px 10px; font-size: 0.88rem; margin-left: 8px; }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }

.ticks { padding-left: 20px; }
.ticks li { margin: 6px 0; }

.game h2 { font-size: 1.15rem; }
.servers { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.server {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.server h3 { margin: 0 0 4px; font-size: 1.02rem; }
.server p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.badge {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 2px;
}
.badge.ours { background: var(--accent); color: var(--accent-text); }
.badge.official { border: 1px solid var(--line); color: var(--muted); }

.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel h2 { margin-top: 20px; }
.who { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.held { margin: 0 0 16px; padding: 0; list-style: none; }
.held li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.count { font-weight: 700; font-variant-numeric: tabular-nums; }
.status { padding: 10px 12px; border-left: 4px solid var(--accent); border-radius: 6px; background: var(--bg); }

textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  resize: vertical;
}
label.check { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 16px; }
label.check input { margin-top: 5px; }
.error { color: var(--bad); font-weight: 600; }
.note { color: var(--muted); }

code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  font: 0.92em ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* The wiki: lists of pages, and the article frame. */
.wiki-list { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.wiki-list li {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.wiki-list a { font-weight: 600; text-decoration: none; }
.wiki-list .meta { color: var(--muted); font-size: 0.85rem; }
.wiki-list .note { font-size: 0.95rem; }
.wiki { max-width: 72ch; padding-top: 24px; }
.wiki h1 { margin: 6px 0 4px; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -0.4px; }
.wiki h2 { margin: 28px 0 10px; }
.wiki h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.wiki li { margin: 6px 0; }
.crumbs { margin: 0; color: var(--muted); font-size: 0.88rem; }
.crumbs a { color: inherit; }
.wiki > .meta { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }

.foot { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

@media (max-width: 760px) {
  .tabs { order: 3; flex-basis: 100%; }
  .menu { margin-left: auto; }
}

@media (max-width: 560px) {
  .server { flex-direction: column; align-items: flex-start; }
}
