/* Three Trials a Day, the hub (game/design-trials.md, section 8), on the site's tokens. Phones first: at 360 px a
   game is one row (its seal, its name, the day's result in words and the way to it), and the casebook is seven
   columns of about 43 px, each day a cell of three marks 10 px wide. The page also loads game.css, which colours
   the wax seal and holds the few shared pieces used here (the hidden text, the box of text to share). */

.hub { max-width: var(--narrow); margin: 0 auto; padding: var(--s-2) var(--gutter) var(--s-6); }
.hub__stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
/* The line that says the day is loading means something only where scripts run. Until they have drawn, and when
   one of them never arrives, the stage keeps what the page was built with: this line and the three games. */
.hub__loading { display: none; margin: 0; color: var(--muted); }
.js .hub__loading { display: block; }

/* ---- the day ---- */

.hub__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-4); }
.hub__title { margin: 0; font-size: clamp(1.35rem, 3.2vw, 1.75rem); }
.hub__title:focus { outline: none; }
.hub__meta { display: flex; flex-wrap: wrap; gap: 0 var(--s-3); color: var(--muted); font-size: .88em; font-variant-numeric: tabular-nums; }
.hub__meta li + li::before { content: "\00B7"; margin-right: var(--s-3); color: var(--line-strong); }

/* ---- the three games: each card is one link, its seal on the left and the way in on the right ---- */

.hub__cards { display: grid; gap: var(--s-2); }
.hub__card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "seal name name" "seal state go"; align-items: center; gap: 2px var(--s-3); min-height: 76px; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease; }
a.hub__card:hover { border-color: var(--text); color: var(--text); }
.hub__seal { grid-area: seal; width: 48px; height: 48px; }
.hub__seal svg { width: 100%; }
/* No seal today: a whole ring with a bar across it for a game finished without one, a broken ring for a game not
   yet played. As in the casebook, the two differ by shape. */
.hub__seal--none { border: 2px solid var(--line-strong); border-radius: 50%; background: linear-gradient(var(--line-strong), var(--line-strong)) center / 18px 3px no-repeat; }
.hub__seal--todo { border: 2px dashed var(--line-strong); border-radius: 50%; }
.hub__name { grid-area: name; font-family: var(--display); font-weight: var(--display-weight); font-size: 1.2rem; line-height: 1.3; }
.hub__state, .hub__line { grid-area: state; color: var(--muted); font-size: .88em; line-height: 1.4; }
.hub__go { grid-area: go; display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); font-size: .88em; font-weight: 600; }
.hub__go--play { padding: 0 var(--s-4); border-radius: 999px; background: var(--accent); color: var(--on-accent); }
/* The page as it is built, before or without scripts: no seal, and under the name one line on what the game is. */
.hub__card--about { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name go" "state state"; row-gap: var(--s-1); }

/* ---- the day's points ---- */

.hub__score { display: grid; gap: var(--s-1); padding: var(--s-3) var(--s-4); border-left: 3px solid var(--gilt); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.hub__score p { margin: 0; }
.hub__points { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.45rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hub__full { font-weight: 600; }
.hub__progress { color: var(--muted); font-variant-numeric: tabular-nums; }
.hub__note { margin: 0; color: var(--muted); font-size: .88em; }

/* ---- the streak and the totals ---- */

.hub__facts { display: grid; gap: var(--s-1) var(--s-5); padding-block: var(--s-3); border-block: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* ---- the casebook: seven columns, Monday first. A cell knows its weekday and takes that column, so the 35 days
   up to today fall in rows of seven with the first and the last row part filled. ---- */

.hub__book { display: grid; gap: var(--s-3); }
.hub__label { margin: 0; color: var(--gilt); font-family: var(--body); font-size: .82em; font-weight: 600; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; }
.lang-si .hub__label { letter-spacing: .02em; font-size: .9em; }
.hub__casebook { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 26rem; }
.hub__day { display: grid; place-items: center; min-height: 30px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hub__day--w0 { grid-column: 1; }
.hub__day--w1 { grid-column: 2; }
.hub__day--w2 { grid-column: 3; }
.hub__day--w3 { grid-column: 4; }
.hub__day--w4 { grid-column: 5; }
.hub__day--w5 { grid-column: 6; }
.hub__day--w6 { grid-column: 7; }
.hub__day--today { box-shadow: inset 0 0 0 2px var(--gilt); }
.hub__pips { display: flex; align-items: center; justify-content: center; gap: 2px; }
/* The five marks, each a shape of its own, so that none is told from another by its colour: a star for a gilt
   seal, a disc for a red one, a ring for a plain one, a bar for a game finished without a seal, and a small dot
   for a game not played. */
.hub__pip { display: block; flex: none; width: 10px; height: 10px; }
.hub__pip--gilt { background: var(--gilt); clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%); }
.hub__pip--red { border-radius: 50%; background: var(--accent-text); }
.hub__pip--plain { border: 2px solid var(--text); border-radius: 50%; }
.hub__pip--none { height: 2px; background: var(--muted); }
.hub__pip--empty { width: 4px; height: 4px; margin: 0 3px; border-radius: 50%; background: var(--line-strong); }
.hub__legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--muted); font-size: .82em; }
.hub__legend li { display: inline-flex; align-items: center; gap: 6px; }

.hub__device { margin: 0; color: var(--muted); font-size: .85em; }

/* ---- wider screens: the facts stand two abreast, and the marks have room to grow ---- */

@media (min-width: 480px) {
  .hub__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub__day { min-height: 36px; }
  .hub__pips { gap: 3px; }
  .hub__pip { width: 12px; height: 12px; }
  .hub__pip--none { height: 2px; }
  .hub__pip--empty { width: 4px; height: 4px; margin: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub *, .hub *::before, .hub *::after { animation: none !important; transition: none !important; }
}
