/* Portrait-first marker. Content has real minimum sizes; short viewports scroll
   rather than clipping the keypad. Scoped to the match, never the join/list UI. */
.marker-shell.marker-layout.marker-active {
  --space: clamp(6px, 1.2vw, 12px);
  --visit-row: clamp(64px, 7.8dvh, 104px);
  --score-size: clamp(64px, min(18vw, 11dvh), 148px);
  --progress-size: clamp(26px, min(7vw, 4dvh), 52px);
  background: #071523; overflow: auto; height: auto;
}
.marker-shell.marker-layout.marker-active > .app-header,
.marker-shell.marker-layout.marker-active > .local-banner {display:none}
.marker-shell.marker-layout.marker-active > main {height:auto;min-height:100dvh;overflow:visible;padding:0}
.marker-shell.marker-layout.marker-active .marker-main {
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr;
  width:100%;max-width:900px;height:auto;min-height:100dvh;margin:0 auto;
  padding:var(--space);padding-bottom:max(var(--space),env(safe-area-inset-bottom));gap:var(--space);overflow:visible;
}
.marker-shell.marker-layout.marker-active .marker-main > .card {padding:0;min-height:0;overflow:visible;border:0;border-radius:12px;background:transparent;box-shadow:none}
.marker-shell.marker-layout.marker-active #matchWorkspace {grid-column:1;grid-row:1;padding:0;margin:0}
.marker-shell.marker-layout.marker-active #matchPanel {position:static;display:grid;height:auto;grid-template-rows:auto auto;gap:var(--space);overflow:visible}
.marker-shell.marker-layout.marker-active .marker-match-head {position:static;display:flex;width:100%;min-height:36px;gap:8px;padding:0 2px;margin:0;pointer-events:auto;flex-wrap:wrap}
.marker-shell.marker-layout.marker-active .marker-match-head > div:first-child {display:block;min-width:0}
.marker-shell.marker-layout.marker-active .marker-match-head .eyebrow,
.marker-shell.marker-layout.marker-active #matchVersion {display:none}
.marker-shell.marker-layout.marker-active .marker-match-head h1 {font-size:clamp(14px,2.4vw,22px);line-height:1.2;margin:0;white-space:normal;letter-spacing:-.02em}
.marker-shell.marker-layout.marker-active .marker-head-actions {display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;align-items:center}
.marker-shell.marker-layout.marker-active .marker-head-actions button {display:block;width:auto;min-width:0;max-width:none;min-height:36px;height:auto;padding:7px 10px;border:1px solid #355168;background:#10283b;color:#c7d6e2;font-size:clamp(11px,1.6vw,15px);line-height:1.2;border-radius:8px;white-space:normal;overflow:visible}
.marker-shell.marker-layout.marker-active .marker-head-actions button::before {display:none;content:none}
.marker-shell.marker-layout.marker-active .marker-scoreboard {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;grid-template-areas:"first second";height:auto;min-height:0;gap:0;border:1px solid #34516a;border-radius:12px;overflow:hidden;background:#0b1d2f}
.marker-shell.marker-layout.marker-active .marker-score-meta {display:none}
.marker-shell.marker-layout.marker-active .marker-player {display:grid;grid-template-rows:auto auto auto auto;align-content:start;align-items:center;min-width:0;min-height:0;padding:8px;gap:4px;background:#0b1d2f;border:0;box-shadow:inset 0 3px transparent;text-align:center}
.marker-shell.marker-layout.marker-active #player1 {grid-area:first}
.marker-shell.marker-layout.marker-active #player2 {grid-area:second;padding:8px;border-left:1px solid #34516a}
.marker-shell.marker-layout.marker-active .marker-player.throwing {background:#10283a;box-shadow:inset 0 3px #ffd23f}
.marker-shell.marker-layout.marker-active .marker-player .throw-label {height:auto;min-height:12px;font-size:clamp(9px,1.6vw,14px);line-height:1.2;letter-spacing:.14em;color:#ffd23f}
.marker-shell.marker-layout.marker-active .marker-player .player-name {display:block;min-height:0;max-width:100%;font-size:clamp(16px,3.6vw,30px);line-height:1.15;font-weight:850;letter-spacing:.01em;overflow-wrap:anywhere;white-space:normal;overflow:visible;text-overflow:clip}
.marker-shell.marker-layout.marker-active .marker-player .remaining-stack {display:grid;grid-template-rows:auto auto;align-content:start;justify-items:center;align-self:auto;gap:4px;min-height:0;margin:0}
.marker-shell.marker-layout.marker-active .marker-player .remaining-label {display:none}
.marker-shell.marker-layout.marker-active .marker-player .remaining {font-size:var(--score-size);line-height:1.02;font-weight:900;letter-spacing:-.055em;color:#f5f8fc;font-variant-numeric:tabular-nums}
.marker-shell.marker-layout.marker-active .marker-player.throwing .remaining {color:#ffd23f}
.marker-shell.marker-layout.marker-active .player-last-visit {display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px;width:auto;min-width:0;min-height:0;max-width:100%;margin:0;padding:2px 0;border:0;border-radius:0;background:transparent;box-shadow:none;line-height:1.2}
.marker-shell.marker-layout.marker-active .player-last-visit span {font-size:clamp(8px,1.4vw,12px);font-weight:700;color:#a5b9cc;letter-spacing:.02em}
.marker-shell.marker-layout.marker-active .player-last-visit strong {font-size:clamp(16px,3vw,26px);color:#f5f8fc;font-weight:850}
.marker-shell.marker-layout.marker-active .player-last-visit em {font-size:10px}
.marker-shell.marker-layout.marker-active .marker-player .player-score {display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;align-items:center;justify-items:center;gap:0;min-height:0;width:100%;margin:4px 0 0;padding:6px 0 0;border:0;border-top:1px solid #34516a;border-radius:0;background:transparent;line-height:1}
.marker-shell.marker-layout.marker-active .player-score-label {grid-column:1;grid-row:1;color:#a5b9cc;font-size:clamp(9px,1.5vw,13px);letter-spacing:.08em}
.marker-shell.marker-layout.marker-active .player-score-value {grid-column:1;grid-row:2;font-size:var(--progress-size);font-weight:900;line-height:1.1}
.marker-shell.marker-layout.marker-active .player-set-score {grid-column:1;grid-row:3;min-height:0;font-size:11px;line-height:1.2}
.marker-shell.marker-layout.marker-active .player-set-score:empty {display:none}
.marker-shell.marker-layout.marker-active .player-turn-count {display:flex;flex-direction:column-reverse;grid-column:2;grid-row:1 / 4;align-self:stretch;align-items:center;justify-content:center;min-width:0;min-height:0;padding:0 3px;border-left:1px solid #34516a;background:transparent;gap:0}
.marker-shell.marker-layout.marker-active .player-turn-count b {font-size:var(--progress-size);font-weight:900;line-height:1.1}
.marker-shell.marker-layout.marker-active .player-turn-count {width:100%;justify-self:stretch}
.marker-shell.marker-layout.marker-active .player-turn-count small {margin:0;font-size:clamp(9px,1.5vw,13px);line-height:1;letter-spacing:.06em;color:#a5b9cc}
.marker-shell.marker-layout.marker-active #entryPanel {display:flex;flex-direction:column;gap:var(--space);height:auto;min-height:0;overflow:visible;padding:0;margin:0}
.marker-shell.marker-layout.marker-active .marker-history {order:0;display:grid;grid-template-rows:28px auto;flex:none;height:auto;min-height:0;gap:0;border:1px solid #34516a;border-radius:10px;overflow:hidden;background:#0b1d2f}
.marker-shell.marker-layout.marker-active .marker-history > .section-head {display:none}
.marker-shell.marker-layout.marker-active .paired-visit-head {display:grid;grid-template-columns:clamp(34px,7vw,56px) repeat(2,minmax(0,1fr));gap:6px;padding:0 6px;align-items:center;border:0;border-bottom:1px solid #34516a;background:#10283a;font-size:clamp(10px,1.7vw,14px);color:#b7c9db;text-align:center}
.marker-shell.marker-layout.marker-active .paired-visit-head strong {color:#b7c9db;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.marker-shell.marker-layout.marker-active .paired-visit-list {display:block;height:calc(var(--visit-row) * 3);min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#45617a transparent;padding:0;scroll-padding:0;background:transparent}
.marker-shell.marker-layout.marker-active .visit-pair-row {display:grid;grid-template-columns:clamp(34px,7vw,56px) repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:6px;height:var(--visit-row);min-height:var(--visit-row);padding:5px 6px;border:0;border-bottom:1px solid #294358;background:transparent;box-shadow:none;overflow:hidden}
.marker-shell.marker-layout.marker-active .visit-pair-row > span {display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;padding:0;color:#9eb3c7;text-shadow:none;line-height:1}
.marker-shell.marker-layout.marker-active .visit-pair-row > span b {font-size:clamp(17px,3vw,27px);font-weight:850;line-height:1}
.marker-shell.marker-layout.marker-active .visit-pair-row > span small {display:none}
.marker-shell.marker-layout.marker-active .visit-pair-row.late-leg-row {background:#721d32;border-block:1px solid #ff5d7a;border-bottom:1px solid #ff5d7a;box-shadow:inset 5px 0 #ff264d}
.marker-shell.marker-layout.marker-active .late-leg-row > span {color:#fff4f6}
.marker-shell.marker-layout.marker-active .late-leg-row .visit-history-cell {background:#8d253d;border-color:#ff8298;color:#fff}
.marker-shell.marker-layout.marker-active .late-leg-row .visit-history-cell small,.marker-shell.marker-layout.marker-active .late-leg-row .visit-history-cell small strong {color:#fff4f6}
.marker-shell.marker-layout.marker-active .visit-history-cell {display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;width:100%;height:100%;min-width:0;min-height:0;margin:0;padding:3px 8px;border:1px solid #34516a;border-radius:6px;background:#132d42;color:#f5f8fc;box-shadow:none;text-align:left;overflow:hidden}
.marker-shell.marker-layout.marker-active .visit-history-cell > span {display:flex;align-items:center;gap:4px}
.marker-shell.marker-layout.marker-active .visit-history-cell > span b {font-size:clamp(26px, min(7vw,4.2dvh), 44px);font-weight:850;line-height:1}
.marker-shell.marker-layout.marker-active .visit-history-cell small {font-size:clamp(10px,1.8vw,15px);line-height:1.15;color:#adc2d5;white-space:normal}
.marker-shell.marker-layout.marker-active .visit-history-cell small strong {color:#f5f8fc}
.marker-shell.marker-layout.marker-active .visit-history-cell small + small,
.marker-shell.marker-layout.marker-active .visit-history-cell i {display:none}
.marker-shell.marker-layout.marker-active .visit-history-cell.empty {background:transparent;border-color:transparent;align-items:center;color:#6a849b;font-size:24px}
.marker-shell.marker-layout.marker-active .visit-entry-cell,
.marker-shell.marker-layout.marker-active .late-entry-cell {position:relative;display:flex;flex-direction:column;align-items:stretch;justify-content:center;padding:0;border:2px solid #ffd23f!important;background:#273022!important;box-shadow:none!important}
.marker-shell.marker-layout.marker-active .visit-entry-cell::before {content:"WPISZ WYNIK";position:static;display:block;padding:3px 6px 0;color:#ffdf72;font-size:clamp(9px,1.6vw,13px);font-weight:800;letter-spacing:.035em;line-height:1.2;text-align:left;pointer-events:none}
.marker-shell.marker-layout.marker-active .late-entry-cell::before {content:"KOŃCÓWKA · WPISZ"}
.marker-shell.marker-layout.marker-active .visit-entry-cell .score-input {display:block;width:100%;height:0;flex:1;min-height:0!important;margin:0;padding:0 6px;border:0;border-radius:0;background:transparent!important;box-shadow:none;font-size:clamp(28px,min(8vw,4.8dvh),52px)!important;font-weight:900!important;line-height:1;text-align:center;letter-spacing:0!important;color:#fff!important;text-shadow:none}
.marker-shell.marker-layout.marker-active #markerInputs {order:1;display:flex;flex-direction:column;flex:1;justify-content:stretch;gap:6px;min-height:0;overflow:visible}
.marker-shell.marker-layout.marker-active #scoreError {flex:none;height:auto;min-height:0;margin:0;font-size:13px;line-height:1.35}
.marker-shell.marker-layout.marker-active #scoreError:empty {display:none}
.marker-shell.marker-layout.marker-active .missed-checkout {position:relative;flex:none;min-height:44px;margin:0;padding:4px 0;border:0;border-radius:0;background:transparent}
.marker-shell.marker-layout.marker-active .missed-checkout legend {float:left;display:flex;align-items:center;width:46%;min-height:44px;padding:0 5px;font-size:clamp(10px,1.65vw,15px);line-height:1.25;color:#b7c9db;letter-spacing:0;font-weight:650}
.marker-shell.marker-layout.marker-active .missed-checkout__choices {display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-left:47%}
.marker-shell.marker-layout.marker-active .missed-checkout__choices button {height:44px;min-height:44px;padding:0;border:1px solid #34516a;border-radius:8px;background:#10283a;color:#c7d6e2;font-size:17px;box-shadow:none}
.marker-shell.marker-layout.marker-active .missed-checkout__choices button.selected {border-color:#ffd23f;color:#ffd23f;background:#242e2b}
.marker-shell.marker-layout.marker-active .missed-checkout small {display:none}
.marker-shell.marker-layout.marker-active .keypad {display:grid;flex:1;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,minmax(44px,1fr));gap:6px;height:auto;min-height:194px;max-height:420px;margin:0}
.marker-shell.marker-layout.marker-active .keypad button {width:100%;height:100%;min-height:44px;max-height:none;margin:0;padding:4px;border:1px solid #35556d;border-radius:9px;background:#153149;color:#f5f8fc;box-shadow:none;font-size:clamp(26px,5.4vw,42px);font-weight:800;line-height:1;touch-action:manipulation}
.marker-shell.marker-layout.marker-active .keypad #submitVisit {border-color:#ffd23f;background:#ffd23f;color:#071523;font-size:clamp(12px,2.4vw,20px);font-weight:900}
.marker-shell.marker-layout.marker-active .keypad button[data-key="back"] {font-size:0;background:#10283a}
.marker-shell.marker-layout.marker-active .keypad button[data-key="back"]::before {content:"\232B";font-size:clamp(24px,5vw,36px);line-height:1}
.marker-shell.marker-layout.marker-active .marker-submit-row {display:grid;grid-template-columns:1fr 1fr;gap:6px;flex:none;height:auto;min-height:44px;margin:0;padding:0;position:static}
.marker-shell.marker-layout.marker-active .marker-submit-row button {height:44px;min-height:44px;margin:0;padding:6px;border:1px solid #35556d;border-radius:9px;background:#10283a;color:#b7c9db;font-size:clamp(12px,1.9vw,16px);line-height:1.2;font-weight:700;box-shadow:none}
.marker-shell.marker-layout.marker-active button:active:not(:disabled) {filter:brightness(1.3);transform:none}
.marker-shell.marker-layout.marker-active button:focus-visible {outline:3px solid #fff;outline-offset:-4px}
.marker-shell.marker-layout.marker-active button:disabled {opacity:.5}
.marker-shell.marker-layout.marker-active .hidden {display:none!important}
.marker-shell.marker-layout.marker-scoring #leasePanel {display:none}
.marker-shell.marker-layout.marker-active #entryGate {flex:none;order:-1;margin:0}
@media (min-width:600px) {
  .marker-shell.marker-layout.marker-active .marker-player,
  .marker-shell.marker-layout.marker-active #player2 {padding:12px;gap:6px}
  .marker-shell.marker-layout.marker-active .marker-submit-row,
  .marker-shell.marker-layout.marker-active .marker-submit-row button {min-height:50px;height:50px}
}
@media (max-width:360px) {
  .marker-shell.marker-layout.marker-active .marker-match-head {gap:4px}
  .marker-shell.marker-layout.marker-active .marker-match-head h1 {font-size:12px}
  .marker-shell.marker-layout.marker-active .marker-head-actions button {padding:6px;font-size:10px}
  .marker-shell.marker-layout.marker-active .late-entry-cell::before {content:"WPISZ WYNIK"}
}
/* Browser chrome reduces the usable phone height considerably. Keep all four
   keypad rows and both recent completed rounds in view without overlap. */
@media (max-width:599px) and (max-height:740px) {
  .marker-shell.marker-layout.marker-active {--space:4px;--visit-row:48px;--score-size:52px;--progress-size:22px}
  .marker-shell.marker-layout.marker-active .marker-match-head {min-height:32px}
  .marker-shell.marker-layout.marker-active .marker-head-actions button {min-height:32px;padding:5px 8px}
  .marker-shell.marker-layout.marker-active .marker-player,
  .marker-shell.marker-layout.marker-active #player2 {padding:5px;gap:2px}
  .marker-shell.marker-layout.marker-active .marker-player .player-name {font-size:16px}
  .marker-shell.marker-layout.marker-active .marker-player .remaining-stack {gap:0}
  .marker-shell.marker-layout.marker-active .player-last-visit strong {font-size:14px}
  .marker-shell.marker-layout.marker-active .player-last-visit span {font-size:7px}
  .marker-shell.marker-layout.marker-active .marker-player .player-score {padding-top:4px;margin-top:2px}
  .marker-shell.marker-layout.marker-active .marker-history {grid-template-rows:24px auto}
  .marker-shell.marker-layout.marker-active .visit-pair-row {padding:3px 5px;gap:4px}
  .marker-shell.marker-layout.marker-active .visit-history-cell {padding:2px 6px;gap:1px}
  .marker-shell.marker-layout.marker-active .visit-history-cell > span b {font-size:22px}
  .marker-shell.marker-layout.marker-active .visit-history-cell small {font-size:9px}
  .marker-shell.marker-layout.marker-active .visit-entry-cell::before {font-size:8px;padding-top:1px}
  .marker-shell.marker-layout.marker-active .visit-entry-cell .score-input {font-size:26px!important}
  .marker-shell.marker-layout.marker-active #markerInputs {gap:4px}
  .marker-shell.marker-layout.marker-active .keypad {gap:4px;min-height:188px}
  .marker-shell.marker-layout.marker-active #backToMatches,
  .marker-shell.marker-layout.marker-active #compactReleaseLease,
  .marker-shell.marker-layout.marker-active #starterAction {min-height:30px;height:auto;padding:4px 6px;font-size:10px}
  .marker-shell.marker-layout.marker-active .player-last-visit {padding:0}
  .marker-shell.marker-layout.marker-active .missed-checkout {padding:0}
}

/* A ring marks every counted 100+ visit, including earlier rows after correction. */
.marker-shell .visit-history-cell.high-score-visit > span b,
.marker-shell .player-last-visit .last-visit-score.high-score-visit {
  display:inline-grid;
  place-items:center;
  width:max-content;
  min-width:2.5em;
  min-height:1.2em;
  padding:0 .18em;
  border:2px solid #ffd23f;
  border-radius:999px;
  color:#fff9dc;
  background:#684c0b;
  font-variant-numeric:tabular-nums;
}
.marker-shell.marker-layout.marker-active .visit-history-cell.high-score-visit {
  box-shadow:inset 3px 0 #ffd23f;
}
.marker-shell.marker-layout.marker-active .late-leg-row .visit-history-cell.high-score-visit {
  box-shadow:inset 3px 0 #ffd23f;
}
