/* ==========================================================================
   Festivus Hunger Games — challenges and the Quick Game (Phase 5)
   Loaded after game.css; shares its tokens.

   Mobile-first throughout. Every interactive target below is at least 44px on
   its short edge, which is the minimum that a thumb hits reliably on a phone.
   ========================================================================== */

/* -------------------------------- streak --------------------------------- */

.streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fire);
  background: color-mix(in srgb, var(--fire) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--fire) 32%, transparent);
  white-space: nowrap;
}

.streak__flame {
  font-size: 0.95rem;
  line-height: 1;
}

/* The player header is a row; the streak sits at its end and wraps under on a
   narrow phone rather than squeezing the name. */
.playerbar {
  flex-wrap: wrap;
}

/* ------------------------------ games header ----------------------------- */

.gamesbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--line);
}

.gamesbar__points {
  margin: 0;
  margin-right: auto;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.gamesbar__points small {
  margin-left: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}

.gamesbar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
}

.gamesbar__link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.section__note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ----------------------------- challenge card ---------------------------- */

.challenge-list {
  display: grid;
  gap: 10px;
}

.challenge {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  /* A card is a tap target in its own right. */
  min-height: 72px;
}

.challenge:active {
  background: var(--bg-elev-2);
}

.challenge[data-state="rewarded"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.challenge__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border-radius: 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
}

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

.challenge__kind {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.challenge__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  /* Long family in-jokes must wrap, never push the card sideways. */
  overflow-wrap: anywhere;
}

.challenge__sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.challenge__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.challenge__reward {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent);
}

/* ------------------------------ today block ------------------------------ */

.today__label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* ----------------------------- Festivus Pick ----------------------------- */

/* Deliberately warm and plain: a present, not a jackpot. No coins, no spinning,
   no flashing, nothing that reads as a slot machine. */
.pick {
  margin-top: 12px;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(170deg, color-mix(in srgb, var(--gold) 12%, var(--bg-elev-2)) 0%, var(--bg-elev) 70%);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
}

.pick--compact {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 16px;
}

.pick__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.pick__prompt {
  margin: 6px 0 14px;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.pick__state {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.pick__row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pick__box {
  width: 84px;
  height: 84px;
  font-size: 2.3rem;
  line-height: 1;
  border-radius: 16px;
  cursor: pointer;
  background: var(--bg-elev-2);
  border: 2px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  transition: transform 140ms ease, border-color 140ms ease, opacity 220ms ease;
}

.pick__box:active {
  transform: scale(0.96);
}

.pick__box:disabled {
  cursor: default;
}

/* A modest lift, not a celebration animation. */
.pick__box--chosen {
  transform: translateY(-6px) scale(1.06);
  border-color: var(--gold);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--gold) 22%, transparent);
}

.pick__box--faded {
  opacity: 0.28;
}

.pick__note {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pick__done {
  padding: 8px 0 0;
}

.pick__done--new {
  animation: pick-reveal 420ms ease-out both;
}

@keyframes pick-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.pick__reward {
  margin: 10px 0 2px;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  color: var(--gold);
}

.pick__again {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
  .pick__box,
  .pick__done--new {
    transition: none;
    animation: none;
  }
}

/* --------------------------- challenge detail ---------------------------- */

.cdetail__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cdetail__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
}

.cdetail__kind {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cdetail__title {
  margin: 2px 0 0;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cdetail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}

.cdetail__reward span {
  font-size: 1.6rem;
  font-weight: 850;
  color: var(--accent);
}

.cdetail__reward small {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cdetail__cap,
.cdetail__foot {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.cdetail__foot {
  margin-top: 18px;
  text-align: center;
}

/* ------------------------------- answering ------------------------------- */

.answer {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.answer__question {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.answer__options {
  display: grid;
  gap: 10px;
}

.answer__option {
  min-height: 56px;
  padding: 12px 16px;
  text-align: left;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  overflow-wrap: anywhere;
}

.answer__option:active {
  background: var(--bg-elev-2);
}

.answer__option--selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev));
}

/* 18px keeps iOS from zooming the page when the field takes focus. */
.answer__number {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  border-radius: 14px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
}

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

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

.answer__preview {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.field__input--area {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}

/* ------------------------------ my result -------------------------------- */

.result {
  margin: 14px 0;
  padding: 16px;
  border-radius: var(--radius);
  text-align: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}

.result--won {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.result--waiting {
  border-style: dashed;
}

.result__headline {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.result--won .result__headline {
  color: var(--accent);
}

.result__sub,
.result__answer {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.result__answer {
  font-weight: 650;
  color: var(--text);
}

/* -------------------------------- history -------------------------------- */

.activity__icon {
  flex: 0 0 auto;
  margin-right: 8px;
  font-size: 1rem;
}

.activity__detail {
  display: block;
  margin-top: 1px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.activity__amount--spend {
  color: var(--text-dim);
}

/* --------------------------- admin: options ------------------------------ */

.optionrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.optionrow .field__input {
  flex: 1 1 140px;
  min-width: 0;
}

.optionrow__correct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/*
 * The radio itself is 24px, but the TAP TARGET is the 44px-tall label wrapping
 * it -- clicking a label selects its control, so the whole strip is live. The
 * control is grown anyway, because a 20px dot is hard to aim at even when the
 * miss is forgiving.
 */
.optionrow__correct input {
  width: 24px;
  height: 24px;
}

/* --------------------------- admin: review ------------------------------- */

.review {
  display: grid;
  gap: 12px;
}

.review__card {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
}

.review__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.review__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.review__what {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.review__when {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.review__photo {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 12px 0;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.review__note {
  margin: 10px 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.review__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.review__actions .btn {
  flex: 1 1 0;
}

/* ------------------------------- countdown ------------------------------- */

/* The inline variant on a challenge card is smaller than the auction one, which
   is the hero of its own screen. */
.countdown--inline {
  margin-top: 8px;
  gap: 6px;
}

.countdown--inline .countdown__value {
  font-size: 0.95rem;
}

.countdown--inline .countdown__label {
  font-size: 0.55rem;
}
