/* ۱۰.۳۷۹ — «بلیت» و «دستگاه چاپ رسید» (طرحی که امیر فرستاد، بازسازی بی‌کتابخانه برای Fresh OS).
 * همان هندسه و حرکت کد اصلی (Ticket با react-parallax-tilt و ReceiptPrinter با motion) — فارسی، راست‌به‌چپ،
 * رنگ هر برند از ticket.js. کسی که «کاهش حرکت» دارد بی‌انیمیشن می‌بیند. */

/* ------------------------------------------------------------------ بلیت */
.fst {
  --ticket-corner-size: 0px; --ticket-notch-size: 13px; --ticket-stub-height: 24%;
  --ticket-paper: #ff633f; --ticket-ink: #171714;
  position: relative; aspect-ratio: 5 / 12; width: min(100%, 17rem);
  filter: drop-shadow(0 1px 1px rgb(15 15 15 / 10%)) drop-shadow(0 18px 26px rgb(15 15 15 / 13%));
  perspective: 1100px;
}
.fst.wide { aspect-ratio: 12 / 7; width: min(100%, 26rem); }
.fst-tilt {
  position: relative; width: 100%; height: 100%; touch-action: pan-y; transform-style: preserve-3d;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
  clip-path: polygon(
    0 var(--ticket-corner-size), var(--ticket-corner-size) 0,
    calc(100% - var(--ticket-corner-size)) 0, 100% var(--ticket-corner-size),
    100% calc(100% - var(--ticket-stub-height) - var(--ticket-notch-size)),
    calc(100% - var(--ticket-notch-size)) calc(100% - var(--ticket-stub-height)),
    100% calc(100% - var(--ticket-stub-height) + var(--ticket-notch-size)),
    100% calc(100% - var(--ticket-corner-size)), calc(100% - var(--ticket-corner-size)) 100%,
    var(--ticket-corner-size) 100%, 0 calc(100% - var(--ticket-corner-size)),
    0 calc(100% - var(--ticket-stub-height) + var(--ticket-notch-size)),
    var(--ticket-notch-size) calc(100% - var(--ticket-stub-height)),
    0 calc(100% - var(--ticket-stub-height) - var(--ticket-notch-size)));
}
.fst-art {
  position: relative; display: grid; width: 100%; height: 100%;
  grid-template-rows: minmax(0, 1fr) var(--ticket-stub-height); overflow: hidden;
  color: var(--ticket-ink); background: linear-gradient(145deg, rgb(255 255 255 / 10%), transparent 42%), var(--ticket-paper);
  transition: color 180ms ease, background-color 180ms ease;
}
.fst-body, .fst-stub { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.fst-body::after {
  content: ""; pointer-events: none; position: absolute; z-index: 2; bottom: 1px;
  right: calc(var(--ticket-notch-size) + 6px); left: calc(var(--ticket-notch-size) + 6px);
  border-bottom: 1px dashed currentColor; opacity: .3;
}
.fst-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 220ms ease;
  background: radial-gradient(60% 50% at var(--gx, 50%) var(--gy, 0%), rgb(255 255 255 / 28%), transparent 70%); }

/* محتوای پیش‌فرض بلیت فرش (کوپن، هدیه، شمارهٔ سفارش) */
.fst-in { height: 100%; padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 6px; font-family: IRAN, Vazirmatn, Tahoma, sans-serif; }
.fst-k { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; opacity: .75; }
.fst-t { font-size: 20px; font-weight: 900; line-height: 1.35; }
.fst-v { font-size: 34px; font-weight: 900; line-height: 1.1; margin-top: auto; font-variant-numeric: tabular-nums; }
.fst-s { font-size: 12.5px; line-height: 1.8; opacity: .85; }
.fst-stubin { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 20px 10px; font-family: IRAN, Vazirmatn, Tahoma, sans-serif; }
.fst-code { direction: ltr; font: 900 17px/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .12em; }
.fst-qr { width: 64px; height: 64px; background: #fff; border-radius: 6px; padding: 4px; flex: none; }
.fst-qr svg, .fst-qr img { width: 100%; height: 100%; display: block; }
.fst-big { font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.fst.used { filter: grayscale(.85) opacity(.6); }
.fst-badge { position: absolute; top: 12px; left: 12px; z-index: 3; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px;
  background: rgb(0 0 0 / 22%); color: #fff; }

/* ------------------------------------------------------- دستگاه چاپ رسید */
.fsp { --printer-radius: 1.5rem; --printer-inset: .75rem; --printer-inner-radius: calc(var(--printer-radius) - var(--printer-inset));
  --g1: #fcfcfc; --g8: #bbbbbb; --g11: #646464; --g12: #202020;
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 24rem; margin: 0 auto; }
.fsp-machine { position: relative; isolation: isolate; width: 100%; overflow: hidden; border-radius: var(--printer-radius);
  border: 1px solid var(--g12); background: color-mix(in oklab, var(--g11) 30%, var(--g12));
  padding: var(--printer-inset); padding-bottom: 2rem;
  box-shadow: 0 20px 36px -20px color-mix(in oklab, var(--g12) 55%, transparent), 0 6px 14px -8px color-mix(in oklab, var(--g12) 24%, transparent),
              inset 0 1px 0 color-mix(in oklab, var(--g1) 14%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--g12) 55%, transparent); }
.fsp-machine::before { content: ""; pointer-events: none; position: absolute; inset: 0; z-index: 0; border-radius: inherit; opacity: .3; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px; }
.fsp-slot { position: absolute; z-index: 40; left: 1.5rem; right: 1.5rem; bottom: var(--printer-inset); height: .5rem; border-radius: .25rem;
  border: 1px solid var(--g12); background: var(--g12); box-shadow: inset 0 2px 4px 0 var(--g12); }
.fsp-head { position: relative; z-index: 10; display: flex; height: 2.75rem; align-items: flex-start; justify-content: space-between; color: var(--g8);
  font: 700 11px/1 IRAN, Vazirmatn, Tahoma, sans-serif; padding: 2px 4px 0; }
.fsp-head .led { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3a; box-shadow: inset 0 1px 1px #000; margin-top: 3px; transition: background 180ms ease, box-shadow 180ms ease; }
.fsp[data-stage="printing"] .fsp-head .led { background: #f5a524; box-shadow: 0 0 8px #f5a524; }
.fsp[data-stage="complete"] .fsp-head .led { background: #30a46c; box-shadow: 0 0 8px #30a46c; }
.fsp-screen { position: relative; z-index: 10; isolation: isolate; overflow: hidden; border-radius: var(--printer-inner-radius);
  border: 1px solid var(--g12); background: var(--g12); padding: 1rem; color: var(--g1); box-shadow: inset 0 2px 4px 0 rgb(32 32 32 / 80%); }
.fsp-screen::after { content: ""; pointer-events: none; position: absolute; inset: 0; z-index: 20; border-radius: inherit;
  box-shadow: inset 0 0 24px 4px color-mix(in oklab, var(--g12) 52%, transparent); }
.fsp-status { position: relative; z-index: 10; display: flex; min-width: 0; align-items: center; gap: .5rem; }
.fsp-ind { position: relative; display: grid; width: 1.25rem; height: 1.25rem; flex: none; place-items: center; }
.fsp-ind > * { grid-area: 1 / 1; transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.fsp-spin { color: var(--g8); animation: fsp-spin 1s linear infinite; }
.fsp-ok { color: #30a46c; opacity: 0; transform: scale(.94); }
.fsp[data-stage="complete"] .fsp-spin { opacity: 0; transform: scale(.96); animation: none; }
.fsp[data-stage="complete"] .fsp-ok { opacity: 1; transform: scale(1); }
@keyframes fsp-spin { to { transform: rotate(360deg); } }
.fsp-lbl { display: grid; min-width: 0; flex: 1; align-items: center; }
.fsp-lbl > span { grid-area: 1 / 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--g8);
  font: 600 12.5px/1.4 IRAN, Vazirmatn, Tahoma, sans-serif; transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1), transform 180ms cubic-bezier(0.23, 1, 0.32, 1); }
.fsp-lbl > span.out { opacity: 0; transform: translateY(-4px); }
.fsp-lbl > span.in { opacity: 0; transform: translateY(4px); }
.fsp-out { position: relative; z-index: 50; margin-top: -1rem; width: calc(80% + 3rem); max-width: 100%; overflow: hidden; padding: 0 1.5rem; }
.fsp-out.auto { height: auto; }
.fsp-shade { pointer-events: none; position: absolute; left: 1.5rem; right: 1.5rem; top: -.25rem; z-index: 20; height: .5rem; background: rgb(32 32 32 / 75%); filter: blur(6px); display: none; }
.fsp:not([data-stage="processing"]) .fsp-shade { display: block; }
.fsp-feed { position: relative; isolation: isolate; opacity: 0; transform: translateY(calc(-100% + 2px)); transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.fsp:not([data-stage="processing"]) .fsp-feed { opacity: 1; }
.fsp-feed::before { content: ""; pointer-events: none; position: absolute; left: .75rem; right: .75rem; top: .75rem; bottom: 1rem; z-index: 0; border-radius: 2px;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--g12) 24%, transparent); }
.fsp-feed::after { content: ""; pointer-events: none; position: absolute; left: 8%; right: 8%; bottom: 0; z-index: 0; height: .75rem; transform: translateY(.375rem);
  border-radius: 99px; background: rgb(32 32 32 / 10%); filter: blur(16px); }
.fsp-paper { position: relative; z-index: 10; min-height: 20rem; padding: 1.75rem 1.5rem 2rem; color: var(--g12);
  background-color: var(--g1); background-blend-mode: soft-light; background-size: cover;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .52 0 0 0 0 .47 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23p)'/%3E%3C/svg%3E");
  font-family: IRAN, Vazirmatn, Tahoma, sans-serif; }
@media (prefers-color-scheme: dark) {
  .fsp-machine { border-color: #2a2a2a; background: #2f2f2f; }
  .fsp-paper { background-color: #f4f1ea; }
}
@media (prefers-reduced-motion: reduce) {
  .fst-tilt { transition: none; } .fsp-spin { animation: none; }
}
