/* Public /duels arena. Editorial scoreboard: black ink, one green accent. */
.duels-hero { padding: 1rem 0 .4rem; }
.duels-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.04; margin: .4rem 0 .6rem; text-wrap: balance; }
.duels-hero .lede { max-width: 62ch; }
.arena-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin: 1.2rem 0; }
/* Wide screens: copy on the left, a 2x2 block of totals on the right, so the
   category picker sits higher on short laptop screens. */
@media (min-width: 901px) {
  .duels-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 2.2rem; align-items: end; padding-bottom: 1.4rem; }
  .duels-hero .lede { margin-bottom: 0; }
  .arena-kpis { grid-template-columns: 1fr 1fr; margin: 0; }
}
.arena-kpi { border: 2px solid #0f0f0f; border-radius: 10px; padding: .8rem .9rem; background: #fff; }
.arena-kpi b { display: block; font-size: 1.7rem; line-height: 1; }
.arena-kpi span { font-size: .82rem; color: #444; }
.pulse-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 999px; background: #1a9e4b; animation: arena-pulse 2s infinite; }
@keyframes arena-pulse { 0% { box-shadow: 0 0 0 0 rgba(26,158,75,.45); } 70% { box-shadow: 0 0 0 9px rgba(26,158,75,0); } 100% { box-shadow: 0 0 0 0 rgba(26,158,75,0); } }
.duel-card-public { border: 2px solid #0f0f0f; border-radius: 12px; padding: 1rem; margin-bottom: .9rem; background: #fff; }
.duel-card-public.enter { animation: arena-in .45s ease-out; }
@keyframes arena-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.duel-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: .7rem; align-items: stretch; margin-top: .7rem; }
.duel-side { border: 1px solid #d8d8d8; border-radius: 8px; padding: .7rem; }
.duel-side.win { border-color: #1a9e4b; outline: 2px solid #1a9e4b; }
.duel-side .model { font-weight: 700; }
.winner-tag { display: inline-block; background: #1a9e4b; color: #fff; border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; font-weight: 700; }
.vs-badge { align-self: center; font-family: 'Krona One', sans-serif; font-size: .8rem; border: 2px solid #0f0f0f; border-radius: 999px; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; background: #ffd21f; }
.cat-chip { display: inline-block; border: 1.5px solid #0f0f0f; border-radius: 999px; padding: .05rem .55rem; font-size: .78rem; font-weight: 600; background: #fff; }
.lb-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 3fr auto; gap: .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid #e6e6e6; }
.lb-track { height: 1.1rem; background: #efefef; border-radius: 999px; overflow: hidden; }
.lb-fill { height: 100%; background: #1a9e4b; border-radius: 999px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; }
.cat-tile { border: 2px solid #0f0f0f; border-radius: 10px; padding: .85rem; background: #fff; }
.cat-tile b { font-size: 1.05rem; }
.duels-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .duels-grid, .duel-vs { grid-template-columns: 1fr; } .vs-badge { justify-self: center; } }
/* Model names with provider logos (shared/lib/model-providers.js). */
.model-id { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; vertical-align: middle; }
.model-text { overflow-wrap: anywhere; min-width: 0; }
.model-logo { flex: 0 0 auto; width: 18px; height: 18px; object-fit: contain; }
/* White- or light-gray-only marks (OpenAI, Qwen, xAI, ...) would vanish on white: draw them black. */
.model-logo.darken { filter: brightness(0); }
.model-letter { display: inline-grid; place-items: center; border-radius: 5px; background: #0f0f0f; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; font-style: normal; }
.cat-btn[aria-pressed="true"] .model-letter { background: #fff; color: #0f0f0f; }
.cat-btn[aria-pressed="true"] .model-logo.darken { filter: brightness(0) invert(1); }
.cat-btn-lead .model-id { gap: .3rem; }
.cat-btn-lead .model-logo { width: 14px; height: 14px; }
.cat-btn-lead .model-letter { font-size: .58rem; border-radius: 4px; }
.h2h-row .h2h-vs { color: #666; font-weight: 600; font-size: .85rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Kind-of-question filter: a horizontal strip of bars that doubles as the
   filter. One hue (ink) for magnitude; the selected kind inverts. */
.cat-filter { margin: .4rem 0 1.4rem; }
.cat-filter-head h2 { margin: 0 0 .2rem; }
.cat-filter-head .hint { margin: 0 0 .7rem; }
.cat-strip { display: flex; gap: .55rem; overflow-x: auto; padding: .15rem .1rem .6rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cat-btn { flex: 0 0 auto; scroll-snap-align: start; min-width: 10.5rem; max-width: 13rem; text-align: left; display: grid; gap: .3rem; padding: .65rem .75rem; border: 2px solid #0f0f0f; border-radius: 10px; background: #fff; color: #0f0f0f; font: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.cat-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 #0f0f0f; }
.cat-btn:focus-visible { outline: 3px solid #1a9e4b; outline-offset: 2px; }
.cat-btn[aria-pressed="true"] { background: #0f0f0f; color: #fff; }
.cat-btn-label { font-weight: 700; font-size: .92rem; line-height: 1.15; }
.cat-btn-meta, .cat-btn-lead { font-size: .76rem; color: #555; }
.cat-btn[aria-pressed="true"] .cat-btn-meta, .cat-btn[aria-pressed="true"] .cat-btn-lead { color: #d6d6d6; }
.cat-btn-lead { font-weight: 600; }
.cat-btn-bar { display: block; height: 6px; border-radius: 4px; background: #ececec; overflow: hidden; }
.cat-btn-bar > span { display: block; height: 100%; border-radius: 4px; background: #0f0f0f; }
.cat-btn[aria-pressed="true"] .cat-btn-bar { background: #3a3a3a; }
.cat-btn[aria-pressed="true"] .cat-btn-bar > span { background: #ffd21f; }
.cat-all { min-width: 7.5rem; align-content: center; }
.cat-report { border: 2px solid #0f0f0f; border-radius: 12px; padding: 1rem 1.1rem; background: #fff; margin-top: .4rem; }
.cat-report.enter { animation: arena-in .3s ease-out; }
.cat-report-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cat-report-head h3 { margin: 0; font-size: 1.3rem; }
.cat-clear { border: 1.5px solid #0f0f0f; border-radius: 999px; background: #fff; padding: .25rem .7rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.cat-clear:hover { background: #f3f3f3; }
.cat-report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin: .8rem 0; }
.cat-report-kpis > div { border: 1px solid #d8d8d8; border-radius: 8px; padding: .55rem .7rem; }
.cat-report-kpis b { display: block; font-size: 1.25rem; line-height: 1.1; overflow-wrap: anywhere; }
.cat-report-kpis span { font-size: .78rem; color: #555; }
.cat-report-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; }
.cat-report-body h4 { margin: .2rem 0 .4rem; }
.feed-filter-label { font-weight: 600; color: #444; }

/* "Why it won": clear chips, a first-class dimension. */
.reason-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .75rem; }
.reason-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1a7a3c; }
.reason-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.reason-chip { display: inline-flex; align-items: center; gap: .35rem; background: #eaf7ef; color: #0f4d27; border: 1.5px solid #1a9e4b; border-radius: 999px; padding: .2rem .65rem; font-size: .82rem; font-weight: 600; }
.reason-chip::before { content: "✓"; font-weight: 800; color: #1a9e4b; }
.reason-chips-count .reason-chip b { background: #1a9e4b; color: #fff; border-radius: 999px; padding: 0 .4rem; font-size: .74rem; }

/* Card answer teaser + modal trigger. */
.duel-teaser { font-size: .86rem; color: #333; margin: .45rem 0 .55rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-btn { border: 1.5px solid #0f0f0f; border-radius: 999px; background: #fff; padding: .3rem .8rem; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.read-btn:hover { background: #0f0f0f; color: #fff; }
.read-btn:focus-visible { outline: 3px solid #1a9e4b; outline-offset: 2px; }

/* Answer modal: both answers side by side, rendered Markdown. */
.answer-modal { width: min(1040px, 96vw); max-height: 92vh; padding: 0; border: 2px solid #0f0f0f; border-radius: 14px; background: #fff; color: #0f0f0f; overflow: hidden; }
.answer-modal[open] { display: flex; flex-direction: column; }
.answer-modal::backdrop { background: rgba(15,15,15,.55); }
.am-head { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.2rem .8rem; border-bottom: 1px solid #e3e3e3; }
.am-head-text { flex: 1; min-width: 0; }
.am-meta { margin: 0 0 .3rem; }
.am-head h2 { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.45rem); line-height: 1.2; }
.am-close { border: 1.5px solid #0f0f0f; border-radius: 999px; background: #fff; width: 2.2rem; height: 2.2rem; font-size: 1rem; cursor: pointer; flex: 0 0 auto; }
.am-close:hover { background: #0f0f0f; color: #fff; }
.am-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem 1.2rem; overflow-y: auto; }
.am-side { border: 1px solid #d8d8d8; border-radius: 10px; padding: .8rem .95rem; min-width: 0; }
.am-side.win { border-color: #1a9e4b; outline: 2px solid #1a9e4b; }
.am-side.focus { box-shadow: 0 0 0 4px rgba(255,210,31,.75); }
.am-side-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.am-side-head .model { font-weight: 800; }
.am-label { font-size: .74rem; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .04em; }
.am-foot { padding: .7rem 1.2rem 1rem; border-top: 1px solid #e3e3e3; }
.am-foot:empty { display: none; }
.md { font-size: .95rem; line-height: 1.55; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 1rem 0 .4rem; line-height: 1.25; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .md-table { margin: 0 0 .7rem; }
.md ul, .md ol { padding-left: 1.3rem; }
.md li { margin: .2rem 0; }
.md code { background: #f2f2f2; border-radius: 4px; padding: .05rem .3rem; font-size: .88em; }
.md pre { background: #0f0f0f; color: #f5f5f5; border-radius: 8px; padding: .75rem .85rem; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { border-left: 3px solid #d8d8d8; padding-left: .8rem; color: #444; }
.md .md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: .88rem; }
.md th, .md td { border: 1px solid #d8d8d8; padding: .3rem .5rem; text-align: left; }
.md a { color: #0b6b33; }
@media (max-width: 760px) {
  .am-sides, .cat-report-body { grid-template-columns: 1fr; }
  .answer-modal { width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; }
}
/* Loading placeholders: shown only when the server could not include the
   feed; the browser replaces them on its first fetch. */
.duel-skeleton { border-color: #d8d8d8; }
.duel-skeleton .sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #efefef 0%, #f7f7f7 50%, #efefef 100%); background-size: 200% 100%; animation: arena-shimmer 1.3s ease-in-out infinite; }
.duel-skeleton .sk-chip { width: 7rem; height: 1.1rem; border-radius: 999px; }
.duel-skeleton .sk-title { width: 78%; height: 1.4rem; margin: .8rem 0 .2rem; }
.duel-skeleton .sk-side { height: 4.2rem; }
.duel-skeleton .sk-vs { width: 2.4rem; height: 2.4rem; border-radius: 999px; align-self: center; }
@keyframes arena-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* A duel that just got its winner picked: brief green glow. */
.duel-card-public.just-picked { animation: arena-picked 1.8s ease-out; }
@keyframes arena-picked { 0% { box-shadow: 0 0 0 0 rgba(26,158,75,.55); background: #eaf7ef; } 100% { box-shadow: 0 0 0 14px rgba(26,158,75,0); background: #fff; } }
@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .duel-card-public.enter, .duel-card-public.just-picked, .duel-skeleton .sk, .cat-report.enter { animation: none; }
  .cat-btn { transition: none; }
}
