/* ===========================================================================
   PHASE 7.7A -- THE HOME DASHBOARD AND THE GAMES ARSENAL CARD.

   Loaded LAST, after phase77.css, for the same reason each of these follows
   the previous one: where it restyles something an earlier sheet defined, that
   is ordinary cascade order rather than `!important`.

   ---------------------------------------------------------------------------
   NO INLINE STYLES. THE POLICY IS `style-src 'self'`
   ---------------------------------------------------------------------------
   `element.style.*` is blocked, and blocked SILENTLY -- the rule simply never
   applies, and Phase 7 shipped a release where every progress bar rendered
   empty because of it. Everything that varies here is a class or an attribute
   the stylesheet can see (`[hidden]`), never a painted style.

   ---------------------------------------------------------------------------
   PHONE FIRST, AND THE 44px RULE
   ---------------------------------------------------------------------------
   Both new surfaces are things somebody taps: an attention row is a link
   across its whole width, and the Arsenal card's actions are buttons. Both are
   held at `var(--tap)`, which is 48px.

   ---------------------------------------------------------------------------
   NO STATE IS CARRIED BY COLOUR ALONE
   ---------------------------------------------------------------------------
   The Arsenal card's four states differ in their WORDS -- "3 power-ups ready",
   "No power-ups ready", "No power-ups discovered yet", "You're Frozen for 18
   minutes" -- and the accent on the effect state reinforces a sentence that
   already says it.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   NEEDS YOUR ATTENTION (Item 7C)
   --------------------------------------------------------------------------- */

.attention {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  overflow: hidden;
}

.attention__row {
  border-bottom: 1px solid var(--line-soft);
}

.attention__row:last-child {
  border-bottom: 0;
}

/*
 * The row is the target.
 *
 * These are read with a thumb while standing up, and a chevron at the end of
 * the line is a 20px target beside 300px of dead space. The anchor IS the flex
 * container rather than something inside it, so the whole strip -- icon,
 * sentence and the gap after it -- is tappable.
 *
 * `.attention__link` is also used for the non-tappable rows, as a div. One
 * class, one layout: the alternative was styling the `<li>` too and then
 * cancelling its padding when it happened to contain a link.
 */
.attention__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}

.attention__link:hover .attention__text,
.attention__link:focus-visible .attention__text {
  color: var(--accent);
}

.attention__icon {
  flex: 0 0 auto;
  width: 24px;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.attention__body {
  flex: 1 1 auto;
  min-width: 0;
}

.attention__text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.attention__sub {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------------
   TODAY'S GAMES, AS ONE LINE (Item 7D)
   --------------------------------------------------------------------------- */

.todaycard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.todaycard__counts {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.todaycard__go {
  flex: 0 0 auto;
}

/*
 * At 320px the count and the button together overflow, so the card becomes two
 * rows and the button takes the full width -- which is a better target anyway.
 */
@media (max-width: 380px) {
  .todaycard {
    flex-direction: column;
    align-items: stretch;
  }

  .todaycard__go {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   YOUR POSITION, under the top three (Item 7F)
   --------------------------------------------------------------------------- */

/*
 * Separated from the three rows above it by a rule rather than a heading: the
 * gap IS the statement that this row is not part of the podium. A heading
 * ("YOUR POSITION") would cost two lines on a phone to say what the row's own
 * rank number already says.
 */
.board--you {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* ---------------------------------------------------------------------------
   THE ARSENAL CARD ON GAMES (Item 8)
   --------------------------------------------------------------------------- */

/*
 * Full width and near the top, which is the whole of Item 8A.
 *
 * What it replaced was a link the width of the word "Arsenal", sitting in a
 * row of navigation chrome below the fold. Players reported they could not
 * find the Arsenal, and that is a sufficient explanation.
 */
.arsenalcard {
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg-elev)) 0%, var(--bg-elev) 62%);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.arsenalcard__title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.arsenalcard__lead {
  margin: 6px 0 0;
  font-size: 1.12rem;
  font-weight: 700;
}

.arsenalcard__hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.arsenalcard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/*
 * WRAPS rather than shrinking.
 *
 * The effect state can carry two actions ("USE LUCKY BREAK" and "OPEN
 * ARSENAL"), and on a 320px screen the alternative to wrapping is two buttons
 * nobody can read or hit.
 */
.arsenalcard__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 10rem;
  min-height: var(--tap);
}

/* ---------------------------------------------------------------------------
   A CELEBRATION YOU CAN TAP (Item 8G)
   --------------------------------------------------------------------------- */

/*
 * The new-discovery toast goes somewhere. It is still tap-to-dismiss in the
 * sense that it disappears, but the tap also opens the Arsenal, which is what
 * 8G's [VIEW ARSENAL] asks for without putting a second target inside a
 * five-second card.
 */
.toast--link {
  cursor: pointer;
}

.toast--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===========================================================================
   PHASE 7.7A-H1 -- THE HWDYK AUTHOR LIFECYCLE

   Review Your Questions, the draft list, and the cancelled-question notice.
   The screens existed only as an API before this; these are the first styles
   they have ever had.

   NO STATE BY COLOUR ALONE, and here that rule is load-bearing rather than
   decorative: the review screen exists to catch an author who ticked the
   wrong one of four answers, so "which one is marked correct" is carried by
   the heading CORRECT ANSWER, by a tick character, and by position -- the
   accent border only reinforces what the words already say.
   =========================================================================== */

.today-draftnote {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 36%, transparent);
  font-size: 0.82rem;
  color: var(--text);
}

/* The two controls on a draft row, side by side and thumb-sized. */
.today-question__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.today-question__actions .btn {
  flex: 1 1 auto;
  min-width: 9rem;
  min-height: var(--tap);
}

/* ---------------------------------------------------------------------------
   REVIEW YOUR QUESTIONS
   --------------------------------------------------------------------------- */

.today-review__item {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev-2);
}

.today-review__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.today-review__prompt {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 650;
}

.today-review__heading {
  margin: 12px 0 4px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/*
 * The marked answer. A tick, a heavier weight, and a left border -- three
 * signals, none of which is only a hue.
 */
.today-review__correct {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  border-left-width: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 1rem;
  font-weight: 700;
}

.today-review__others {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.today-review__others li {
  margin: 3px 0;
}

.today-review__edit,
.today-review__go {
  margin-top: 12px;
  min-height: var(--tap);
}

.today-review__publish {
  margin-top: 16px;
  min-height: var(--tap);
}

/* ---------------------------------------------------------------------------
   A CANCELLED QUESTION
   --------------------------------------------------------------------------- */

.today-cancelled__item {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: var(--bg-elev-2);
}

/*
 * The word first. "CANCELLED - DID NOT COUNT" is the whole message; the muted
 * treatment below it is what makes the rest of the card read as past tense.
 */
.today-cancelled__flag {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  color: var(--warn);
}

.today-cancelled__item .today-review__prompt {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-faint) 70%, transparent);
}

/* ---------------------------------------------------------------------------
   ADMIN: one question row, with its cancel control
   --------------------------------------------------------------------------- */

.games-author__questiontext {
  margin: 0;
}

.games-author__question .btn {
  margin-top: 8px;
  min-height: var(--tap);
}
