/* Live scoresheet (score2.php): the apps' dark scoring surface inside the site's light page.
   Palette matches the iOS / Android AppTheme so the screen reads the same on all three. */
.scoresheet {
  --ss-bg: #0d1117; --ss-bg2: #161b22; --ss-card: #21262d; --ss-head: #1c2128; --ss-line: #30363d;
  --ss-text: #fff; --ss-muted: #8b949e; --ss-dim: #6e7681; --ss-gold: #ffd700; --ss-red: #f85149;
  --ss-green: #3fb950; --ss-blue: #58a6ff; --ss-warn: #d29922;
  background: var(--ss-bg); color: var(--ss-text); border-radius: var(--radius); overflow: hidden;
  border: 1px solid #0b0f14; box-shadow: var(--shadow); margin-bottom: 18px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.scoresheet *, .ss-modal * { box-sizing: border-box; }
.scoresheet button { font: inherit; cursor: pointer; }
.scoresheet button:focus-visible, .ss-modal button:focus-visible, .ss-modal input:focus-visible, .ss-modal select:focus-visible {
  outline: 3px solid var(--ss-gold); outline-offset: 2px;
}

/* Header bar: location, period selector, clock and game controls */
.ss-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 12px 16px; background: var(--ss-head); border-bottom: 1px solid var(--ss-line);
}
.ss-bar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.ss-chip {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px; min-height: 44px;
  background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 10px; color: var(--ss-text); text-align: left;
}
.ss-chip .pin { width: 16px; height: 16px; color: var(--ss-gold); flex: 0 0 16px; }
.ss-chip-main { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-chip-sub { display: block; font-size: 12px; color: var(--ss-muted); line-height: 1.2; }

.ss-periods { display: inline-flex; align-items: stretch; border: 2px solid var(--ss-gold); border-radius: 10px; overflow: hidden; }
.ss-periods button { min-width: 44px; height: 36px; padding: 0 8px; background: transparent; border: 0; color: var(--ss-gold); font-size: 16px; font-weight: 800; }
.ss-periods button.ot { font-size: 12px; min-width: 40px; }
.ss-periods button.is-current { background: var(--ss-gold); color: var(--ss-bg); }
.ss-periods button.pm { min-width: 36px; font-size: 18px; }

.ss-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px;
  border: 0; border-radius: 10px; background: var(--ss-gold); color: var(--ss-bg); font-size: 13px; font-weight: 700; text-decoration: none;
}
.ss-pill:hover { background: #ffe14d; text-decoration: none; color: var(--ss-bg); }
.ss-pill.danger { background: var(--ss-red); color: #fff; }
.ss-pill.danger:hover { background: #ff6b66; }
.ss-pill.quiet { background: var(--ss-card); color: var(--ss-text); border: 1px solid var(--ss-line); }
.ss-pill.quiet:hover { background: #2b323a; color: var(--ss-text); }
.ss-outline { min-height: 32px; padding: 4px 12px; background: transparent; border: 2px solid var(--ss-gold); border-radius: 10px; color: var(--ss-gold); font-size: 12px; font-weight: 700; }
.ss-link { background: none; border: 0; padding: 0; color: var(--ss-muted); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ss-link:hover { color: var(--ss-text); }

.ss-clock {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 16px;
  background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 10px; color: var(--ss-text);
  font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ss-clock .tri { width: 0; height: 0; border-style: solid; }
.ss-clock.running .tri { width: 10px; height: 12px; border: 0; border-left: 3px solid var(--ss-gold); border-right: 3px solid var(--ss-gold); }
.ss-clock:not(.running) .tri { border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--ss-green); }

.ss-status { font-size: 12px; font-weight: 600; color: var(--ss-muted); white-space: nowrap; }
.ss-status.saved { color: var(--ss-green); }
.ss-status.pending { color: var(--ss-warn); }
.ss-status.error { color: var(--ss-red); }
.ss-final { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 8px; background: var(--ss-card); color: var(--ss-gold); font-size: 12px; font-weight: 800; letter-spacing: .08em; }

/* Team score panels */
.ss-teams { display: grid; grid-template-columns: 1fr 1fr; }
.ss-team { background: var(--ss-bg2); min-width: 0; }
.ss-team + .ss-team { border-left: 2px solid var(--ss-line); }
.ss-team-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--ss-card); }
.ss-score { font-size: 56px; font-weight: 900; line-height: 1; min-width: 72px; font-variant-numeric: tabular-nums; }
.ss-side { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--ss-muted); }
.ss-name { margin: 0; font-size: 18px; font-weight: 800; color: var(--ss-text); font-family: inherit; line-height: 1.2; overflow-wrap: anywhere; }
.ss-team-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; }
.ss-team.away .ss-team-actions { flex-direction: row-reverse; }

.ss-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ss-table th { padding: 8px 10px; background: var(--ss-head); color: var(--ss-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: center; }
.ss-table td { padding: 9px 10px; text-align: center; border-top: 1px solid var(--ss-line); font-weight: 600; font-variant-numeric: tabular-nums; }
.ss-table td.gold { color: var(--ss-gold); font-weight: 800; }
.ss-table td.red { color: var(--ss-red); font-weight: 800; }
.ss-table td.act { white-space: nowrap; text-align: right; }
.ss-table tr.other-period td { color: var(--ss-dim); }
.ss-table tr.other-period td.gold, .ss-table tr.other-period td.red { opacity: .7; }
.ss-empty { padding: 14px 16px; color: var(--ss-dim); font-size: 13px; }
.ss-icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; margin-left: 4px;
  background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 8px; color: var(--ss-muted); font-size: 15px; font-weight: 700;
}
.ss-icon-btn:hover { color: var(--ss-text); border-color: var(--ss-muted); }
.ss-icon-btn.del:hover { color: var(--ss-red); border-color: var(--ss-red); }

/* Penalties */
.ss-penalties { border-top: 2px solid var(--ss-line); background: var(--ss-bg2); }
.ss-pen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--ss-head); }
.ss-pen-head .ss-title { font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.ss-pen-cols { display: grid; grid-template-columns: 1fr 1fr; }
.ss-pen-cols > div + div { border-left: 1px solid var(--ss-line); }

/* Goalies and shots */
.ss-extras { border-top: 2px solid var(--ss-line); background: var(--ss-bg2); }
.ss-row { display: grid; grid-template-columns: 1fr 100px 1fr; align-items: center; }
.ss-row + .ss-row { border-top: 1px solid var(--ss-line); }
.ss-row-label { align-self: stretch; display: grid; place-items: center; padding: 12px 0; background: var(--ss-head); font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.ss-cell { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; }
.ss-goalie { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 10px; color: var(--ss-text); font-size: 18px; font-weight: 800; }
.ss-goalie small { font-size: 12px; font-weight: 600; color: var(--ss-muted); }
.ss-round { width: 44px; height: 44px; border-radius: 50%; border: 0; font-size: 24px; font-weight: 800; color: #fff; background: var(--ss-red); }
.ss-round.plus { background: var(--ss-gold); color: var(--ss-bg); }
.ss-round:disabled { opacity: .4; cursor: default; }
.ss-count { min-width: 50px; padding: 8px 6px; text-align: center; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 6px; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ss-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--ss-line); font-size: 12.5px; color: var(--ss-muted); }
.ss-foot .ss-link { margin-left: auto; }

/* Modal: full-screen on phones, centred card on larger screens (the app's entry sheets) */
.ss-modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.ss-modal {
  width: 100%; max-width: 640px; max-height: 100%; overflow: auto; background: #0d1117; color: #fff;
  border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ss-bg: #0d1117; --ss-bg2: #161b22; --ss-card: #21262d; --ss-head: #1c2128; --ss-line: #30363d;
  --ss-text: #fff; --ss-muted: #8b949e; --ss-dim: #6e7681; --ss-gold: #ffd700; --ss-red: #f85149; --ss-green: #3fb950;
}
@media (min-width: 700px) {
  .ss-modal-backdrop { align-items: center; padding: 20px; }
  .ss-modal { border-radius: 16px; max-height: calc(100vh - 40px); }
}
.ss-modal-head { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 16px; background: var(--ss-head); border-bottom: 1px solid var(--ss-line); }
.ss-modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; text-align: center; color: #fff; font-family: inherit; }
.ss-modal-head button { background: none; border: 0; font: inherit; font-size: 15px; font-weight: 600; color: var(--ss-muted); padding: 6px 0; }
.ss-modal-head .save { color: var(--ss-gold); font-weight: 800; text-align: right; }
.ss-modal-head .save:disabled { color: var(--ss-dim); cursor: default; }
.ss-modal-body { display: grid; gap: 12px; padding: 16px; }
.ss-modal p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ss-text); }
.ss-card { background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 16px; padding: 14px 16px; }
.ss-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ss-lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ss-muted); }
.ss-lbl.gold { color: var(--ss-gold); }
.ss-indicator { display: flex; align-items: center; gap: 10px; }
.ss-indicator .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ss-gold); flex: 0 0 12px; }
.ss-indicator .dot.red { background: var(--ss-red); }
.ss-indicator strong { flex: 1; font-size: 18px; font-weight: 800; }
.ss-indicator span:last-child { font-size: 14px; font-weight: 600; color: var(--ss-muted); }
.ss-time {
  width: 100%; height: 60px; background: var(--ss-bg2); border: 1px solid var(--ss-line); border-radius: 10px; color: #fff;
  font: inherit; font-size: 28px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums;
}
.ss-time::placeholder { color: var(--ss-muted); }
.ss-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ss-players.two { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); }
.ss-picker { display: grid; gap: 8px; min-width: 0; }
.ss-select, .ss-num, .ss-text {
  width: 100%; min-height: 46px; padding: 8px 10px; background: var(--ss-bg2); border: 1px solid var(--ss-line); border-radius: 10px;
  color: #fff; font: inherit; font-size: 15px; font-weight: 600;
}
.ss-select option { background: #161b22; color: #fff; }
.ss-num { font-size: 24px; font-weight: 800; text-align: center; }
.ss-num::placeholder, .ss-text::placeholder { color: var(--ss-muted); font-weight: 600; }
.ss-seg { display: flex; gap: 8px; }
.ss-seg button, .ss-grid button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 10px 6px; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 10px; color: #fff;
}
.ss-seg button b { font-size: 16px; font-weight: 800; }
.ss-seg button small, .ss-grid button small { font-size: 10px; font-weight: 600; color: var(--ss-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ss-seg button.on, .ss-grid button.on { background: var(--ss-gold); border-color: var(--ss-gold); color: var(--ss-bg); }
.ss-seg button.on small, .ss-grid button.on small { color: var(--ss-bg); }
.ss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ss-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ss-grid button { padding: 7px 4px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.ss-grid.five button b { font-size: 12px; }
.ss-grid.five button small { font-size: 8.5px; }
.ss-minutes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ss-minutes button { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; background: var(--ss-card); border: 1px solid var(--ss-line); border-radius: 6px; color: #fff; font-size: 18px; font-weight: 800; }
.ss-minutes button.on { background: var(--ss-gold); border-color: var(--ss-gold); color: var(--ss-bg); }
.ss-minutes .ss-num { width: 70px; height: 50px; min-height: 0; }
.ss-modal .ss-pill { min-height: 44px; }
.ss-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 720px) {
  .ss-teams, .ss-pen-cols { grid-template-columns: 1fr; }
  .ss-team + .ss-team { border-left: 0; border-top: 2px solid var(--ss-line); }
  .ss-pen-cols > div + div { border-left: 0; border-top: 1px solid var(--ss-line); }
  .ss-row { grid-template-columns: 1fr; }
  .ss-row-label { padding: 8px 0; }
  .ss-score { font-size: 44px; min-width: 60px; }
  .ss-bar-right { margin-left: 0; width: 100%; }
  .ss-players, .ss-players.two { grid-template-columns: 1fr; }
  .ss-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ss-name-btn { padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; text-decoration: underline dotted var(--ss-muted); text-underline-offset: 4px; }
.ss-name-btn:hover { color: var(--ss-gold); }
