/* Share-link page (specs/share-link.md). Colors follow the app's My Tree look (TreeColors). */
:root {
  --cocoa950: #110C0A;
  --cocoa900: #150F0D;
  --cocoa800: #2A1D17;
  --gold: #DBAC55;
  --gold-light: #F3D69B;
  --parchment: #F6EBD6;
  --parchment-dim: #CDBFA6;
  --pine: #253E35;
  --pine-light: #35594B;
  --snow: #FFF9EC;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #2A1D17 0%, var(--cocoa950) 60%) fixed, var(--cocoa950);
  color: var(--parchment);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.card {
  width: 100%;
  max-width: 440px;
  text-align: center;
  background: rgba(21, 15, 13, 0.92);
  border: 1px solid rgba(219, 172, 85, 0.3);
  border-radius: 26px;
  padding: 32px 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.25;
  margin: 18px 0 8px;
}
.sub { color: var(--parchment-dim); margin: 0 0 22px; }
/* Fallback steps: get the app, then type the code in it */
.help { margin-top: 4px; }
.help.divided { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(219, 172, 85, 0.18); }
.help-title { font-weight: 600; margin: 0 0 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--cocoa800); border: 1px solid rgba(219, 172, 85, 0.4); color: var(--gold-light); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.steps.single .num { display: none; }
.steps.single li { justify-content: center; text-align: center; }
.step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.step p { margin: 0; color: var(--parchment-dim); font-size: 14px; }
.steps.single .stores { justify-content: center; }
.step .stores { justify-content: flex-start; }
.path { color: var(--parchment) !important; font-weight: 600; }
/* Invite code box: one compact tappable row; tapping anywhere copies the code */
.code { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--cocoa800); border: 1px solid rgba(219, 172, 85, 0.4); border-radius: 14px; padding: 8px 14px; margin-top: 2px; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.code:active { transform: scale(0.99); }
.code-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.code-label { color: var(--parchment-dim); font-size: 12px; line-height: 1.3; }
.code-value { color: var(--gold-light); font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: 2.5px; font-variant-numeric: tabular-nums; }
.ico { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-done, .code.copied .ico-copy { display: none; }
.code.copied .ico-done { display: block; }
.code.copied .code-label { color: var(--gold); }
.invalid { color: #FF9A8F; margin: 0 0 20px; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
/* Official store badges (Apple and Google artwork, unchanged). Same height, never below 40px. */
.badge { display: inline-flex; justify-content: center; line-height: 0; }
.badge img { height: 52px; width: auto; display: block; }
/* Phones: the fallback badge stays small under "Continue in the app" (Apple's 40px minimum) */
.help .badge img { height: 44px; }
.help.divided .badge img { height: 40px; }
.badge:active { transform: scale(0.98); }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  font-family: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 999px;
  padding: 14px 22px;
  border: 0;
  cursor: pointer;
}
.btn.primary { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--cocoa900); }
.btn.secondary { background: var(--cocoa800); color: var(--parchment); border: 1px solid rgba(219, 172, 85, 0.4); }
.btn:active { transform: scale(0.98); }
.link { background: none; border: 0; color: var(--gold); font: inherit; font-size: 14px; cursor: pointer; padding: 4px; }
.note { color: var(--parchment-dim); font-size: 13px; margin: 0; }
.update { color: rgba(205, 191, 166, 0.7); font-size: 12px; margin: 8px 0 0; }
[hidden] { display: none !important; }
#desktop-note { margin: 0 0 16px; }

/* ------------------------------------------------------------------ web Wish (specs/web-wish.md) */
/* Quick action: Deep Pine Green (palette primary). Calm, not "danger"; same size and weight as the gold app button */
.btn.wish { background: linear-gradient(180deg, var(--pine-light), var(--pine)); color: var(--snow); border: 1px solid rgba(219, 172, 85, 0.45); box-shadow: inset 0 1px 0 rgba(255, 249, 236, 0.12); }
/* Icons sit at the same spot on every button; the label stays centred */
.btn { position: relative; padding-left: 52px; padding-right: 52px; }
.btn > .bi { position: absolute; left: 22px; top: 50%; margin-top: -10px; }
.btn:disabled { opacity: 0.7; cursor: default; }
.bi { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#desktop-note { margin: 14px 0 0; }
.card.is-done .intro { display: none; }
.card.is-done .help { margin-top: 22px; }

/* One spacing rhythm (4/8/16/24): related things 8 apart, groups 24 apart */
.wish-form { text-align: left; display: flex; flex-direction: column; gap: 0; }
.field { position: relative; }
.wish-form textarea, .wish-form input {
  width: 100%;
  background: var(--cocoa800);
  border: 1px solid rgba(219, 172, 85, 0.4);
  border-radius: 14px;
  color: var(--parchment);
  font: inherit;
  font-size: 16px; /* no zoom on iOS */
  padding: 12px 14px;
  outline: none;
}
.wish-form textarea { resize: none; min-height: 112px; padding-bottom: 26px; line-height: 1.45; }
.wish-form textarea::placeholder { color: rgba(205, 191, 166, 0.55); }
.wish-form textarea:focus, .wish-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(219, 172, 85, 0.18); }
.count { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: rgba(205, 191, 166, 0.6); font-variant-numeric: tabular-nums; }
#turnstile:empty { display: none; }
#turnstile { display: flex; justify-content: center; margin-top: 16px; }
.wish-form .btn { margin-top: 16px; }
.wish-form .link { align-self: center; margin-top: 8px; padding: 8px 12px; }

/* Done: the sealed envelope drops to the foot of the tree */
.done h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: 26px; line-height: 1.25; margin: 6px 0 6px; }
.done .sub { margin-bottom: 12px; }
.scene { position: relative; height: 212px; margin: -4px auto 4px; width: 220px; }
.scene::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 200px; height: 200px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(243, 214, 155, 0.28), rgba(243, 214, 155, 0)); }
.scene-tree { position: absolute; left: 50%; bottom: 6px; height: 200px; width: auto; transform: translateX(-50%); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45)); }
.scene-env { position: absolute; left: 50%; bottom: 0; width: 64px; height: 64px; margin-left: 18px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.animate .scene-env { animation: env-seal 1.25s cubic-bezier(0.3, 0.8, 0.35, 1) both; }
.animate .scene::before { animation: glow 1.6s ease-out 0.9s both; }
@keyframes env-seal {
  0%   { transform: translate(-60%, -150px) scale(1.6); opacity: 0; }
  22%  { transform: translate(-60%, -150px) scale(1.25); opacity: 1; }
  34%  { transform: translate(-60%, -150px) scale(1.42); }
  46%  { transform: translate(-60%, -150px) scale(1.25); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes glow { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0.7; } }
.countdown { display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px; background: rgba(219, 172, 85, 0.12); border: 1px solid rgba(219, 172, 85, 0.35); color: var(--gold-light); font-size: 13px; font-weight: 600; }
.yours { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--cocoa800); border: 1px dashed rgba(219, 172, 85, 0.45); border-radius: 18px; padding: 14px 16px; margin: 0 0 14px; }
.yours-tree { flex: none; width: 54px; height: auto; filter: grayscale(0.85) brightness(0.8); opacity: 0.6; }
.yours h3 { margin: 0 0 4px; font-size: 17px; font-family: Georgia, "Times New Roman", serif; }
.yours p { margin: 0; font-size: 14px; color: var(--parchment-dim); line-height: 1.45; }
#own-note { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .animate .scene-env, .animate .scene::before { animation: none; }
}

/* Form type scale, by importance:
   1 form title (serif 24) > 2 wish text (16) > 3 seal promise (14, gold) = error (14)
   > 4 field label (13, caps) > 5 helper under the signature (12, dim). The invite line becomes a small eyebrow. */
.form-title { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 600; line-height: 1.25; margin: 0 0 16px; color: var(--parchment); }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--parchment-dim); margin: 24px 0 8px; }
.hint { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: rgba(205, 191, 166, 0.72); }
.sealed { display: flex; align-items: flex-start; gap: 8px; margin: 24px 0 0; font-size: 14px; line-height: 1.4; color: var(--gold-light); text-align: left; }
.seal-ico { flex: none; margin-top: 1px; width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.error { margin: 16px 0 0; color: #FF9A8F; font-size: 14px; text-align: center; }
/* Signature with the dice inside the field, on the right */
.sign-row { position: relative; }
.sign-row input { padding-right: 56px; }
.dice { position: absolute; right: 6px; top: 50%; width: 42px; height: 42px; margin-top: -21px; display: flex; align-items: center; justify-content: center; background: rgba(219, 172, 85, 0.12); border: 1px solid rgba(219, 172, 85, 0.35); border-radius: 11px; color: var(--gold-light); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.dice svg { width: 24px; height: 24px; }
.dice .die { fill: none; stroke: currentColor; stroke-width: 1.7; }
.dice circle { fill: currentColor; }
.dice:hover { background: rgba(219, 172, 85, 0.2); }
.dice.roll svg { animation: roll 0.45s cubic-bezier(0.3, 0.8, 0.35, 1); }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(0.85); } 100% { transform: rotate(360deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .dice.roll svg { animation: none; } }

/* Quick Wish: drawn as the text field itself (pencil, placeholder, send arrow), so it reads as
   "type here now" rather than one more button */
.composer { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 6px; padding: 8px 8px 8px 18px; background: var(--cocoa800); border: 1px solid rgba(219, 172, 85, 0.45); border-radius: 16px; color: var(--parchment-dim); font: inherit; font-size: 16px; text-align: left; cursor: text; -webkit-tap-highlight-color: transparent; transition: border-color 0.15s, box-shadow 0.15s; }
.composer:hover, .composer:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(219, 172, 85, 0.18); outline: none; }
.composer:active { transform: scale(0.99); }
.composer > .bi { color: var(--gold); }
.composer-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-send { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--pine-light), var(--pine)); border: 1px solid rgba(219, 172, 85, 0.45); }
.composer-send svg { width: 20px; height: 20px; fill: none; stroke: var(--gold-light); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* One main task (specs/web-wish.md): heading + promise, the form, then the app path as a quiet second section */
.card.pending #app-path, .card.pending .help { display: none; }
.card.is-wish .icon { width: 64px; height: 64px; border-radius: 16px; }
.card.is-wish h1 { margin-top: 14px; }
.card.is-wish .sub { margin-bottom: 20px; }
.card.is-wish .app-path { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(219, 172, 85, 0.18); }
.card.is-wish .help.divided { margin-top: 24px; padding-top: 0; border-top: 0; }
.card.is-wish .help-title { font-size: 14px; color: var(--parchment-dim); }
.card.is-wish #desktop-note { margin: 0; font-size: 15px; font-weight: 600; color: var(--parchment); }
.card.is-wish .help:not(.divided) { margin-top: 16px; }
.app-lead { margin: 0 0 10px; font-size: 14px; color: var(--parchment-dim); }
