/* The choice of an envelope while an invitation is made (envelope-pick.js), in the Sogno soft language: the envelope lies in a
   pressed tray, and under it four rows of choices that show what they are, with no words. The chosen one sinks in and takes the teal ring. */
.ep { display: grid; gap: 18px; justify-items: center; min-width: 0; }
.ep__view { width: 100%; padding: 26px 30px 34px; border-radius: 24px; background: var(--surface); box-shadow: var(--pressed); }
/* the envelope takes its invitation's proportions; an upright one is held to the tray's height, in the middle */
.ep__view { display: grid; justify-items: center; }
.ep__view .pe { width: min(100%, calc(250px / var(--pe-shape, 0.64))); }

.ep__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 100%; }
/* twelve papers and twelve waxes: two rows of six each */
.ep__row--paper, .ep__row--wax { max-width: 340px; }
.ep__pick { position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); box-shadow: var(--raised-sm); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: box-shadow .25s var(--ease), transform .25s var(--spring); }
.ep__pick:active { transform: scale(.96); }
.ep__pick[aria-checked="true"] { box-shadow: var(--pressed); outline: 2px solid var(--teal); outline-offset: 2px; }
.ep__pick:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

/* paper: a small envelope in the paper's own colour */
.ep__pick--paper svg { width: 36px; height: 26px; overflow: visible; filter: drop-shadow(0 1.5px 1.5px rgba(40, 30, 20, .28)); }
.ep__pick--paper rect { fill: var(--c); }
.ep__pick--paper path { fill: none; stroke: rgba(30, 20, 10, .3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* grain: a patch of the paper itself, in the colour chosen above */
.ep__pick--grain::before { content: ""; width: 34px; height: 34px; border-radius: 9px; background-color: var(--ep-paper, #cfc89f); background-image: var(--g);
  background-size: 210px; background-position: 30% 40%; background-blend-mode: overlay; box-shadow: 0 1.5px 2px rgba(40, 30, 20, .3), inset 0 0 0 1px rgba(255, 255, 255, .18); }

/* wax: a drop of it, a little uneven like the real seal, with the light on its upper left */
.ep__pick--wax i { width: 30px; height: 30px; border-radius: 47% 53% 51% 49% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 42%), radial-gradient(circle at 60% 66%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .3) 100%), var(--c);
  box-shadow: 1px 2px 2.5px rgba(40, 22, 12, .4), inset 0 0 0 3px rgba(255, 255, 255, .1), inset 0 0 0 4px rgba(0, 0, 0, .1); }

/* the seal's two letters: each round is a small drop of the chosen wax, lettered in the seal's own script, so it reads as the
   seal's letters at a glance (the plain grey A and B did not say what they were for) */
.ep__row--letters { direction: ltr; gap: 10px; }
.ep__seal { flex: 1 0 100%; display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 6px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--muted, #6b7775) 25%, transparent); }
.ep__seal-name { color: var(--muted, #6b7775); font-size: .9375rem; }
.ep__letter { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--pressed);
  color: var(--ink, #111); font: 500 1.25rem/1 var(--body, inherit); text-align: center; text-transform: uppercase; caret-color: var(--teal); outline: none; }
.ep__letter:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.ep__letter::placeholder { color: var(--hint, #8a9694); opacity: 1; }

@media (max-width: 480px) {
  .ep__view { padding: 20px 20px 26px; }
  .ep__row { gap: 8px; }
  .ep__row--wax { max-width: 200px; }
  .ep__pick, .ep__letter { width: 44px; height: 44px; }
  .ep__pick { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .ep__pick { transition: none; } }
