/* =====================================================================
   Keys to Victory (keys/index.html, the Preview on nfl/game.html; sb-keys.js; added 2026-11-04)
   Three measurable keys per team per game, side by side; after the game, each one hit or missed.
   ===================================================================== */

/* ---- both teams' keys ---- */
.kk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 48px; }
.kk-name { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; margin: 0 0 6px; min-width: 0; }
.kk-name .badge { height: 20px; }
.kk-name small { color: var(--muted); font: 500 .85rem/1 var(--font-body); }
.kk-name .kk-tally { margin-left: auto; font: 600 .8rem/1 var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.kk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.kk-key { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kk-num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  font: 700 1.05rem/1 var(--font-display); background: var(--kk); color: var(--kk-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}
.kk-mark { width: 30px; height: 30px; margin-top: 1px; }
.kk-key p { margin: 0; }
.kk-head { font: 700 1.3rem/1.15 var(--font-display); }
.kk-why { color: var(--muted); font-size: .92rem; margin-top: 3px !important; }
.kk-result { font-weight: 600; font-size: .92rem; margin-top: 4px !important; }
.kk-key.hit .kk-result { color: var(--win); }
.kk-key.miss .kk-result { color: var(--loss); }
.kk-key.none .kk-result { color: var(--muted); }
.kk-empty { color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .kk { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

/* ---- title row on the game page ---- */
.kk-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kk-title h2 { margin: 0 !important; }
.kk-share {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 600 .9rem/1 var(--font-body); cursor: pointer; text-decoration: none;
}
.kk-share:hover { border-color: var(--ink); }
.game-upcoming .kk-section { margin-bottom: 40px; }
.kk-final { margin-top: 32px; }

/* ---- the Keys page ---- */
.kh-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; padding: 28px 0 8px; }
.kh-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.kh-head p { color: var(--muted); margin: 6px 0 0; max-width: 40em; }
.kh-bar { position: sticky; top: 0; z-index: 6; background: color-mix(in srgb, var(--chalk) 94%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); margin: 8px 0 14px; }
.kh-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-block: 10px; }
.kh-jump { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.kh-jump select {
  min-height: 42px; min-width: 260px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 1rem/1 var(--font-body); cursor: pointer;
}
.kh-bye { margin: 0; color: var(--muted); font-weight: 600; }
.kh-bye:empty { display: none; }
.kg { scroll-margin-top: 76px; }
.kg:focus { outline: none; }
.kg.is-target { border-color: var(--turf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--turf) 35%, transparent); }
.kg .kk-team.is-mine .kk-name > span:not([class]) { text-decoration: underline; text-decoration-color: var(--turf); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.kh-list { display: grid; gap: 16px; padding-bottom: 48px; }
.kh-day { font: 600 .8rem/1 var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 14px 0 -4px; }
.kg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.kg::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--ka) 50%, var(--kh) 50%); }
.kg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px 0; }
.kg-match { font: 700 1.5rem/1.1 var(--font-display); margin: 0; }
.kg-match .at { color: var(--muted); font-weight: 600; }
.kg-meta { color: var(--muted); font-size: .85rem; font-weight: 500; }
.kg-meta b { color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.kg-actions { margin-left: auto; display: flex; gap: 8px; }
.kg-actions a.kk-share { text-decoration: none; }
.kg .kk { padding: 12px 16px 6px; }
.kg .kk-list { border-top: 0; }
.kg .kk-key:last-child { border-bottom: 0; }
.kh-empty { padding: 40px 0 80px; color: var(--muted); }
.kk-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--chalk);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 50;
}
@media (max-width: 520px) {
  .kh-jump { width: 100%; }
  .kh-jump select { flex: 1; min-width: 0; }
  .kg-top { padding: 12px 14px 0; }
  .kg .kk { padding: 10px 14px 4px; }
  .kg-actions { margin-left: 0; width: 100%; }
  .kg-actions > * { flex: 1; justify-content: center; }
  .kk-head { font-size: 1.25rem; }
}
