/* Layout: one narrow column like a club notice board; coloured band on top,
   condensed scoreboard numerals, two bib colours for the teams.
   Must work on the scoreboard iPad with iOS 12.5.7 (Safari 12.1): no logical shorthands like
   padding-block or inset, gap in flexbox only with the fallback at the end of this file. */
:root {
  /* Colours come from /group/theme.css (palette of the group, light and dark). */
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.wrap { max-width: 900px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* hero */
.hero { background: var(--primary); color: var(--primary-ink); background-image: repeating-linear-gradient(90deg, transparent 0 60px, rgba(0, 0, 0, .06) 60px 120px); padding-top: env(safe-area-inset-top, 0px); }
.hero-inner { padding-top: 26px; padding-bottom: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
h1 { font-family: var(--display); font-weight: 700; font-size: 3rem; line-height: .95; margin: 0; text-transform: uppercase; letter-spacing: .01em; }
.hero-sub { margin: 6px 0 0; opacity: .85; font-size: .95rem; }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.stats { display: flex; gap: 22px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat b { font-family: var(--display); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.session { display: flex; gap: 10px; align-items: center; font-size: .85rem; }
.role-pill { border: 1px solid var(--chalk); border-radius: 999px; padding: 2px 10px; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.link-btn { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

.main { padding-top: 22px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; }
#app-view { display: flex; flex-direction: column; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
h2 { font-size: 1.6rem; } h3 { font-size: 1.3rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* login */
.login { display: flex; justify-content: center; }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.login-card p { margin: 0; }
.login-card label { font-size: .85rem; color: var(--muted); }
input[type=password], input[type=text], input[type=date], input[type=number], input:not([type]) { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 10px; min-width: 0; }

/* buttons and messages */
.btn { background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--loss); border: 1px solid var(--loss); }
.msg { font-size: .9rem; margin: 0; min-height: 0; }
.msg:empty { display: none; }
.msg.err { color: var(--loss); } .msg.ok { color: var(--win); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.tabs button { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; background: none; border: 0; color: var(--muted); padding: 6px 12px 8px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--highlight); }

/* table */
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: right; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th.l, td.l { text-align: left; }
td.rank { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--muted); width: 2.5em; }
tr.top td.rank { color: var(--win); }
td.name { font-weight: 600; }
td.elo { font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.delta { font-size: .85rem; }
.up { color: var(--win); } .down { color: var(--loss); } .flat { color: var(--muted); }
.form { display: inline-flex; gap: 3px; }
.form i { display: inline-block; width: 18px; height: 18px; border-radius: 3px; font-style: normal; font-size: .68rem; font-weight: 600; line-height: 18px; text-align: center; color: var(--surface); }
.form i.S { background: var(--win); } .form i.U { background: var(--draw); } .form i.N { background: var(--loss); }
.spark { display: block; }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-left: 6px; font-weight: 500; }
@media (max-width: 620px) { .hide-sm { display: none; } }

/* games */
.games { display: flex; flex-direction: column; gap: 10px; }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 14px; align-items: start; }
.game-head { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.game-score { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; align-self: center; font-variant-numeric: tabular-nums; }
.game-team { font-size: .88rem; min-width: 0; }
.game-team.b { text-align: right; }
.game-player { display: block; }
.game-team strong { display: block; font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .03em; }
.game-team.a strong { color: var(--team-a-text); } .game-team.b strong { color: var(--team-b-text); }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 24px 20px; text-align: center; color: var(--muted); }

/* enter match */
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .9rem; }
.meta-row select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 6px 8px; }
.roster { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.row .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .label small { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.row.in-a { background: var(--team-a-soft); } .row.in-b { background: var(--team-b-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 11px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on.A { background: var(--team-a); color: #fff; }
.seg button.on.B { background: var(--team-b); color: #fff; }
@media (max-width: 520px) { h1 { font-size: 2.3rem; } .hero-right { align-items: flex-start; } .stat { align-items: flex-start; } .game { padding: 10px 12px; gap: 6px 8px; } }

/* admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.admin-grid p { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form input { flex: 1 1 140px; }
.list { border: 1px solid var(--line); border-radius: 8px; }
.list .row:last-child { border-bottom: 0; }
.row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row.paused .label { color: var(--muted); }

.explain { font-size: .92rem; }
.explain p { margin: 6px 0; max-width: 68ch; }
.host-field { display: flex; align-items: center; }
.host-field input { flex: 1 1 auto; min-width: 0; }
.host-ending { flex: 0 0 auto; padding-left: 6px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.setup-steps { margin: 4px 0; padding-left: 20px; }
.setup-steps .err { color: var(--loss); }
.explain code { background: var(--sunken); padding: 1px 5px; border-radius: 4px; font-size: .88em; word-break: break-word; overflow-wrap: anywhere; }
.explain ul { margin: 6px 0; padding-left: 20px; max-width: 68ch; }
.explain .points-table { width: auto; border-collapse: collapse; margin: 8px 0; font-size: .85rem; font-variant-numeric: tabular-nums; }
.explain .points-table th, .explain .points-table td { padding: 4px 4px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.points-figure { margin: 10px 0; }
@media (max-width: 400px) { .explain .points-table th, .explain .points-table td { padding: 4px 2px; } .explain .points-table { font-size: .8rem; } }
.points-chart { display: block; width: 100%; max-width: 480px; height: auto; }
.points-chart .grid { stroke: var(--line); stroke-width: 1; }
.points-chart .zero, .points-chart .mark { stroke: var(--muted); stroke-width: 1; }
.points-chart .mark { stroke-dasharray: 3 3; }
.points-chart .tick { fill: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.points-chart .axis { fill: var(--muted); font-size: 10px; }
.points-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.points-chart .line.win { stroke: var(--win); } .points-chart .line.loss { stroke: var(--loss); }
.points-chart .label { font-size: 9px; font-weight: 700; } .points-chart .label.win { fill: var(--win); } .points-chart .label.loss { fill: var(--loss); }
.points-figure figcaption { font-size: .85rem; margin-top: 6px; }
.explain .goal-steps { margin: 4px 0 2px; padding-left: 18px; list-style: disc; }
.explain .points-table th:first-child { white-space: normal; hyphens: manual; -webkit-hyphens: manual; text-align: left; font-weight: 600; color: var(--muted); }

/* small-screen adjustments */
.list .row { flex-wrap: wrap; }
.list .row .label { white-space: normal; }
@media (max-width: 520px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tabs button { font-size: 1rem; padding: 6px 8px 8px; }
}

/* share image */
.table-tools { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }

/* rhythm of new matchdays */
.rhythm { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rhythm legend { padding: 0 4px; }
.rhythm select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 6px 8px; flex: 1 1 140px; }
.day-chips { display: flex; gap: 6px; }
.day-chips label { cursor: pointer; flex: 1 1 0; min-width: 0; }
.day-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chips span { display: block; text-align: center; padding: 5px 0; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.day-chips input:checked + span { background: var(--highlight); border-color: var(--highlight); color: var(--surface); }
.day-chips input:focus-visible + span { outline: 2px solid var(--highlight); outline-offset: 2px; }

/* settings */
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 4px; }

/* admin site: group settings */
.group-form .fields { display: flex; flex-direction: column; gap: 10px; }
.group-form label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.group-form label small { font-size: .78rem; }
.group-form input:not([type=checkbox]), .group-form select { color: var(--ink); font-size: .95rem; }
.group-form select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 7px 8px; }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field-row label { flex: 1 1 150px; }
.icon-preview { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.group-form a { color: inherit; }

/* team proposal and bib changes */
.proposal { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--highlight); border-radius: 10px; padding: 10px 14px; font-size: .9rem; }
.proposal p { margin: 2px 0; }
.bib-games { margin-top: 14px; }
.bib-game { grid-template-columns: 1fr 1fr; }

/* player profile */
.name-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-align: left; }
.profile { width: min(560px, calc(100% - 24px)); max-height: calc(100% - 32px); overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.profile:not([open]) { display: none; }
.profile[open] { display: block; position: fixed; top: 16px; right: 0; bottom: auto; left: 0; margin: 0 auto; z-index: 10; }
.profile::backdrop { background: rgba(0, 0, 0, .45); }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px 8px; border-bottom: 1px solid var(--line); position: -webkit-sticky; position: sticky; top: 0; background: var(--surface); }
.close-btn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 1.1rem; width: 40px; height: 40px; cursor: pointer; flex: none; }
.profile-body { padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.profile-body h3 { font-size: 1.1rem; margin-top: 6px; }
.profile-body p { margin: 0; }
.profile-facts, .profile-pair { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.profile-facts > div, .profile-pair > div { background: var(--sunken); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.profile-facts small, .profile-pair small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.profile-facts .big { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.profile-chart { width: 100%; height: auto; display: block; background: var(--sunken); border-radius: 8px; }
.profile .list .row { flex-wrap: nowrap; }
.profile .form i { vertical-align: 1px; }

/* movement in the table */
.mv { font-style: normal; font-size: .75rem; font-weight: 600; margin-left: 5px; }
.day-best { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; font-weight: 600; }
.badge { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .72rem; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }

/* next matchday poll */
.poll { display: flex; flex-direction: column; gap: 8px; }
.poll p { margin: 0; }
.poll-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.poll-head strong { font-size: 1.05rem; }
.poll-me { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; }
.poll-me select { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 7px 8px; min-width: 0; }
.poll-answer button { padding: 7px 9px; }
.poll-me .poll-answer { flex: 1 1 100%; max-width: 420px; }
.poll-me .poll-answer button { flex: 1 1 auto; padding: 9px 8px; font-size: .95rem; white-space: nowrap; }
.poll-me input { font: inherit; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 7px 8px; min-width: 0; flex: 1 1 140px; }
.poll-full { flex-basis: 100%; }
.seg button.on.yes { background: var(--win); color: var(--surface); }
.seg button.on.no { background: var(--loss); color: var(--surface); }
.seg button.on.maybe { background: var(--muted); color: var(--surface); }
.seg button.on.wait { background: var(--accent); color: var(--accent-ink); }
.wait-label { font-weight: 600; }
.maybe-label { font-weight: 600; color: var(--muted); }
.poll-free { color: var(--win); font-weight: 600; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.poll-count { font-size: .95rem; }
.poll-drinks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .95rem; }
.poll details summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 2px 0; }
.poll details .list { margin-top: 6px; }
.poll details .row { flex-wrap: nowrap; }
@media (max-width: 420px) {
  .poll details .poll-answer button { padding: 6px 6px; font-size: .8rem; }
  .poll-me .poll-answer button { padding: 9px 5px; font-size: .88rem; }
}
input[type=time] { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 10px; min-width: 0; }

/* scoreboard ("Spiel eintragen"), after docs/mockups/scoreboard.html.
   Layout by screen width, not by device: tablets like the scoreboard iPad (768 and 1024 px)
   get the teams side by side, phones (< 600 px) stacked. No animations, no shadows. */
.sb-board { display: grid; grid-template-columns: 1fr 120px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sb-team { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sb-team.a { background: var(--team-a-soft); }
.sb-team.b { background: var(--team-b-soft); text-align: right; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sb-team.b .sb-head { flex-direction: row-reverse; }
.sb-name { font-family: var(--display); font-weight: 700; font-size: 34px; text-transform: uppercase; white-space: nowrap; }
.a .sb-name { color: var(--team-a-text); } .b .sb-name { color: var(--team-b-text); }
.sb-avg { color: var(--muted); font-size: 16px; }
.sb-score { display: flex; flex-direction: column; gap: 10px; }
.sb-goals { width: 100%; min-width: 0; font-family: var(--display); font-weight: 700; font-size: 168px; line-height: .95; text-align: center; font-variant-numeric: tabular-nums; border: 0; border-radius: 10px; background: transparent; color: var(--ink); padding: 0; -moz-appearance: textfield; appearance: textfield; }
.sb-goals::-webkit-outer-spin-button, .sb-goals::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sb-goals::placeholder { color: var(--ink); opacity: 1; }
.sb-goals:focus { background: var(--surface); }
.sb-btns { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.sb-team.b .sb-btns { grid-template-columns: 88px 1fr; }
.sb-plus, .sb-minus { border: 0; border-radius: 12px; font-family: var(--display); font-weight: 700; cursor: pointer; touch-action: manipulation; }
.sb-plus { height: 104px; font-size: 52px; color: #fff; }
.a .sb-plus { background: var(--team-a); } .b .sb-plus { background: var(--team-b); }
.sb-minus { height: 104px; font-size: 30px; background: var(--surface); color: var(--muted); border: 2px solid var(--line); }
.sb-players { font-size: 16px; }
.sb-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px 4px; }
.sb-colon { font-family: var(--display); font-weight: 700; font-size: 110px; line-height: .8; color: var(--muted); }
.sb-mid small { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.sb-mid b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-info { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.sb-info p { margin: 0; }
.sb-line { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; }
.sb-line .note { color: var(--muted); font-size: 14px; }
.sb-line .up, .sb-line .down { font-weight: 700; }
.sb-actions { display: flex; gap: 12px; align-items: stretch; }
.sb-save { flex: 1.4; min-height: 64px; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-size: 22px; font-weight: 700; cursor: pointer; }
.sb-save:disabled { opacity: .45; cursor: not-allowed; }
.sb-ghost { flex: 1; min-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 17px; font-weight: 600; cursor: pointer; }
.sb-ghost:disabled { opacity: .45; cursor: not-allowed; }
@media (min-width: 600px) and (orientation: portrait) {
  .sb-goals { font-size: 200px; }
  .sb-plus, .sb-minus { height: 140px; }
  .sb-team { gap: 18px; padding-top: 24px; padding-bottom: 28px; }
  .sb-board { grid-template-columns: 1fr 104px 1fr; }
  .sb-mid small { font-size: 11px; letter-spacing: .04em; }
  .sb-colon { font-size: 90px; }
  .sb-actions { flex-wrap: wrap; }
  .sb-save { flex-basis: 100%; }
}
@media (max-width: 599px) {
  .sb-board { grid-template-columns: 1fr; }
  .sb-team { padding: 12px 14px 14px; gap: 8px; }
  .sb-team.b { text-align: left; }
  .sb-team.b .sb-head { flex-direction: row; }
  .sb-name { font-size: 26px; }
  .sb-avg { font-size: 13px; }
  .sb-score { display: grid; grid-template-columns: 92px 1fr 64px; gap: 10px; align-items: center; }
  .sb-goals { font-size: 88px; text-align: left; }
  .sb-btns { display: contents; }
  .sb-team.b .sb-btns .sb-minus { order: 2; }
  .sb-plus, .sb-minus { height: 88px; }
  .sb-plus { font-size: 40px; } .sb-minus { font-size: 24px; }
  .sb-players { font-size: 13px; color: var(--muted); }
  .sb-mid { flex-direction: row; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; gap: 8px; }
  .sb-colon { display: none; }
  .sb-mid b { font-size: 15px; }
  .sb-info { padding: 10px 14px; }
  .sb-line { flex-direction: column; gap: 2px; font-size: 14px; }
  .sb-line .note { font-size: 12px; }
  .sb-actions { flex-wrap: wrap; gap: 8px; }
  .sb-save { flex-basis: 100%; min-height: 56px; font-size: 19px; }
  .sb-ghost { min-height: 52px; font-size: 15px; }
}
.scoreboard .hero-inner { padding-top: 10px; padding-bottom: 10px; align-items: center; }
.scoreboard h1 { font-size: 30px; }
.scoreboard .hero-sub, .scoreboard .stats, .scoreboard #explain, .scoreboard #next-matchday { display: none; }
.scoreboard .main { padding-top: 12px; gap: 12px; }
/* iPad in landscape (768 px high): smaller numbers so "Spiel speichern" stays on screen */
@media (min-width: 600px) and (orientation: landscape) and (max-height: 820px) {
  .sb-goals { font-size: 128px; }
  .sb-plus, .sb-minus { height: 92px; }
  .sb-team { padding-top: 12px; padding-bottom: 14px; gap: 8px; }
  .sb-colon { font-size: 80px; }
}

/* Fallback for browsers without gap in flexbox (Safari before 14.1, e.g. the scoreboard iPad
   with iOS 12.5.7). They also lack the inset property, so @supports can tell them apart; grid gap
   works there and stays as it is. Columns get a top margin on every item after the first, rows a
   left margin, wrapping rows a right and bottom margin with the last line pulled back up. */
@supports not (inset: 0) {
  /* "html" in front of every selector, so these win over rules like ".login-card p { margin: 0 }". */
  /* columns */
  html .hero-right > * + *, html .login-card > * + *, html .profile-body > * + *, html .group-form .fields > * + * { margin-top: 10px; }
  html .profile-body > * + h3 { margin-top: 16px; } /* gap plus the 6px of h3 */
  html .main > * + * { margin-top: 22px; }
  html .main > #app-view { margin-top: 0; }
  html #app-view > * + * { margin-top: 18px; }
  html #app-view > .tabs { margin-top: 0; }
  html #app-view > #next-matchday { margin-bottom: 18px; }
  html .stack > * + * { margin-top: 12px; }
  html .stack > * + hr { margin-top: 16px; } /* gap plus the 4px of hr */
  html .games > * + * { margin-top: 10px; }
  html .rhythm > * + *, html .poll > * + *, html .sb-info > * + *, html .sb-mid > * + * { margin-top: 8px; }
  html .group-form label:not(.check) > * + * { margin-top: 4px; }
  html .profile-facts > div > * + *, html .profile-pair > div > * + * { margin-top: 2px; }
  html .sb-team > * + *, html .sb-score > * + * { margin-top: 10px; }
  html .scoreboard .main > * + * { margin-top: 12px; }
  html .scoreboard .main > #app-view, html .scoreboard .hero-right > * { margin-top: 0; }

  /* rows */
  html .stats > * + * { margin-left: 22px; }
  html .session > * + *, html .profile-head > * + * { margin-left: 10px; }
  html .tabs > * { margin-right: 4px; }
  html .form > * + * { margin-left: 3px; }
  html .row > * + *, html .game-head > * + *, html .sb-head > * + * { margin-left: 8px; }
  html .sb-team.b .sb-head > * + * { margin-left: 0; margin-right: 8px; } /* row-reverse */
  html .check > input { margin-right: 8px; }
  html .table-tools > * + *, html .meta-row > * + * { margin-left: 10px; }
  html .actions > * + * { margin-left: 8px; } /* as a plain row: often it holds only an empty message */
  html .meta-row > strong { margin-left: 10px; } /* after the plain word for the scorer, which is no element */
  html .day-chips > * + * { margin-left: 6px; }
  html .sb-line > * + * { margin-left: 12px; }

  /* wrapping rows */
  html .hero-inner > * { margin-right: 24px; margin-bottom: 12px; }
  html .hero-inner { padding-bottom: 8px; }
  html .scoreboard .hero-inner > * { margin-bottom: 10px; }
  html .scoreboard .hero-inner { padding-bottom: 0; }
  html .inline-form > *, html .poll-me > * { margin-right: 8px; margin-bottom: 8px; }
  html .inline-form, html .poll-me { margin-bottom: -8px; }
  html .field-row > * { margin-right: 10px; margin-bottom: 10px; }
  html .field-row { margin-bottom: -10px; }
  html .row .row-actions > * { margin-right: 6px; margin-bottom: 6px; }
  html .row .row-actions { margin-bottom: -6px; }
  html .day-best > *, html .poll-head > *, html .poll-drinks > * { margin-right: 10px; margin-bottom: 6px; }
  html .poll-head, html .poll-drinks { margin-bottom: -6px; }
  html .day-best { margin-bottom: 4px; } /* 10px below it, minus the 6px of its items */
  html .sb-actions > * { margin-right: 12px; margin-bottom: 12px; }
  html .sb-actions { margin-bottom: -12px; }
  html .hero-inner > :last-child, html .inline-form > :last-child, html .poll-me > :last-child,
  html .field-row > :last-child, html .row .row-actions > :last-child, html .day-best > :last-child,
  html .poll-head > :last-child, html .poll-drinks > :last-child, html .sb-actions > :last-child { margin-right: 0; }

  @media (min-width: 600px) and (orientation: portrait) {
    html .sb-team > * + * { margin-top: 18px; }
    html .sb-actions > .sb-save { margin-right: 0; }
  }
  @media (min-width: 600px) and (orientation: landscape) and (max-height: 820px) {
    html .sb-team > * + * { margin-top: 8px; }
  }
  @media (max-width: 520px) {
    html .tabs > * { margin-top: 4px; } /* tabs wrap here */
    html #app-view > .tabs { margin-top: -4px; }
  }
  @media (max-width: 599px) {
    html .sb-team > * + * { margin-top: 8px; }
    html .sb-score > * + * { margin-top: 0; }
    html .sb-mid > * + * { margin-top: 0; margin-left: 8px; }
    html .sb-mid > small { margin-left: 0; }
    html .sb-line > * + * { margin-left: 0; margin-top: 2px; }
    html .sb-actions > * { margin-right: 8px; margin-bottom: 8px; }
    html .sb-actions { margin-bottom: -8px; }
    html .sb-actions > .sb-save, html .sb-actions > :last-child { margin-right: 0; }
  }
}
