:root {
  --bg: #071428;
  --card: #0c1e38;
  --line: #1a3d66;
  --text: #e8eef4;
  --muted: #8aa0b8;
  --accent: #ff6a12;
  --accent2: #ff8f2a;
  --circuit: #2b9bff;
  --warn: #f4c430;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
header {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 1.5rem;
}
.brandrow {
  display: flex;
  align-items: center;
  gap: .85rem;
}
header .logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}
header .brand { font-size: 1.3rem; font-weight: 700; }
header .brand span { color: var(--accent); }
header .sub { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
nav a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .85rem;
}
nav a.on { background: var(--accent); border-color: var(--accent); }
header .inner,
main {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}
header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--bg);
  padding: 1.1rem 0 .95rem;
}
main { padding-top: 1.2rem; padding-bottom: 5.5rem; }
.runchip {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: baseline;
  margin: 0 0 1rem;
  padding: .65rem .9rem;
  background: #10284a;
  border: 1px solid var(--circuit);
  border-radius: 10px;
  font-size: .92rem;
}
.runchip strong { color: var(--circuit); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.runchip span { color: var(--text); }
.findbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin: 0 0 .85rem;
}
.findbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
  background: #071428;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .65rem;
}
.ff-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.ff-filters button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: .8rem;
  padding: .3rem .65rem;
  border-radius: 999px;
}
.ff-filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.actions.ff-sticky {
  position: sticky;
  bottom: 0;
  z-index: 22;
  background: rgba(7, 20, 40, .94);
  backdrop-filter: blur(8px);
  padding: .7rem 0 .85rem;
  margin: 1rem 0 0;
  border-top: 1px solid var(--line);
}
.intro {
  display: grid;
  gap: 1.25rem;
}
.hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 1100px) {
  header .inner,
  main { width: min(100%, 1280px); }
  .intro { grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
  .hub { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (min-width: 1600px) {
  header .inner,
  main { width: min(100%, 1560px); }
  .hub { grid-template-columns: repeat(6, 1fr); gap: 1.1rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  header .brand { font-size: 1.45rem; }
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.cat {
  margin: 1.4rem 0 .6rem;
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
label.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .7rem .7rem;
  cursor: pointer;
  overflow: hidden;
  min-height: 0;
}
label.card:hover { border-color: var(--circuit); }
label.card.heavy { border-color: #5a4a22; }
label.card.off {
  opacity: .45;
  filter: grayscale(.75);
  cursor: not-allowed;
}
label.card.off:hover { border-color: var(--line); }
label.card.off input { pointer-events: none; }
label.card .why {
  display: block;
  color: var(--warn);
  font-size: .75rem;
  margin-top: .2rem;
  min-height: 0;
}
.hwbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .75rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hwbar .hw-label { font-weight: 700; }
.hwbar label { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .35rem; }
.hwbar select {
  background: #071428;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .3rem .45rem;
}
.hwbar .hw-count { color: var(--muted); font-size: .85rem; margin-left: auto; }
.hwbar .hw-hide { margin-left: .2rem; }
label.card input {
  position: absolute;
  top: .55rem;
  left: .55rem;
  z-index: 2;
  accent-color: var(--accent);
  margin: 0;
}
label.card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  max-height: 72px;
  margin: .15rem 0 .45rem;
  border-radius: 8px;
  background: #071428;
  border: 1px solid var(--line);
  overflow: hidden;
  flex: 0 0 72px;
}
label.card .icon img,
label.card .icon .logoimg,
label.card img {
  display: block;
  max-width: 56px;
  max-height: 56px;
  width: 56px;
  height: 56px;
  object-fit: contain;
  object-position: center;
}
label.card .icon .letter {
  font-weight: 700;
  color: var(--circuit);
  font-size: 1.2rem;
}
label.card .body { min-width: 0; padding-left: 1.35rem; }
label.card .name { font-weight: 600; display: block; }
label.card .meta { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.25rem 0 .5rem; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .55rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
pre {
  background: #05101f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  overflow: auto;
  font-size: .78rem;
  max-height: 420px;
}
.note { color: var(--muted); font-size: .88rem; }
footer { color: var(--muted); font-size: .8rem; margin-top: 2rem; }
a { color: var(--circuit); }
.hub a {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem;
}
.hub a:hover { border-color: var(--accent2); }
.hub h2 { margin: 0 0 .4rem; }
.hub p { margin: 0; color: var(--muted); font-size: .92rem; }
.about { margin: 1.4rem 0 0; }
.about h1, .donate h1 { font-size: 1.15rem; margin: 0 0 .5rem; }
.about p, .about li, .donate p { color: var(--muted); }
.about ul, .about ol { color: var(--muted); }
.donate {
  margin-top: 2rem;
  padding: 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
a.paypal {
  display: inline-block;
  margin-top: .6rem;
  background: #003087;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  padding: .55rem 1.1rem;
}
a.paypal:hover { background: #009cde; }

#ff-chat-toggle,
#ff-donate-toggle {
  position: fixed;
  z-index: 40;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .65rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  text-decoration: none;
  font-size: .92rem;
}
#ff-chat-toggle {
  right: 1.1rem;
  bottom: 1.1rem;
  background: var(--accent);
}
#ff-donate-toggle {
  right: 1.1rem;
  bottom: 4.15rem;
  background: #003087;
}
#ff-donate-toggle:hover { background: #009cde; color: #fff; }
@media (min-width: 720px) {
  #ff-donate-toggle { right: 10.4rem; bottom: 1.1rem; }
}
@media (max-width: 719px) {
  #ff-chat-panel { bottom: 7.2rem; }
}
#ff-chat-panel {
  position: fixed;
  right: 1.1rem;
  bottom: 4.2rem;
  width: min(360px, calc(100vw - 2rem));
  height: 420px;
  z-index: 41;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
#ff-chat-panel[hidden] { display: none; }
#ff-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}
#ff-chat-head button {
  background: transparent;
  color: var(--muted);
  padding: 0 .35rem;
}
#ff-chat-log { flex: 1; overflow: auto; padding: .75rem; }
.ff-msg { margin: 0 0 .55rem; padding: .5rem .65rem; border-radius: 8px; font-size: .88rem; }
.ff-msg.bot { background: #071428; border: 1px solid var(--line); }
.ff-msg.you { background: #1a3a18; border: 1px solid #2d5a28; }
#ff-chat-form { display: flex; gap: .4rem; padding: .65rem; border-top: 1px solid var(--line); }
#ff-chat-input {
  flex: 1;
  background: #071428;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: .45rem .6rem;
}

#ff-chat-hints {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .15rem .65rem .55rem;
}
#ff-chat-hints button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
  font-size: .75rem;
  padding: .25rem .55rem;
  border-radius: 999px;
}
#ff-chat-hints button:hover { border-color: var(--accent); color: var(--accent2); }
#ff-chat-panel { height: 460px; }
