/* Syne and IBM Plex Mono are SIL Open Font License. Files are self-hosted. */
@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("/fonts/syne-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c0c0b;
  --bg-2: #141412;
  --bg-3: #1d1d1a;
  --line: #2e2e29;
  --text: #f6f4ec;
  --muted: #b9b6aa;
  --accent: #cdf546;
  --ink: #121211;
  --agent: #00e8e4;
  --perp: #bb46f5;
  --prediction: #1085ff;
  --spot: #ff632e;
  --display: "Syne", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Source Code Pro", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(246, 244, 236, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 244, 236, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse 70% 42% at 0% -8%, rgba(0, 232, 228, 0.16), transparent 52%),
    radial-gradient(ellipse 55% 36% at 100% 0%, rgba(187, 70, 245, 0.16), transparent 48%),
    radial-gradient(ellipse 40% 28% at 90% 100%, rgba(255, 99, 46, 0.08), transparent 46%);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
  background-attachment: fixed;
}
a { color: var(--text); }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--ink); }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--accent);
  color: var(--ink);
  padding: 6px 10px;
  z-index: 6;
}
.skip:focus { top: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(12, 12, 11, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 12px 16px 10px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--bg-3);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--agent);
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 999px;
}
.nav a[aria-current="page"]:not(.nav-submit) { box-shadow: inset 0 -2px 0 var(--agent); }
.nav a.nav-submit {
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  padding: 8px 16px;
  margin-left: 4px;
  animation: submit-glow 2.8s ease-in-out infinite;
}
.nav a.nav-submit[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--agent); }
.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-2);
}
.lang button {
  background: transparent;
  color: var(--muted);
  border: 0;
  min-width: 44px;
  min-height: 36px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--text); color: var(--ink); font-weight: 700; }

.non-official {
  margin: 0;
  padding: 9px 16px;
  background: #17150f;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invite-code { font-size: 0.92rem; }
.invite-code strong { font-family: var(--mono); letter-spacing: 0.08em; color: var(--accent); }
.site-footer {
  margin-top: 56px;
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
  background: rgba(12, 12, 11, 0.72);
}
.site-footer .invite, .site-footer .compliance, .footer-links {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}
.site-footer .invite { padding-top: 16px; }
.footer-links { color: var(--muted); font-family: var(--mono); font-size: 0.82rem; }

main { padding: 28px 16px 8px; max-width: 1180px; margin: 0 auto; }
.kicker {
  margin: 0 0 8px;
  color: var(--agent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero {
  display: grid;
  gap: 18px;
  margin-bottom: 8px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0 0 12px;
}
.hero h1::after {
  content: "";
  display: block;
  width: min(220px, 70%);
  height: 4px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--agent) 0 25%, var(--perp) 25% 50%, var(--prediction) 50% 75%, var(--spot) 75% 100%);
}
.hero p, .legend, .hint, .card-note, .card-alt, .card-by { color: var(--muted); }
.hero-copy > p:not(.kicker) { max-width: 62ch; margin: 0; }
.legend, .count { font-size: 0.92rem; }
.face-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.face-key li { display: inline-flex; align-items: center; gap: 6px; }
.face-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--agent);
}
.face-key i[data-swatch="perp"] { background: var(--perp); }
.face-key i[data-swatch="prediction"] { background: var(--prediction); }
.face-key i[data-swatch="spot"] { background: var(--spot); }

.submit-entry {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 168px;
  padding: 18px 18px 20px;
  text-decoration: none;
  color: var(--ink);
  background: var(--accent);
  border-radius: 2px 26px 2px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 8px 8px 0 rgba(0, 232, 228, 0.28);
}
.submit-entry::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--agent) 0 25%, var(--perp) 25% 50%, var(--prediction) 50% 75%, var(--spot) 75% 100%);
  transform-origin: left center;
  animation: bar-shift 3.2s ease-in-out infinite;
}
.submit-entry-kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.submit-entry strong {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.submit-entry > span:last-child { color: #2a2a12; max-width: 28ch; }
.submit-entry:hover { transform: translate(-2px, -2px); box-shadow: 12px 12px 0 rgba(187, 70, 245, 0.35); }
.submit-entry:focus-visible { outline: 3px solid var(--agent); outline-offset: 3px; }

.filters {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
  padding: 12px;
  background: rgba(20, 20, 18, 0.88);
  border: 1px solid var(--line);
}
label, .search { display: grid; gap: 6px; }
.label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  min-height: 48px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 128px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--agent);
  outline-offset: 1px;
  border-color: var(--agent);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn-primary:hover { background: #d8ff62; }
.btn-ghost { border-color: #4a4a44; background: var(--bg-2); }
.btn-submit { width: 100%; min-height: 54px; margin-top: 6px; font-size: 1.05rem; border-radius: 2px 18px 2px 18px; }
.is-disabled { opacity: 0.7; cursor: default; }
.grid { display: grid; gap: 12px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(20, 20, 18, 0.94);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px 16px 14px 18px;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--agent), var(--perp), var(--prediction), var(--spot));
}
.card[data-face="agent"]::before { background: var(--agent); }
.card[data-face="perp"]::before { background: var(--perp); }
.card[data-face="prediction"]::before { background: var(--prediction); }
.card[data-face="spot"]::before { background: var(--spot); }
.card[data-face="transfer"]::before { background: #8d8d86; }
.card h2 {
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 4px 0 0;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.card:focus-visible { outline: 2px solid var(--agent); outline-offset: 2px; }
.agent-mark { display: block; width: 48px; height: 48px; }
.agent-mark svg, .agent-mark img { width: 48px; height: 48px; border-radius: 50%; display: block; object-fit: cover; }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-head .agent-mark, .detail-head .agent-mark svg, .detail-head .agent-mark img { width: 72px; height: 72px; border-radius: 50%; }
.detail-head h1 { margin: 0; font-family: var(--display); letter-spacing: -0.04em; line-height: 1.05; }
.detail[data-face="agent"] .detail-head h1 { color: var(--agent); }
.detail[data-face="perp"] .detail-head h1 { color: var(--perp); }
.detail[data-face="prediction"] .detail-head h1 { color: #7eb6ff; }
.detail[data-face="spot"] .detail-head h1 { color: var(--spot); }
.market {
  margin: 22px 0 26px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(12, 12, 11, 0.72);
  box-shadow: inset 3px 0 0 var(--prediction);
}
.market h2 {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.market-picks, .intervals { display: flex; flex-wrap: wrap; gap: 6px; }
.market-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.market-symbol {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.market-last { margin: 4px 0 0; color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.interval[aria-pressed="true"], .market-pick[aria-pressed="true"] {
  background: var(--text);
  color: var(--ink);
  border-color: var(--text);
}
.market-svg { width: 100%; height: auto; background: #10100e; border: 1px solid var(--line); margin-top: 10px; }
.account { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 0.9rem; }
.mojo-face { width: 32px; height: 32px; flex: none; }
.mojo-avatar, .mojo-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  background: var(--bg-3);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.card-by, .card-alt, .card-note { margin: 0; font-size: 0.88rem; }
.card-by { margin-top: auto; font-family: var(--mono); font-size: 0.75rem; }
.empty { color: var(--muted); }

.detail { position: relative; }
.detail::before {
  content: "";
  display: block;
  height: 4px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--agent) 0 25%, var(--perp) 25% 50%, var(--prediction) 50% 75%, var(--spot) 75% 100%);
}
.detail[data-face="agent"]::before { background: var(--agent); }
.detail[data-face="perp"]::before { background: var(--perp); }
.detail[data-face="prediction"]::before { background: var(--prediction); }
.detail[data-face="spot"]::before { background: var(--spot); }
.detail[data-face="transfer"]::before { background: #8d8d86; }
.detail h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; margin: 8px 0 12px; }
.facts {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
  padding: 4px 14px;
  background: rgba(20, 20, 18, 0.94);
  border: 1px solid var(--line);
}
.facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #262622;
}
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); margin: 0; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; }
.facts dd { margin: 0; }
.prompt {
  white-space: pre-wrap;
  background: #10100e;
  border: 1px solid var(--line);
  border-left: 3px solid var(--agent);
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font);
}
.notice, .compliance, .banner {
  background: rgba(20, 20, 18, 0.94);
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin: 12px 0;
}
.compliance p { margin: 0 0 8px; font-size: 0.92rem; color: var(--muted); }
.compliance p:last-child { margin-bottom: 0; }
.banner-error { border-color: var(--spot); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.sources { color: var(--muted); font-size: 0.92rem; }
.back { margin: 0 0 8px; font-family: var(--mono); font-size: 0.82rem; }
.back a { color: var(--agent); text-decoration: none; }

.form-page, .admin, .about { max-width: 740px; }
.form-page h1, .about h1, .admin h1, .prose h1, .prose h2 {
  font-family: var(--display);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.form-page h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 8px; }
.share-lead {
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid var(--agent);
  background: rgba(0, 232, 228, 0.07);
  border-radius: 2px 18px 2px 18px;
  box-shadow: 6px 6px 0 rgba(205, 245, 70, 0.18);
}
.share-lead input { font-size: 1.05rem; background: #0c0c0b; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 2px;
  margin: 0;
  padding: 12px;
}
fieldset legend { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 36px; padding: 4px 0; }
.check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: 3px; accent-color: var(--accent); }
.attestation { margin: 12px 0; }
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }
#submit-form { display: grid; gap: 12px; }
#submit-form .hint { margin: 0; }
.prose h1, .prose h2 { line-height: 1.2; }
.links { padding-left: 1.1rem; }

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 12px;
  z-index: 5;
  max-height: 50vh;
  overflow: auto;
}
.toast h2 { margin: 0 0 8px; font-size: 1rem; }
.pending-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px;
  margin: 12px 0;
  background: var(--bg-2);
}
.pending-card pre { white-space: pre-wrap; font-size: 0.88rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@keyframes submit-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(205, 245, 70, 0); }
  50% { box-shadow: 0 0 0 5px rgba(205, 245, 70, 0.22); }
}
@keyframes bar-shift {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.72); }
}

@media (max-width: 719px) {
  .site-header { position: static; }
  .header-bar { align-items: center; }
  .nav { width: 100%; }
  .nav a.nav-submit { margin-left: auto; }
  .header-tools { width: 100%; margin-left: 0; }
  .submit-entry { min-height: 148px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .filters .btn { width: 100%; }
}

@media (min-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.7fr); align-items: stretch; gap: 28px; }
  .submit-entry { min-height: 100%; }
}
@media (min-width: 720px) {
  .filters { grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)) auto; align-items: end; }
  .grid { grid-template-columns: 1fr 1fr; }
  .avatar { width: 44px; height: 44px; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .nav a.nav-submit, .submit-entry::after { animation: none; }
  .card, .submit-entry, .btn { transition: none; }
  .card:hover, .submit-entry:hover { transform: none; }
}
