@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url('/fonts/spacegrotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url('/fonts/spacegrotesk-700.woff2') format('woff2'); }

/* joshuaaah.com color bible -- canonical tokens, copied verbatim (memory/feedback_joshuaaah_color_bible.md) */
:root {
  --jx-bg: #FFFFFF;
  --jx-surface: #F7F6FA;
  --jx-surface-alt: #ECEAF1;
  --jx-black: #000000;
  --jx-black-soft: #0D0D10;
  --jx-primary: #1A0633;
  --jx-primary-hover: #2E1152;
  --jx-primary-deep: #0F0320;
  --jx-silver: #C4CED4;
  --jx-accent: #0D9488;
  --jx-accent-hover: #14B8A6;
  --jx-accent-text: #0F766E;
  --jx-text: #121117;
  --jx-text-secondary: #6B6974;
  --jx-text-on-dark: #F2F1F5;
  --jx-border: #D8D5E0;
  --jx-success: #16A34A;
  --jx-warning: #D97706;
  --jx-spotlight: #F97316;
  --jx-spotlight-hover: #FB923C;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-sans: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
  --nav-height: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--jx-text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(13,148,136,0.05), transparent 60%),
    radial-gradient(900px 560px at 110% 10%, rgba(26,6,51,0.07), transparent 55%),
    var(--jx-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: var(--jx-primary); }
a:hover, a:focus-visible { color: var(--jx-accent-text); }
:focus-visible { outline: 2px solid var(--jx-accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header: purple fading into black, sticky */
.bar {
  position: sticky; top: 0; z-index: 20; height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: linear-gradient(90deg, var(--jx-primary) 0%, var(--jx-primary-deep) 55%, var(--jx-black) 100%);
  color: #fff; box-shadow: 0 1px 0 rgba(196,206,212,0.18), 0 6px 20px rgba(15,3,32,0.18);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand b { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand small { color: var(--jx-silver); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.bar nav a { color: #fff; text-decoration: none; font-size: 0.9rem; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; }
.bar nav a:hover { background: var(--jx-primary-hover); color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 44px; }

.card { background: linear-gradient(165deg, var(--jx-surface-alt), #ffffff); border: 1px solid var(--jx-border); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }

/* ---------- buttons & pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 22px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn.small { padding: 7px 15px; font-size: 0.86rem; font-weight: 600; }
.btn.primary { background: var(--jx-primary); color: #fff; border-color: var(--jx-primary); }
.btn.primary:hover { background: var(--jx-primary-hover); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--jx-primary); border-color: var(--jx-border); }
.btn.ghost:hover { border-color: var(--jx-accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }
.btn.spot { background: var(--jx-spotlight); color: #1a0a00; border-color: var(--jx-spotlight); }
.btn.spot:hover { background: var(--jx-spotlight-hover); }
.btn.ghost-dark { background: transparent; color: #fff; border-color: rgba(196,206,212,0.45); }
.btn.ghost-dark:hover { border-color: var(--jx-accent-hover); background: rgba(255,255,255,0.06); }
.pill { border: 1px solid var(--jx-border); background: #fff; color: var(--jx-text); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.pill:hover { border-color: var(--jx-accent); color: var(--jx-accent-text); }

/* ---------- setup ---------- */
.setup { max-width: 860px; margin: 0 auto; padding: 22px 24px 20px; }
.setup-head h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); color: var(--jx-primary); line-height: 1.08; }
.setup-head .sub { color: var(--jx-text-secondary); margin: 8px 0 16px; max-width: 620px; line-height: 1.5; }
.samples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.samples-lbl { font-size: 0.8rem; font-weight: 700; color: var(--jx-text-secondary); text-transform: uppercase; letter-spacing: 0.1em; margin-right: 2px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span, .seed-field > span { font-weight: 700; font-size: 0.88rem; color: var(--jx-primary); }
.field i, .seed-field i, .radio i { font-style: normal; font-weight: 400; color: var(--jx-text-secondary); }
.field input, .field textarea, .seed-field input { width: 100%; border: 1px solid var(--jx-border); border-radius: var(--radius-md); background: #fff; color: var(--jx-text); padding: 10px 13px; }
.field textarea { resize: vertical; min-height: 170px; line-height: 1.45; font-size: 0.95rem; }
.field input:focus, .field textarea:focus, .seed-field input:focus { outline: none; border-color: var(--jx-accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.14); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -2px 0 14px; }
.count-chip { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; background: var(--jx-primary); color: #fff; padding: 3px 11px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.count-chip.bad { background: var(--jx-warning); }
.count-note { font-size: 0.86rem; color: var(--jx-text-secondary); }
.order { min-width: 0; border: 1px solid var(--jx-border); border-radius: var(--radius-md); padding: 10px 14px 12px; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; background: #fff; }
.order legend { font-weight: 700; font-size: 0.88rem; color: var(--jx-primary); padding: 0 6px; }
.radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 0.92rem; }
.radio input { accent-color: var(--jx-accent); width: 16px; height: 16px; margin: 0; }
.seed-field { display: grid; gap: 5px; flex-basis: 100%; max-width: 340px; }
.form-msg { color: #B45309; font-size: 0.9rem; margin: 0 0 10px; min-height: 0; }
.form-msg:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.judge-state { font-size: 0.86rem; color: var(--jx-text-secondary); display: inline-flex; align-items: center; gap: 7px; }
.judge-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--jx-silver); }
.judge-state.on::before { background: var(--jx-accent); box-shadow: 0 0 8px rgba(13,148,136,0.7); }
.judge-state.off::before { background: var(--jx-warning); }
.judge-state:empty { display: none; }

/* ---------- arena ---------- */
.arena-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.arena-titles { min-width: 0; }
.kicker { display: block; color: var(--jx-accent-text); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.76rem; }
#arena-title { font-size: clamp(1.5rem, 4.4vw, 2.2rem); color: var(--jx-primary); line-height: 1.1; overflow-wrap: anywhere; }
.arena-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 0.84rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--jx-surface); border: 1px solid var(--jx-border); color: var(--jx-text); }
.status-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--jx-silver); }
.status-pill.busy::before { background: var(--jx-accent); box-shadow: 0 0 8px rgba(13,148,136,0.8); animation: pulse 1.2s ease-in-out infinite; }
.status-pill.done::before { background: var(--jx-spotlight); box-shadow: 0 0 8px rgba(249,115,22,0.7); }
.status-pill.warn::before { background: var(--jx-warning); }
@keyframes pulse { 50% { opacity: .35; } }

/* spotlight: the match being revealed */
.spotlight { margin-bottom: 14px; padding: 16px 20px 18px; }
.spot-meta { font-size: 0.8rem; font-weight: 700; color: var(--jx-text-secondary); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 10px; }
.spot-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 12px; }
.spot-side { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--jx-border); border-radius: var(--radius-md); padding: 12px 14px; min-width: 0; transition: box-shadow .35s, border-color .35s, opacity .35s, transform .35s; }
.spot-side .nm { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.02rem, 2.6vw, 1.35rem); color: var(--jx-primary); overflow-wrap: anywhere; min-width: 0; }
.spot-side .seed:empty { display: none; }
.spot-v { align-self: center; font-family: var(--font-display); font-weight: 700; color: var(--jx-text-secondary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }
.spot-side.win { border-color: var(--jx-accent); box-shadow: 0 0 0 2px rgba(13,148,136,0.35), 0 10px 26px rgba(13,148,136,0.22); transform: translateY(-2px); }
.spot-side.lose { opacity: .45; }
.spot-line { margin-top: 12px; min-height: 1.6em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.spot-line q { font-size: 1.04rem; line-height: 1.45; color: var(--jx-text); animation: rise .45s ease-out; }
.spot-line q::before { content: '\201C'; color: var(--jx-accent-text); font-weight: 700; }
.spot-line q::after { content: '\201D'; color: var(--jx-accent-text); font-weight: 700; }
.spot-tag { font-size: 0.78rem; font-weight: 700; color: var(--jx-text-secondary); text-transform: uppercase; letter-spacing: 0.1em; }
.thinking { color: var(--jx-accent-text); font-weight: 600; }
.dots i { font-style: normal; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.seed { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; min-width: 24px; text-align: center; padding: 2px 6px; border-radius: 999px; background: var(--jx-surface-alt); color: var(--jx-text-secondary); font-variant-numeric: tabular-nums; }

/* notice: judge unavailable */
.notice { margin-bottom: 14px; border-color: rgba(217,119,6,0.45); background: linear-gradient(165deg, #FFF7ED, #ffffff); }
.notice-msg { margin: 0 0 4px; font-weight: 700; color: var(--jx-primary); font-size: 1.02rem; }
.notice-sub { margin: 0 0 12px; color: var(--jx-text-secondary); font-size: 0.9rem; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* champion banner: orange spotlight */
.champion { position: relative; overflow: hidden; margin-bottom: 16px; border-radius: var(--radius-lg); padding: 22px 22px 20px; color: var(--jx-text-on-dark); background: linear-gradient(120deg, var(--jx-primary) 0%, var(--jx-primary-deep) 60%, var(--jx-black-soft) 100%); border: 1px solid var(--jx-primary-hover); animation: rise .6s ease-out; }
.champ-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(520px 240px at 50% -40px, rgba(249,115,22,0.42), transparent 70%); }
.champion > * { position: relative; }
.champion .kicker { color: var(--jx-spotlight-hover); }
#champ-name { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.05; margin: 4px 0 12px; color: #fff; text-shadow: 0 0 28px rgba(249,115,22,0.55); overflow-wrap: anywhere; }
.champ-path { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.champ-path li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; font-size: 0.92rem; line-height: 1.45; border-top: 1px solid rgba(196,206,212,0.16); padding-top: 8px; }
.champ-path .rd { grid-row: span 2; align-self: start; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(13,148,136,0.22); color: #99F6E4; border: 1px solid rgba(20,184,166,0.45); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.champ-path .vs { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.champ-path .ln { color: #d9d6e2; overflow-wrap: anywhere; }
.champ-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.copy-msg { font-size: 0.85rem; color: var(--jx-silver); }

/* ---------- bracket (desktop) ---------- */
.bracket-scroll { overflow-x: auto; overflow-y: hidden; margin-bottom: 18px; border: 1px solid var(--jx-border); border-radius: var(--radius-lg); background: #fff; -webkit-overflow-scrolling: touch; }
.bracket { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 196px; column-gap: 40px; padding: 16px 20px 20px; width: max-content; min-width: 100%; }
.col { display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; }
.col-h { font-family: var(--font-display); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--jx-text-secondary); padding: 0 2px 10px; white-space: nowrap; }
.col.live .col-h { color: var(--jx-accent-text); }
.col-b { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.m { background: #fff; border: 1px solid var(--jx-border); border-radius: 12px; overflow: hidden; transition: box-shadow .3s, border-color .3s; cursor: default; }
.m.judgeable { cursor: pointer; }
.m.live { border-color: rgba(13,148,136,0.55); border-style: dashed; }
.m.current { border-color: var(--jx-accent); box-shadow: 0 0 0 2px rgba(13,148,136,0.3), 0 0 18px rgba(13,148,136,0.28); }
.m.onpath { border-color: var(--jx-accent); }
.slot { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px; font-size: 0.86rem; min-width: 0; }
.slot + .slot { border-top: 1px solid var(--jx-surface-alt); }
.slot .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.slot .seed { min-width: 20px; padding: 1px 5px; font-size: 0.68rem; }
.slot.tbd .nm { color: var(--jx-silver); }
.slot.bye .nm { color: var(--jx-text-secondary); font-style: italic; }
.slot.win { font-weight: 700; color: var(--jx-primary); background: linear-gradient(90deg, rgba(13,148,136,0.10), transparent 75%); box-shadow: inset 3px 0 0 var(--jx-accent); }
.slot.lose .nm { color: var(--jx-text-secondary); text-decoration: line-through; text-decoration-color: var(--jx-silver); }
.slot.fresh .nm { animation: slidein .5s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.champ-col .col-b { justify-content: center; }
.champ-slot { border: 1px dashed var(--jx-border); border-radius: 12px; height: 66px; display: flex; align-items: center; justify-content: center; padding: 0 12px; text-align: center; font-family: var(--font-display); font-weight: 700; color: var(--jx-silver); overflow-wrap: anywhere; }
.champ-slot.won { border: 1px solid var(--jx-spotlight); color: var(--jx-primary); background: linear-gradient(165deg, #FFF7ED, #fff); box-shadow: 0 0 0 3px rgba(249,115,22,0.18), 0 0 26px rgba(249,115,22,0.35); animation: slidein .5s ease-out; }
.conn { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.conn path { fill: none; stroke: var(--jx-border); stroke-width: 2; }
.conn path.done { stroke: #A8A1B8; }
.conn path.onpath { stroke: var(--jx-accent); stroke-width: 2.5; filter: drop-shadow(0 0 4px rgba(20,184,166,0.75)); }
.conn path.fill { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .6s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- feed: results by round (the whole layout on phones) ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.feed-round { padding: 14px 16px; }
.feed-round h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--jx-text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.feed-round h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--jx-silver); }
.feed-round.live h3 { color: var(--jx-accent-text); }
.feed-round.live h3::before { background: var(--jx-accent); box-shadow: 0 0 8px rgba(13,148,136,0.7); }
.fm { list-style: none; margin: 0; padding: 0; }
.fm li { padding: 9px 0; border-top: 1px solid var(--jx-border); font-size: 0.92rem; line-height: 1.45; }
.fm li:first-child { border-top: 0; }
.fm .pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
.fm .w { font-weight: 700; color: var(--jx-primary); overflow-wrap: anywhere; }
.fm .def { color: var(--jx-text-secondary); font-size: 0.82rem; }
.fm .l { color: var(--jx-text-secondary); overflow-wrap: anywhere; }
.fm .tbd { color: var(--jx-silver); }
.fm .line { margin: 3px 0 0; color: var(--jx-text); }
.fm .line q::before { content: '\201C'; color: var(--jx-accent-text); }
.fm .line q::after { content: '\201D'; color: var(--jx-accent-text); }
.fm .tag { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--jx-text-secondary); background: var(--jx-surface-alt); border-radius: 999px; padding: 1px 8px; margin-top: 3px; }
.fm li.pending .pair { color: var(--jx-text-secondary); }
.fm li.live { box-shadow: inset 3px 0 0 var(--jx-accent); padding-left: 10px; }
.fm li.fresh { animation: rise .45s ease-out; }

@media (min-width: 721px) {
  .fm li.pending, .fm li.bye-row { display: none; }
  .feed-round.no-results { display: none; }
}
@media (max-width: 720px) {
  .bracket-scroll { display: none; }
  .feed { grid-template-columns: 1fr; }
  .setup { padding: 18px 16px; }
  .spotlight { padding: 14px 14px 16px; }
  .spot-vs { grid-template-columns: 1fr; gap: 6px; }
  .spot-v { justify-self: center; }
  .bar .brand small { display: none; }
}
@media (max-width: 380px) { .brand b { font-size: 1rem; } }

/* ---------- footer ---------- */
.foot { background: linear-gradient(90deg, var(--jx-black) 0%, var(--jx-primary-deep) 50%, var(--jx-primary) 100%); color: var(--jx-text-on-dark); padding: 22px 16px 28px; font-size: 0.84rem; line-height: 1.55; }
.foot p { max-width: 1148px; margin: 0 auto 10px; color: #d9d6e2; }
.foot b { color: #fff; }
.foot a { color: var(--jx-silver); }
.foot a:hover { color: var(--jx-accent-hover); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .conn path.fill { stroke-dashoffset: 0; }
}
