/* /white-elephant-generator only. Loaded after styles/site.css; use its tokens (var(--ink), var(--tag), ...). Empty files are not linked. See docs/WRITERS.md. */

/* ---------- the tool ---------- */
.we-tool { margin-bottom: 28px; }
.we-tool textarea { min-height: 8rem; }
@media (max-width: 479px) { .we-tool textarea { min-height: 6.5rem; } }
.we-tool .help { margin: 0.4rem 0 0.75rem; }
.we-opts { display: grid; gap: 0 16px; align-items: end; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--rule); }
.we-opts .field { margin-bottom: 0.25rem; }
.we-opts .check { margin: 0.5rem 0 0.25rem; }
@media (min-width: 560px) {
  .we-opts { grid-template-columns: minmax(12rem, 16rem) 1fr; }
  .we-opts .check { margin-bottom: 0.9rem; }
}
.we-tool .actions { margin-top: 0.9rem; }
@media (max-width: 479px) {
  #we-draw, #we-draw-reveal { flex: 1 1 100%; }
}
#we-draw { min-height: 52px; padding: 10px 28px; }

.we-result { margin-top: 1.25rem; border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.we-result-h { font: 600 1.3rem/1.2 var(--serif); margin: 0 0 0.5rem; }
.we-result-h:focus { outline: none; }
.we-result-h:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.we-order { list-style: none; margin: 0 0 0.5rem; padding: 0; border-top: 1px solid var(--rule); }
.we-order li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.we-n {
  flex: none; min-width: 2.2rem; text-align: right;
  font: 600 1.1rem/1 var(--serif); color: var(--cran); font-variant-numeric: tabular-nums;
}
.we-who { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.we-final-turn .we-n { font: 700 0.8rem/1.3 var(--sans); letter-spacing: 0.08em; font-variant-caps: all-small-caps; }
.we-final-turn .we-who { font-weight: 400; font-style: italic; }
/* A long list goes in two columns on a wide screen. */
@media (min-width: 720px) {
  .we-order:has(li:nth-child(13)) { columns: 2; column-gap: 28px; }
}
.we-print-box { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--rule); }
.we-print-box .check { margin: 0; }

.we-numbers { margin: 0.5rem 0 1rem; max-width: 24rem; }
.we-numbers .inline input { max-width: 7rem; }
.we-numbers .help { margin: 0.4rem 0 0; }
.we-fig img { display: block; width: 100%; max-width: 720px; height: auto; border: 1px solid var(--tag-edge); border-radius: 4px; box-shadow: 0 1px 0 var(--edge); }

/* JavaScript off: the fields can't do anything, so only the notice (with the
   PDF) shows, as the draw tool does on the other tool pages. */
@media (scripting: none) {
  .we-form, .we-numbers { display: none; }
}

/* ---------- reveal one at a time: a big tag on the kraft ground ---------- */
html.we-stage-open { overflow: hidden; }
.we-stage {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
  background: var(--ground-tex) 0 0 / 240px 240px, var(--ground);
  color: var(--ground-ink);
}
.we-stage-card {
  position: relative; width: min(100%, 60rem);
  padding: 64px 20px 20px; text-align: center;
  background: var(--tag); color: var(--ink);
  border-radius: 8px; border: 1px solid var(--tag-edge);
  box-shadow: 0 1px 0 var(--edge), 0 26px 34px -26px var(--shadow);
}
/* the punched hole of the tag */
.we-stage-card::before {
  content: ""; position: absolute; top: 18px; left: 50%; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
  background: radial-gradient(circle closest-side, var(--ground) 0 40%, var(--edge) 42% 48%, var(--ring) 50% 100%);
}
.we-stage-card p { margin: 0; }
.we-stage-game {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 700; color: var(--cran); font-variant-caps: all-small-caps; letter-spacing: 0.16em; font-size: clamp(1rem, 2.4vw, 1.4rem);
}
.we-stage-game::before, .we-stage-game::after { content: ""; height: 1px; width: 2.2rem; background: var(--gold); }
.we-stage-turn { margin-top: 0.6rem !important; font: 600 clamp(1.3rem, 4vw, 2.6rem)/1.2 var(--serif); color: var(--muted); font-variant-numeric: tabular-nums; }
.we-stage-name {
  margin: 0.2rem 0 1rem !important; min-height: 1.1em;
  font: 600 clamp(2.6rem, 11vw, 7.5rem)/1.05 var(--serif); letter-spacing: -0.02em; color: var(--ink);
  overflow-wrap: anywhere; text-wrap: balance;
}
.we-stage-name.we-stage-ask { font-style: italic; font-weight: 400; color: var(--muted); font-size: clamp(2rem, 7vw, 4.5rem); }
.we-stage-sofar {
  list-style: none; margin: 0 auto 1.1rem; padding: 10px 0 0; max-width: 52rem;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px;
  border-top: 1px dashed var(--rule); font-size: clamp(0.95rem, 1.8vw, 1.2rem); color: var(--muted);
  max-height: 7.5em; overflow-y: auto;
}
.we-stage-sofar:empty { display: none; }
.we-stage-sofar .we-n { min-width: 0; font-size: 1em; }
.we-stage-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.we-stage-actions button { min-height: 56px; font-size: 1.1rem; padding: 10px 26px; }
#we-next { min-width: 12rem; }
@media (max-width: 479px) { .we-stage-actions button { flex: 1 1 8rem; } #we-next { min-width: 0; } }
.we-stage-tools { display: flex; justify-content: center; gap: 8px; margin-top: 0.5rem; }
.we-stage-keys { margin-top: 0.4rem !important; font-size: 0.85rem; color: var(--muted); }
@media (hover: none) { .we-stage-keys { display: none; } }

/* ---------- print: order sheet and slips (only from the Print buttons) ---------- */
.we-sheet { display: none; }

@media print {
  @page { margin: 0.5in; }
  body.we-print .page-head,
  body.we-print .page-body > :not(#we-sheet) { display: none !important; }
  body.we-print .we-sheet { display: block; color: #000; font-family: var(--sans); }
  body:not(.we-print) .we-sheet, body:not(.we-print) .we-stage { display: none !important; }
  body.we-print main, body.we-print .page-body { padding: 0 !important; margin: 0 !important; max-width: none; }

  .we-order-page { break-after: page; }
  .we-sheet-title { font: 600 22pt/1.2 var(--serif); margin: 0 0 2pt; }
  .we-sheet-meta { font-size: 10pt; color: #333; margin: 0 0 12pt; }
  .we-sheet-cols { display: grid; grid-template-columns: 0.55in 1fr 2.4in; gap: 8pt; font-size: 8.5pt; letter-spacing: 0.08em; text-transform: uppercase; color: #333; border-bottom: 1pt solid #000; padding-bottom: 3pt; }
  .we-sheet-list { list-style: none; margin: 0; padding: 0; }
  .we-sheet-list li { display: grid; grid-template-columns: 0.55in 1fr 2.4in; gap: 8pt; align-items: baseline; padding: 6pt 0 3pt; border-bottom: 0.5pt solid #999; font-size: 11.5pt; break-inside: avoid; }
  .we-sheet-list .we-n { text-align: right; color: #000; font: 600 12pt/1 var(--serif); min-width: 0; font-variant-numeric: lining-nums tabular-nums; }
  .we-sheet-list .we-who { font-weight: 600; }
  .we-sheet-list .we-gift { align-self: end; border-bottom: 0.5pt dotted #666; height: 1em; }
  .we-sheet-list.we-two-cols { columns: 2; column-gap: 0.35in; }
  .we-two-cols li { grid-template-columns: 0.4in 1fr 1.1in; font-size: 10pt; }
  /* two columns of rows: the header row would only fit one, and the rows read on their own */
  .we-sheet-cols:has(+ .we-two-cols) { display: none; }
  .we-two-cols { border-top: 1pt solid #000; }
  .we-sheet-list .we-final-turn .we-n { font: 700 8pt/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
  .we-sheet-list .we-final-turn .we-who { font-weight: 400; font-style: italic; }
  .we-sheet-foot { margin-top: 14pt; font-size: 10pt; color: #333; }
  .we-nowrap { white-space: nowrap; }

  .we-slip-page { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1.2in; break-after: page; border-top: 1pt dashed #777; border-left: 1pt dashed #777; }
  .we-slip-page:last-child { break-after: auto; }
  .we-slip {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-right: 1pt dashed #777; border-bottom: 1pt dashed #777; padding: 4pt; text-align: center; break-inside: avoid;
  }
  .we-slip-game { position: absolute; top: 5pt; left: 0; right: 0; font-size: 6.5pt; letter-spacing: 0.14em; text-transform: uppercase; color: #555; }
  .we-slip-n { font: 600 34pt/1 var(--serif); color: #000; font-variant-numeric: lining-nums; }
  .we-slip-n.we-turnable { text-decoration: underline; text-decoration-thickness: 2.5pt; text-underline-offset: 4pt; }
  .we-slip-name {
    margin-top: 4pt; font-size: 9pt; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; line-height: 1.15;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  }
  .we-slip-name.we-long { font-size: 7.5pt; }
}
