/*
 * PHASE 8Q.2 -- THE COMPACT HOME, THE PICK SPLASH, YOUR ARSENAL ON PRIZES,
 * AND THE COMPLETION FLASH.
 *
 * ---------------------------------------------------------------------------
 * ONLY TOKENS THAT EXIST
 * ---------------------------------------------------------------------------
 * Every custom property read below is defined in app.css, and tests/phase8q2-home-ui
 * asserts it. Phase 8B shipped a stylesheet reading four tokens nobody had
 * defined -- white cards and pale text that no structural test could see --
 * so this file is held to the one set of tokens the whole app is built on.
 *
 * ---------------------------------------------------------------------------
 * PHONE FIRST: NOTHING SCROLLS SIDEWAYS AT 375 OR 412 PX
 * ---------------------------------------------------------------------------
 * No fixed widths. Grids use `minmax(0, 1fr)` (a long word cannot push a
 * column wider than its share), every text node may wrap anywhere, and rows
 * are flex with `min-width: 0` on the part that should shrink. Summaries are
 * compact on purpose: Item 22 wants about two passive sections per phone
 * screen.
 *
 * NO INLINE STYLES anywhere in the scripts these classes serve: `style-src
 * 'self'` refuses them silently.
 */

/* ------------------------------------------------------------ A. top status */

.hx-bidstreak {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--warn);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------- shared compact card */

.hx-card {
  padding: 12px 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hx-sub {
  margin: 2px 0 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ------------------------------------------------ C. YOUR AUCTION, E. progress */

.hx-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

@media (min-width: 400px) {
  .hx-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.hx-stat {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
}

.hx-stat__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.hx-stat__value {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* State in words first; the colour only repeats it. */
.hx-stat--good .hx-stat__value { color: var(--accent); }
.hx-stat--action { border-color: var(--warn); }
.hx-stat--action .hx-stat__value { color: var(--warn); }
.hx-stat--done .hx-stat__value { color: var(--accent); }

.hx-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.hx-foot__note {
  margin: 0;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--warn);
}

.hx-foot__go,
.hx-links__go {
  min-height: var(--tap);
  flex: 1 1 auto;
  text-align: center;
}

.hx-closest {
  margin-top: 10px;
}

.hx-closest__name,
.hx-closest__figures {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hx-closest__name {
  color: var(--text);
  font-weight: 700;
}

.hx-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* -------------------------------------------- D. recaps, F. recent updates */

.hx-rows,
.hx-updates {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hx-row + .hx-row,
.hx-update + .hx-update {
  border-top: 1px solid var(--line-soft);
}

.hx-row__link,
.hx-update__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 6px 0;
  color: inherit;
  text-decoration: none;
}

.hx-row__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.hx-row__title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hx-row__sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.hx-row__go {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.hx-update__icon {
  flex: 0 0 auto;
}

.hx-update__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------ B. attention: the extras */

/* The 8Q recovery block sits inside the list as one row. */
.attention__row--recovery {
  padding: 4px 0;
}

/* An in-place reveal (Pick, milestone) is a BUTTON shaped like the links. */
button.attention__link {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* ------------------------------------------- Item 23. YOUR ARSENAL on Prizes */

.hx-arsenal {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: inherit;
  text-decoration: none;
}

.hx-arsenal--good { border-color: var(--accent-dim); }
.hx-arsenal--action { border-color: var(--warn); }

.hx-arsenal__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.hx-arsenal__label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.hx-arsenal__lead {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hx-arsenal__go {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ------------------------------------------------ Item 19. the Pick splash */

.picksplash {
  text-align: center;
}

/* The dialog panel itself: centred content, and never wider than the phone. */
.picksplash__panel {
  max-width: 100%;
  text-align: center;
}

.picksplash__prompt {
  margin-top: 0;
}

.picksplash__reward {
  margin: 12px 0 4px;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* Three presents on the narrowest phones: they shrink, never overflow. */
@media (max-width: 359px) {
  .picksplash .pick__row {
    gap: 8px;
  }
  .picksplash .pick__box {
    width: 72px;
    height: 72px;
  }
}

/* ------------------------------------------ Item 18. the completion flash */

.cflash {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.cflash__mark {
  flex: 0 0 auto;
  color: var(--accent);
}

.cflash__text {
  min-width: 0;
}

.cflash--in {
  animation: cflash-in 260ms ease-out both;
}

.cflash--out {
  animation: cflash-out 260ms ease-in both;
}

@keyframes cflash-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes cflash-out {
  from { opacity: 1; max-height: 80px; }
  to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cflash--in,
  .cflash--out {
    animation: none;
  }
}
