[hidden] { display:none !important; }
.app-form { display:grid; gap:1.25rem; }
.app-form > fieldset { min-width:0; border:0; padding:0; margin:0; }
.app-form label { display:grid; gap:.4rem; font-weight:700; }
.app-form input { width:100%; min-width:0; padding:.7rem; border:1px solid #b4b9b2; border-radius:.5rem; background:#fff; color:#152a2a; font:inherit; }
.app-form input:focus { outline:3px solid #99d8b3; }
.app-fixture { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; border:1px solid #c9c8be; border-radius:.7rem; margin:1.2rem 0; padding:1rem; }
.app-prediction { display:grid; grid-template-columns:1fr auto 1fr; align-items:end; gap:1rem; border:1px solid #c9c8be; border-radius:.7rem; padding:1rem; }
.app-actions { display:flex; gap:1.2rem; flex-wrap:wrap; margin-top:1rem; }
.app-form .button { justify-self:start; }
.member-main [data-status] { padding:1rem; background:#fff; border-radius:.5rem; position:sticky; bottom:1rem; }
.member-main [data-status]:empty { display:none; }
.is-error { color:#992c20; }
.workspace-card { padding:1.5rem; border:1px solid #d3cbbf; border-radius:1rem; background:var(--paper-2); }
button:disabled { opacity:.55; cursor:wait; }
@media(max-width:550px) { .app-fixture { grid-template-columns:1fr; } }

.leaderboard { width:100%; border-collapse:collapse; margin:1rem 0; }
.leaderboard th,.leaderboard td { padding:.8rem; text-align:left; border-bottom:1px solid #d3cbbf; }
.leaderboard caption { text-align:left; font-weight:bold; padding:.8rem; }
.app-form select { padding:.7rem; font:inherit; }
.app-form .result-confirm { display:flex; align-items:center; gap:.5rem; }
.app-form .result-confirm input { width:auto; }

/* Compact scoreline shared by player predictions and administrator results. */
.app-form > .app-prediction, .match-result { display:block; min-width:0; padding:1rem; margin:0; border:1px solid var(--line); border-radius:.75rem; background:rgba(255,255,255,.45); }
.app-prediction legend, .match-result-meta { padding:0; margin-bottom:.7rem; color:var(--muted); font-size:.8rem; line-height:1.5; }
.match-score-row { display:grid; grid-template-columns:minmax(0,1fr) 3rem 1rem 3rem minmax(0,1fr); align-items:center; gap:.65rem; width:100%; max-width:48rem; margin-inline:auto; }
.app-form .team-name { display:block; min-width:0; font-size:1rem; line-height:1.35; overflow-wrap:anywhere; }
.team-home { text-align:right; }
.team-away { text-align:left; }
.app-form .score-box { width:3rem; height:3rem; padding:.2rem; text-align:center; font-size:1.2rem; font-weight:800; font-variant-numeric:tabular-nums; border-radius:.4rem; appearance:textfield; -moz-appearance:textfield; }
.score-box::-webkit-inner-spin-button, .score-box::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.app-form .score-box:disabled { opacity:1; color:var(--ink); background:#eee9df; -webkit-text-fill-color:var(--ink); }
.score-versus { text-align:center; color:var(--muted); font-size:.85rem; }
.match-result-controls { display:flex; flex-wrap:wrap; gap:.8rem 1.2rem; align-items:center; justify-content:space-between; margin-top:1rem; padding-top:.8rem; border-top:1px solid var(--line); }
.app-form .result-state { display:flex; align-items:center; gap:.5rem; font-size:.8rem; }
.app-form .result-state select { min-height:44px; max-width:10rem; border:1px solid var(--line); border-radius:.4rem; background:white; }
.app-form .result-confirm { font-size:.85rem; min-height:44px; cursor:pointer; }
.app-form .result-confirm input { width:1.1rem; height:1.1rem; flex-shrink:0; }
.match-result-controls .button { min-height:44px; padding:.65rem 1rem; }
@media(max-width:550px) {
 .member-shell .workspace-card { padding:1rem; }
 .app-form > .app-prediction, .match-result { padding:.75rem; }
 .match-score-row { grid-template-columns:minmax(0,1fr) 2.75rem .65rem 2.75rem minmax(0,1fr); gap:.35rem; }
 .app-form .score-box { width:2.75rem; height:2.75rem; font-size:1.1rem; }
 .app-form .team-name { font-size:.85rem; }
 .match-result-controls { gap:.5rem; }
 .match-result-controls .result-state { width:100%; }
 .match-result-controls .result-state select { flex:1; max-width:none; }
}
/* Constrain grid children to the viewport instead of their table/legend width. */
.member-shell { grid-template-columns:minmax(0,1fr); }
.member-shell > *, [data-app], [data-app] > *, .app-form > *, .match-score-row > * { min-width:0; max-width:100%; }
[data-app] { display:grid; grid-template-columns:minmax(0,1fr); gap:1.5rem; }
.app-form { grid-template-columns:minmax(0,1fr); }
.app-prediction legend { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.member-shell h1 { font-size:clamp(2rem,7vw,4rem); overflow-wrap:anywhere; }
.member-shell p { overflow-wrap:anywhere; }
.member-page .nav > * { min-width:0; }
.member-page .nav > .app-actions { margin-top:0; }
@media(max-width:759px) {
 .member-page .nav { display:grid; grid-template-columns:minmax(0,1fr); gap:.5rem; padding-block:.65rem; }
 .member-page .site-brand { width:100%; }
 .member-page .site-wordmark { min-width:0; }
 .member-page .nav > .app-actions { display:flex; align-items:center; justify-content:space-between; gap:.5rem .75rem; width:100%; }
 .member-page .nav > .app-actions > * { min-width:0; font-size:.8rem; }
 .member-page [data-account-name] { overflow-wrap:anywhere; }
 .member-page [data-public-home], .member-page [data-sign-out] { min-height:44px; display:inline-flex; align-items:center; }
 .member-main { padding-top:1.25rem; }
}
.match-result [hidden] { display:none !important; }

.app-fixture [hidden] { display:none !important; }
.app-fixture select { min-width:0; width:100%; }
.app-fixture .fixture-manual { display:flex; align-items:center; gap:.5rem; }
.fixture-manual input { width:auto; }
[data-fixture-list] { min-width:0; }
/* Last Man Standing uses cards to keep picks and results readable on phones. */
.lms-rules summary { cursor:pointer; font-weight:700; }
.lms-rules li { margin:.6rem 0; }
.lms-fixtures, .lms-players { display:grid; gap:.75rem; margin-top:1rem; }
.lms-match { display:grid; gap:.3rem; padding:1rem; border:1px solid var(--line); border-radius:.7rem; }
.lms-match span, .lms-muted { color:var(--muted); font-size:.85rem; }
.lms-player { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:.6rem; padding:.85rem 0; border-bottom:1px solid var(--line); align-items:center; overflow-wrap:anywhere; }
.lms-state { font-size:.8rem; font-weight:700; color:var(--green); }
.lms-highlight { padding:1rem; border-left:4px solid var(--green); background:var(--paper-2); }
[data-view=lms] select { width:100%; min-width:0; }
[data-view=lms] [hidden] { display:none !important; }
[data-view=lms] [data-results] { display:grid; gap:1rem; }
@media(max-width:550px) { .lms-player { grid-template-columns:minmax(0,1fr) auto; } .lms-player > span:nth-child(2) { grid-column:1; font-size:.85rem; } .lms-player .lms-state { grid-column:2; grid-row:1 / 3; } }

/* Time-limited organiser access. */
.access-date-grid { display:grid; gap:1rem; }
.access-grant-list { display:grid; gap:1rem; }
.access-grant-card { display:grid; gap:1rem; align-items:center; }
.access-grant-card h3 { margin:.5rem 0 .15rem; }
.access-grant-card p { margin:.25rem 0; color:var(--muted); }
.access-active { color:#e5fff0; background:var(--green-dark); }
.access-scheduled { color:#714b00; background:#ffe9b3; }
.access-expired,.access-revoked { color:#5d6163; background:#e1ded8; }
@media(min-width:760px) {
 .access-date-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .access-grant-card { grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; }
}.access-user { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--line); }
.access-user > div { min-width:0; overflow-wrap:anywhere; }
.access-user p,.access-audit p { margin:.3rem 0; color:var(--muted); }
.access-user button { flex-shrink:0; }
.access-exhausted { color:#714b00; background:#ffe9b3; }
.access-audit { border-bottom:1px solid var(--line); padding-bottom:.75rem; overflow-wrap:anywhere; }
[data-view=organiser-access] .access-grant-card { overflow-wrap:anywhere; }
[data-view=organiser-access] form select,[data-view=organiser-access] form input { min-width:0; max-width:100%; }
@media(max-width:550px) { .access-user { align-items:flex-start; flex-direction:column; } }
.access-game-options { border:1px solid var(--line); border-radius:.6rem; padding:1rem; display:grid; gap:.75rem; min-width:0; }
.access-game-options legend { font-weight:700; padding:0 .4rem; }
[data-view=organiser-access] .access-game-options label { display:flex; align-items:center; gap:.75rem; min-height:44px; cursor:pointer; }
[data-view=organiser-access] .access-game-options input { width:1.2rem; height:1.2rem; flex-shrink:0; margin:0; }

.app-form .gamble-choice { display:flex; align-items:center; gap:.65rem; margin-top:.85rem; min-height:44px; cursor:pointer; }
.app-form .gamble-choice input { width:1.2rem; height:1.2rem; margin:0; flex-shrink:0; accent-color:var(--green-dark); }

/* Keep competition tables within small screens. */
.leaderboard { min-width:0; max-width:100%; table-layout:fixed; }
.leaderboard th,.leaderboard td,.leaderboard caption { overflow-wrap:anywhere; }
.entry-leaderboard { font-size:clamp(1.1rem,2.5vw,1.35rem); }
.entry-leaderboard th:first-child { width:75%; }
.entry-leaderboard th:last-child,.entry-leaderboard td:last-child { width:25%; text-align:right; font-variant-numeric:tabular-nums; }
.entry-leaderboard th,.entry-leaderboard td { padding:.75rem .5rem; }
.participant-row { display:flex; flex-wrap:wrap; gap:.75rem; align-items:center; justify-content:space-between; padding:1rem 0; border-bottom:1px solid var(--line); }
.participant-row > div { min-width:0; overflow-wrap:anywhere; }
.participant-row p { margin:.3rem 0 0; color:var(--muted); }
.participant-row button { min-height:44px; max-width:100%; white-space:normal; }

.player-predictions-link { border:0; background:none; padding:0; color:var(--green-dark); font:inherit; font-weight:700; text-decoration:underline; text-align:left; white-space:normal; overflow-wrap:anywhere; cursor:pointer; min-height:44px; }
.individual-prediction { border-top:1px solid var(--line); padding:1rem 0; overflow-wrap:anywhere; }
.individual-prediction p { margin:.4rem 0; }

.fixture-predictions { border-top:1px solid var(--line); padding:.7rem 0; min-width:0; }
.fixture-predictions summary { min-height:44px; padding:.6rem 0; font-weight:700; cursor:pointer; overflow-wrap:anywhere; }
.fixture-predictions th:first-child { width:55%; }

.entry-leaderboard tbody th,.entry-leaderboard tbody td { font-size:inherit; text-transform:none; letter-spacing:normal; line-height:1.4; }
.entry-leaderboard thead th { font-size:.95rem; text-transform:none; letter-spacing:normal; padding:.65rem .25rem; }
