/* PokerBotsArena hand replayer page (replay.html) on the site palette (site.css): hand list,
   step line, slider, options and full screen. The table is the separate Riropo component in
   #rp-frame (riropo/, GPLv3); none of its styles live here. Text >= 12px, visible focus, 44px
   touch targets. */

.rp { padding-block: clamp(28px, 4vw, 56px) clamp(48px, 6vw, 88px); }
.rp-head { display: grid; gap: 18px; max-width: 900px; margin-bottom: 28px; }
.rp-head .lede { margin: 0; }
.rp-honest { margin: 0; padding: 12px 16px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.rp-honest strong { color: var(--white); }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

/* ---------- stage ---------- */
.rp-stage { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1); }
.rp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.rp-title { margin: 0 auto 0 0; color: var(--white); font-size: 18px; font-weight: 750; letter-spacing: -.01em; }

/* The table is the Riropo component (riropo/, GPLv3) in its own frame. The frame is sized to
   Riropo's table plus its button bar: landscape 792 x 500 when the stage is wide, upright
   500 x 800 on phones. The component fits itself to whatever box it gets. */
.rp-table { position: relative; container-type: inline-size; }
.rp-frame { display: block; width: 100%; height: calc(100cqw * 500 / 792 + 53px); border: 0; border-radius: 8px; background: #2b1508; }
@container (max-width: 600px) {
  .rp-frame { height: calc(100cqw * 800 / 500 + 73px); }
}

.rp-line { min-height: 3em; margin: 12px 4px 0; color: var(--white); font-size: 16px; line-height: 1.5; }

/* ---------- controls ---------- */
.rp-controls, .rp-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.rp-ctl { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--ink-0); color: var(--white); font: 700 15px/1 var(--font); cursor: pointer; }
.rp-ctl:hover:not(:disabled) { border-color: var(--volt); color: var(--volt); }
.rp-ctl:disabled { opacity: .4; cursor: not-allowed; }
.rp-step { flex: 1 1 160px; min-width: 120px; height: 44px; accent-color: var(--volt); }
.rp-count { color: var(--text-3); font: 500 12.5px/1.3 var(--mono); }
.rp-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-2); font-size: 14.5px; }
.rp-opt select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--ink-0); color: var(--white); font: inherit; }
.rp-check input { width: 20px; height: 20px; accent-color: var(--volt); }
.rp-keys { margin: 10px 4px 0; color: var(--text-3); font: 500 12.5px/1.4 var(--mono); }
.rp-credit { margin: 10px 4px 0; color: var(--text-3); font-size: 13px; line-height: 1.45; }
.rp-credit a { color: var(--text-2); }

/* ---------- side ---------- */
.rp-side { display: grid; gap: 16px; min-width: 0; }
.rp-panel { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1); }
.rp-panel h2 { margin: 0 0 12px; color: var(--text-3); font: 600 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.rp-panel .field + .field { margin-top: 12px; }
.rp-panel input[type="search"], .rp-panel select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--ink-0); color: var(--white); font: inherit; font-size: 15px; }
.rp-hands { display: grid; gap: 4px; max-height: 320px; margin: 12px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.rp-hand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rp-hand:hover { background: rgba(255, 255, 255, .04); }
.rp-hand[aria-current="true"] { border-color: var(--volt); background: rgba(186, 255, 67, .06); }
.rp-hand-num { color: var(--white); font-weight: 700; font-size: 14.5px; }
.rp-hand-sum { color: var(--text-3); font: 500 12.5px/1.3 var(--mono); }
.rp-panel-note { margin: 0 0 8px; color: var(--text-3); font-size: 14px; line-height: 1.45; }
.rp-samples { max-height: none; margin-top: 0; }
.rp-samples .rp-hand[aria-current="true"] { border-color: var(--info); background: rgba(138, 216, 255, .06); }
.rp-hand-flag { color: var(--warn); font: 600 12px/1.3 var(--mono); }
.rp-log { max-height: 380px; margin: 0; padding: 0; overflow-y: auto; list-style: none; font-size: 14.5px; }
.rp-log li { border-left: 2px solid transparent; color: var(--text-2); }
.rp-log li[aria-current="step"] { border-left-color: var(--volt); background: rgba(186, 255, 67, .06); color: var(--white); }
.rp-log-step { display: block; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rp-log-step:hover { background: rgba(255, 255, 255, .04); color: var(--white); }
.rp-log-street { padding: 10px 0 4px; color: var(--volt); font: 700 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.rp-log-empty { padding: 8px 10px; color: var(--text-3); font-size: 14.5px; }
.rp-auto { margin-left: 8px; padding: 1px 6px; border: 1px solid rgba(255, 171, 107, .55); border-radius: 999px; color: var(--warn); font: 700 12px/1.3 var(--mono); }

/* ---------- full screen ---------- */
/* The Fullscreen API where it exists; otherwise (iPhone) .is-full covers the window. Options and
   help stay on the page; the table, the step line and the slider fill the screen. */
.rp-stage:fullscreen, .rp-stage.is-full { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 0; border-radius: 0; background: var(--ink-0); }
.rp-stage.is-full { position: fixed; inset: 0; z-index: 1000; }
html.rp-locked, html.rp-locked body { overflow: hidden; }
.rp-stage:fullscreen .rp-table, .rp-stage.is-full .rp-table { flex: 1 1 auto; min-height: 0; }
.rp-stage:fullscreen .rp-frame, .rp-stage.is-full .rp-frame { height: 100%; }
.rp-stage:fullscreen :is(.rp-bar, .rp-line, .rp-controls), .rp-stage.is-full :is(.rp-bar, .rp-line, .rp-controls) { flex: none; margin: 0; }
.rp-stage:fullscreen :is(.rp-options, #rp-share-note, .rp-credit, .rp-keys), .rp-stage.is-full :is(.rp-options, #rp-share-note, .rp-credit, .rp-keys) { display: none; }
.rp-stage:fullscreen .rp-line, .rp-stage.is-full .rp-line { min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Short screens (phones held sideways): the table and its own buttons take the whole height. */
@media (max-height: 520px) {
  .rp-stage:fullscreen :is(.rp-bar, .rp-line, .rp-controls), .rp-stage.is-full :is(.rp-bar, .rp-line, .rp-controls) { display: none; }
  .rp-stage:fullscreen, .rp-stage.is-full { padding: 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .rp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .rp-stage { padding: 10px; }
}
@media (max-width: 360px) {
  .rp-stage { padding: 6px; border-radius: 8px; }
  .rp-controls .rp-step { flex-basis: 100%; }
  .rp-keys { display: none; }
}

@media (forced-colors: active) {
  .rp-ctl { border: 1px solid CanvasText; }
  .rp-hand[aria-current="true"] { outline: 2px solid Highlight; }
}
