/* ==========================================================================
   FESTIVUS HUNGER GAMES — PHASE 7.4
   The grouped Arsenal, the prize badges, and the resolved HWDYK result.

   A SEPARATE FILE, DELIBERATELY
   -----------------------------
   phase7.css already owns the six-ability Arsenal, and everything there still
   applies: a card is still `.arsenal-item`, a reason is still
   `.arsenal-item__reason`. This file adds the grouping, the countdowns and the
   two new surfaces, so a reader can see exactly what Phase 7.4 changed about
   the look of the application without diffing a 1500-line file.

   TOKENS, NEVER LITERALS, FOR ANYTHING STRUCTURAL
   -----------------------------------------------
   Spacing, radii and borders come from app.css's `:root`. Hues are literal
   because the Arsenal's colour language is per-ability and predates a token for
   it -- the same choice phase7.css made for `.arsenal-badge--shield`.

   STATE IS NEVER COLOUR-ONLY
   --------------------------
   Phase 6's rule, and it bites hardest in the resolved result, where the two
   states are "right" and "wrong" about a named person. Every one carries a
   glyph or a word as well as a hue, and the right/wrong marks are written into
   the text content rather than added with `::before`, so they survive being
   copied out of the page.
   ========================================================================== */

/* ==========================================================================
   THE ARSENAL — FOUR GROUPS (A1)
   ========================================================================== */

.arsenal-group {
  margin: 0 0 1.1rem;
}

.arsenal-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line-soft);
}

.arsenal-group__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--metal-dim);
}

.arsenal-group__count {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.arsenal-group__blurb {
  margin: 0.35rem 0 0.6rem;
  font-size: 0.82rem
  ;
  color: var(--text-faint);
}

/* ---- the card, extending phase7.css's .arsenal-item --------------------- */

.arsenal-item__body { min-width: 0; }

/* An ability that is currently doing something reads as live, not as selected. */
.arsenal-item--active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elev));
}

.arsenal-item__facts {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.arsenal-item__status {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.arsenal-item__status--ok { color: var(--accent); }
.arsenal-item__status--ok::before { content: "●"; font-size: 0.7em; }

/* A suppressed defence. The glyph matters: "asleep" and "up" must not differ
   only by hue, because that is the one pair somebody will act on. */
.arsenal-item__status--warn { color: var(--warn); }
.arsenal-item__status--warn::before { content: "☾"; }

.arsenal-badge--suppressed { color: var(--warn); }
.arsenal-badge--boost { color: #ffd98a; }
.arsenal-badge--insurance { color: #9fd3c7; }

/* ---- WHAT IS BEING DONE TO ME ------------------------------------------ *
   A panel rather than a band, because up to five can be true at once and five
   full-width bands would push the abilities off a phone screen entirely. */

.arsenal-against {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--danger) 9%, var(--bg-elev));
}

.arsenal-against__title {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--danger);
}

.arsenal-against__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.arsenal-against__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.arsenal-against__label { font-weight: 600; }

.arsenal-against__when {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A disabled radio in a picker still has to read as a row, not as a gap. */
.hwdyk-choice--disabled { opacity: 0.5; }

/* ==========================================================================
   PRIZE BADGES (A11, A13)
   ========================================================================== */

.prize__marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.prize__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid currentColor;
  /* A badge must never be the reason a card scrolls sideways. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prize__mark--bounty { color: #ffd98a; }
.prize__mark--climb { color: #93c6f0; }

/* ---- the detail page's notes ------------------------------------------- */

.prize-notes {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}

.prize-note {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid currentColor;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}

.prize-note__label {
  font-size: 0.85rem;
  font-weight: 700;
}

.prize-note__detail {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.prize-note--bounty  { color: #ffd98a; }
.prize-note--climb   { color: #93c6f0; }
.prize-note--insured { color: #9fd3c7; }
.prize-note--locked  { color: var(--danger); }
.prize-note--tax     { color: var(--warn); }

/* ==========================================================================
   THE RESOLVED HWDYK RESULT (B1, B2)
   ========================================================================== */

.today-results { display: grid; gap: 0.75rem; }

.result-question {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
}

.result-question__prompt {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
}

.result-question__by {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.result-question__answer {
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.result-question__answer-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.result-question__answer b {
  font-size: 1.02rem;
  color: var(--accent);
}

.result-question__score {
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.result-question__none {
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  color: var(--text-faint);
}

/* ---- who got it right. The positive default (B1). ---------------------- */

.result-right { margin-top: 0.5rem; }

.result-right__label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.result-right__names {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.result-right__names li {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #04241b;
  background: var(--accent);
}

/* ---- SEE ALL ANSWERS (B2) ---------------------------------------------- */

.result-all { margin-top: 0.6rem; }

.result-all__summary {
  /* 44px of tappable height, which a bare <summary> does not have. */
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.result-all__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.result-all__list {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-all__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.86rem;
  background: var(--bg);
  border-left: 3px solid transparent;
}

.result-all__who { font-weight: 600; }

.result-all__said {
  color: var(--text-dim);
  text-align: right;
  /* A long typed answer wraps rather than widening the row. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-all__row--right { border-left-color: var(--accent); }
.result-all__row--right .result-all__said { color: var(--accent); }

.result-all__row--wrong { border-left-color: var(--danger); }
.result-all__row--wrong .result-all__said { color: var(--text-dim); }

/* "No answer" is its own state, and reads as neutral rather than as wrong --
   not answering is not the same as getting it wrong, and the page should not
   imply it is. */
.result-all__row--none { border-left-color: var(--line); }
.result-all__row--none .result-all__said {
  color: var(--text-faint);
  font-style: italic;
}

/* ==========================================================================
   ADMIN: THE ARSENAL PLAYTEST PANEL (A21, A22)
   ========================================================================== */

.admin-playtest-arsenal { display: grid; gap: 0.7rem; }

.admin-playtest-arsenal__subhead {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--metal-dim);
}

.admin-cooldown {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.admin-cooldown__label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-cooldown__note {
  margin: 0.2rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.admin-cooldown__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-inventory {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.admin-inventory__who {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-inventory__held {
  margin: 0.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.95rem;
}

.admin-inventory__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  background: var(--bg-elev-2);
  font-variant-numeric: tabular-nums;
}

.admin-inventory__gaps {
  margin: 0.3rem 0 0;
  font-size: 0.76rem;
  color: var(--text-faint);
}

/* ==========================================================================
   NARROW PHONES — 320px
   ==========================================================================
   The Arsenal card's three columns become two: the count moves under the body
   rather than squeezing the description into a two-word column. Tested at
   320px, which is the narrowest device anybody in this family has. */

@media (max-width: 360px) {
  .arsenal-item {
    grid-template-columns: 2.2rem 1fr;
  }

  .arsenal-item__count {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.3rem;
  }

  .arsenal-against__item {
    flex-direction: column;
    gap: 0.1rem;
  }

  .result-all__row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .result-all__said { text-align: left; }
}

/* ==========================================================================
   REDUCED MOTION
   ==========================================================================
   Nothing here animates, so there is nothing to disable -- stated rather than
   omitted, because the absence of a `prefers-reduced-motion` block in a new
   stylesheet otherwise looks like an oversight. */

/* ==========================================================================
   PHASE 7.4A — PLAYER UX CORRECTIONS
   ========================================================================== */

/* ---- the undiscovered Arsenal (Fix 4) ---------------------------------- */

.arsenal-empty {
  padding: 1.6rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  text-align: center;
}

.arsenal-empty__title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.arsenal-empty__detail {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.45;
  color: var(--text-dim);
  /* Readable as a paragraph on a phone rather than one long line. */
  max-width: 34ch;
  margin-inline: auto;
}

/* ---- the shared result block (Fixes 1 and 2) --------------------------- */

.result-block {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

/*
 * "How everybody did appears once today's round closes."
 *
 * Quiet on purpose: it is an explanation for an absence, not a result. A
 * player who has just answered should read it once and stop noticing it.
 */
.result-question__pending {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

/*
 * The reader's own row in See All Answers.
 *
 * A left rule and a weight change, NOT a background: the row already carries a
 * right/wrong colour on its left border, and a second background colour would
 * fight it and make "mine" and "correct" hard to tell apart.
 */
.result-all__row--you .result-all__who {
  font-weight: 800;
}

.result-all__row--you {
  box-shadow: inset -3px 0 0 var(--metal-dim);
}

/* ---- the Games page's daily-game pool (Fix 3) -------------------------- */

/*
 * The staging area the three daily-game hosts are painted into before they are
 * moved into their bucket. Permanently hidden: nothing is ever meant to be
 * read here, and a card left behind is a card the server called `unavailable`.
 */
.games-pool { display: none; }

/*
 * A daily-game card sitting inside a Games bucket.
 *
 * Home spaces these with its own `.section` rhythm; inside a bucket they stack
 * directly, so they need their own gap or two cards touch.
 */
[data-games="available"] > *:not([hidden]) + *:not([hidden]),
[data-games="in-progress"] > *:not([hidden]) + *:not([hidden]),
[data-games="completed-today"] > *:not([hidden]) + *:not([hidden]) {
  margin-top: 0.6rem;
}
