/*
 * Phase 8Q.4-H -- Golden Tickets: the Home card, the details, the earned
 * splash and the Admin dry-run report.
 *
 * Only tokens app.css defines (--bg-elev, --bg-elev-2, --line, --line-soft,
 * --accent, --accent-dim, --warn, --danger, --text, --text-dim, --text-faint,
 * --radius, --radius-sm, --tap): an undefined custom property fails silently
 * into a default colour (Phase 8B shipped four). --warn is the gold.
 *
 * Nothing has a fixed width: at 320 px with the largest system font the card
 * wraps rather than scrolling sideways, and the three prize images share the
 * row. The whole Home card is ONE link (directive 67) -- the CTA inside it is a
 * span styled as a button, never a second control -- and the HOW IT WORKS
 * button sits outside it. Linked before phase8k.css, which stays LAST.
 */

/* ---- the Home card --------------------------------------------------------- */

.gt-home {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 0;
  min-height: var(--tap);
  padding: 18px 16px 16px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev) 100%);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.gt-home:focus-visible {
  outline: 3px solid var(--warn);
  outline-offset: 2px;
}

/* ---- the gold ticket (follow-up): one SVG everywhere, sized by class ------- */

.gt-icon {
  display: inline-block;
  flex: none;
  height: auto;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(255, 196, 40, 0.35));
}
.gt-icon--sm { width: 26px; }
.gt-icon--md { width: 42px; }
.gt-icon--lg { width: 64px; }
.gt-icon--xl { width: clamp(88px, 22vw, 140px); }

.gt-home__icon { justify-self: center; }

/* ---- teaser OFF: the compact counter -------------------------------------- */

.gt-mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.gt-mini__link {
  display: flex;
  flex: 1 1 12rem;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}
.gt-mini__link:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; border-radius: var(--radius-sm); }
.gt-mini__count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; }
.gt-mini__n { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--warn); }
.gt-mini__word { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; color: var(--warn); overflow-wrap: anywhere; }
.gt-mini__help { display: flex; flex: 0 1 auto; justify-content: flex-end; }

.gt-home__count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 8px;
  margin: 0;
}

.gt-home__n {
  font-size: clamp(2rem, 11vw, 2.8rem);
  font-weight: 800;
  line-height: 1;
  color: var(--warn);
}

.gt-home__word {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--warn);
}

.gt-home__title {
  margin: 4px 0 0;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.gt-home__sub,
.gt-home__tease {
  margin: 0;
  color: var(--text-dim);
}

.gt-home__tease {
  font-weight: 700;
  letter-spacing: 0.1em;
}

.gt-home__prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.gt-home__prize {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/*
 * THE CTA (follow-up). A span inside the one link: as an INLINE element it
 * ignored .btn's 44px min-height, so the label floated in a short, narrow pill.
 * Now a deliberate block-level button: centred, one height, full width up to a
 * comfortable maximum, label centred on both axes.
 */
.gt-home__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  box-sizing: border-box;
  width: min(100%, 20rem);
  min-height: 48px;
  margin-top: 10px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  pointer-events: none;
}
.gt-home__prizes--n1 { grid-template-columns: minmax(0, 160px); justify-content: center; }
.gt-details__count { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.gt-home__help {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

/* ---- the rules list (Home rules card, details) ---------------------------- */

.gt-rules {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gt-rules__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.gt-rules__n {
  font-weight: 800;
  color: var(--warn);
}

.gt-rules__note {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.gt-howto__lead {
  font-weight: 700;
}

.gt-howto__h,
.gt-details__h {
  margin: 14px 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.gt-howto__mine {
  font-weight: 700;
  color: var(--warn);
}

/* ---- the details ------------------------------------------------------------ */

.gt-details {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.gt-details__head {
  text-align: center;
}

.gt-details__count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 8px;
  margin: 0;
}

.gt-details__n {
  font-size: clamp(2.2rem, 12vw, 3rem);
  font-weight: 800;
  color: var(--warn);
}

.gt-details__word {
  font-weight: 800;
  color: var(--warn);
}

.gt-details__earned,
.gt-details__alloc,
.gt-details__note {
  margin: 0;
  color: var(--text-dim);
}

.gt-history {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gt-history__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.gt-history__n {
  font-weight: 800;
  color: var(--warn);
}

.gt-history__n--minus {
  color: var(--danger);
}

.gt-history__when {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.gt-history__more {
  justify-self: center;
  min-height: var(--tap);
}

/* ---- the earned splash --------------------------------------------------------- */

.gt-splash {
  border-top: 4px solid var(--warn);
}

.gt-earned {
  display: grid;
  gap: 6px;
  padding: 6px 2px 2px;
  text-align: center;
  overflow-wrap: anywhere;
}

.gt-earned p {
  margin: 0;
}

.gt-earned__icon { display: block; margin: 0 auto; }

.gt-earned__title {
  font-size: clamp(1.3rem, 7vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--warn);
}

.gt-earned__what {
  font-weight: 600;
}

.gt-earned__amount {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--warn);
}

.gt-earned__list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-dim);
}

.gt-earned__total {
  color: var(--text-dim);
}

@media (prefers-reduced-motion: no-preference) {
  .gt-earned__icon {
    animation: gt-pop 420ms ease-out both;
  }
  @keyframes gt-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* ---- Admin ----------------------------------------------------------------------- */

.gt-admin__rules,
.gt-admin__events {
  margin: 4px 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
}

.gt-admin__player summary {
  min-height: var(--tap);
  padding: 10px 0;
  cursor: pointer;
}

.gt-admin__excluded {
  color: var(--text-faint);
}

.ac__golden-tickets input,
.ac__golden-tickets select {
  font-size: 16px;
  max-width: 100%;
}

.gt-howto__icon { display: block; margin: 0 auto 6px; }
