/* ============================================================
   PotatoPay — Fax Me a Message
   Retro Win95 / GeoCities chrome, 1:1 with the reference look,
   plus the PotatoPay character placements.
   ============================================================ */

:root {
  --w95: #c0c0c0; --w95-dark: #808080; --w95-light: #ffffff; --w95-black: #000;
  --title: linear-gradient(90deg, #000080, #1084d0);
  --neon: #39ff14; --pink: #ff2bd6; --yellow: #fff200; --cyan: #00f0ff;
  --spud: #c98a4b; --spud-lt: #e8c79a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background-color: #000018;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff, transparent),
    radial-gradient(2px 2px at 200px 150px, #fffbcc, transparent),
    radial-gradient(1px 1px at 300px 40px, #cfe, transparent),
    radial-gradient(1px 1px at 60px 190px, #fff, transparent),
    radial-gradient(2px 2px at 250px 260px, #fff, transparent),
    radial-gradient(1px 1px at 340px 220px, #fcf, transparent);
  background-size: 360px 300px;
  animation: drift 60s linear infinite;
  color: #fff;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive;
  overflow-x: hidden;
}
@keyframes drift { to { background-position: -360px 300px; } }

.marquee { background: #000; border-top: 2px solid var(--pink); border-bottom: 2px solid var(--pink);
  overflow: hidden; white-space: nowrap; font-family: "VT323", monospace; font-size: 22px; color: var(--neon); padding: 4px 0; }
.marquee span { display: inline-block; padding-left: 100%; animation: scroll 24s linear infinite; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* ---------- header ---------- */
header { text-align: center; padding: 22px 16px 6px; }

.brandbar {
  font: 12px "Press Start 2P", monospace; color: var(--spud-lt);
  letter-spacing: 3px; margin-bottom: 18px;
  text-shadow: 2px 2px 0 #5a3a1c;
}
.brandbar .spud { color: var(--yellow); }

/* mascots flank the WordArt on wide screens, tuck behind it on small ones */
.hero { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2vw, 28px); }
.wordart { font-family: "Press Start 2P", monospace; font-weight: normal; font-size: clamp(24px, 6.5vw, 50px);
  line-height: 1.35; margin: 0; color: #fff200; text-shadow: 4px 4px 0 #ff2bd6, 8px 8px 0 #00f0ff; }
.sub { font-family: "Press Start 2P", monospace; font-size: 10px; color: var(--cyan); margin-top: 14px; line-height: 1.8; }
.blink { animation: blink 1s steps(1) infinite; color: var(--yellow); }
@keyframes blink { 50% { visibility: hidden; } }

.mascot { width: clamp(70px, 13vw, 150px); height: auto; flex: none;
  filter: drop-shadow(3px 3px 0 rgba(255,43,214,.45)); }
.mascot-l { animation: bob 3.2s ease-in-out infinite; }
.mascot-r { animation: bob 3.2s ease-in-out infinite .7s; transform: scaleX(-1); }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }

main { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: flex-start;
  max-width: 980px; margin: 14px auto 0; padding: 0 16px; }

/* ---------- Win95 window ---------- */
.win { background: var(--w95); color: #000; width: 100%; max-width: 480px;
  border: 2px solid; border-color: var(--w95-light) var(--w95-black) var(--w95-black) var(--w95-light);
  box-shadow: inset -1px -1px var(--w95-dark), inset 1px 1px #dfdfdf, 8px 8px 0 rgba(255,43,214,.55);
  font-family: "Tahoma", "MS Sans Serif", "Segoe UI", sans-serif; font-size: 14px; }
.titlebar { background: var(--title); color: #fff; font-weight: bold; padding: 3px 4px 3px 6px;
  display: flex; align-items: center; justify-content: space-between; }
.titlebar .btns { display: flex; gap: 2px; }
.titlebar .btns i { width: 18px; height: 16px; background: var(--w95); color: #000; font-style: normal; font-size: 11px;
  display: grid; place-items: center; border: 1px solid; border-color: #fff #000 #000 #fff; font-weight: bold; }
.menubar { padding: 3px 6px; font-size: 13px; border-bottom: 1px solid var(--w95-dark); }
.menubar u { margin-right: 12px; text-decoration: none; }
.menubar u::first-letter { text-decoration: underline; }
.body { padding: 14px; }
.inset { width: 100%; background: #fff; font: inherit; font-size: 16px; padding: 6px;
  border: 2px solid; border-color: var(--w95-dark) var(--w95-light) var(--w95-light) var(--w95-dark);
  box-shadow: inset 1px 1px #000; outline: none; border-radius: 0; }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.custom[hidden] { display: none; }
.btn { background: var(--w95); font: inherit; font-weight: bold; padding: 8px 4px; cursor: pointer; color: #000;
  border: 2px solid; border-color: var(--w95-light) var(--w95-black) var(--w95-black) var(--w95-light);
  box-shadow: inset -1px -1px var(--w95-dark), inset 1px 1px #dfdfdf; border-radius: 0; }
.btn:active, .btn.on { border-color: var(--w95-black) var(--w95-light) var(--w95-light) var(--w95-black);
  box-shadow: inset 1px 1px var(--w95-dark); background: #b5b5b5; }
.btn.on { background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0/2px 2px; }
.custom { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.custom span { font-weight: bold; font-size: 18px; }
.go { width: 100%; margin-top: 16px; padding: 12px; font-family: "Press Start 2P", monospace;
  font-size: 14px; letter-spacing: 1px; }
.go:disabled { color: var(--w95-dark); text-shadow: 1px 1px #fff; cursor: not-allowed; }
.status { border-top: 1px solid var(--w95-dark); display: flex; gap: 2px; padding: 2px; font-size: 12px; }
.status div { flex: 1; padding: 2px 6px;
  border: 1px solid; border-color: var(--w95-dark) var(--w95-light) var(--w95-light) var(--w95-dark); }
.err { color: #c00; font-weight: bold; font-size: 12px; min-height: 16px; margin-top: 6px; }

/* ---------- Editable receipt (the receipt IS the form) ---------- */
.step { font-weight: bold; margin: 0 0 6px; }

/* the potato peeks over the top of the printer */
.printzone { position: relative; margin-top: 16px; }
.peeker { position: absolute; right: -14px; top: -74px; width: clamp(110px, 26vw, 190px); height: auto;
  z-index: 3; pointer-events: none; transform: scaleX(-1);
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.25)); }

.printer { background: linear-gradient(#2b2b2b, #111); border-radius: 12px 12px 6px 6px; height: 46px; position: relative;
  box-shadow: 0 4px 0 #000, inset 0 2px 0 #444; z-index: 2; }
.printer::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: 8px; height: 6px; background: #000; border-radius: 3px; }
.printer .led { position: absolute; right: 14px; top: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--neon); box-shadow: 0 0 8px var(--neon); animation: led 2s steps(1) infinite; }
@keyframes led { 50% { opacity: .35; } }
.printer .brand { position: absolute; left: 14px; top: 8px; font: 9px "Press Start 2P", monospace; color: #888; }
.paperwrap { margin: -10px 5% 0; overflow: hidden; position: relative; z-index: 1; }
.paper { background: #fbfbf7; color: #000; padding: 22px 16px 28px; text-align: center; font-family: "Courier New", monospace;
  position: relative; }
/* torn bottom edge: drawn on top in the window color (Safari-safe, no CSS mask) */
.paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; pointer-events: none;
  background: linear-gradient(45deg, var(--w95) 50%, transparent 50%) 0 100% / 10px 10px repeat-x,
              linear-gradient(-45deg, var(--w95) 50%, transparent 50%) 0 100% / 10px 10px repeat-x; }
.paper.printing { animation: feed .5s steps(10) both; }
@keyframes feed { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.r-src { font-size: 14px; letter-spacing: 1px; }
.paper input, .paper textarea { width: 100%; border: 0; background: transparent; color: #000; outline: none; padding: 4px 2px;
  border-radius: 0; border-bottom: 2px dashed #bbb; }
.paper input:focus, .paper textarea:focus { border-bottom-color: #1084d0; background: #eef6ff; }
.r-name { font: bold 26px "Courier New", monospace; text-align: center; margin: 10px 0 8px; }
.r-amt { font-weight: bold; font-size: 15px; margin-bottom: 12px; }

/* Payer photo. Greyscale + contrast on screen, because that is roughly what
   a 1-bit thermal head will actually produce. */
.r-addphoto { display: inline-block; cursor: pointer; font: 12px "Courier New", monospace;
  color: #555; border: 2px dashed #bbb; padding: 5px 12px; margin: 2px 0 12px; background: #fafafa; }
.r-addphoto:hover { border-color: #1084d0; color: #1084d0; background: #eef6ff; }
.r-photo { position: relative; display: inline-block; margin: 4px 0 12px; }
.r-photo img { display: block; width: 132px; height: 132px; object-fit: cover;
  filter: grayscale(1) contrast(1.35); border: 1px solid #000; }
.r-photo button { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; line-height: 1;
  border: 2px solid #000; background: var(--w95); font: bold 14px system-ui; cursor: pointer; padding: 0; }
.r-msg { font-family: "Chalkboard", "Chalkboard SE", "Comic Sans MS", cursive; font-size: 22px; line-height: 1.2;
  text-align: left; resize: none; overflow: hidden; min-height: 2.6em; display: block; }
.paper ::placeholder { color: #9a9a9a; }
.r-date { font-size: 13px; margin-top: 14px; }
.count { font: 12px "Courier New", monospace; color: #888; text-align: right; margin-top: 4px; }

/* ---------- pay row: money potato hands over the cash ---------- */
.payrow { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.paypotato { width: clamp(78px, 20vw, 128px); height: auto; flex: none;
  animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 4px -4px; rotate: -4deg; } }
.paybox { flex: 1; min-width: 0; }
.paybox.off { opacity: .45; pointer-events: none; filter: grayscale(1); }
.note { font-size: 12px; color: #333; margin: 8px 0 0; text-align: center; }

/* ---------- 90s junk ---------- */
.junk { max-width: 980px; margin: 30px auto 0; padding: 0 16px 40px; text-align: center; }
.construction { height: 22px; background: repeating-linear-gradient(-45deg, #fff200 0 14px, #000 14px 28px);
  border: 2px solid #000; margin: 0 auto 14px; max-width: 480px; position: relative; }
.construction b { position: absolute; inset: 0; display: grid; place-items: center; font: 9px "Press Start 2P", monospace;
  color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.counter { display: inline-flex; gap: 2px; background: #000; padding: 4px; border: 2px inset #666; margin: 6px 0; }
.counter span { font: 22px "VT323", monospace; color: #ff3b3b; background: #200; width: 18px; text-shadow: 0 0 6px #f00; }
.webring { font-family: "Times New Roman", serif; font-size: 15px; margin-top: 12px; }
.webring a { color: var(--cyan); }
.webring a:visited { color: #c58cff; }
.netscape { font: 10px "Press Start 2P", monospace; color: #888; margin-top: 16px; line-height: 1.8; }
hr.rainbow { border: 0; height: 4px; max-width: 480px; margin: 16px auto;
  background: linear-gradient(90deg, red, orange, yellow, lime, cyan, blue, magenta); }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,40,.6); display: none; place-items: center; padding: 16px; z-index: 10;
  -webkit-transform: translateZ(0); transform: translateZ(0); }  /* own layer: iPhone keeps it on screen after app switches */
.overlay.show { display: grid; }
.dlg { max-width: 360px; }
.dlg .row { display: flex; gap: 12px; align-items: flex-start; }
.dlg .icon { font-size: 34px; line-height: 1; }
.dlgpotato { display: block; margin: 10px auto 0; width: 110px; height: auto;
  animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
.dlgpotato[hidden] { display: none; }
@keyframes pop { from { scale: .3; rotate: -14deg; opacity: 0; } to { scale: 1; rotate: 0deg; opacity: 1; } }
.bar { height: 22px; margin-top: 12px; padding: 2px; background: #fff;
  border: 2px solid; border-color: var(--w95-dark) var(--w95-light) var(--w95-light) var(--w95-dark); }
.bar i { display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, #000080 0 12px, transparent 12px 15px); transition: width .25s steps(1); }
.dlg .actions { text-align: center; margin-top: 14px; display: flex; gap: 8px; justify-content: center; }
.dlg .actions .btn { min-width: 90px; }

.sparkle { position: fixed; pointer-events: none; z-index: 20; font-size: 14px; animation: fall 900ms linear forwards; }
@keyframes fall { to { transform: translateY(40px) rotate(180deg); opacity: 0; } }

/* ---------- small screens: keep the chrome, calm the potatoes ---------- */
@media (max-width: 560px) {
  .hero { gap: 8px; }
  .mascot { width: 58px; }               /* give the WordArt room to breathe */
  .mascot-r { display: none; }           /* one mascot is plenty at phone width */
  .peeker { right: -8px; top: -52px; }
  .payrow { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  body, .marquee span, .blink, .paper.printing,
  .mascot-l, .mascot-r, .paypotato, .dlgpotato, .printer .led { animation: none !important; }
}
