/* Granville St Recipes: the tin, the cards, the add sheet. Ported as-is from the base Worker. */
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1c1a; color: #2a2620; overscroll-behavior: none; }
  body { font-family: "Courier New", Courier, monospace; user-select: none; }
  /* the counter: dark speckled granite */
  #counter { position: fixed; inset: 0;
    background:
      radial-gradient(circle at 20% 30%, rgba(255,255,255,.06) 0 1px, transparent 2px) 0 0/23px 19px,
      radial-gradient(circle at 70% 60%, rgba(255,255,255,.05) 0 1.5px, transparent 2.5px) 0 0/37px 31px,
      radial-gradient(circle at 40% 80%, rgba(120,110,95,.18) 0 3px, transparent 5px) 0 0/53px 47px,
      radial-gradient(ellipse at 50% 40%, #3a3834, #1b1a18 75%); }

  /* ---- scene 1: the tin ---- */
  #scene { position: fixed; inset: 0; perspective: 1000px; perspective-origin: 50% 35%; transition: opacity .5s; }
  #tin { position: absolute; left: 50%; top: 52%; transform-style: preserve-3d;
    transform: rotateX(-26deg) rotateY(-14deg); transition: transform 1.4s cubic-bezier(.45,0,.25,1); }
  .stand { transition: opacity .4s; }
  /* label-maker tape: black, raised white capitals, cut ends, a little crooked */
  .dymo { position: absolute; left: 50%; top: 9%; transform: translateX(-50%) rotate(-1.2deg); white-space: nowrap;
    background: linear-gradient(#2a2a2a, #111 45%, #1c1c1c); color: #e8c840; font-family: Arial, Helvetica, sans-serif;
    font-weight: bold; letter-spacing: .14em; padding: .32em .7em .28em; border-radius: 1px;
    text-shadow: 0 -1px 0 rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.25);
    box-shadow: 0 1px 2px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
    clip-path: polygon(0 4%, 100% 0, 99.4% 100%, .5% 96%); }
  .f { position: absolute; left: 0; top: 0; transform-origin: 0 0; backface-visibility: hidden; }
  .y { background-color: #e2c23a; box-shadow: inset 0 0 0 1px rgba(120,90,10,.35); background-repeat: no-repeat; background-size: 100% 100%; }
  .in { background-color: #d6d3c9; background-size: 36px 36px; }
  .in.dk { background-color: #bdb9ad; }
  #lid { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transition: transform 2.1s cubic-bezier(.45,0,.25,1.06); }
  .stand { position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 2px; }
  .stand .tb { position: absolute; top: -13px; height: 14px; width: 23%; background: #deae46; border-radius: 3px 3px 0 0;
    font: bold 6.5px/14px Arial, sans-serif; letter-spacing: .3px; text-align: center; color: #241d10; overflow: hidden; white-space: nowrap; }
  .stand .pt { padding: 2px 5px 0; font: bold 5.5px/1.2 "Courier New", monospace; color: #2a2620; white-space: nowrap; overflow: hidden; }
  #tapme { position: fixed; left: 0; right: 0; top: 25vh; text-align: center; color: #8a857a; font-size: 13px; letter-spacing: 1px; transition: opacity .4s; }

  /* ---- scene 2: inside the box ---- */
  #well { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
  #well.on { pointer-events: auto; }
  #stack { position: absolute; inset: 0; transform-origin: 50% 100%; transform: translateY(120vh); transition: transform 1.5s cubic-bezier(.2,.75,.25,1); }
  #front { position: absolute; left: -2px; right: -2px; bottom: 0; height: 15vh; z-index: 550;
    background-color: #e2c23a; background-repeat: no-repeat; background-size: 100% 100%;
    box-shadow: 0 -2px 0 #f0d659, 0 -6px 14px rgba(0,0,0,.25); }
  .it { position: absolute; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3,.7,.3,1), filter .45s;
    will-change: transform; }
  .dv { background: #deae46; border-radius: 3px;
    background-image: repeating-linear-gradient(transparent 0 25px, rgba(120,80,10,.16) 25px 26px);
    box-shadow: 0 2px 6px rgba(0,0,0,.18); }
  .dv .tab { position: absolute; top: -27px; height: 29px; width: 23%; background: #deae46; border-radius: 6px 6px 0 0;
    font: bold 10.5px/29px Arial, sans-serif; letter-spacing: .5px; text-transform: uppercase; text-align: center; color: #241d10;
    box-shadow: 0 1px 0 rgba(255,240,190,.6) inset; white-space: nowrap; overflow: hidden; }
  .dv .idx { opacity: 0; transition: opacity .3s; position: absolute; left: 7%; right: 7%; top: 34px; font-size: 13px; line-height: 26px; color: #4a3a17; }
  .pp { padding: 9px 14px; font-size: 13.5px; line-height: 1.35; color: #2b2721; overflow: hidden; }
  .pp .t { font-weight: bold; font-size: 14.5px; letter-spacing: .2px; }
  .pp .by { font-size: 11.5px; color: #6b6253; margin-top: 2px; }
  .pp .bd { margin-top: 12px; white-space: pre-wrap; font-size: 12.5px; color: #3b352c; }
  .hand { font-family: cursive; }
  .hand .t { font-weight: normal; font-size: 21px; }
  .hand .bd { font-size: 15px; }
  .dv.front .idx { opacity: 1; }
  .fallen { filter: brightness(.55) saturate(.6); }

  /* the family you're in, on a little paper label stuck to the front of the tin */
  #fam { position: fixed; left: 50%; z-index: 700; padding: 3px 12px 2px; background: #f3ecd8; color: #2b2721;
    font-size: 12px; letter-spacing: 1px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transform: translateX(-50%) rotate(-1deg); opacity: 0; transition: opacity .35s; pointer-events: none; }
  #fam.on { opacity: 1; }
  /* ---- odds and ends that fall out of the box with the cards ---- */
  #odds { position: fixed; inset: 0; z-index: 860; pointer-events: none; }
  .odd { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; will-change: transform; }
  .pcard { width: 46px; height: 64px; background: #fbfaf5; border-radius: 4px; overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,.35); }
  .pcard svg { display: block; width: 100%; height: 100%; }
  .chip { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 3px 7px rgba(0,0,0,.4);
    background: radial-gradient(circle, #2f7d4a 0 9px, #f4efe2 9px 10.5px, #2f7d4a 10.5px 13px, transparent 13px),
      repeating-conic-gradient(#2f7d4a 0 22deg, #f4efe2 22deg 38deg); }
  .chip::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px dashed rgba(244,239,226,.85); }
  /* prototype only: stands in for making a new member's tag at the bench */
  #newtag { position: fixed; top: 10px; right: 10px; z-index: 870; background: none; border: 1px dashed #6b6658; color: #8a857a;
    font: 11px "Courier New", monospace; letter-spacing: 1px; padding: 6px 9px; border-radius: 3px; }
  /* ---- adding a recipe: one clear + below the box, always there; it opens one plain screen ---- */
  #addb { position: fixed; left: 50%; bottom: 28px; z-index: 870; width: 52px; height: 52px; margin-left: -26px; border-radius: 50%;
    border: 0; background: #241d10; color: #deae46; font: 30px/52px "Courier New", monospace; padding: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,.45), 0 0 0 3px #deae46; }
  #add { position: fixed; inset: 0; z-index: 950; background: #f3ecd8; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; transform: translateY(100%); transition: transform .38s cubic-bezier(.3,.7,.25,1); }
  #add.on { transform: none; }
  #add .ain { padding: 22px 22px 40px; max-width: 560px; margin: 0 auto; }
  #add .hd { display: flex; align-items: center; }
  #add h2 { margin: 0; font-size: 20px; letter-spacing: 1px; }
  #add .close { margin-left: auto; background: none; border: 0; font: 30px/1 "Courier New", monospace; color: #6b6253; padding: 4px 8px; }
  #add .under { font-size: 12.5px; color: #8a7f6c; margin-top: 4px; }
  #add .snap { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin: 22px 0 6px; padding: 16px;
    background: #deae46; color: #241d10; border: 0; border-radius: 4px; font: bold 16px "Courier New", monospace; letter-spacing: .5px;
    box-shadow: 0 2px 0 #b38a2c; }
  #add .snap svg { width: 38px; height: 38px; stroke: #241d10; fill: none; stroke-width: 1.5; }
  #add .or { text-align: center; font-size: 12px; color: #8a7f6c; letter-spacing: 1px; margin: 14px 0 4px; }
  #add .shot { display: none; margin-top: 14px; }
  #add .shot.on { display: block; }
  #add .shot img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 3px; }
  #add .shot .st { font-size: 13px; color: #6b6253; margin-top: 8px; }
  #add label { display: block; font-size: 12px; letter-spacing: 1.5px; color: #6b6253; margin: 20px 0 6px; }
  #add input, #add textarea { display: block; width: 100%; box-sizing: border-box; border: 1px solid rgba(60,50,30,.3); border-radius: 3px;
    background: #fbf8ef; font: 16px/1.5 "Courier New", monospace; color: #241d10; padding: 10px 12px; outline: none; }
  #add input[type=file] { display: none; }
  #add input:focus, #add textarea:focus { border-color: #b38a2c; box-shadow: 0 0 0 2px rgba(222,174,70,.4); }
  #add textarea { resize: vertical; }
  #add #a-ing { height: 150px; }
  #add #a-steps { height: 170px; }
  #add .save { display: block; width: 100%; margin-top: 26px; padding: 16px; border: 0; border-radius: 4px; background: #241d10; color: #deae46;
    font: bold 17px "Courier New", monospace; letter-spacing: 2px; }
  #add .save:disabled { opacity: .35; }
  #add .filled { animation: fill 1.2s ease-out; }
  @keyframes fill { from { background: #f6e3a8; } to { background: #fbf8ef; } }
  /* ---- reading a card: it comes up out of the tin, straightens, and fills the screen ---- */
  #read { position: fixed; inset: 0; z-index: 880; background: rgba(20,18,14,0); pointer-events: none; transition: background .45s; }
  #read.on { background: rgba(20,18,14,.6); pointer-events: auto; }
  #rclip { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
  #rc { position: fixed; display: none; overflow: hidden; pointer-events: auto; transform-origin: 50% 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,.35); }
  #flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: perspective(1400px) rotateY(0deg);
    transition: transform .65s cubic-bezier(.4,.1,.3,1); }
  #flip.over { transform: perspective(1400px) rotateY(180deg); }
  .face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  .face.back { transform: rotateY(180deg); }
  #rc.big .face { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  #rc .t, #rc .by, #rc .bd, #rc .face { transition: font-size .45s, padding .45s; }
  #rc.big .face { padding: 26px 24px 40px; }
  #rc.big .t { font-size: 22px; }
  #rc.big .by { font-size: 13px; }
  #rc.big .bd { font-size: 16px; line-height: 1.55; margin-top: 18px; }
  #rc.big .hand .t { font-size: 28px; }
  #rc .ph { margin: 14px 0 4px; padding: 14px; background: #f6f0de; transform: rotate(1.2deg);
    box-shadow: 0 2px 8px rgba(0,0,0,.25); font-family: cursive; font-size: 17px; line-height: 1.45;
    background-image: repeating-linear-gradient(transparent 0 24px, rgba(70,110,170,.25) 24px 25px); }
  #rc .lbl { font-family: "Courier New", monospace; font-size: 11px; letter-spacing: 1px; color: #8a7f6c; margin-top: 18px; }
  #rc .hand .lbl ~ .bd { font-family: "Courier New", monospace; }
  /* the turned-up corner: tap it (or swipe sideways) to turn the card over */
  .ear { position: absolute; right: 0; bottom: 0; width: 40px; height: 40px; display: none;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.18) 50%, #e2d8bd 54%, #efe7d0); }
  #rc.big .ear { display: block; }
  /* the back of a card: everyone's notes, questions, and snapshots of what they made */
  .back .bh { font-size: 12px; letter-spacing: 1px; color: #8a7f6c; }
  /* the back reads like a feed: newest first, one row each, name + when, then what they said */
  .fd { padding: 14px 0 13px; border-bottom: 1px solid rgba(60,50,30,.16); }
  .fd-h { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: #8a7f6c; }
  .fd-h b { color: #2a2620; font-size: 13.5px; }
  .fd-h .when { margin-left: auto; white-space: nowrap; }
  .fd-new { color: #b8402a; font-weight: bold; font-size: 11px; letter-spacing: .5px; }
  .fd-t { font-size: 15px; line-height: 1.45; margin-top: 5px; color: #2a2620; }
  .fd-img { height: 200px; margin-top: 9px; border-radius: 2px; }
  .fd-rp { margin: 10px 0 0 4px; padding-left: 12px; border-left: 2px solid rgba(60,50,30,.22); }
  .fd .rm { margin-left: 2px; }
  .fd-empty { padding: 18px 0; color: #8a7f6c; font-size: 14px; }
  img.fd-img { display: block; width: 100%; object-fit: cover; }
  .fd-img { cursor: zoom-in; }
  /* a photo, opened up: pinch to zoom, drag around, double-tap to zoom in; x or swipe down to put it back */
  #lb { position: fixed; inset: 0; z-index: 1000; background: rgba(12,11,9,0); transition: background .3s; touch-action: none; }
  #lb.on { background: rgba(12,11,9,.94); }
  #lbi { position: absolute; transform-origin: 0 0; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
  #lbi img { display: block; width: 100%; height: 100%; }
  #lb .lx { position: absolute; top: 14px; right: 14px; z-index: 2; background: none; border: 0; color: #e8e0cc;
    font: 30px/1 "Courier New", monospace; padding: 8px 12px; opacity: 0; transition: opacity .3s; }
  #lb .lcap { position: absolute; left: 20px; right: 20px; bottom: 26px; z-index: 2; color: #e8e0cc; font: 14px/1.4 "Courier New", monospace;
    opacity: 0; transition: opacity .3s; pointer-events: none; }
  #lb .lcap span { color: #9a917e; }
  #lb.on .lx, #lb.on .lcap { opacity: 1; }
  #lb.zoomed .lcap { opacity: 0; }
  #rc.big .face.back { padding-bottom: 110px; }
  /* adding, on the back only: the + at the bottom fans out bubbles (as on the cache pages), in divider mustard */
  #rc .plus, #rc .fan button { position: absolute; left: 50%; bottom: 24px; border-radius: 50%; border: 0; z-index: 6;
    background: #deae46; color: #241d10; box-shadow: 0 2px 7px rgba(0,0,0,.32); padding: 0;
    display: flex; align-items: center; justify-content: center; }
  #rc .plus { width: 52px; height: 52px; margin-left: -26px; font: 28px/1 "Courier New", monospace;
    opacity: 0; pointer-events: none; transition: opacity .3s, background .2s; }
  #rc.big.backside .plus { opacity: 1; pointer-events: auto; }
  #rc .plus.open { background: #f1e3bd; }
  #rc .fan button { width: 46px; height: 46px; margin-left: -23px; bottom: 27px; opacity: 0; pointer-events: none;
    transition: transform .2s ease-out, opacity .2s ease-out; }
  #rc .fan.out button { transform: translate(var(--dx), var(--dy)); opacity: 1; pointer-events: auto; }
  #rc .fan svg { width: 22px; height: 22px; stroke: #241d10; fill: none; stroke-width: 1.5; }
  #rc .nsheet { position: absolute; left: 0; right: 0; top: 0; z-index: 7; padding: 22px 18px 16px;
    background: repeating-linear-gradient(transparent 0 27px, rgba(120,80,10,.2) 27px 28px), #deae46;
    box-shadow: 0 4px 14px rgba(0,0,0,.28); transform: translateY(-105%); transition: transform .3s cubic-bezier(.3,.7,.3,1); }
  #rc .nsheet.on { transform: none; }
  #rc .nsheet .nh { display: flex; align-items: center; font-size: 12px; letter-spacing: 1px; color: #4a3a17; }
  #rc .nsheet .nh button { margin-left: auto; background: none; border: 0; font: 24px/1 "Courier New", monospace; color: #4a3a17; padding: 4px 6px; }
  #rc .nsheet textarea { display: block; width: 100%; height: 112px; margin-top: 6px; background: transparent; border: 0; resize: none;
    font: 15px/28px "Courier New", monospace; color: #241d10; outline: none; padding: 0; }
  #rc .nsheet .go { display: block; margin: 10px 0 0 auto; background: #241d10; color: #deae46; border: 0; border-radius: 2px;
    font: bold 13px "Courier New", monospace; letter-spacing: 1px; padding: 9px 18px; }
  .nt { font-family: "Courier New", monospace; font-size: 15px; line-height: 1.45; margin: 18px 0 0; }
  .nt .w { font-family: "Courier New", monospace; font-size: 11.5px; color: #8a7f6c; margin-left: 6px; white-space: nowrap; }
  .nt .rp { margin: 6px 0 0 22px; }
  .rm { font-family: "Courier New", monospace; font-size: 12px; color: #a8322a; background: none; border: 0; padding: 0 4px; }
  .snap { position: relative; display: block; width: 62%; margin: 26px 0 6px 8%; background: #fbfaf6; padding: 8px 8px 30px;
    box-shadow: 0 2px 7px rgba(0,0,0,.28); }
  .snap .img { height: 150px; }
  .snap .cap { position: absolute; left: 10px; bottom: 7px; font-family: "Courier New", monospace; font-size: 13px; color: #2b4a8f; }
  .snap .pc { position: absolute; top: -16px; left: 22px; }
  .add { display: flex; gap: 10px; align-items: flex-end; margin: 16px 0 4px; }
  .add input { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px solid rgba(60,50,30,.35); border-radius: 0;
    font-family: "Courier New", monospace; font-size: 15px; color: #2a2620; padding: 4px 2px; outline: none; }
  .add button { font-family: "Courier New", monospace; font-size: 13px; background: none; border: 0; color: #6b6253; padding: 4px; }
  /* on the front: a paperclipped snapshot when people have cooked it; a red dot on your own card when there's something new */
  .hints { position: absolute; top: 4px; right: 12px; width: 80px; height: 46px; pointer-events: none; }
  .mini { position: absolute; right: 0; top: 6px; width: 34px; height: 30px; background: #fbfaf6; padding: 3px 3px 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,.3); transform: rotate(7deg); }
  .mini .img { width: 100%; height: 100%; }
  .mini .pc { position: absolute; top: -6px; left: 9px; }
  .ndot { position: absolute; top: 10px; right: 46px; min-width: 19px; height: 19px; border-radius: 10px; background: #b8402a; color: #fff;
    font: bold 11px/19px "Courier New", monospace; text-align: center; padding: 0 4px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
  #rc .x { position: absolute; z-index: 5; top: 14px; right: 104px; font-size: 26px; color: #6b6253; background: none; border: 0;
    font-family: inherit; opacity: 0; transition: opacity .3s; padding: 4px 8px; }
  #rc.big .x { opacity: 1; }
  #toast { position: fixed; left: 50%; top: 18px; z-index: 1100; transform: translate(-50%, -300%); transition: transform .3s;
    background: #241d10; color: #deae46; font: 13px "Courier New", monospace; padding: 10px 14px; border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0,0,0,.4); max-width: 86vw; text-align: center; }
  #toast.on { transform: translate(-50%, 0); }
  .own { display: flex; gap: 18px; margin-top: 26px; }
  .own button { background: none; border: 0; padding: 4px 0; font: 12px "Courier New", monospace; letter-spacing: 1px; color: #8a7f6c;
    text-decoration: underline; }
  .own button.del { color: #a8322a; }
