@import url('./rally-story.css');
/* Approved home: warm daylight, forest actions, original globe connected to a real
   source. Archivo carries the welcome; system text carries the task. Progress is
   secondary, inside Your rally. No invented impact or beneficiary imagery. */
.rally-page { color: var(--ink); }
body.home-discovery.garden-surface { --garden-mint: var(--sheet); --garden-blush: var(--sheet); --garden-ink: var(--ink); }
body.home-discovery .relief-appearance > summary { display: inline-flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font-weight: 600; }
body.home-discovery .relief-appearance > summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
body.home-discovery .relief-appearance[open] > summary::after { transform: rotate(225deg); }
body.home-discovery .relief-appearance > summary:focus-visible { outline: 3px solid var(--stamp-ink); outline-offset: 4px; }
.rally-opening { padding-block: 12px 16px; }
.rally-opening h1 { font: 850 clamp(38px, 5.6vw, 80px)/1.02 var(--body); letter-spacing: -.035em; max-width: 15ch; margin: 0 0 18px; text-wrap: balance; }
.rally-opening .lede { max-width: 48ch; }
.rally-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.rally-links a { min-height: 44px; display: inline-flex; align-items: center; }
.rally-lobby { display: grid; background: var(--sheet); }
.rally-controls { padding: 20px; }
.rally-finder, .rally-host-form { display: grid; gap: 16px; }
.rally-field { display: grid; gap: 8px; font-weight: 600; }
.rally-page :is(select,input:not([type=checkbox]),textarea) { width: 100%; min-height: 48px; color: var(--ink); background: var(--sheet); font: inherit; border: 1px solid var(--rule); padding: 10px; caret-color: var(--ink); }
.rally-remember { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 44px; }
.rally-remember input { width: 20px; height: 20px; }
.rally-page .btn { min-height: 44px; white-space: normal; }
.rally-page .btn:not(.quiet) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rally-world { min-width: 0; position: relative; }
.rally-map { height: 280px; position: relative; overflow: hidden; }
.rally-map > canvas { width: 100%; height: 100%; }
.rally-map canvas { display: block; touch-action: pan-y pinch-zoom; }
.rally-map[data-reward="orbit"]::after { content: ''; position: absolute; inset: 13% 12%; border: 2px solid #a9d4ff; border-radius: 50%; transform: rotate(-24deg); pointer-events: none; }
.rally-map[data-reward="sunrise"]::after { content: ''; position: absolute; inset: 10% 16%; border: 3px solid #ffd27d; border-radius: 50% !important; transform: rotate(-20deg); pointer-events: none; }
.rally-map[data-reward="bloom"]::after { content: ''; position: absolute; inset: 10% 16%; border: 5px dotted #b8e6a0; border-radius: 50% !important; transform: rotate(20deg); pointer-events: none; }
.rally-map[data-reward="beacon"]::after { content: ''; position: absolute; inset: 8% 14%; border: 5px double #fff3cf; border-radius: 50% !important; transform: rotate(-20deg); pointer-events: none; }
.rally-recovery { margin-block: 24px; padding: 18px; border: 1px solid var(--rule); }
.rally-recovery input { display: block; margin-block: 12px; }
.rally-recovery p { max-width: 65ch; }
.rally-world { order: -1; }
.rally-page .rally-daily h2 { font-size: 24px; }
.rally-mobile-action { margin-top: 16px; }
.rally-daily .rally-start { display: none; }
.rally-daily .rally-xp { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; margin-block: 18px 6px; font-variant-numeric: tabular-nums; }
.rally-daily progress { width: 100%; height: 8px; accent-color: var(--ink); }
.rally-daily progress::-webkit-progress-bar { background: var(--rule); }
.rally-daily progress::-webkit-progress-value { background: var(--ink); }
.rally-daily progress::-moz-progress-bar { background: var(--ink); }
.rally-action-error { border: 1px solid currentColor; padding: 12px; }
.rally-earned-badge { font-size: 12px; border: 1px solid currentColor; padding: 6px; }
.rally-mission-detail button { display: block; width: 100%; text-align: left; margin-block: 8px; }
.rally-daily summary, .rally-find-disclosure summary { display: list-item; list-style: disclosure-closed inside; }
.rally-daily details[open] > summary, .rally-find-disclosure[open] > summary { list-style-type: disclosure-open; }
.rally-daily details, .rally-find-disclosure { border-top: 1px solid var(--rule); }
.rally-reward-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 10px; }
.rally-reward-row button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.rally-task { border-top: 1px solid var(--rule); margin-block: 16px; padding-block: 16px; }
.rally-task button { margin: 8px 8px 0 0; }
.rally-invites input { font-size: 12px; margin-block: 12px; }
.rally-map .map-status { position: absolute; z-index: 2; top: auto; bottom: 36px; margin: 8px; padding: 10px; max-width: calc(100% - 40px); background: var(--sheet); color: var(--ink); }
.rally-map .map-status button { background: var(--ink); color: var(--paper); }
.rally-map-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.rally-map-caption { padding: 0 12px 12px; max-width: 70ch; }
.rally-status { min-height: 24px; margin-block: 20px; overflow-wrap: anywhere; }
.rally-results { scroll-margin-top: 90px; }
.rally-page h2 { font-size: clamp(26px, 3vw, 36px); margin: 0 0 14px; }
.rally-page h3 { font-size: 23px; margin: 10px 0; overflow-wrap: anywhere; }
.rally-page h4 { font-size: 20px; margin: 0 0 10px; overflow-wrap: anywhere; }
.rally-matches { display: grid; gap: 24px; margin-block: 20px; }
.rally-match { border-top: 2px solid var(--rule); padding-top: 18px; display: flex; flex-direction: column; align-items: start; }
.rally-match .btn { margin-top: auto; }
.rally-match p { max-width: 65ch; }
.rally-mission { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rally-reason { font-size: 14px; color: var(--muted); }
.rally-briefing { margin-block: 36px; padding: 24px; background: var(--garden-blush); scroll-margin-top: 90px; overflow-wrap: anywhere; }
.rally-briefing[hidden] { display: none; }
.rally-briefing > p { max-width: 75ch; }
.rally-briefing h3 { margin-top: 36px; }
.rally-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block: 14px; }
.rally-plan { border-top: 1px solid var(--rule); padding-block: 22px; }
.rally-plan > .btn { margin: 4px 8px 4px 0; }
.rally-plan details { margin-top: 12px; }
.rally-page summary { min-height: 44px; padding-block: 12px; font-weight: 650; cursor: pointer; }
.rally-plan textarea { display: block; margin-block: 12px; }
.rally-board { border-top: 1px solid var(--rule); margin-block: 48px; padding-top: 26px; }
.rally-follow-row { display: flex; gap: 12px; justify-content: space-between; align-items: start; padding-block: 14px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.rally-follow-row > :first-child { text-align: left; }
.rally-follow-row > :last-child { flex-shrink: 0; }
.rally-notes { border-top: 1px solid var(--rule); padding-block: 12px; }
.rally-notes > a { display: inline-flex; min-height: 44px; align-items: center; margin: 8px 18px; }
.rally-page :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--stamp-ink); outline-offset: 4px; }
.rally-page button:disabled { opacity: .65; cursor: wait; }
.rally-page button:active { transform: translateY(1px); }
.rally-page a { text-underline-offset: .2em; }
@media(min-width:900px) {
  .rally-mobile-action { display: none; }
  .rally-daily .rally-start { display: inline-flex; }
  .rally-map-tools { display: flex; flex-wrap: wrap; }
  .rally-opening h1 { max-width: none; font-size: clamp(42px, 5vw, 72px); }
  .rally-lobby { grid-template-columns: minmax(300px, .75fr) minmax(0, 1.7fr); }
  .rally-world { order: 0; }
  .rally-controls { padding: 32px; }
  .rally-map { height: 620px; }
  .rally-matches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
}

/* Phone-first density and touch behavior; retain the full desktop composition. */
@media(max-width:899px) {
  body.home-discovery { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  body.home-discovery .tabs { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); margin: 0; background: var(--sheet); border-top: 1px solid var(--rule); }
  body.home-discovery .tabs a { flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 11px; line-height: 1.2; text-align: center; }
  body.home-discovery .tabs .icon { width: 23px; height: 23px; }
  body.home-discovery .tabs a[aria-current="page"] { box-shadow: none; }
  body.home-discovery .tabs a[aria-current="page"]::before { display: block; }
  body.home-discovery main { padding: 12px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  body.home-discovery .top { padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); gap: 8px; }
  body.home-discovery :is(.lang-btn,.demo-pill) { min-height: 44px; }
  body.home-discovery .relief-appearance > summary { min-height: 44px; padding: 8px 12px; }
  .rally-opening { padding-block: 10px 14px; }
  .rally-opening h1 { font-size: clamp(30px, 8.5vw, 38px); max-width: 17ch; margin-bottom: 12px; }
  .rally-opening .lede { font-size: 16px; line-height: 1.5; margin-block: 0 12px; }
  .rally-mobile-action { margin-top: 12px; }
  .rally-mobile-action > .btn { width: 100%; min-height: 48px; justify-content: center; }
  .rally-map { height: clamp(220px, 32svh, 300px); }
  .rally-map canvas { touch-action: pan-y pinch-zoom; }
  .rally-map-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; }
  .rally-map-tools .btn { min-height: 48px; padding: 8px 4px; font-size: 13px; line-height: 1.3; }
  .rally-map-caption { font-size: 12px; line-height: 1.5; margin-block: 0; padding: 4px 12px 12px; }
  .rally-controls { padding: 16px; border-top: 1px solid var(--rule); }
  .rally-page .rally-daily h2 { font-size: 22px; }
  .rally-page :is(input:not([type=checkbox]),select,textarea) { font-size: 16px; min-height: 48px; }
  .rally-page :is(button,summary,a.btn) { touch-action: manipulation; scroll-margin-block: 88px calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); }
  .rally-page :is(input,select,textarea,[tabindex]) { scroll-margin-block: 88px calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); }
  .rally-page summary { min-height: 48px; }
  .rally-daily > .btn { width: 100%; justify-content: center; }
  .rally-reward-row { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .rally-reward-row button { min-width: 0; overflow-wrap: anywhere; text-align: left; }
  .rally-links { gap: 0 16px; font-size: 14px; }
  .rally-status { margin-block: 12px; }
  .rally-matches { gap: 20px; }
  .rally-match > .btn { width: 100%; justify-content: center; }
  .rally-briefing { margin-block: 24px; padding: 16px; }
  .rally-actions { display: grid; grid-template-columns: minmax(0,1fr); }
  .rally-actions .btn { width: 100%; justify-content: center; }
  .rally-task button, .rally-tasks > button, .rally-invites button { width: 100%; margin-inline: 0; }
  .rally-board { margin-block: 32px; }
  .rally-follow-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .rally-follow-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
}
@media(max-width:359px) {
  .rally-map-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-discovery .mark { font-size: 20px; }
}

/* Cause-led home composition. The dark map and its source form one story. */
body.home-discovery { --stamp: #2e9b72; --stamp-ink: #153f36; --stamp-wash: #e6f3eb; --muted: #52695d; --rally-soft: #e6f3eb; --rally-peach: #f5d8c7; }
body.home-discovery[data-alert-mode="dark"] { --stamp-ink: #b3eccd; --muted: #bcd6c8; --rally-soft: #244d3d; --rally-peach: #493e32; }
body.home-discovery .relief-appearance > summary { border: 0; background: transparent; font-weight: 500; }
body.home-discovery .top { border-bottom: 0; }
.rally-home-nav { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rule); }
.rally-home-nav a { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; font-size: 14px; }
.rally-home-nav .btn { border: 0; padding-inline: 0; font-size: 14px; font-weight: 500; background: transparent; }
.rally-opening { padding-block: 24px; }
.rally-opening h1 { font-family: var(--body); font-weight: 650; font-size: clamp(38px, 9.6vw, 64px); line-height: 1.05; letter-spacing: -.035em; max-width: 16ch; text-wrap: initial; margin-bottom: 16px; }
.rally-opening .lede { font-size: 17px; line-height: 1.5; max-width: 32ch; margin: 0; color: var(--muted); }
.rally-world { order: 0; background: #03141a; color: #d8fff0; }
.rally-map { height: 210px; }
.rally-map-tools { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 0 16px; }
.rally-map-tools .btn, .rally-map-options > summary { color: #d8fff0; background: transparent; border: 0; min-height: 44px; padding: 10px 0; font-size: 12px; font-weight: 450; }
.rally-map-options { text-align: right; max-width: 65%; }
.rally-map-options .btn { display: block; width: 100%; text-align: right; }
.rally-map-options p { text-align: left; padding: 12px 0; }
.rally-spotlight { padding: 24px; background: var(--rally-soft); }
.rally-spotlight h2 { font-size: 26px; line-height: 1.14; letter-spacing: -.025em; margin: 0 0 10px; font-weight: 650; }
.rally-source { font-size: 13px; margin: 0 0 14px; color: var(--muted); }
.rally-spotlight-note { font-size: 15px; line-height: 1.5; margin: 0 0 20px; max-width: 42ch; }
.rally-spotlight > .btn { width: 100%; min-height: 48px; justify-content: center; }
.rally-discover-more { padding-block: 16px; }
.rally-mobile-action { display: none; }
.rally-find-disclosure { border: 0; }
.rally-find-disclosure > summary { font-weight: 500; font-size: 15px; }
.rally-finder { padding: 16px 0; }
.rally-daily-invitation { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--rally-peach); font-size: 14px; }
.rally-daily-invitation .btn { border: 0; padding: 8px 0; font-size: 14px; text-align: right; background: transparent; }
.rally-personal { margin-block: 16px 24px; }
.rally-personal > summary { font-size: 18px; }
.rally-personal .rally-daily { padding-block: 24px; max-width: 640px; }
.rally-personal .rally-start { display: none; }
.rally-personal .rally-board { margin-top: 20px; }
.rally-status:empty { display: none; }
.rally-links { margin-block: 20px; }
.rally-page .btn.quiet { box-shadow: none; }
.rally-page .btn:hover:not(:disabled) { filter: brightness(.94); }
@media(min-width:900px) {
  .rally-opening { padding-block: 36px; }
  .rally-opening h1 { max-width: none; }
  .rally-opening .lede { max-width: 48ch; }
  .rally-lobby { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
  .rally-map { height: 460px; }
  .rally-spotlight { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
  .rally-spotlight h2 { font-size: 36px; }
  .rally-spotlight > .btn { width: auto; align-self: start; }
}
