/* Home refresh layer, loaded after styles-base.css (the full design system).
   Both are <link>ed in index.html (no @import: it delays paint and the offline cache needs both). */

/* The home should feel like opening a game, not a dashboard. Keep the existing
   components and behaviour, but give the first screen a much clearer hierarchy. */
#screen-hub { gap: 20px; }

/* 1. A warmer opening line. The heading wraps to two lines on small phones instead of
   pushing the countdown off screen; the countdown stacks into a small column on the right. */
#screen-hub > .hub-head { align-items: center; margin-top: 2px; }
#screen-hub > .hub-head h2 { flex: 1 1 auto; min-width: 0; white-space: normal; gap: 10px; }
/* One line, always: the title shrinks to fit the space beside the cat and the countdown
   (app.js fitHubTitle sets --title-size for each phone width and theme). */
#screen-hub > .hub-head .hub-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--title-size, 26px);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#screen-hub > .hub-head .mascot-mini { flex: none; }
#screen-hub > .hub-head > .meta {
  flex: none; font-size: 11.5px; opacity: .72; padding-bottom: 2px;
  white-space: normal; text-align: right; line-height: 1.25; max-width: 5.8em;
}
#screen-hub > .hub-head > .meta b { white-space: nowrap; }

/* 2. Today's game is the main event. More breathing room, larger prompt, one obvious tap target. */
#screen-hub #hero-card {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  padding: 22px 22px 20px;
  b
  box-shadow: 0 1px 0 rgb(20 20 19 / .06), 0 14px 38px rgb(20 20 19 / .07);
  transform: translateZ(0);
}
#screen-hub #hero-card::before {
  content: "TODAY";
  position: absolute;
  right: 20px;
  bottom: 19px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  opacity: .38;
}
#screen-hub #hero-card::after {
  content: "PLAY  →";
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: var(--block-ink);
  color: #FAFAF7;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .01em;
  line-height: 1;
}
#screen-hub #hero-card .hero-top { margin-bottom: 20px; }
#screen-hub #hero-card .hero-kicker { font-size: 13px; font-weight: 700; }
#screen-hub #hero-card .hero-prompt {
  max-width: 95%;
  font-size: clamp(31px, 8.6vw, 39px);
  line-height: 1.02;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
#screen-hub #hero-card .muted { margin-top: 13px; max-width: 82%; font-size: 13px; }
/* One button on the big card: the PLAY pill at the bottom. The old top-right pill is hidden. */
#screen-hub #hero-card .hero-status { display: none; }
#screen-hub #hero-card.all-done::after { content: "SEE VERDICT  →"; }
html[data-theme="retro"] #screen-hub #hero-card::after { border-radius: 3px; }
#screen-hub #hero-card:active { transform: scale(.985); }

/* 3. Live community content comes directly after today's game. */
#screen-hub > #rant-box { margin-top: 10px; } /* a breath after the game rows */
#screen-hub .rant-strip { padding-top: 2px; }
#screen-hub .rs-head { margin-bottom: 10px; }
#screen-hub .rs-head .hub-label { font-size: 15px; font-weight: 740; }
#screen-hub .rs-tag { opacity: 1; }
#screen-hub .rs-card { transition: transform .16s var(--ease), opacity .16s ease; }
#screen-hub .rs-card:active { transform: scale(.97); }

/* 4. Friends (people + group games, one row): under today's remaining games while any are left,
   then right under Ranting now (app.js placeFriends moves it in the page, so reading order follows). */
#screen-hub > #friends-label { margin-top: 4px; margin-bottom: -10px; }
#screen-hub > #pals-row {
 
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-card);
}
#screen-hub > #pals-row .row-icon { background: var(--b-lilac); color: var(--block-ink); }
#screen-hub > #pals-row .row-name { font-size: 17px; font-weight: 760; }
#screen-hub > #pals-row .row-sub { max-width: 245px; }
#screen-hub > #pals-row .row-go { color: var(--accent); font-weight: 720; }
#screen-hub > #pals-row:active { transform: scale(.985); }

/* 5. The other daily games. */
#screen-hub > #progress-box { margin-top: 8px; }
#screen-hub > #progress-box #progress-title { font-size: 15px; font-weight: 740; white-space: nowrap; }
#screen-hub .game-list .tile.row { min-height: 68px; }

/* Completion is useful, but it should read like a quiet recap rather than a task list. */
#screen-hub > #done-box { opacity: .88; }
#screen-hub > #done-box > .hub-label { color: var(--ink-2); }

/* Permission prompts and notifications are contextual utilities, so they no longer interrupt
   the core Home sequence. They remain fully functional lower on the page. */
#screen-hub > #note-box { background: transparent; border: 1px solid var(--line); }

/* The profile chip should read as identity first. Credits remain available inside it without
   visually competing with the daily game. */
.top .credits-pill { min-width: 36px; }
.top .credits-pill.has-avatar #credits-text,
.top .credits-pill.has-avatar .coin { display: none; }
.top .credits-pill.has-avatar { padding-inline: 4px; background: transparent; }
.top .credits-pill.has-avatar .me-avatar { width: 32px; height: 32px; }

@media (max-width: 370px) {
  #screen-hub #hero-card { min-height: 226px; padding: 20px; }
  #screen-hub #hero-card .hero-prompt { font-size: 30px; }
  #screen-hub > #friends-label::after { content: ""; }
  #screen-hub > #progress-box #progress-title, #screen-hub .rs-head .hub-label { font-size: 13px; }
}

@media (prefers-color-scheme: dark) {
  #screen-hub #hero-card { box-shadow: 0 16px 42px rgb(0 0 0 / .22); }
}

@media (prefers-reduced-motion: reduce) {
  #screen-hub .rs-card,
  #screen-hub > #pals-row,
  #screen-hub #hero-card { transition: none; }
}

/* Accessibility pass (ui-ux-pro-max checklist): every tap target at least 44px, small text at
   least 4.5:1 contrast, nothing pushed off screen with large text. Looks the same as before. */
#screen-hub .mascot-mini { width: 44px; height: 44px; padding: 4px; margin: -4px; box-sizing: border-box; }
.top .credits-pill.has-avatar { min-height: 44px; min-width: 44px; justify-content: center; }
#screen-hub .rs-all { min-height: 44px; padding-left: 12px; flex: none; }
#screen-hub > .hub-head > .meta { opacity: 1; color: var(--ink-2); font-size: 12px; }
#screen-hub #hero-card::before { opacity: 1; color: var(--block-ink-2); font-size: 11px; }
/* Large text: the heading wraps under itself instead of shoving "All" off the screen. */
#screen-hub .rs-head { flex-wrap: nowrap; }
#screen-hub .rs-head .hub-label { white-space: normal; flex-wrap: wrap; row-gap: 2px; min-width: 0; }
#screen-hub .rs-tag { white-space: nowrap; }
@media (max-width: 340px) { #screen-hub .rs-tag::before { content: ""; } }
.wordmark a { min-height: 44px; display: inline-flex; align-items: center; }

/* Game rows show today's question (two lines at most) instead of a cut-off tagline. */
#screen-hub .game-list .tile.row .tile-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-weight: 520; }
/* Rant card labels at the 12px minimum. */
#screen-hub .rs-meta { font-size: 12px; letter-spacing: .01em; }

/* Small phones: a smaller cat and countdown leave room for the one-line title. */
@media (max-width: 359px) {
  #screen-hub > .hub-head { gap: 8px; }
  #screen-hub > .hub-head h2 { gap: 6px; }
  #screen-hub .hub-head .mascot-mini { width: 36px; height: 36px; padding: 2px; margin: 0; }
  #screen-hub > .hub-head > .meta { font-size: 11px; }
}
