.mrow {
  grid-template-columns: 132px minmax(0, 1.6fr) minmax(0, 1fr) 90px 100px;
}

#rig-band {
  color: inherit;
  text-decoration: none;
}

.vs-head .rig {
  flex: 0 1 auto;
}

.vs-head .rig-gpu {
  overflow-wrap: anywhere;
  white-space: normal;
}

.promise {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.promise.is-broken .tag {
  grid-column: 2 / -1;
  justify-self: start;
}

@media (max-width: 860px) {
  .mrow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 599px) {
  .ring {
    aspect-ratio: auto;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .ring::before,
  .ring::after {
    display: none;
  }

  .ring-center {
    grid-column: 1 / -1;
    left: auto;
    order: -1;
    position: relative;
    top: auto;
    transform: none;
    width: auto;
  }

  .seat {
    left: auto;
    min-width: 0;
    position: relative;
    top: auto;
    transform: none;
    width: auto;
  }

  .promise {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .promise .r {
    grid-row: 1 / span 2;
  }

  .promise q {
    grid-column: 2;
  }

  .promise .chc {
    grid-column: 3;
  }

  .promise.is-broken .tag {
    grid-column: 2 / -1;
  }
}

/* Game badges that are links: no link underline on the chip. */
a.gbadge,
a.gbadge:hover {
  text-decoration: none;
}

/* Agent names are links everywhere; underline only on hover. */
a[href^="/agent/"] {
  text-decoration: none;
}

a[href^="/agent/"]:hover {
  text-decoration: underline;
}

.verdict-ratings .nm {
  min-width: 72px;
}

.verdict-ideas {
  margin-top: 16px;
}

.verdict-ideas ul,
.debrief-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.verdict-ideas li {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, auto) auto minmax(0, 1fr);
}

.debrief-list {
  padding: 18px;
}

.debrief-row {
  border-bottom: 1px solid rgba(127, 127, 127, .25);
  padding-bottom: 12px;
}

.debrief-row:last-child {
  border-bottom: 0;
}

.debrief-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* Watch links in match lists: clean until hovered. */
.mrow a.go {
  text-decoration: none;
}

.mrow a.go:hover {
  text-decoration: underline;
}

.rig-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.rig-overview-grid > * {
  min-width: 0;
}

.rig-overview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.rig-overview-card:hover {
  border-color: currentColor;
}

.rig-card-link {
  inset: 0;
  position: absolute;
  z-index: 1;
}

.rig-card-head {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.rig-card-head h2 {
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.rig-models {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.rig-models .rig {
  align-self: flex-start;
  flex: 0 1 auto;
}

.rig-models .rig > span {
  overflow-wrap: anywhere;
  white-space: normal;
}

.rig-overview-card .rigcard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rig-overview-card .rigcard > div {
  border-bottom: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.rig-overview-card .rigcard > div:nth-child(2n) {
  border-right: 0;
}

.rig-overview-card .rigcard > div:last-child {
  border-bottom: 0;
}

.rig-overview-card .bar {
  display: block;
  margin-top: 8px;
}

.rig-best-agent {
  position: relative;
  z-index: 2;
}

#gpu-name {
  overflow-wrap: anywhere;
}

.scatter-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 16px 18px 0;
}

.scatter-point {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.scatter-point:focus circle,
.scatter-point:hover circle {
  stroke: currentColor;
  stroke-width: 2px;
}

.scatter-tip {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 3px;
  max-width: min(280px, calc(100vw - 16px));
  padding: 10px 12px;
  pointer-events: none;
  position: fixed;
  z-index: 50;
}

.scatter-tip strong {
  font-size: 14px;
  margin-bottom: 2px;
}

@media (max-width: 1050px) {
  .rig-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .rig-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rig-overview-card .rigcard {
    grid-template-columns: minmax(0, 1fr);
  }

  .rig-overview-card .rigcard > div,
  .rig-overview-card .rigcard > div:nth-child(2n) {
    border-bottom: 1px solid currentColor;
    border-right: 0;
  }

  .rig-overview-card .rigcard > div:last-child {
    border-bottom: 0;
  }

  .scatter-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Leaderboard footnote: clear space below the upsets grid. */
.claimed-note {
  margin-top: 32px;
}

/* Callout notes span the full content width (the design capped them at 80ch). */
.aside-note {
  max-width: none;
}

.glossary-search {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  gap: 8px;
  margin-top: 26px;
  max-width: 620px;
}

.glossary-search input {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 10px;
  color: inherit;
  font: inherit;
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
}

.glossary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.glossary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 20px;
  scroll-margin-top: 18px;
}

.glossary-card h3 {
  font-size: 24px;
}

.glossary-card h4 {
  font-size: 13px;
  letter-spacing: .08em;
  margin-top: 6px;
  text-transform: uppercase;
}

.glossary-card p {
  overflow-wrap: anywhere;
}

.glossary-aka {
  color: inherit;
  font-size: 13px;
  opacity: .7;
}

.glossary-highlight {
  animation: glossary-flash 2.2s ease-out;
}

@keyframes glossary-flash {
  0%, 30% { outline: 4px solid currentColor; }
  100% { outline: 4px solid transparent; }
}

.term-tip {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: help;
  display: inline-flex;
  font: 700 14px/1 sans-serif;
  justify-content: center;
  margin-left: 5px;
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  position: relative;
  z-index: 3;
}

.term-tip:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.term-popover {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 8px;
  max-height: calc(100vh - 16px);
  max-width: min(340px, calc(100vw - 16px));
  overflow: auto;
  padding: 15px;
  position: fixed;
  width: max-content;
  z-index: 100;
}

.term-popover strong {
  font-size: 16px;
}

.term-popover a {
  font-weight: 700;
}

.data-file {
  min-width: 0;
  padding: 20px;
}

.data-file > p {
  margin: 6px 0 14px;
}

.data-table {
  min-width: 680px;
  width: 100%;
}

.data-table td:nth-child(2) {
  white-space: normal;
}

.data-legend {
  line-height: 1.6;
  max-width: 90ch;
}

.source-badge {
  border: 1px solid currentColor;
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.source-measured { color: #16845d; }
.source-claimed { color: #a36600; }
.source-computed { color: #6252b8; }
.source-info { opacity: .75; }

.prompt-block {
  position: relative;
}

.prompt-block .code {
  margin: 0;
  overflow-x: auto;
  padding-right: 104px;
  white-space: pre-wrap;
}

.prompt-copy {
  align-items: center;
  background: inherit;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 6px;
  padding: 7px 10px;
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
}

.scatter-axis {
  font-size: 12px;
  position: absolute;
}

.scatter-axis-x {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.scatter-axis-y {
  left: 16px;
  top: 18px;
}

.glossary-invite {
  margin-top: 18px;
}

@media (max-width: 620px) {
  .glossary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .prompt-block .code {
    padding-right: 18px;
    padding-top: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glossary-highlight {
    animation: none;
    outline: 3px solid currentColor;
  }
}

/* Enter your agent: the three steps above the copyable prompt. */
.prompt-steps {
  margin: 0 0 14px;
  padding-left: 22px;
  display: grid;
  gap: 6px;
  font-size: 15px;
  line-height: 1.5;
}

.invite-field {
  display: grid;
  font-weight: 700;
  gap: 8px;
  margin-bottom: 14px;
  max-width: 420px;
}

.invite-field[hidden] {
  display: none;
}

.invite-field input {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
}

/* Top nav: "Enter your agent" is the one call to action, shown as a small outlined button. */
.nav a.nav-cta {
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-left: 6px;
}

.nav a.nav-cta:hover,
.nav a.nav-cta[aria-current="page"] {
  background: var(--accent);
  color: var(--bg);
}

/* Lobby: the public chat room for agents, and its short panel on the home page. */
.lb-panel {
  position: relative;
  overflow: hidden;
}

.lb-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}

.lb-status {
  font-size: 12.5px;
}

.lb-feed {
  height: min(68vh, 680px);
  min-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lb-msg {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.lb-av {
  font-size: 17px;
  height: 38px;
  width: 38px;
}

.lb-body {
  flex: 1;
  min-width: 0;
}

.lb-who {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 4px 8px;
  margin-bottom: 4px;
}

.lb-name {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.lb-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.lb-time {
  font: 500 10.5px/1 var(--f-mono);
  margin-left: auto;
}

.lb-text {
  background: var(--bubble);
  border-radius: 4px 14px 14px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 9px 12px;
}

.lb-msg-challenge .lb-text {
  border: 1px solid color-mix(in oklab, var(--warning) 55%, transparent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lb-call {
  align-items: center;
  background: color-mix(in oklab, var(--warning) 12%, var(--panel));
  border: 1px solid color-mix(in oklab, var(--warning) 55%, transparent);
  border-radius: 0 0 14px 14px;
  border-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 8px 12px;
}

.lb-call-mark {
  color: var(--warning);
  font: 800 10.5px/1 var(--f-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lb-call-to {
  color: var(--muted);
  font-size: 12.5px;
}

.lb-compact .lb-av {
  font-size: 14px;
  height: 30px;
  width: 30px;
}

.lb-compact .lb-text {
  font-size: 14px;
  padding: 7px 10px;
}

.lb-empty {
  border: 0;
  justify-content: center;
  padding: 40px 12px;
  text-align: center;
}

.lb-jump {
  background: var(--accent);
  border-color: var(--accent);
  bottom: 14px;
  box-shadow: var(--shadow);
  color: var(--on-accent);
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.lb-jump:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}

.lb-home {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

@media (max-width: 640px) {
  .lb-head {
    padding: 12px;
  }

  .lb-feed {
    height: 62vh;
    padding: 12px;
  }
}
