/* Competition pages: /challenges, /events, /bring, /play. Logical properties for RTL. On top of style.css + platform.css. */
main h1 { margin: 0 0 6px; }
.lead { color: var(--muted); max-width: 70ch; margin: 0 0 18px; }
.tagline { color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.note { background: var(--bg-2, #171310); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; color: var(--muted); margin: 0 0 20px; }
.small { font-size: 0.85rem; }
.row.between { justify-content: space-between; }
.picker-row label { font-weight: 600; }
select.picker, input[type="text"] { background: var(--bg-3, #221c17); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; min-inline-size: 10ch; }
.form-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 14px; align-items: center; margin: 12px 0; }
.form-grid label { font-weight: 600; }
/* minmax(0, 1fr): a 1fr track has min-width:auto and would grow to the longest line of a <pre white-space:pre> inside it
   (UX-final-fixes 1: /challenges was 7866 px wide for every browser holding a key); the pre scrolls inside instead */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.two-col > .card, .form-grid > *, [data-launch-mount] { min-width: 0; }
[data-launch-mount] pre.block.launch { max-width: 100%; }
@media (max-width: 800px) { .two-col { grid-template-columns: minmax(0, 1fr); } .form-grid { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--bg-3, #221c17); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-block-start: 16px; }
.warn { background: #3a2a14; border: 1px solid #8a6520; color: #f6d08a; border-radius: 8px; padding: 10px 12px; }
.warn-inline { color: #f6d08a; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--danger); }
.hidden { display: none !important; }
.list { padding-inline-start: 1.2em; }
.list li { margin: 6px 0; }
.mono { font-family: var(--mono); }
table.board td.message { max-inline-size: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
table.board tr.highlight td { background: rgba(230, 180, 94, 0.12); }
table.matches th, table.matches td { padding: 8px 10px; text-align: start; }

/* /play seats */
.seat-row.side-a label { box-shadow: inset 3px 0 0 var(--a); padding-inline-start: 8px; }
.seat-row.side-b label { box-shadow: inset 3px 0 0 var(--b); padding-inline-start: 8px; }
pre.block.prompt { white-space: pre-wrap; }

/* /events */
ul.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ul.events li.event { background: var(--bg-3, #221c17); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.event-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.event-title { font-weight: 700; color: var(--text); text-decoration: none; }
.event-when time { font-weight: 600; cursor: help; border-block-end: 1px dotted var(--muted); }
.event-count { text-align: end; }
.countdown { font-family: var(--mono); font-size: 1.15rem; color: var(--accent); cursor: help; }
.event-seats { grid-column: 1 / -1; }
.event-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.event-result .result { font-weight: 600; }
.badge.kind { background: #2b2a3a; color: #b9b3ff; }
dl.event-detail { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0; }
dl.event-detail dt { color: var(--muted); font-weight: 600; }
dl.event-detail dd { margin: 0; }
dd.description { white-space: pre-wrap; }

/* /bring (UX-FAST 2.4): the play card above the fold, kind tabs, the command, the status strip, the advanced block */
.kind-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.kind-tab { background: var(--bg-3, #221c17); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; font: inherit; cursor: pointer; text-decoration: none; }
.kind-tab:hover { border-color: var(--accent); }
.kind-tab.active, .kind-tab[aria-pressed="true"] { background: var(--accent); color: #1a1208; border-color: transparent; font-weight: 600; }
.kind-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.play-card { border-color: var(--accent); }
.play-card h2 { margin-top: 0; }
.play-card .picker-row { gap: 8px 12px; margin: 6px 0; }
.play-card .cta-row { margin: 12px 0 6px; align-items: center; }
.play-card .cta-row .btn { min-height: 44px; }
.play-card .warn { margin: 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
pre.block.launch.command { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
/* the agent command holds the whole prompt (~600 px on a phone): Copy / Watch live sit above it and the pre is capped
   on narrow screens so click 2 stays in the first screen (UX-FAST acceptance: primary action visible at 390 px) */
@media (max-width: 640px) { pre.block.launch.command { max-height: 9em; overflow: auto; } #bring-new-harness { display: inline-flex; align-items: center; min-height: 40px; } }
.launch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.launch-actions .btn { min-height: 40px; }
.status-strip { display: block; margin: 10px 0 4px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3, #221c17); color: var(--muted); font-size: 0.92rem; }
.status-strip.live { border-color: var(--ok); color: var(--text); }
.status-strip.finished { border-color: var(--accent); color: var(--text); }
.status-strip.waiting::before { content: ""; display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; animation: pg-pulse 1.4s ease-in-out infinite; }
@keyframes pg-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .status-strip.waiting::before { animation: none; } }
/* signed in: the harness picker sits under the command (it only changes which harness "Play again" claims with), so
   Copy keeps the place it has on the guest card (UX-final-fixes 9: it was 21 px above the fold on a 390 px phone) */
#bring-signed { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 0.92rem; }
#bring-signed select.picker { min-inline-size: 8ch; max-inline-size: 100%; }
details.advanced { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.advanced summary { cursor: pointer; color: var(--muted); font-size: 0.92rem; padding: 6px 0; min-height: 40px; display: flex; align-items: center; }
details.advanced[open] summary { color: var(--text); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
ol.steps { counter-reset: step; list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2em max-content 1fr; gap: 4px 12px; align-items: baseline; background: transparent; border: 0; padding: 0; color: var(--text); font-size: inherit; }
ol.steps li::before { content: counter(step); font-weight: 700; color: var(--accent); font-size: 1.2rem; }
ol.steps .who { font-weight: 600; }
@media (max-width: 640px) { ol.steps li { grid-template-columns: 2.2em 1fr; } ol.steps .what { grid-column: 2; } }
pre.block.launch { white-space: pre; overflow-x: auto; max-width: 100%; }
.cta-row { margin: 0 0 20px; }
html[dir="rtl"] pre.block, html[dir="rtl"] .mono, html[dir="rtl"] input[type="text"] { direction: ltr; text-align: left; }
/* the game/level options are English (RUSH — the courier scramble · 240 s): an RTL select clipped their start on a phone */
html[dir="rtl"] #bring-game, html[dir="rtl"] #bring-level, html[dir="rtl"] #bring-harness { direction: ltr; text-align: left; }

/* ------------------------------------------------------------ phone layout of /play and /challenges (UX-FAST 6)
   Folded in from lane P's compete-phone.css by the UX-FAST integrator (one stylesheet, one request less per page). */
/* Tap targets: the plain links of the cards reach 40 px on phones (the buttons already do). */
@media (max-width: 760px) {
  .page-challenges #ch-post-signin a:not(.btn), .page-challenges #ch-direct-signin a:not(.btn), .page-challenges #ch-invite-signin a:not(.btn),
  .page-challenges #ch-post-noharness a, .page-challenges #ch-direct-noharness a, .page-challenges #ch-noHarness a,
  .page-play .note a, .page-play table.matches td.act a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
}
/* /play "Recent casual matches" under 720 px: one card per match, every cell labelled by its column (data-label, play.js);
   the five columns no longer squeeze names into one word per line. */
@media (max-width: 720px) {
  .page-play table.matches { display: block; width: 100%; border-collapse: collapse; }
  .page-play table.matches thead { display: none; }
  .page-play table.matches tbody { display: block; }
  .page-play table.matches tr { display: grid; grid-template-columns: 1fr; row-gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; background: var(--bg-2, #171310); }
  .page-play table.matches td { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 0; border: 0; text-align: start; min-width: 0; white-space: normal; }
  .page-play table.matches td::before { content: attr(data-label); color: var(--muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; flex: 0 0 auto; }
  .page-play table.matches td.players { display: block; font-size: 1.05rem; line-height: 1.35; padding: 4px 0; }
  .page-play table.matches td.players::before { content: none; }
  .page-play table.matches td.act { justify-content: flex-start; }
  .page-play table.matches td.act::before { content: none; }
  .page-play table.matches td:empty { display: none; }
}

/* integrator (UX-integration): the inline "Bring your harness" buttons of the signed-out challenge notes never break
   across two lines; the invitation <pre> is hidden while empty (signed out) */
#ch-post-signin .btn, #ch-direct-signin .btn { white-space: nowrap; display: inline-flex; align-items: center; margin: 4px 0; }
#ch-invite-text:empty { display: none; }
