/* 一飛沖天: the result card, the share sheet and the 紀念駕照, laid out as the sister games lay them out. Written against
   the series tokens in style.css :root (--ink --accent --accent-dark --accent-soft --paper --muted --line --good --bad
   --mono --ease-out); each has the series value as a fallback. 390 × 844 first; tap targets 44 px or more. */

/* ---- the result card (app.js showResult): the kicker, the stamp, the title, what adds something, the buttons ---- */
.result-card { text-align: center; }
.result-card h2 { margin: 2px 0 6px; padding-right: 0; }
.stamp {
  position: static; width: 110px; height: 110px; margin: 6px auto 4px; padding: 0; border-radius: 50%;
  border: 6px solid var(--good, #2f8f4e); color: var(--good, #2f8f4e); background: transparent;
  display: grid; place-items: center; font-size: 30px; font-weight: 900; letter-spacing: 0; line-height: 1;
  transform: rotate(-12deg); animation: result-stamp 0.4s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)) both;
}
.stamp[data-stamp="fail"] { border-color: var(--bad, #d4402b); color: var(--bad, #d4402b); font-size: 26px; }
@keyframes result-stamp {
  from { transform: rotate(-12deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-12deg) scale(1); opacity: 1; }
}
.result-reason { margin: 0 0 6px; font-weight: 700; }
.result-quip {
  margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft, #eef6c8);
  font-size: 15px; font-weight: 700;
}
.result-facts, .result-exam { list-style: none; margin: 8px 0; padding: 0; text-align: left; font-size: 13px; }
.result-facts li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line, rgba(29, 42, 42, 0.14)); }
.fact-text { flex: 1; min-width: 0; font-weight: 700; }
.fact-tag {
  flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.4;
  background: rgba(29, 42, 42, 0.08); color: var(--muted, #556464);
}
.result-facts li[data-tag="official"] .fact-tag { background: var(--ink, #1d2a2a); color: var(--accent, #c6e03a); }
.fact-what { flex: none; min-width: 4em; text-align: right; font-weight: 800; color: var(--accent-dark, #4d5c00); }
.result-facts li[data-state="fail"] .fact-what { color: var(--bad, #d4402b); }
.result-exam li {
  display: grid; grid-template-columns: 1fr auto 4.2em; align-items: center; gap: 10px; padding: 6px 0;
  border-top: 1px solid var(--line, rgba(29, 42, 42, 0.14));
}
.exam-name { font-weight: 700; }
.exam-state { font-weight: 800; }
.result-exam li[data-state="pass"] .exam-state { color: var(--good, #2f8f4e); }
.result-exam li[data-state="fail"] .exam-state { color: var(--bad, #d4402b); }
.result-exam li[data-state="none"] { color: var(--muted, #556464); }
.exam-time { text-align: right; font: 700 17px/1.2 var(--mono, 'Barlow Condensed', ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.result-exam .exam-total { border-top: 2px solid var(--ink, #1d2a2a); }
.result-exam .exam-total .exam-name { font-weight: 900; }
.result-challenge {
  margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--ink, #1d2a2a); color: var(--paper, #f5f6ef);
  font-size: 14px; font-weight: 800;
}
/* what to try next time (advice.js adviceFor), and the 精準時刻 badges earned on top of a pass (badges.js) */
.result-advice { list-style: none; margin: 8px 0; padding: 0; text-align: left; font-size: 13px; }
.result-advice li { margin: 4px 0; padding: 4px 0 4px 10px; border-left: 3px solid var(--accent-dark, #4d5c00); font-weight: 700; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0; padding: 0; }
.badges li { padding: 5px 11px; border-radius: 999px; background: var(--ink, #1d2a2a); color: var(--accent, #c6e03a); font-size: 12.5px; font-weight: 800; }
.result-meta { margin: 6px 0; color: var(--muted, #556464); font-size: 12.5px; }
.result-legend { margin: 6px 0 0; color: var(--muted, #556464); font-size: 11.5px; line-height: 1.6; text-align: left; }
.result-legend a { color: inherit; font-weight: 800; }
.result-actions { display: grid; gap: 8px; margin-top: 10px; }
.result-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-actions .row > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.result-actions button { min-height: 44px; }
.result-actions .text-button { justify-self: start; }

/* ---- the share sheet (reel.js), as the sisters': 分享, the words in 「」, 貼文 4:5 · 限動 9:16 · 名場面影片 · 複製連結,
   the preview of what is chosen, the text options, Threads and LINE, 關閉 ---- */
dialog.sheet.reel { width: min(calc(100% - 24px), 440px); overscroll-behavior: contain; }
.reel-quote {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft, #eef6c8);
  font-size: 15px; font-weight: 700; text-align: center;
}
.reel-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reel-format { min-height: 44px; }
.reel-format[aria-pressed="true"] { border-color: var(--ink, #1d2a2a); box-shadow: inset 0 0 0 1px var(--ink, #1d2a2a); background: var(--accent-soft, #eef6c8); }
.reel-formats:has(> [hidden]) > .reel-format:last-child { grid-column: 1 / -1; }
.reel-stage {
  position: relative; height: min(40svh, 400px); max-width: 100%; aspect-ratio: 4 / 5; margin: 12px auto 0; border-radius: 10px;
  overflow: hidden; background: var(--ink, #1d2a2a); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.reel-stage[data-format="story"], .reel-stage[data-format="video"] { aspect-ratio: 9 / 16; }
.reel-photo, .reel-video, .reel-live {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--ink, #1d2a2a);
}
.reel-video { cursor: pointer; }
.reel-sound {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 50%; background: rgba(29, 42, 42, 0.72); color: #fff;
}
.reel-sound[aria-pressed="true"] { background: var(--accent, #c6e03a); color: var(--ink, #1d2a2a); }
.reel-wait { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px 14px; background: linear-gradient(transparent, rgba(29, 42, 42, 0.82)); }
.reel-progress {
  display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.22);
  -webkit-appearance: none; appearance: none; accent-color: var(--accent, #c6e03a);
}
.reel-progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.22); }
.reel-progress::-webkit-progress-value { background: var(--accent, #c6e03a); }
.reel-progress::-moz-progress-bar { background: var(--accent, #c6e03a); }
.reel-status { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted, #556464); text-align: center; }
.reel-status:empty { display: none; }
.reel-captions { display: grid; gap: 4px; min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.reel-captions legend { margin-bottom: 4px; padding: 0; font-size: 12.5px; font-weight: 800; color: var(--muted, #556464); }
.reel-caption {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line, rgba(29, 42, 42, 0.14)); background: #fff; font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer;
}
.reel-caption:has(input:checked) { border-color: var(--accent-dark, #4d5c00); background: var(--accent-soft, #eef6c8); }
.reel-caption input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-dark, #4d5c00); }
.reel-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.reel-link.secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; color: var(--ink, #1d2a2a); }
.reel-more { display: flex; justify-content: center; }
.reel-more .text-button { min-height: 44px; }
.reel-copy {
  display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line, rgba(29, 42, 42, 0.14)); background: #fff; font: inherit; font-size: 16px; line-height: 1.4; resize: none;
}
.reel .sheet-actions { margin-top: 8px; }
.reel .sheet-actions .text-button { min-height: 44px; justify-self: center; }
.reel-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* ---- the 紀念駕照 sheet (license-card.js licenseSheet): the card, 駕照上的名字, the note, 分享駕照 and 關閉; in an app's
   own browser the card can turn into a picture (.license-image) to keep with a long press ---- */
.license-body { display: grid; gap: 10px; justify-items: center; }
.license-canvas, .license-image {
  display: block; width: 100%; max-width: 440px; height: auto; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(29, 42, 42, 0.2);
}
.license-body label { justify-self: start; margin-top: 2px; font-size: 14px; font-weight: 800; }
.license-body input {
  display: block; width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line, rgba(29, 42, 42, 0.14)); background: #fff; color: var(--ink, #1d2a2a);
  font: inherit; font-size: 16px; font-weight: 700;
}
.license-body input:focus-visible { outline: 3px solid var(--accent, #c6e03a); outline-offset: 1px; border-color: var(--ink, #1d2a2a); }
.license-note { justify-self: start; margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted, #556464); }
.license-empty { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink, #1d2a2a); }
#license .sheet-actions button { min-height: 44px; }
#license .sheet-actions .text-button { justify-self: center; }

/* the instant replay's stamp after 看重播 on a pass (app.js instantReplay sets data-verdict) */
.instant[data-verdict="pass"] .instant-stamp,
.instant[data-verdict="pass"] .stamp { border-color: var(--good, #2f8f4e); color: var(--good, #2f8f4e); }

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
}
