/* Screen layouts. Content that sits directly on the world scene uses paper-colored text;
   everything else lives on paper cards. */

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); max-width: 1120px; margin: 0 auto; }
.topbar__end { display: flex; align-items: center; gap: var(--s-2); }
.topbar .btn--icon { margin-bottom: 0; }

/* ---------- Home ---------- */
.home {
  max-width: 1120px; margin: 0 auto;
  min-height: calc(100% - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-6); padding: var(--s-6) 0 var(--s-4);
}
.home__hero { text-align: center; color: var(--n-paper); }
.logo {
  font-size: clamp(3rem, 13vw, var(--fs-72)); letter-spacing: -.03em; line-height: .95;
  color: var(--n-paper);
  text-shadow: 0 4px 0 color-mix(in srgb, var(--n-ink) 35%, transparent);
}
.logo span { color: var(--c-sun); }
.tagline { margin-top: var(--s-3); font-size: var(--fs-18); color: color-mix(in srgb, var(--n-paper) 88%, transparent); max-width: 30ch; margin-inline: auto; }
.home__actions { width: 100%; max-width: var(--col); display: flex; flex-direction: column; gap: var(--s-3); }
.world-note, .meta-line { text-align: center; font-size: var(--fs-14); color: color-mix(in srgb, var(--n-paper) 85%, transparent); }
.home__actions .btn--primary { margin-top: var(--s-3); }
.home__actions .action-list { margin-top: var(--s-5); }

@media (min-width: 960px) {
  .home {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: var(--s-8); padding: 0 var(--s-6);
  }
  .home__hero { flex: 1; text-align: left; max-width: 520px; }
  .logo { font-size: clamp(var(--fs-72), 7vw, 6.5rem); }
  .tagline { margin-inline: 0; font-size: var(--fs-20); }
  .home__actions { flex: none; }
}
@media (min-width: 960px) and (max-height: 780px) {
  .home__actions .action-list { margin-top: var(--s-4); }
  .list-btn { min-height: 58px; }
}

/* ---------- Generic pages ---------- */
.page { max-width: var(--page); margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-5); }
.page--wide { max-width: var(--page-wide); }
.page__head { display: flex; align-items: center; gap: var(--s-3); color: var(--n-paper); }
.page__head h2 { flex: 1; color: var(--n-paper); }
.page__head .btn--icon { margin-bottom: 0; }
.page__intro, .page__note { color: color-mix(in srgb, var(--n-paper) 88%, transparent); }
.page__note { text-align: center; font-size: var(--fs-14); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.filters #rPeriod { flex: 2 1 300px; }
.filters #rWorld { flex: 1 1 200px; }

/* ---------- Result ---------- */
.result { width: min(100%, 440px); display: flex; flex-direction: column; gap: var(--s-4); animation: pop-in var(--t-slow) var(--ease-pop); }
.result__head { background: var(--n-paper) var(--grain); border-radius: var(--r-lg); box-shadow: var(--sh-float); padding: var(--s-6) var(--s-5) var(--s-5); text-align: center; }
.eyebrow { font-size: var(--fs-12); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.result__score { font: 800 clamp(3.5rem, 16vw, 5rem)/1 var(--f-display); letter-spacing: -.03em; margin-top: var(--s-2); animation: score-pop 420ms var(--ease-pop) both; }
@keyframes score-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.result__best { color: var(--ink-soft); margin-top: var(--s-1); }
.badge { display: inline-block; margin-bottom: var(--s-2); padding: 5px 12px; border-radius: var(--r-pill); background: var(--c-sun); color: var(--n-ink); font: 700 var(--fs-12)/1.2 var(--f-body); letter-spacing: .1em; text-transform: uppercase; animation: pop-in var(--t-slow) var(--ease-pop) .2s both; }
.rankline {
  display: inline-flex; align-items: center; gap: var(--s-1); margin-top: var(--s-4);
  min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  background: var(--paper-2); font-weight: 700; color: var(--n-ink);
  transition: background-color var(--t-fast);
}
.rankline:hover { background: var(--c-sand); }
.rankline .i { width: 18px; height: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); text-align: center; background: var(--n-paper) var(--grain); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: var(--s-4) var(--s-3); }
.stat-row b { font-size: var(--fs-20); }
.rewards { list-style: none; margin: 0; padding: var(--s-4) var(--s-5); background: var(--n-paper) var(--grain); border-radius: var(--r-lg); box-shadow: var(--sh-card); display: flex; flex-direction: column; gap: var(--s-2); }
.rewards li { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; animation: screen-in var(--t-slow) var(--ease-out) both; }
.rewards li:nth-child(2) { animation-delay: 60ms; } .rewards li:nth-child(3) { animation-delay: 120ms; } .rewards li:nth-child(4) { animation-delay: 180ms; }
.rewards .glow-dot { width: 14px; height: 14px; }
.rewards .muted { font-weight: 400; color: var(--ink-soft); font-size: var(--fs-14); }
.rewards .tag { flex: none; font-size: var(--fs-12); padding: 2px 8px; border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-soft); }
.result__actions { display: flex; flex-direction: column; gap: var(--s-3); }
.result__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

/* ---------- Pilot modal extras ---------- */
.restore { text-align: left; border-top: 1px solid var(--ink-faint); padding-top: var(--s-3); }
.restore summary { cursor: pointer; font-weight: 700; color: var(--c-sea); min-height: var(--tap); display: flex; align-items: center; list-style: none; }
.restore summary::-webkit-details-marker { display: none; }
.restore summary::after { content: "+"; margin-left: auto; font-size: var(--fs-20); }
.restore[open] summary::after { content: "–"; }
.restore[open] { display: flex; flex-direction: column; gap: var(--s-3); }

@media (max-width: 420px) {
  h2 { font-size: var(--fs-24); }
  .card { padding: var(--s-4); }
  .stat-row b { font-size: var(--fs-18); }
  .trow { grid-template-columns: 40px minmax(0,1fr) 52px 80px; gap: var(--s-2); }
}
@media (max-height: 820px) {
  .result { gap: var(--s-3); }
  .result__head { padding: var(--s-5) var(--s-5) var(--s-4); }
  .result__score { font-size: 3.5rem; }
  .rankline { margin-top: var(--s-3); }
  .rewards { padding: var(--s-3) var(--s-5); gap: var(--s-1); }
  .stat-row { padding: var(--s-3); }
  .result .btn--xl { min-height: 56px; }
}

/* Phones in landscape: two zones so the primary action is visible without scrolling */
@media (max-height: 540px) and (orientation: landscape) {
  .home { flex-direction: row; align-items: center; justify-content: center; gap: var(--s-6); padding: var(--s-2) 0; min-height: calc(100% - 52px); }
  .home__hero { flex: 1; max-width: 300px; text-align: left; }
  .logo { font-size: var(--fs-48); }
  .tagline { font-size: var(--fs-14); margin-inline: 0; }
  .home__actions { gap: var(--s-2); max-width: 380px; }
  .world-note, .meta-line { display: none; }
  .home__actions .btn--primary { margin-top: var(--s-1); min-height: 52px; }
  .home__actions .action-list { margin-top: var(--s-2); gap: 6px; }
  .list-btn { min-height: 48px; padding-block: 4px; }
  .list-btn__icon { width: 36px; height: 36px; }
  .list-btn__text small { display: none; }
}
