/* An invitation (templates/referral_join.html): the inviter's card, the
   profile's banner (static/css/profile.css) with the email form along its
   bottom; then the people they brought to Grass, their other friends, and
   what they've played most. */
:root { color-scheme: light; font-family: var(--font-sans); color: #243d3e; background: #f7f4ec; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 90% 5%, #e3eadb, transparent 55%); min-height: 100vh; }
a { color: #17656b; text-underline-offset: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #c88732; outline-offset: 4px; }

.invitation {
  --hero-ink: #fff9ec;
  --hero-gold: #f4d89f;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: calc(100% - 48px);
  max-width: 1032px;
  margin: 24px auto 64px;
  animation: arrive .6s ease-out both;
}

/* The card: who is asking on the left, the profile's banner as their share
   card draws it; creating an account on the right. */
.invitation-card {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  overflow: hidden; border: 1px solid #dce3d7; border-radius: 24px; background: #fffefb;
  box-shadow: 0 24px 70px rgba(38, 63, 51, 0.1);
}
.invitation-who { display: flex; flex-direction: column; border-radius: 0; box-shadow: none; }
.invitation-who .hero-main { flex: 1; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 24px; padding: 40px 36px 32px; }
.invitation-who .hero-avatar { width: 120px; height: 120px; }
.invitation-who .hero-name { font-size: clamp(2rem, 3.4vw, 2.9rem); }
a.hero-avatar { text-decoration: none; }
.hero-initial { font-family: var(--font-serif); font-size: 52px; font-weight: 600; line-height: 1; color: var(--hero-ink); }

.invitation-join { align-self: center; min-width: 0; padding: 44px 40px; }
.app-home-link { display: inline-flex; margin-bottom: 18px; border-radius: 14px; }
.app-icon { display: block; width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 4px 12px rgba(23, 63, 53, 0.08); }
.invitation-join h1 { margin: 0 0 8px; font-family: var(--font-serif); font-size: clamp(1.7rem, 2.8vw, 2.2rem); font-weight: 600; line-height: 1.15; color: #1f3d36; overflow-wrap: anywhere; }
#invite-signup-heading { margin: 0 0 18px; font-size: 1.05rem; font-weight: 600; color: #3c5650; }
#invite-form { display: grid; gap: 12px; }
#invite-form input { width: 100%; min-height: 52px; padding: 14px 16px; border: 1px solid #a2b6af; border-radius: 10px; background: #fff; color: #243d3e; font: inherit; }
#invite-form button, .stores a {
  min-height: 52px; padding: 14px 16px; border: 0; border-radius: 10px;
  background: #176052; color: white; font: inherit; font-weight: 700; text-align: center; text-decoration: none;
  cursor: pointer; box-shadow: 0 4px 12px rgba(23, 63, 53, 0.08); transition: background .2s, transform .2s;
}
#invite-form button:hover, .stores a:hover { background: #10483d; transform: translateY(-1px); }
#invite-form button:disabled { opacity: .65; cursor: wait; transform: none; }
#invite-status { margin: 12px 0 0; font-size: 14px; color: #a32e28; }
#invite-status:empty { display: none; }
.invitation-join p { line-height: 1.6; }
.invitation-join .small { margin-top: 14px; font-size: 13px; color: #526762; }
.invitation-join .small p, .invitation-join noscript p { margin: 0; }
#invite-download { animation: arrive .4s ease-out both; }
#invite-download h2 { margin: 0 0 10px; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: #1f3d36; }
#invite-download p { margin: 0 0 12px; }
.step-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 12px; background: #f4ecd9; color: #695025; font-size: 24px; }
.stores { display: grid; gap: 12px; margin-top: 20px; }

/* Their people: whoever they brought in first, then their other friends. */
.invitation-section { padding: 18px 20px 20px; }
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; margin: 0; padding: 0; list-style: none; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.person:hover { background: #f4f1e8; }
.person-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #e4ece6; }
.person-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.person-initial { font-size: 18px; font-weight: 700; color: var(--color-forest-main); }
.is-invited .person-avatar { width: 52px; height: 52px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hero-gold); }
.person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person-name { font-weight: 700; color: var(--color-text-primary); overflow-wrap: anywhere; }
.person-place { font-size: 0.82rem; color: var(--color-text-muted); }
.people-more summary { width: fit-content; margin-top: 6px; padding: 6px 8px; border-radius: 6px; list-style: none; font-weight: 700; color: var(--color-forest-main); cursor: pointer; }
.people-more summary::-webkit-details-marker { display: none; }
.people-more summary:hover { background: #f4f1e8; }
.people-more[open] summary { display: none; }

/* What they've played most: each kind's first five, as the profile ranks them. */
.invite-played { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.invite-played-panel { border-radius: 10px; padding: 14px 16px 16px 12px; background: color-mix(in srgb, var(--played) 7%, white); }
.invite-played-panel h3 { margin: 0 0 10px 30px; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--played); }
.invite-played-panel ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.invite-played-panel li { display: grid; grid-template-columns: 22px 72px minmax(0, 1fr); gap: 10px; align-items: center; }
.invite-played-rank { text-align: right; font-weight: 800; line-height: 1.35; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.invite-played-what { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.invite-played-what > a, .invite-played-what > span:first-child { font-weight: 700; color: var(--color-text-primary); overflow-wrap: anywhere; }
.invite-played-what > a { color: #17656b; text-decoration: underline; text-decoration-color: rgba(23, 101, 107, 0.3); text-underline-offset: 3px; }
.invite-played-what > a:hover { text-decoration-color: currentColor; }
.invite-played-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.invite-played-bar { flex: none; min-width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--played); }
.invite-played-time { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* A link that finds no one */
.invitation-missing { padding: 40px; background: #fffefb; border: 1px solid #dce3d7; border-radius: 22px; }
.invitation-missing h1 { margin: 0 0 12px; font-family: var(--font-serif); font-size: 2rem; font-weight: 500; }
.invitation-missing p { margin: 0; line-height: 1.6; }

@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 860px) {
  .invitation-who .hero-main { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 32px 28px 26px; }
  .invitation-who .hero-avatar { width: 96px; height: 96px; }
  .hero-initial { font-size: 44px; }
  .invitation-join { padding: 36px 30px; }
}
@media (max-width: 720px) {
  .invitation-card { grid-template-columns: minmax(0, 1fr); border-radius: 20px; }
  .invitation-who .hero-main { grid-template-columns: auto minmax(0, 1fr); }
  .invitation-join { padding: 28px 26px 30px; }
}
@media (max-width: 560px) {
  .invitation { width: calc(100% - 24px); margin-top: 12px; gap: 14px; }
  .invitation-who .hero-main { padding: 22px 18px 18px; gap: 14px 16px; }
  .invitation-who .hero-avatar { width: 84px; height: 84px; }
  .hero-initial { font-size: 40px; }
  .invitation-join { padding: 24px 20px 26px; }
  .app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .app-home-link { margin-bottom: 14px; }
  .invite-played { grid-template-columns: minmax(0, 1fr); }
  .invitation-section { padding: 16px; }
  .invitation-missing { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
