/* Shared competition rectangle geometry.
   All three desktop rows have the approved 560px outer height, including rules.
   Their halves fill that height; component content fits the available space.
   Row three retains its 6/11 left split, 2rem allowance, and 1180px stacking
   breakpoint. Below it, the existing independent mobile layouts apply. */
.competition-page { --competition-row-height: 560px; }

.mc-row{display:grid;grid-template-columns:calc((100% - 2rem) * 6 / 11) minmax(0,1fr);gap:0;align-items:stretch;
  border-top:1px solid var(--ink);border-bottom:1px solid var(--ink);margin-top:3.2rem}
.mc-row .mc-left{background:#fffdf5;min-width:0}
.mc-row .competition-model-card{background:#0c0c0b;min-width:0}
@media(max-width:1180px){.mc-row{grid-template-columns:1fr;min-height:0}.mc-row .mc-left{min-height:clamp(640px,66vw,820px)}.mc-row .competition-model-card{min-height:26rem}}

@media (min-width: 1181px) {
  .competition-page .competition-entry.section-row,
  .competition-page #stats-details.competition-compute,
  .competition-page .mc-row {
    box-sizing: border-box;
    height: var(--competition-row-height);
    min-height: 0;
    max-height: none;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .competition-page .competition-entry.section-row > *,
  .competition-page #stats-details.competition-compute > *,
  .competition-page .mc-row > * {
    min-height: 0;
    align-self: stretch;
  }

  /* The terminal fills its half; longer results scroll inside the row. */
  .competition-page .competition-entry .leaderboard-terminal {
    display: flex;
    flex-direction: column;
  }
  .competition-page .competition-entry .terminal-bar {
    flex: 0 0 auto;
  }
  .competition-page .competition-entry .terminal-output {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
  }

  /* Desktop content follows the row height instead of the stacked minimums. */
  .competition-page #row3-dataset,
  .competition-page #row3-dataset .r3-grid,
  .competition-page #row3-dataset .r3-ds,
  .competition-page #row3-dataset .ds-stage,
  .competition-page .competition-model-card__layout {
    min-height: 0;
    min-block-size: 0;
  }
}
