/* The Strategy Games pages (decision 0015): one small sheet both hosts link, on the host's theme variables where it has them. */
/* The page keeps room for the scrollbar, so a long tab and a short one sit at the same place. */
html:has(.sg-page){scrollbar-gutter:stable}
/* a sheet over the page scrolls by itself, and the page under it stays still */
html:has(.match-over){overflow:hidden}
.sg-page{box-sizing:border-box;width:100%;max-width:720px;margin:0 auto;padding:12px 16px}
/* The controls (decision 0030): four kinds of button, every control at least 44 pixels tall and drawn in the theme. A plain button is
   the outline secondary; primary is the reader's move, one a screen; quiet is text alone; danger is the red of an action that costs. */
.sg-page button,.sg-page .sg-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;min-width:44px;padding:8px 16px;border-radius:10px;border:1px solid var(--line,rgba(255,255,255,.3));background:transparent;color:inherit;font:inherit;text-decoration:none;cursor:pointer;touch-action:manipulation}
/* A plain button is an action and stands out: the accent's outline and words on a faint fill. The pills, the tabs, a team sheet's
   names and a row's small tools keep the quiet look. */
.sg-page button:not(.primary,.quiet,.danger,[role=tab],[aria-pressed],.sheet-name,.coin-pick){border-color:#f5c518;color:#f5c518;background:rgba(245,197,24,.1);font-weight:600}
.sg-page .edit-tools button{border-color:var(--line,rgba(255,255,255,.3));color:inherit;background:transparent;font-weight:400}
.sg-page button.primary,.sg-page .sg-button.primary{background:#f5c518;border-color:#f5c518;color:#1a1a1a;font-weight:700}
.sg-page button.quiet{border-color:transparent;padding:8px 4px;text-decoration:underline;text-align:left}
.sg-page button.danger{background:#8a2020;border-color:#a33}
.sg-page button:disabled{opacity:.5;cursor:default}
.sg-page button:active:not(:disabled),.sg-page .sg-button:active{opacity:.7}
.sg-page :is(button,a,select,input,textarea,summary):focus-visible{outline:2px solid #f5c518;outline-offset:2px}
.sg-page select,.sg-page input:not([type=radio],[type=checkbox],[type=range]),.sg-page textarea{box-sizing:border-box;min-height:44px;max-width:100%;padding:8px 10px;border-radius:10px;border:1px solid var(--line,rgba(255,255,255,.25));background:transparent;color:inherit;font:inherit}
.sg-page input[type=range]{min-height:44px}
.sg-page summary{box-sizing:border-box;min-height:44px;cursor:pointer}
.sg-page summary:not(.ball-row){padding-top:11px;padding-bottom:11px}
.sg-page label:has(>input[type=checkbox]){display:flex;align-items:center;gap:8px;min-height:44px}
.sg-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.sg-tile{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px;border:1px solid var(--line,rgba(255,255,255,.15));border-radius:14px;text-decoration:none;color:inherit;background:var(--card,rgba(255,255,255,.05))}
.sg-tile-soon{opacity:.55;cursor:default}
.sg-glyph{font-size:34px}
.sg-name{font-weight:700}
.sg-meta,.sg-muted,.sg-row-meta{opacity:.75;font-size:.9em}
.sg-rows{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:8px}
/* A match's row (decision 0030): the box is the list item's, so Archive sits inside it under the link. */
.sg-rows>li{border:1px solid var(--line,rgba(255,255,255,.15));border-radius:10px}
.sg-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;text-decoration:none;color:inherit}
.sg-back{display:inline-flex;align-items:center;min-height:44px;color:inherit;opacity:.85;text-decoration:none}
.sg-row-main{display:grid;gap:2px}
.sg-row-title{font-weight:700}
.sg-tag{flex:none;font-size:13px;padding:2px 10px;border-radius:10px;border:1px solid var(--line,rgba(255,255,255,.25))}
.sg-tag.yours{background:#f5c518;border-color:#f5c518;color:#1a1a1a;font-weight:700}
.sg-join{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0}
.sg-join label{flex:1 0 100%}
.sg-join input{flex:1 1 160px}
.sg-error{color:var(--warn,#e8a33d)}
/* Cricket's home (decision 0026): the groups, the Archive link under a row, its confirm in place, and the archived matches. */
.sg-group{font-size:13px;text-transform:uppercase;letter-spacing:.06em;opacity:.75;margin:14px 0 6px}
.sg-page button.sg-archive{display:flex;margin:0 12px 4px auto;opacity:.75}
.sg-confirm{margin:6px 8px 8px;padding:10px 12px;border:1px solid #f5c518;border-radius:10px;display:grid;gap:6px}
.sg-confirm h3{margin:0;font-size:1em}
.sg-confirm ul{margin:0;padding-left:18px}
.sg-tick{display:flex;gap:8px;align-items:flex-start}
.sg-confirm-buttons{display:flex;flex-wrap:wrap;gap:8px}
.sg-archived summary{margin:14px 0 8px;opacity:.85}
.sg-form{display:grid;gap:10px;margin:12px 0}
.sg-form fieldset{border:1px solid var(--line,rgba(255,255,255,.15));border-radius:10px;padding:10px 12px;display:grid;gap:6px}
.sg-form label{display:flex;justify-content:space-between;gap:12px;align-items:center}
/* A picker's list is drawn by the browser, on white unless told: colour the options from the host's theme. */
.sg-page option{background:var(--theme-bg-surface,#16402f);color:var(--theme-text-primary,#f4efe4)}
.sg-table{width:100%;border-collapse:collapse;margin:8px 0}
.sg-table th,.sg-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line,rgba(255,255,255,.15))}
.sg-code{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:.06em}

/* The round on the match page (decision 0016): the brief, then the board. */
.round-brief{display:grid;gap:6px;padding:10px 12px;border:1px solid var(--line,rgba(255,255,255,.15));border-radius:12px;background:var(--card,rgba(255,255,255,.04))}
.round-steps{display:flex;gap:6px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.round-steps li{padding:3px 10px;border-radius:999px;border:1px solid var(--line,rgba(255,255,255,.2));font-size:.85em;opacity:.7}
.round-steps li.done{opacity:1}
.round-steps li.now{opacity:1;font-weight:700;border-color:currentColor}
.round-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.round-board{display:grid;grid-template-columns:1fr;gap:8px;margin-top:10px}
.round-card{border:1px solid var(--line,rgba(255,255,255,.15));border-radius:12px;padding:8px 12px;min-width:0}
.round-card.yours{border-color:rgba(245,197,24,.45)}
.round-card.focused{border-color:#f5c518;border-width:2px}
.round-card-head:focus{outline:none}
.round-card-head{display:flex;align-items:center;gap:8px;margin:0;font-size:1em}
.round-card .round-card-title{flex:1;font-weight:700;padding:4px 0}
.plan-rows{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:3px 10px;margin:4px 0 8px;font-size:.95em}
.plan-rows dt{font-weight:600;opacity:.8}
.plan-rows dd{margin:0;overflow-wrap:anywhere}
.round-yours{font-size:13px;font-weight:700;padding:1px 6px;border-radius:4px;background:#f5c518;color:#1a1a1a}
.round-card-details summary{opacity:.8}
.round-flag{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--warn,#e8a33d);color:#1a1205;font-weight:900}
.round-conflicts{list-style:none;padding:0;margin:6px 0}
.round-conflicts .hard{color:var(--warn,#e8a33d);font-weight:600}
.round-stamps{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:6px 0}
.round-stamps li{padding:2px 8px;border-radius:999px;border:1px solid var(--line,rgba(255,255,255,.2));font-size:.85em}
.round-note{border-left:3px solid var(--line,rgba(255,255,255,.3));padding-left:8px;margin:6px 0}
.round-card textarea{width:100%;min-height:4em}
.plan-editor{display:grid;gap:10px;margin:8px 0;padding:8px;border:1px solid var(--line,rgba(255,255,255,.2));border-radius:10px}
.plan-preview{border:1px dashed var(--line,rgba(255,255,255,.3));border-radius:10px;padding:8px 10px}
.edit-warning{color:var(--warn,#e8a33d)}
.edit-form{display:grid;gap:8px}
.edit-choice,.edit-list{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;border:1px solid var(--line,rgba(255,255,255,.15));border-radius:10px;padding:6px 10px}
.edit-choice legend,.edit-list legend{font-weight:600;padding:0 4px}
.edit-choice label{position:relative;display:inline-flex;align-items:center;gap:4px;box-sizing:border-box;min-height:44px;padding:4px 14px;border:1px solid var(--line,rgba(255,255,255,.25));border-radius:999px}
.edit-choice label:has(input:checked){border-width:2px;padding:3px 13px;border-color:#f5c518;background:rgba(245,197,24,.18);font-weight:700}
.edit-choice label input[type=radio]{position:absolute;opacity:0;width:1px;height:1px}
.edit-choice label:has(input:focus-visible){outline:2px solid #f5c518;outline-offset:2px}
.edit-line{border-bottom:1px solid var(--line,rgba(255,255,255,.15));min-width:0}
.edit-line>summary{padding-left:2px;padding-right:2px;font-weight:600;overflow-wrap:anywhere}
.edit-line[open]{border:1px solid var(--line,rgba(255,255,255,.35));border-radius:10px;padding:0 10px 10px}
.edit-line[open]>:not(summary){margin-top:8px}
.edit-line .edit-row label{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
/* Inside an open line a list has no box of its own: a line adds one box and its lists add none. */
.edit-line .edit-list{border:0;padding:0}
.edit-order{margin:0;padding-left:0;display:grid;gap:4px;width:100%}
/* An order's row (decision 0030): the name and its line on the left, the arrows always on the right. */
.edit-order li.edit-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
/* A row that reads in three short lines (decision 0030): what must hold, then what it does, then the row's tools at the right. */
.edit-row.edit-pair{display:grid;grid-template-columns:minmax(0,1fr);align-items:center;gap:6px;width:100%;padding:8px 0;border-top:1px solid var(--line,rgba(255,255,255,.12))}
.edit-pair>.edit-tools{justify-self:end}
.edit-if,.edit-then{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
.edit-if select,.edit-then select{flex:1 1 7em;min-width:0}
.edit-if .edit-condition,.edit-then .edit-condition{flex:1 1 auto;min-width:0}
.edit-pair input[type=number]{width:4.5em}
/* The editor's foot stays in view at the bottom of the screen while the editor is open (decision 0030). */
.plan-editor .editor-foot{position:sticky;bottom:0;z-index:1;margin:0 -8px -8px;padding:8px 8px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line,rgba(255,255,255,.2));border-radius:0 0 10px 10px;background:var(--theme-bg-page,#041510)}
.edit-list{min-width:0}
.edit-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0;max-width:100%}
.edit-row label{max-width:100%;min-width:0}
.edit-row select{max-width:100%}
.edit-detail{display:block;font-size:.85em}
.edit-condition{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px}
.edit-condition input{width:4.5em}
.edit-tools{display:inline-flex;gap:8px}
.edit-choice input[type=range]{flex:1 1 120px;min-width:100px}
.field-board{max-width:420px;margin:6px 0}
.edit-tools button{padding:8px}

/* The reveal on the match page (decisions 0019 and 0028): the three views, a row per ball with its outcome in a circle, the over card,
   the summary, the replay beside the chain, the scorecard. */
.feed-views{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 10px}
.feed-views button{padding:4px 14px;border-radius:999px}
.feed-views button[aria-pressed=true]{background:rgba(245,197,24,.18);border-color:#f5c518;font-weight:700}
.ball-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.ball-chain{min-width:0}
.scorecard-total{font-weight:700}
.ball-why{margin:4px 0}
.ball-card{border:1px solid var(--line,rgba(255,255,255,.15));border-radius:10px;padding:6px 10px}
.ball-row{display:grid;grid-template-columns:2.4em 1.9em minmax(0,1fr);gap:6px;align-items:start}
.ball-card summary.ball-row{list-style:none}
.ball-card summary.ball-row::-webkit-details-marker{display:none}
.ball-label{font-size:.85em;opacity:.75;padding-top:2px}
.ball-outcome{display:inline-grid;place-items:center;width:1.8em;height:1.8em;border-radius:50%;font-size:13px;font-weight:700;background:rgba(255,255,255,.08)}
.ball-outcome.wicket{background:#c0392b;color:#fff}
.ball-outcome.boundary{background:#f5c518;color:#1a1205}
.ball-outcome.extra{border:1px solid currentColor}
.ball-text{min-width:0;overflow-wrap:anywhere}
.ball-head{display:block}
.ball-detail{display:block;font-size:.9em;opacity:.8}
.over-card{border-radius:10px;padding:6px 10px;background:rgba(255,255,255,.05);font-size:.9em}
.over-card p{margin:2px 0}
.over-head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;font-weight:700}
.segment-end{margin-top:8px;font-size:.85em;font-weight:700;text-transform:uppercase;letter-spacing:.04em;opacity:.8}
.summary-score{margin:2px 0;font-size:1.1em;font-weight:700}
.summary-result{margin:4px 0 10px;font-weight:700}
.summary-card{border:1px solid var(--line,rgba(255,255,255,.15));border-radius:10px;padding:8px 10px;margin:8px 0}
.summary-card-head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;margin:0 0 4px;font-weight:700}
.summary-two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 12px;font-size:.9em}
.summary-two ul{list-style:none;margin:0;padding:0}
.summary-moments{margin:12px 0 6px;font-size:1em}
.summary-moments-side{margin:8px 0 4px;font-size:.9em}
.ball-body{margin-top:8px;display:grid;gap:8px}
.ball-body button{justify-self:start}
/* An open ball: the words and More info, with a small oval at the row's right from its top where there is room, and under the words
   on a phone; with more info, every drawing in turn. */
.ball-drawn{display:grid;gap:8px;min-width:0}
.ball-oval{max-width:220px}
.chain-lines{margin:0;padding-left:1.4em;display:grid;gap:2px}
.ball-replay{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:10px}
.feed-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:8px 0}
.feed-filters label{display:inline-flex;align-items:center;gap:4px;min-height:44px}
.scorecard{margin:8px 0}
.scorecard h3{margin:8px 0 0;font-size:1em}
.scorecard caption{text-align:left;font-weight:600;padding:4px 0}
@media (max-width:720px){
.ball-replay{grid-template-columns:1fr}
}
/* A wide screen: the sheet is phone first, so here the page widens and the match list and Plan's board take two columns. A card
   whose editor is open takes the whole row. Forms keep a width a line of fields reads well at. */
@media (min-width:600px){
.ball-card[open]:has(>.ball-body.beside){position:relative;box-sizing:border-box;min-height:196px;padding-right:206px}
.ball-body.beside .ball-oval{position:absolute;top:8px;right:10px;width:180px}
}
@media (min-width:960px){
.sg-page{max-width:1080px}
.sg-rows{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.sg-form,.sg-join{max-width:560px}
.round-board{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
.round-card:has(.plan-editor),.round-board>p{grid-column:1/-1}
}

/* a tile's inside is a little lighter than the page, so it stands off it; mixed from the text colour, it holds on a light theme too */
.sg-rows>li,.sg-form fieldset,.round-brief,.round-card,.ball-card,.summary-card{background:color-mix(in srgb,currentColor 8%,transparent)}
.over-card{background:color-mix(in srgb,currentColor 14%,transparent)}

/* each side has its colour, so a score, an innings and a segment say whose they are at a glance: Harbor blue, Valley orange */
[data-side=Home]{--side:#5bb8f5}
[data-side=Away]{--side:#ff9466}
.summary-card[data-side]{border-color:var(--side);border-left-width:5px;background:color-mix(in srgb,var(--side) 18%,transparent)}
.summary-card[data-side] .summary-card-head span:first-child,[data-side]>.summary-moments-side{color:var(--side)}
.summary-score[data-side],.scorecard[data-side]{border-left:5px solid var(--side);padding-left:10px}
.match-commentary[data-side] .segment-end{color:var(--side);opacity:1}
.match-commentary[data-side] .over-card{border-left:5px solid var(--side)}

/* the picker's tiles stand off the page: a gold edge, a lit corner and a shadow, the game's sign in a ring, and what the game is
   in a few lines; a game still to come stays quiet */
.sg-tile{gap:8px;padding:20px 16px;border:2px solid rgba(245,197,24,.6);text-align:center;background:linear-gradient(160deg,rgba(245,197,24,.2),color-mix(in srgb,currentColor 7%,transparent) 60%);box-shadow:0 8px 20px rgba(0,0,0,.35)}
a.sg-tile:hover,a.sg-tile:focus-visible{border-color:#f5c518}
a.sg-tile:active{transform:translateY(1px)}
.sg-tile-soon{border:1px solid var(--line,rgba(255,255,255,.2));background:color-mix(in srgb,currentColor 6%,transparent);box-shadow:none}
.sg-tile .sg-glyph{display:grid;place-items:center;width:76px;height:76px;border-radius:50%;border:2px solid #f5c518;background:rgba(0,0,0,.28)}
.sg-tile-soon .sg-glyph{border-color:var(--line,rgba(255,255,255,.3))}
.sg-tile .sg-name{font-size:1.3em;color:#f5c518}
.sg-tile-soon .sg-name{color:inherit}
.sg-about{max-width:34em;font-size:.95em;line-height:1.45}
