/* Peel it open — the gift (gifts/peel-it-open) and the idea (ideas/peel-cards). See js/peel.js. */
:root { --cw: 420px; --ink: #2b2523; --ink-2: #6d6863; --paper: #f6f4f0; --ease: cubic-bezier(0.22, 0.68, 0.16, 1); }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper); color: var(--ink-2);
  font-family: "Patrick Hand", "Gochi Hand", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.home { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); z-index: 5;
  font-family: system-ui, sans-serif; font-size: 0.86rem; color: var(--ink-2); text-decoration: none; }
.home:hover { color: var(--ink); }

.pc { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(22px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
body:has(.home) .pc { padding-top: 52px; }

/* the card */
.card {
  width: var(--cw); aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; position: relative;
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.08), 0 14px 34px rgba(60, 40, 20, 0.16), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  transition: transform 0.52s var(--ease), opacity 0.4s var(--ease);
}
.card canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.card canvas:focus-visible { box-shadow: inset 0 0 0 3px rgba(43, 37, 35, 0.4); }
.card.is-leaving { transform: translate(-34%, -118%) rotate(-14deg); transition: transform 0.42s cubic-bezier(0.5, 0, 0.75, 0.3), opacity 0.42s; opacity: 0; }
.card.is-coming { transform: translateY(115%) rotate(7deg); transition: none; opacity: 1; }

/* what to do, and two ways on */
.hint { margin: 20px 0 6px; font-size: 21px; line-height: 1.2; text-align: center; min-height: 1.2em; max-width: 92vw; }
.hint.is-nudge { animation: nudge 0.5s var(--ease); }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.acts { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 46px; }
.fresh { background: #1d1b1a; color: #fbf9f5; border: 0; border-radius: 999px; padding: 7px 24px 8px; font-size: 19px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16); transition: transform 0.2s var(--ease); }
.fresh:hover { transform: translateY(-1px); }
.auto { background: none; border: 0; padding: 6px 2px; font-size: 19px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.auto:hover { color: var(--ink); }

/* the fruit to pick, and the sound */
.tray { margin-top: 16px; display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 8px 22px rgba(60, 40, 20, 0.08); }
.fruits { display: flex; gap: 6px; }
.tray .fr { width: 50px; height: 60px; padding: 4px 5px; border: 0; border-radius: 11px; background: none; transition: background 0.2s, transform 0.2s var(--ease); }
.tray .fr canvas { display: block; width: 40px; height: 52px; border-radius: 5px; box-shadow: 0 2px 5px rgba(60, 40, 20, 0.16); transform: rotate(-3deg); transition: transform 0.25s var(--ease); }
.tray .fr:nth-child(even) canvas { transform: rotate(3deg); }
.tray .fr[aria-pressed="true"] { background: #f1eee8; }
.tray .fr[aria-pressed="true"] canvas, .tray .fr:hover canvas { transform: rotate(0) translateY(-2px); }
.tray .sep { width: 1px; height: 34px; background: #e7e2db; margin: 0 6px; }
.tray.is-one .fruits, .tray.is-one .sep { display: none; }
.snd { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; display: grid; place-items: center; color: var(--ink); }
.snd:hover { background: #f4f1ec; }
.snd svg { width: 22px; height: 22px; }
.tray button:focus-visible, .fresh:focus-visible, .auto:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.said { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* customise */
.fab { position: fixed; z-index: 20; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  border: 0; border-radius: 999px; padding: 9px 16px; background: #1d1b1a; color: #fbf9f5; font-family: system-ui, sans-serif; font-size: 0.86rem; font-weight: 500;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.ed { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 20px 14px; overflow-y: auto;
  background: rgba(40, 34, 30, 0.42); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); font-family: system-ui, sans-serif; color: var(--ink); }
.ed__box { position: relative; width: min(520px, 100%); margin: auto 0; background: #fbf9f5; border-radius: 20px; padding: 24px 22px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.ed__x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #efebe4; color: var(--ink); }
.ed__kicker { margin: 0; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: #b0452f; font-weight: 600; }
.ed__title { margin: 6px 40px 6px 0; font-family: "Patrick Hand", cursive; font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.ed__sub { margin: 0 0 16px; font-size: 0.9rem; color: #6d6863; line-height: 1.5; }
.ed__field { display: block; margin: 0 0 12px; }
.ed__field span { display: block; font-size: 0.8rem; font-weight: 600; color: #5b5652; margin-bottom: 5px; }
.ed__field input, .ed__field textarea { width: 100%; border: 1px solid #ddd6cc; border-radius: 12px; background: #fff; padding: 10px 12px; font: inherit; font-size: 0.95rem; color: var(--ink); resize: vertical; }
.ed__field textarea { font-family: "Gochi Hand", cursive; font-size: 1.15rem; line-height: 1.25; }
.ed__field input:focus, .ed__field textarea:focus { outline: 2px solid #1d1b1a; outline-offset: 1px; border-color: transparent; }
.ed__notes { display: grid; gap: 4px; margin: 4px 0 6px; }
.ed__note { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.ed__note canvas { width: 40px; height: 52px; border-radius: 5px; box-shadow: 0 2px 5px rgba(60, 40, 20, 0.16); margin-top: 8px; }
.ed__note .ed__field { margin: 0 0 6px; }
.ed__note-msg { min-height: 1.2em; margin: 4px 0 8px; font-size: 0.88rem; color: #b0452f; }
.ed__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.ed__btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: #1d1b1a; color: #fbf9f5; font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.ed__btn.ghost { background: transparent; color: var(--ink); border: 1px solid #d6cfc5; }
.share__link { width: 100%; margin: 0 0 14px; border: 1px solid #ddd6cc; border-radius: 12px; padding: 11px 12px; font: inherit; font-size: 0.85rem; background: #fff; color: var(--ink); }

/* a link that didn't arrive whole */
.broken { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-family: system-ui, sans-serif; color: var(--ink); }
.broken h2 { font-family: "Patrick Hand", cursive; font-weight: 400; font-size: 2rem; margin: 0 0 10px; }
.broken p { max-width: 36ch; margin: 0 auto; color: var(--ink-2); line-height: 1.5; }

@media (max-width: 600px) {
  .hint { font-size: 19px; margin-top: 16px; }
  .fresh, .auto { font-size: 18px; }
  .tray { margin-top: 12px; }
  .fab { padding: 8px 13px; font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card.is-leaving { transition: none; }
}
