/* Silver Dolla Bowl — palette drawn from a struck silver coin:
   die shadow, polished relief, frosted proof field, and the russet
   rim toning old silver develops. */
:root {
  --strike:  #0B0D10;
  --relief:  #E9EAEC;
  --frost:   #8A8F98;
  --tone:    #C0873C;
  --tone-dk: #96682A;
  --won:     #2F7D48;
  --lost:    #A03A34;

  --bg:      #F2F1EE;
  --card:    #FFFFFF;
  --edge:    #D8D6D1;
  --text:    var(--strike);
  --muted:   #6B7079;
  --dim-bg:  #E7E5E1;

  --r: 3px;
  --pad: 14px;
  font-synthesis-weight: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #0B0D10;
    --card:   #15181D;
    --edge:   #262A31;
    --text:   var(--relief);
    --muted:  #8A8F98;
    --dim-bg: #101318;
    --won:    #4FA96B;
    --lost:   #C4635C;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 Saira, system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 0 12px 64px; }

/* ---- masthead ---------------------------------------------------- */
header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--edge);
}
.brand {
  font-family: "Saira Condensed", Saira, system-ui, sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: .14em;
  text-transform: uppercase; margin: 0; line-height: 1;
}
.brand span { color: var(--tone); }
.headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wk {
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-size: 13px;
}

/* ---- the five coin slots: the ante, made literal ------------------ */
.ante { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.slots { display: flex; gap: 6px; }
.slot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--frost); background: transparent;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.slot.filled { background: var(--tone); border-color: var(--tone-dk); }
.slot.struck { animation: strike .26s ease; }
@keyframes strike {
  0% { transform: scale(.55); } 60% { transform: scale(1.15); } 100% { transform: scale(1); }
}
.ante-label { font-size: 13px; color: var(--muted); }

/* ---- day heading -------------------------------------------------- */
.day {
  display: flex; align-items: center; gap: 10px;
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: .13em; font-size: 12px;
  color: var(--muted); margin: 22px 0 8px;
}
.day::after { content: ""; flex: 1; height: 1px; background: var(--edge); }

/* ---- a game: two stacked rows, tap the team you want ------------- */
.game { margin-bottom: 14px; }

.matchup {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--muted); margin-bottom: 4px;
  font-family: "Saira Condensed", Saira, sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.faces {
  display: grid; grid-template-rows: 1fr 1fr; gap: 1px;
  background: var(--edge); border: 1px solid var(--edge); border-radius: var(--r);
  overflow: hidden;
}
.face {
  appearance: none; -webkit-appearance: none;
  position: relative; border: 0; margin: 0; cursor: pointer;
  background: var(--card); color: var(--text);
  padding: 9px 12px; min-height: 48px;
  display: flex; align-items: center; gap: 11px;
  font: inherit; text-align: left; width: 100%;
  transition: background-color .14s ease, color .14s ease;
}
.logo { flex: 0 0 auto; object-fit: contain; }
.tname {
  font-family: "Saira Condensed", Saira, sans-serif;
  font-weight: 600; font-size: 18px; letter-spacing: .02em; line-height: 1.1;
}
/* Labelled, not a bare number. Unlabelled, "1" reads as "you have selected
   one thing" rather than "one person took this team" -- which is exactly how
   it was misread in testing. There is no hover on a phone, so a title
   attribute cannot carry the meaning. */
.tally {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums;
  letter-spacing: .04em; white-space: nowrap; flex: 0 0 auto;
}

.face[aria-pressed="true"] { background: var(--strike); color: var(--relief); }
.face[aria-pressed="true"] .tally { color: inherit; opacity: .75; }
@media (prefers-color-scheme: dark) {
  .face[aria-pressed="true"] { background: var(--relief); color: var(--strike); }
}
.face:focus-visible { outline: 2px solid var(--tone); outline-offset: -3px; }
@media (hover: hover) {
  .face:not(:disabled):hover { background: var(--dim-bg); }
  .face[aria-pressed="true"]:not(:disabled):hover { background: var(--strike); }
}

/* A finished pick carries its own result. */
.face.won  { background: var(--won);  color: #fff; }
.face.lost { background: var(--lost); color: #fff; }
.face.tie  { background: var(--tone); color: #fff; }
.face.won .tally, .face.lost .tally, .face.tie .tally { color: #fff; opacity: .85; }

.game.locked .face { cursor: default; background: var(--dim-bg); color: var(--muted); }
.game.locked .face .logo { filter: grayscale(1); opacity: .7; }
.game.locked .face[aria-pressed="true"] { background: var(--muted); color: var(--card); }
.game.locked .face[aria-pressed="true"] .logo { filter: none; opacity: 1; }
.game.locked .face.won  { background: var(--won);  color: #fff; }
.game.locked .face.lost { background: var(--lost); color: #fff; }
.game.locked .face.tie  { background: var(--tone); color: #fff; }
.game.locked .face.won .logo, .game.locked .face.lost .logo,
.game.locked .face.tie .logo { filter: none; opacity: 1; }

.meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 3px; font-size: 12px; color: var(--muted);
}
.score { font-weight: 700; color: var(--text); }
.tag {
  font-family: "Saira Condensed", Saira, sans-serif; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 600; font-size: 11px;
}
.granted { color: var(--tone); }

/* ---- sign in ------------------------------------------------------ */
.panel {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--r);
  padding: 18px; margin-top: 28px;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px; }
select, input, button.primary {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--edge); border-radius: var(--r);
  padding: 11px 12px; margin-bottom: 14px;
}
input[inputmode="numeric"] { letter-spacing: .5em; font-size: 20px; text-align: center; }
button.primary {
  background: var(--strike); color: var(--relief); border-color: var(--strike);
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer; margin-bottom: 0;
}
button.primary:disabled { opacity: .5; cursor: default; }
@media (prefers-color-scheme: dark) {
  button.primary { background: var(--relief); color: var(--strike); border-color: var(--relief); }
}

.msg { font-size: 14px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r); }
.msg.err { background: color-mix(in srgb, var(--lost) 12%, transparent); color: var(--lost); }
.msg.ok  { background: color-mix(in srgb, var(--won) 12%, transparent); color: var(--won); }

.who {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; font-size: 13px; color: var(--muted);
}
.linkish {
  background: none; border: 0; padding: 0; color: var(--muted);
  font: inherit; text-decoration: underline; cursor: pointer;
}
.linkish:hover { color: var(--text); }

.empty { color: var(--muted); text-align: center; padding: 40px 12px; }

/* ---- tabs --------------------------------------------------------- */
nav.tabs { display: flex; gap: 2px; margin-top: 10px; }
nav.tabs button {
  flex: 1; background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 4px; cursor: pointer; color: var(--muted);
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; font-size: 12px;
}
nav.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--tone); }

/* ---- standings ---------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--edge); font-size: 14px; }
th {
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 600; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
td.num, th.num { text-align: right; }
tr.inactive td { color: var(--muted); }
.rank { color: var(--muted); width: 28px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* On a locked picked face the amber nickname falls onto grey and the
   contrast drops. Use the card colour instead -- the amber is doing no
   work there, since a locked pick can no longer be changed. */
.game.locked .face[aria-pressed="true"] .nick { color: var(--card); opacity: .8; }

.foot { font-size: 12px; color: var(--muted); margin: 10px 2px 0; line-height: 1.5; }
tbody tr[data-weeks] { cursor: pointer; }
tr.wkline td {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  padding-top: 0; border-bottom: 1px solid var(--edge);
}

.sub {
  font-family: "Saira Condensed", Saira, sans-serif; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; font-size: 13px;
  margin: 0 0 10px; color: var(--text);
}
.rost { display: flex; align-items: center; gap: 8px; padding: 7px 0;
        border-bottom: 1px solid var(--edge); font-size: 14px; }
.rost .nm { flex: 1; }
.rost .off { color: var(--muted); text-decoration: line-through; }
.rost button {
  background: none; border: 1px solid var(--edge); border-radius: var(--r);
  color: var(--muted); font: inherit; font-size: 12px; padding: 3px 8px; cursor: pointer;
}
.rost button:hover { color: var(--text); border-color: var(--muted); }
.pill { font-size: 11px; color: var(--tone); }
.aud { font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--edge);
       color: var(--muted); font-variant-numeric: tabular-nums; }
.aud b { color: var(--text); font-weight: 600; }

/* Who picked what. Secondary to the game itself -- it lost its rules in a
   cleanup and inherited 16px body text, which shouted louder than the row
   it belongs to. */
.who-picked {
  font-size: 12px; line-height: 1.7; color: var(--muted);
  padding: 7px 2px 2px; margin-top: 2px;
  border-top: 1px dashed var(--edge);
}
.who-picked b {
  color: var(--text); font-weight: 700;
  font-family: "Saira Condensed", Saira, sans-serif; letter-spacing: .06em;
}
.meta .linkish { font-size: 12px; }

/* ---- week nav ---------------------------------------------------- */
.wkbtn {
  background: none; border: 1px solid var(--edge); border-radius: var(--r);
  color: var(--text); font-size: 15px; line-height: 1; cursor: pointer;
  padding: 3px 8px;
}
.wkbtn:disabled { opacity: .35; cursor: default; }
.wknum { display: inline-block; min-width: 62px; text-align: center; }
.wk { display: flex; align-items: center; gap: 6px; }

/* ---- live scores --------------------------------------------------- */
.pts {
  margin-left: auto; flex: 0 0 auto;
  font-family: "Saira Condensed", Saira, sans-serif;
  font-weight: 700; font-size: 21px; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--muted);
}
.pts.lead { color: var(--text); }
.face[aria-pressed="true"] .pts, .face.won .pts,
.face.lost .pts, .face.tie .pts { color: inherit; }
.face[aria-pressed="true"] .pts:not(.lead) { opacity: .7; }

.livetag {
  color: var(--lost); font-weight: 700;
  font-family: "Saira Condensed", Saira, sans-serif; letter-spacing: .08em;
}
.game.playing .faces { box-shadow: 0 0 0 1px var(--lost); }

.rost.unpaid .nm { color: var(--muted); }
.paybtn { border-color: var(--tone) !important; color: var(--tone) !important; font-weight: 600; }
.paybtn:hover { background: var(--tone); color: #fff !important; }
