/* Creator invite page (/invite): gift and community links rendered by the `invite` Function. */
@font-face { font-family: Kim; src: url('/assets/kim.otf') format('opentype'); font-display: swap; }
:root {
  color-scheme: dark;
  --night: oklch(0.16 0.03 265);
  --ink: oklch(0.22 0.035 260);
  --ink-edge: oklch(0.42 0.05 245);
  --gold: oklch(0.86 0.13 85);
  --gold-deep: oklch(0.68 0.13 70);
  --text: oklch(0.96 0.01 250);
  --muted: oklch(0.78 0.025 250);
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--night);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, oklch(0.42 0.09 255 / 0.55), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, oklch(0.32 0.08 30 / 0.35), transparent 70%),
    repeating-linear-gradient(60deg, oklch(1 0 0 / 0.025) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-60deg, oklch(1 0 0 / 0.025) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, oklch(0.2 0.04 262), var(--night) 60%);
  overflow-x: hidden;
}
a { color: oklch(0.85 0.09 225); }
a:focus-visible, .button:focus-visible { outline: 3px solid oklch(0.92 0.08 90); outline-offset: 5px; }
h1, h2, .eyebrow, .reward-amount, .step-number { font-family: Kim, Arial, sans-serif; font-weight: normal; }

.bar { display: flex; justify-content: center; padding: 1.25rem 1rem 0; }
.logo { height: 50px; width: auto; filter: drop-shadow(0 4px 10px oklch(0 0 0 / 0.5)); }

.invite { position: relative; z-index: 1; width: min(100% - 2rem, 760px); margin: 1.5rem auto 4rem; display: grid; gap: 1.75rem; }

/* Hero: crest above the title, with a slow light behind it. */
.hero { display: grid; justify-items: center; text-align: center; gap: 1rem; }
.crest { position: relative; display: grid; place-items: center; width: 220px; height: 220px; isolation: isolate; }
.crest::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, oklch(0.86 0.13 85 / 0.16) 0 6deg, transparent 6deg 18deg),
    radial-gradient(circle, oklch(0.86 0.13 85 / 0.35), transparent 65%);
  mask: radial-gradient(circle, #000 35%, transparent 70%);
  animation: rays 40s linear infinite;
}
.crest .sigil { filter: drop-shadow(0 10px 18px oklch(0 0 0 / 0.6)); animation: rise 600ms cubic-bezier(.16, 1, .3, 1) both; }
.crest-gift img { width: 150px; height: auto; filter: drop-shadow(0 10px 18px oklch(0 0 0 / 0.6)); animation: rise 600ms cubic-bezier(.16, 1, .3, 1) both; }
.eyebrow { margin: 0; display: inline-flex; align-items: center; gap: .6rem; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; font-size: .95rem; }
.tag { padding: .1rem .55rem; border: 1px solid var(--gold-deep); border-radius: 4px; letter-spacing: .1em; }
h1 { margin: .2rem 0 0; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; text-wrap: balance; text-shadow: 0 3px 0 oklch(0.1 0.02 260), 0 0 30px oklch(0.6 0.12 250 / 0.35); }
.lead { margin: .5rem auto 0; max-width: 54ch; color: var(--muted); font-size: 1.1rem; line-height: 1.6; text-wrap: pretty; }

/* Panels share the game's ink-blue frame. */
.rewards, .step {
  border: 1px solid var(--ink-edge);
  border-radius: 10px;
  background: linear-gradient(180deg, oklch(0.26 0.04 255 / 0.92), oklch(0.19 0.03 262 / 0.95));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.07), 0 18px 40px oklch(0.05 0.02 260 / 0.55);
}
.rewards { padding: 1.4rem 1.4rem 1.1rem; }
.rewards h2 { margin: 0 0 1rem; text-align: center; color: var(--gold); font-size: 1.35rem; letter-spacing: .08em; text-transform: uppercase; }
.reward-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .9rem; }
.reward {
  --tone: oklch(0.85 0.02 250);
  position: relative;
  display: grid;
  justify-items: center;
  gap: .3rem;
  padding: 1rem .6rem .8rem;
  border: 2px solid color-mix(in oklch, var(--tone) 70%, transparent);
  border-radius: 8px;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in oklch, var(--tone) 22%, oklch(0.22 0.03 255)), oklch(0.15 0.025 260));
  box-shadow: inset 0 0 0 3px oklch(0.14 0.02 260), 0 0 18px color-mix(in oklch, var(--tone) 18%, transparent);
  text-align: center;
  animation: rise 500ms cubic-bezier(.16, 1, .3, 1) both;
}
.reward:nth-child(2) { animation-delay: 60ms; } .reward:nth-child(3) { animation-delay: 120ms; }
.reward:nth-child(4) { animation-delay: 180ms; } .reward:nth-child(n+5) { animation-delay: 240ms; }
.rarity-rare { --tone: oklch(0.6 0.14 255); }
.rarity-epic { --tone: oklch(0.58 0.17 15); }
.rarity-legendary { --tone: oklch(0.75 0.15 70); }
.rarity-gold { --tone: oklch(0.85 0.14 90); }
.reward-art { display: grid; place-items: center; width: 64px; height: 64px; }
.reward-sprite { image-rendering: pixelated; filter: drop-shadow(0 4px 4px oklch(0 0 0 / 0.5)); }
.reward-art img { width: 48px; height: auto; }
.reward-amount { position: absolute; top: .45rem; right: .55rem; padding: 0 .4rem; border: 1px solid var(--gold-deep); border-radius: 4px; background: oklch(0.14 0.02 260); color: var(--gold); font-size: .95rem; }
.reward-name { font-weight: bold; font-size: .95rem; line-height: 1.25; }
.reward-kind { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.fine { margin: 1rem 0 0; text-align: center; color: var(--muted); font-size: .85rem; }

/* Two steps: install, then launch. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.step { display: flex; gap: 1rem; padding: 1.3rem; }
.step h2 { margin: .1rem 0 .3rem; font-size: 1.3rem; }
.step p { margin: 0 0 1rem; color: var(--muted); line-height: 1.5; }
.step-number {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(0.4 0.06 255), oklch(0.2 0.03 260));
  color: var(--gold);
  font-size: 1.2rem;
}
.step:last-child { border-color: var(--gold-deep); box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.07), 0 0 0 1px oklch(0.86 0.13 85 / 0.15), 0 18px 40px oklch(0.05 0.02 260 / 0.55); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3rem;
  padding: .75rem 1.25rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 150ms ease-out, filter 150ms ease-out;
}
.button img { flex: none; }
.button:hover { filter: brightness(1.12); transform: translateY(-2px); }
.button:active { transform: translateY(2px); }
.button-primary { border: 2px solid oklch(0.9 0.13 92); background: linear-gradient(oklch(0.88 0.15 90), oklch(0.74 0.15 75)); color: oklch(0.22 0.04 60); text-transform: uppercase; letter-spacing: .03em; box-shadow: inset 0 2px oklch(0.97 0.04 95 / 0.6), 0 4px 0 oklch(0.42 0.09 65), 0 0 24px oklch(0.86 0.13 85 / 0.3); }
.button-secondary { border: 1px solid #38789c; background: linear-gradient(110deg, #1b678f, #21435d); color: oklch(0.98 0.005 240); box-shadow: 0 4px 0 #112a3a; }
.actions { margin: 0; text-align: center; }

.code-hint { margin: 0; text-align: center; color: var(--muted); }
code { padding: .1rem .45rem; border: 1px dashed var(--gold-deep); border-radius: 4px; color: var(--gold); font: 1.05em/1 Kim, monospace; letter-spacing: .08em; }

/* The three classes watch from the bottom edge. */
.party { position: fixed; inset: auto 0 0 0; z-index: 0; display: flex; justify-content: space-between; padding: 0 2vw; pointer-events: none; opacity: .28; }
.party img { width: clamp(120px, 16vw, 220px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 0 12px oklch(0 0 0 / 0.6)); }
.party img:nth-child(2) { display: none; }
.foot { position: relative; z-index: 1; margin-top: auto; display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 1.5rem 1rem; color: var(--muted); font-size: .85rem; background: oklch(0.13 0.02 265 / 0.7); }

@keyframes rays { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .crest { width: 180px; height: 180px; }
  .crest .sigil { width: 120px; height: auto; }
  .party { opacity: .16; }
}
@media (max-width: 420px) {
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { flex-direction: column; gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .crest::before, .crest .sigil, .crest-gift img, .reward { animation: none; }
  .button { transition: none; }
}
