/* =====================================================================
   SCRATCH — design system v3: "the long ticket roll".
   The page is ONE long lottery ticket roll lying on a dark counter:
   a deep-red strip, torn apart by perforation lines, carrying one
   giant printed ticket, a ticket window, a notice board, the scratch
   stage — and a full-bleed cream-paper ticket back. Flat colour only,
   thick ink outlines, hard offset shadows, print textures. Anton for
   display, Barlow for body, Space Mono for print/receipt details.
   ===================================================================== */

:root{
  --bg-deep:   #2B060B;
  --bg-panel:  #7A0A18;
  --bg-panel2: #5E0812;
  --card:      #C6102E;
  --card-soft: #E02140;
  --ink:       #2B060B;
  --cream:     #FFF6E5;
  --cream-2:   #F3D2CB;
  --cream-3:   #C08B84;
  --paper:     #FFF6E5;
  --paper-ink: #331016;
  --gold:      #FFB800;
  --gold-b:    #FFC41F;
  --gold-d:    #D98E00;
  --silver:    #C9CFDA;
  --silver-d:  #9AA3B2;
  --ok:        #7FE0A8;
  --err:       #FF8A7A;
  --anton: "Anton","Noto Sans SC",sans-serif;
  --sans:  "Barlow","Noto Sans SC",-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  --mono:  "Space Mono",ui-monospace,"Courier New",monospace;
  --ease:  cubic-bezier(.22,.61,.21,1);
  --shadow: 8px 8px 0 var(--ink);
  --shadow-sm: 5px 5px 0 var(--ink);
}

*{ box-sizing:border-box; margin:0; padding:0; }
[hidden]{ display:none !important; }
html{ scroll-behavior:smooth; }
html,body{ background:var(--bg-deep); }
body{
  color:var(--cream);
  font-family:var(--sans);
  font-size:15.5px;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
::selection{ background:var(--gold); color:var(--ink); }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; cursor:pointer; background:none; border:none; color:inherit; }
.mono{ font-family:var(--mono); font-variant-numeric:tabular-nums; }

/* ---------------- counter surface + confetti specks ---------------- */
.specks{ position:fixed; inset:0; z-index:0; pointer-events:none; }
.specks i{ position:absolute; display:block; }
.specks .s1{ left:6%;  top:12%; width:9px; height:9px; border-radius:50%; background:var(--gold-d); }
.specks .s2{ left:12%; top:64%; width:14px; height:5px; background:var(--card); transform:rotate(24deg); }
.specks .s3{ left:3%;  top:38%; width:7px; height:7px; border-radius:50%; background:var(--silver-d); }
.specks .s4{ left:9%;  top:86%; width:10px; height:4px; background:var(--gold-d); transform:rotate(-18deg); }
.specks .s5{ right:5%; top:9%;  width:8px; height:8px; border-radius:50%; background:var(--card-soft); }
.specks .s6{ right:11%; top:44%; width:13px; height:5px; background:var(--gold-d); transform:rotate(38deg); }
.specks .s7{ right:4%; top:71%; width:7px; height:7px; border-radius:50%; background:var(--silver-d); }
.specks .s8{ right:9%; top:90%; width:11px; height:4px; background:var(--card); transform:rotate(-30deg); }
.specks .s9{ left:16%; top:26%; width:6px; height:6px; border-radius:50%; background:var(--card-soft); }
.specks .s10{ right:16%; top:22%; width:9px; height:4px; background:var(--silver-d); transform:rotate(14deg); }
.specks .s11{ left:15%; top:52%; width:6px; height:6px; border-radius:50%; background:var(--gold-d); }
.specks .s12{ right:15%; top:58%; width:6px; height:6px; border-radius:50%; background:var(--gold-d); }

/* ---------------- the roll ---------------- */
.roll{
  position:relative; z-index:1;
  max-width:940px; margin:0 auto;
  background:var(--bg-panel);
  border-left:3px solid var(--ink);
  border-right:3px solid var(--ink);
  box-shadow:0 0 0 6px rgba(0,0,0,.18);
}
.seg{ padding:52px 46px 58px; }

/* ---------------- perforation tear line ---------------- */
.perf{ position:relative; height:0; border-top:3px dashed rgba(255,246,229,.5); }
.perf::before,.perf::after{
  content:''; position:absolute; top:-13px; width:26px; height:26px; border-radius:50%;
  background:var(--bg-deep);
}
.perf::before{ left:-16px; }
.perf::after{ right:-16px; }
.perf-scissor{
  position:absolute; right:34px; top:-13px; font-size:15px; line-height:1;
  color:rgba(255,246,229,.55); transform:rotate(-8deg);
}

/* ---------------- stub header ---------------- */
.stub-head{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 26px 14px;
}
.stub-brand{ display:flex; align-items:baseline; gap:14px; min-width:0; }
.stub-name{
  font-family:var(--anton); font-size:26px; letter-spacing:.04em; color:var(--cream);
  white-space:nowrap;
}
.stub-star{ color:var(--gold); margin-left:5px; }
.stub-issue{
  font-family:var(--mono); font-size:10.5px; letter-spacing:.18em; color:var(--cream-3);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.stub-actions{ display:flex; align-items:center; gap:9px; flex-shrink:0; }
.stub-x{
  font-weight:800; font-size:13px; border:2px solid var(--ink); border-radius:8px;
  padding:6px 11px; background:var(--bg-panel2); box-shadow:3px 3px 0 var(--ink); color:var(--cream);
}
.stub-lang{
  font-family:var(--mono); font-size:11.5px; font-weight:700; letter-spacing:.08em;
  border:2px solid var(--ink); border-radius:8px; padding:7px 10px;
  background:var(--bg-panel2); box-shadow:3px 3px 0 var(--ink); color:var(--cream);
}

/* ---------------- buttons ---------------- */
.tbtn{
  display:inline-block; border:3px solid var(--ink); border-radius:10px;
  font-weight:800; letter-spacing:.06em; color:var(--ink);
  box-shadow:var(--shadow-sm); transition:transform .12s var(--ease), box-shadow .12s var(--ease), background .12s var(--ease);
}
.tbtn-gold{ background:var(--gold); }
.tbtn-gold:hover:not(:disabled){ background:var(--gold-b); transform:translate(-1px,-1px); box-shadow:6px 6px 0 var(--ink); }
.tbtn-ghost{ background:var(--bg-panel2); color:var(--cream); }
.tbtn-ghost:hover:not(:disabled){ background:var(--card); }
.tbtn-sm{ padding:8px 14px; font-size:12.5px; }
.tbtn-block{ display:block; width:100%; padding:15px 18px; font-size:16px; margin-top:18px; }
.tbtn:disabled{ opacity:.45; cursor:not-allowed; box-shadow:3px 3px 0 var(--ink); }

/* ---------------- hero: the giant ticket ---------------- */
.hero-stage{ padding:54px 46px 50px; }
.big-ticket{
  position:relative;
  background:var(--card);
  border:3px solid var(--ink); border-radius:20px;
  box-shadow:14px 14px 0 var(--ink);
  transform:rotate(-3deg);
  padding:0 0 18px;
  margin:6px 8px 0;
}
.bt-band{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--gold); border-bottom:3px solid var(--ink);
  border-radius:17px 17px 0 0; padding:13px 22px;
  color:var(--ink);
}
.bt-stars{ font-size:15px; letter-spacing:.35em; white-space:nowrap; }
.bt-name{ font-weight:900; font-size:16.5px; letter-spacing:.1em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bt-issue{ font-family:var(--mono); font-size:12px; font-weight:700; letter-spacing:.14em; white-space:nowrap; }
.bt-slogan{
  font-family:var(--anton); font-weight:400;
  font-size:clamp(30px, 5.6vw, 52px); line-height:1.16; letter-spacing:.01em;
  color:var(--cream); padding:26px 30px 4px;
}
.bt-slogan em{ font-style:normal; color:var(--gold); }

.bt-jackpot{ padding:16px 30px 0; }
.bt-jp-k{ font-size:11px; font-weight:800; letter-spacing:.3em; color:var(--gold); }
.bt-jp-board{
  margin-top:8px; background:var(--ink); border:3px solid var(--ink); border-radius:12px;
  padding:14px 18px 12px; display:flex; align-items:center; gap:16px;
  box-shadow:inset 0 0 0 2px rgba(255,246,229,.13);
}
.odo{ display:flex; gap:5px; flex-wrap:wrap; }
.odo-cell{
  font-family:var(--anton); font-size:clamp(30px, 5vw, 44px); line-height:1;
  color:var(--gold); background:rgba(255,246,229,.06);
  border:1px solid rgba(255,246,229,.16); border-radius:6px;
  min-width:.82em; text-align:center; padding:6px 2px 3px;
}
.bt-jp-unit{ font-family:var(--anton); font-size:20px; color:var(--cream-2); letter-spacing:.08em; }
.bt-jp-sub{ display:block; margin-top:8px; font-family:var(--mono); font-size:10px; letter-spacing:.22em; color:var(--cream-2); }

.bt-foil{
  position:relative; margin:20px 30px 0; height:158px;
  background:var(--silver); border:3px solid var(--ink); border-radius:12px; overflow:hidden;
}
.bt-foil::before{
  content:''; position:absolute; inset:0;
  background:repeating-linear-gradient(90deg, transparent 0 26px, rgba(43,6,11,.10) 26px 28px);
}
.bt-streak{ position:absolute; height:20px; background:var(--gold-b); border-radius:10px; transform:rotate(-2deg); }
.bt-streak.k1{ left:5%; top:26px; width:56%; }
.bt-streak.k2{ left:3%; top:66px; width:38%; height:24px; }
.bt-streak.k3{ left:8%; top:112px; width:64%; }
.bt-reveal{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%) rotate(-2deg);
  background:var(--gold-b); color:var(--ink); border:3px solid var(--ink); border-radius:10px;
  font-family:var(--anton); font-size:40px; padding:8px 30px 4px; letter-spacing:.04em;
  box-shadow:5px 5px 0 var(--ink); z-index:2;
}
.bt-foil-tag{
  position:absolute; right:12px; bottom:9px; font-family:var(--mono);
  font-size:10px; letter-spacing:.2em; color:rgba(43,6,11,.55); font-weight:700;
}

.bt-draw{ padding:22px 30px 0; }
.bt-draw-k{
  display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap;
  font-size:12px; font-weight:800; letter-spacing:.26em; color:var(--cream-2);
}
.bt-draw-k b{ font-family:var(--mono); font-size:12.5px; letter-spacing:.1em; color:var(--gold); }
.draw-cells{ display:flex; align-items:stretch; gap:8px; margin-top:10px; }
.draw-cell{
  flex:1; background:var(--bg-panel2); border:3px solid var(--ink); border-radius:10px;
  box-shadow:4px 4px 0 var(--ink); text-align:center; padding:9px 4px 6px;
}
.draw-num{ display:block; font-family:var(--anton); font-size:36px; line-height:1; color:var(--cream); }
.draw-unit{ display:block; margin-top:4px; font-size:9px; font-weight:800; letter-spacing:.22em; color:var(--cream-3); }
.draw-sep{ align-self:center; font-family:var(--anton); font-size:24px; color:var(--gold); }

.bt-margin{
  display:flex; flex-wrap:wrap; gap:6px 10px; align-items:center;
  padding:18px 30px 0; font-family:var(--mono); font-size:11.5px; font-weight:700;
  letter-spacing:.12em; color:var(--cream);
}
.bt-dot{ color:var(--gold); }
.bt-foot{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin:16px 30px 0; padding-top:13px; border-top:2px dashed rgba(255,246,229,.45);
  font-size:11px; letter-spacing:.12em; color:var(--cream-2);
}
.barcode{ width:118px; height:26px; flex-shrink:0; }
.barcode rect{ fill:var(--cream); }
.bt-coin{
  position:absolute; right:-24px; bottom:52px; width:86px; height:86px; border-radius:50%;
  background:var(--gold); border:3px solid var(--ink); box-shadow:var(--shadow-sm);
  display:flex; align-items:center; justify-content:center;
  font-size:36px; color:var(--ink); transform:rotate(10deg); z-index:3;
}
.hero-note{
  max-width:640px; margin:36px auto 0; text-align:center;
  font-size:15px; line-height:1.85; color:var(--cream-2);
}
.hero-note b{ color:var(--cream); }
.hero-note.small{ margin-top:8px; font-size:12.5px; color:var(--cream-3); }

/* ---------------- section sign + printed notes ---------------- */
.win-sign{
  display:flex; align-items:baseline; gap:16px; flex-wrap:wrap;
  border-bottom:3px solid var(--ink); padding-bottom:12px; margin-bottom:26px;
}
.win-sign-t{ font-family:var(--anton); font-size:34px; letter-spacing:.03em; color:var(--cream); }
.win-sign-s{ font-family:var(--mono); font-size:10.5px; letter-spacing:.26em; color:var(--gold); }
.ticket-note{ font-size:15px; line-height:1.85; color:var(--cream-2); margin-bottom:14px; max-width:720px; }
.ticket-note b{ color:var(--cream); }
.ticket-note.dim{ font-size:13px; color:var(--cream-3); }

/* ---------------- ticket window (mint) ---------------- */
.window{
  background:var(--bg-panel2); border:3px solid var(--ink); border-radius:16px;
  box-shadow:var(--shadow); overflow:hidden; margin-top:26px;
}
.win-top{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--card); border-bottom:3px solid var(--ink); padding:14px 24px;
}
.win-top-t{ font-weight:900; font-size:17px; letter-spacing:.08em; }
.win-top-s{ font-family:var(--mono); font-size:11.5px; letter-spacing:.1em; color:var(--gold); }
.win-body{ padding:22px 24px 24px; }
.wline{
  display:flex; align-items:baseline; justify-content:space-between; gap:14px;
  padding:7px 0; border-bottom:1px dashed rgba(255,246,229,.22);
}
.wline .wk{ font-size:13px; color:var(--cream-2); letter-spacing:.06em; }
.wline .wv{ font-weight:800; font-size:14.5px; font-variant-numeric:tabular-nums; text-align:right; }
.wline .wv.hot{ color:var(--gold); }
.wline.total .wv{ font-size:17px; }

.qty{
  display:flex; align-items:stretch; gap:0; margin-top:20px;
  border:3px solid var(--ink); border-radius:12px; overflow:hidden; box-shadow:var(--shadow-sm);
}
.qty-btn{
  width:64px; background:var(--card); color:var(--cream);
  font-size:24px; font-weight:900; line-height:1;
}
.qty-btn:hover{ background:var(--card-soft); }
.qty-val{
  flex:1; background:var(--ink); text-align:center; padding:11px 0 9px;
  font-family:var(--anton); font-size:24px; color:var(--cream);
}
.qty-val small{ font-family:var(--sans); font-size:12.5px; font-weight:700; color:var(--cream-3); margin-left:4px; }
.qty-quick{ display:flex; gap:9px; margin-top:12px; }
.qty-quick button{
  flex:1; padding:9px 0; border:3px solid var(--ink); border-radius:9px;
  background:var(--bg-panel); color:var(--cream); font-weight:800; font-size:13.5px;
  box-shadow:3px 3px 0 var(--ink);
}
.qty-quick button.on{ background:var(--gold); color:var(--ink); }
.qty-quick button:hover{ background:var(--card); }
.qty-quick button.on:hover{ background:var(--gold-b); }

.roll-meter{ margin-top:22px; }
.meter-row{ display:flex; align-items:baseline; gap:10px; }
.meter-row .meter-k{ font-size:12px; font-weight:800; letter-spacing:.14em; color:var(--cream-2); }
.meter-row .meter-v{ font-family:var(--mono); font-size:11.5px; color:var(--cream-3); }
.meter-row .meter-pct{ margin-left:auto; font-family:var(--anton); font-size:16px; color:var(--gold); }
.meter-row.sub{ margin-top:14px; }
.meter-row.sub .meter-pct{ font-size:13px; color:var(--cream-2); }
.roll-bar{
  position:relative; margin-top:8px; height:20px;
  background:var(--ink); border:3px solid var(--ink); border-radius:11px;
}
.roll-bar.thin{ height:13px; border-radius:8px; }
.roll-fill{
  height:100%; width:0%; background:var(--gold); border-radius:8px;
  transition:width .8s var(--ease);
}
.roll-fill.dim{ background:var(--card-soft); }
.roll-cap{
  position:absolute; top:50%; width:12px; height:12px; border-radius:50%;
  background:var(--bg-panel); border:3px solid var(--ink); transform:translateY(-50%); z-index:2;
}
.roll-cap.l{ left:-8px; }
.roll-cap.r{ right:-8px; }

.win-note{ margin-top:13px; font-size:12.5px; line-height:1.65; color:var(--cream-3); }
.win-note.warn{ color:var(--err); font-weight:700; }

/* ---------------- receipt ---------------- */
.receipt{
  max-width:520px; margin:34px auto 0;
  background:var(--paper); color:var(--paper-ink);
  border:3px solid var(--ink); box-shadow:var(--shadow-sm);
  padding:20px 24px 16px;
  font-family:var(--mono); font-size:12.5px; line-height:1.9;
  transform:rotate(-.6deg);
}
.rc-head{ text-align:center; font-weight:700; letter-spacing:.14em; border-bottom:2px dashed rgba(51,16,22,.4); padding-bottom:8px; }
.rc-sec{ margin-top:12px; font-weight:700; letter-spacing:.1em; color:var(--card); }
.rc-line{ display:flex; align-items:baseline; gap:8px; }
.rc-line .rc-dots{ flex:1; border-bottom:2px dotted rgba(51,16,22,.45); transform:translateY(-3px); }
.rc-line b{ font-size:13.5px; }
.rc-line .rc-amt{ color:rgba(51,16,22,.6); font-size:11.5px; min-width:56px; text-align:right; }
.rc-line.hot b{ color:var(--card); }
.rc-foot{ margin-top:12px; border-top:2px dashed rgba(51,16,22,.4); padding-top:8px; text-align:center; letter-spacing:.12em; color:rgba(51,16,22,.65); }

/* ---------------- price list ---------------- */
.price-list{ margin-top:36px; border:3px solid var(--ink); border-radius:14px; overflow:hidden; box-shadow:var(--shadow-sm); }
.pl-head{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  background:var(--ink); padding:11px 20px;
}
.pl-head [data-i18n], .pl-head{ color:var(--cream); }
.pl-head{ font-weight:900; letter-spacing:.14em; font-size:14.5px; }
.pl-head-s{ font-family:var(--mono); font-size:10px; letter-spacing:.22em; color:var(--gold); font-weight:700; }
.price-table{ width:100%; border-collapse:collapse; background:var(--bg-panel2); }
.price-table th{
  text-align:left; font-size:10.5px; letter-spacing:.18em; color:var(--cream-3);
  padding:11px 20px 8px; border-bottom:2px solid rgba(255,246,229,.25); font-weight:800;
}
.price-table td{
  padding:8px 20px; font-size:13px; border-bottom:1px dashed rgba(255,246,229,.14);
  font-variant-numeric:tabular-nums; color:var(--cream-2);
}
.price-table td:first-child{ font-weight:800; color:var(--cream); }
.price-table tr.cur td{ background:rgba(255,184,0,.12); color:var(--cream); }
.cur-tag{
  display:inline-block; margin-left:9px; background:var(--gold); color:var(--ink);
  font-size:9.5px; font-weight:900; letter-spacing:.14em; padding:2px 7px; border-radius:5px;
  vertical-align:2px;
}

/* ---------------- notice board (prize pool) ---------------- */
.notice-board{
  background:var(--card); border:3px solid var(--ink); border-radius:16px;
  box-shadow:var(--shadow); padding:28px 30px 24px;
}
.nb-head{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; border-bottom:3px solid var(--ink); padding-bottom:14px; }
.nb-tag{
  background:var(--gold); color:var(--ink); border:3px solid var(--ink); border-radius:8px;
  font-weight:900; letter-spacing:.3em; padding:5px 10px 5px 13px; font-size:13px;
  box-shadow:3px 3px 0 var(--ink);
}
.nb-title{ font-family:var(--anton); font-size:30px; color:var(--cream); letter-spacing:.02em; }
.nb-sub{ margin-left:auto; font-family:var(--mono); font-size:10px; letter-spacing:.24em; color:var(--gold); }
.nb-note{ margin-top:14px; font-size:13.5px; color:var(--cream-2); }
.nb-clauses{ margin-top:8px; }
.nb-clauses p{ font-size:15px; line-height:1.85; color:var(--cream-2); margin-top:10px; }
.nb-clauses b{ color:var(--cream); }
.nb-stats{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:0; margin-top:22px;
  border:3px solid var(--ink); border-radius:12px; overflow:hidden; background:var(--bg-panel2);
}
.nb-stat{ padding:13px 16px 11px; border-left:2px dashed rgba(255,246,229,.25); }
.nb-stat:first-child{ border-left:none; }
.nb-stat .nk{ display:block; font-size:10.5px; font-weight:800; letter-spacing:.16em; color:var(--cream-3); }
.nb-stat .nv{ display:block; margin-top:3px; font-weight:800; font-size:15.5px; font-variant-numeric:tabular-nums; }
.nb-foot{ margin-top:14px; font-size:12px; color:var(--cream-3); }

/* ---------------- scratch stage ---------------- */
.demo-head{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  max-width:620px; margin:30px auto 12px;
}
.demo-title{ font-weight:900; font-size:16.5px; letter-spacing:.08em; }
.demo-pct{ font-family:var(--anton); font-size:26px; color:var(--gold); }
.stage-ticket{
  max-width:620px; margin:0 auto;
  background:var(--bg-panel2); border:3px solid var(--ink); border-radius:16px;
  box-shadow:var(--shadow); overflow:hidden; transform:rotate(-1deg);
}
.st-band{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--gold); color:var(--ink); border-bottom:3px solid var(--ink); padding:11px 20px;
}
.stb-name{ font-weight:900; letter-spacing:.1em; font-size:14.5px; }
.stb-no{ font-family:var(--mono); font-size:11px; font-weight:700; letter-spacing:.14em; }
.st-card{ position:relative; margin:18px; border:3px solid var(--ink); border-radius:12px; overflow:hidden; background:var(--gold-b); }
.st-reveal{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(43,6,11,.10) 34px 36px),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(43,6,11,.10) 34px 36px),
    var(--gold-b);
  color:var(--ink); text-align:center; padding:20px;
}
.str-k{ font-size:10.5px; font-weight:800; letter-spacing:.3em; background:var(--ink); color:var(--gold); padding:4px 12px; border-radius:6px; }
.str-big{ font-family:var(--anton); font-size:clamp(44px, 9vw, 72px); line-height:1.05; margin-top:12px; }
.str-sub{ font-family:var(--mono); font-weight:700; letter-spacing:.2em; font-size:15px; margin-top:4px; }
#scratchCanvas{
  position:relative; display:block; width:100%; height:300px;
  touch-action:none; cursor:crosshair;
}
.st-stamp{
  position:absolute; left:50%; top:50%; z-index:5;
  transform:translate(-50%,-50%) rotate(-12deg) scale(2.2);
  background:var(--card); color:var(--cream); border:3px solid var(--ink); border-radius:10px;
  font-weight:900; font-size:26px; letter-spacing:.14em; padding:8px 20px;
  box-shadow:var(--shadow-sm); opacity:0; pointer-events:none;
  transition:opacity .18s var(--ease), transform .18s var(--ease);
}
.st-stamp.show{ opacity:1; transform:translate(-50%,-50%) rotate(-12deg) scale(1); }
.st-card.done #scratchCanvas{ pointer-events:none; }
.burst-piece{ position:absolute; z-index:6; pointer-events:none; border-radius:2px; }
.st-foot{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin:0 18px 16px; padding-top:11px; border-top:2px dashed rgba(255,246,229,.4);
  font-size:11px; letter-spacing:.12em; color:var(--cream-2);
}
.scratch-meter{
  max-width:620px; margin:16px auto 0; height:12px;
  background:var(--ink); border:3px solid var(--ink); border-radius:8px; overflow:hidden;
}
.scratch-fill{ height:100%; width:0%; background:var(--gold); transition:width .18s var(--ease); }
.demo-row{
  max-width:620px; margin:12px auto 0;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.demo-status{ font-size:13px; color:var(--cream-2); }
.seg > .win-note{ max-width:620px; margin-left:auto; margin-right:auto; text-align:center; }

/* my cards: fan of stubs */
.fan{
  margin-top:38px; background:var(--bg-panel2); border:3px solid var(--ink); border-radius:16px;
  box-shadow:var(--shadow-sm); padding:20px 24px 22px; position:relative;
}
.fan::before,.fan::after{
  content:''; position:absolute; top:50%; width:20px; height:20px; border-radius:50%;
  background:var(--bg-panel); border:3px solid var(--ink); transform:translateY(-50%);
}
.fan::before{ left:-13px; }
.fan::after{ right:-13px; }
.fan-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; border-bottom:3px solid var(--ink); padding-bottom:11px; }
.fan-t{ font-weight:900; font-size:16.5px; letter-spacing:.08em; }
.fan-s{ font-family:var(--mono); font-size:11.5px; color:var(--gold); }
.fan-lines{ margin-top:8px; }
.fan-btns{ display:flex; gap:12px; margin-top:18px; flex-wrap:wrap; }
.stub-btn{
  flex:1; min-width:220px; padding:14px 16px;
  border:3px dashed var(--ink); border-radius:10px;
  background:var(--bg-panel); color:var(--cream);
  font-weight:800; font-size:14.5px; letter-spacing:.04em;
  box-shadow:4px 4px 0 var(--ink);
  transition:transform .12s var(--ease), background .12s var(--ease);
}
.stub-btn.gold{ background:var(--gold); color:var(--ink); border-style:solid; }
.stub-btn:hover:not(:disabled){ transform:translate(-1px,-1px); background:var(--card); }
.stub-btn.gold:hover:not(:disabled){ background:var(--gold-b); }
.stub-btn:disabled{ opacity:.45; cursor:not-allowed; }

/* ---------------- the ticket back: cream paper ---------------- */
.paper{
  position:relative; z-index:1;
  background:
    radial-gradient(rgba(51,16,22,.055) 1px, transparent 1.4px) 0 0 / 9px 9px,
    var(--paper);
  color:var(--paper-ink);
  border-top:3px solid var(--ink); border-bottom:3px solid var(--ink);
  padding:64px 28px 70px;
}
.paper-in{ position:relative; max-width:848px; margin:0 auto; }
.paper-stamp{
  position:absolute; right:6px; top:-16px; transform:rotate(9deg);
  border:4px solid var(--card); color:var(--card); border-radius:10px;
  font-weight:900; font-size:19px; letter-spacing:.34em; padding:8px 12px 8px 16px;
  opacity:.85; pointer-events:none; white-space:nowrap;
}
.paper-head{ display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; border-bottom:3px solid var(--paper-ink); padding-bottom:11px; }
.paper-h-t{ font-family:var(--anton); font-size:32px; letter-spacing:.02em; }
.paper-h-s{ font-family:var(--mono); font-size:10.5px; letter-spacing:.2em; color:var(--card); font-weight:700; }
.paper-note{ margin-top:14px; font-size:14.5px; color:rgba(51,16,22,.75); }
.back-table{ width:100%; border-collapse:collapse; margin-top:22px; }
.back-table th{
  text-align:left; font-size:11px; letter-spacing:.2em; color:rgba(51,16,22,.55);
  padding:0 10px 9px; border-bottom:2.5px solid var(--paper-ink); font-weight:800;
}
.back-table td{ padding:11px 10px; border-bottom:1.5px dashed rgba(51,16,22,.3); font-size:15px; font-weight:700; }
.back-table td.pct{ font-family:var(--anton); font-size:19px; color:var(--card); width:86px; }
.back-table td.bar-cell{ width:42%; }
.back-table tr.none td{ color:rgba(51,16,22,.5); }
.back-table tr.top td{ color:var(--card); }
.odds-bar{ height:13px; border:2px solid var(--paper-ink); border-radius:7px; overflow:hidden; background:rgba(51,16,22,.06); }
.odds-bar i{ display:block; height:100%; background:var(--card); }
.fact-row{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-top:24px; }
.fact-box{
  border:3px solid var(--paper-ink); border-radius:12px; padding:14px 18px 12px;
  background:#fff; box-shadow:5px 5px 0 rgba(51,16,22,.9);
}
.fb-k{ display:block; font-size:11px; font-weight:800; letter-spacing:.2em; color:rgba(51,16,22,.55); }
.fb-v{ display:block; margin-top:3px; font-family:var(--anton); font-size:27px; color:var(--paper-ink); }
.fb-v span{ font-size:15px; }
.paper-lede{ margin-top:26px; font-size:14.5px; line-height:1.85; color:rgba(51,16,22,.8); max-width:700px; }
.paper-rule{ margin:44px 0 34px; border-top:3px dashed rgba(51,16,22,.45); }
.steps-print{ margin-top:24px; display:grid; grid-template-columns:1fr 1fr; gap:16px 30px; }
.step-line{ display:flex; gap:14px; }
.step-n{
  flex-shrink:0; width:38px; height:38px; border-radius:50%;
  background:var(--card); color:var(--cream); border:2.5px solid var(--paper-ink);
  font-family:var(--anton); font-size:18px; display:flex; align-items:center; justify-content:center;
}
.step-line h3{ font-size:16.5px; font-weight:900; letter-spacing:.04em; }
.step-line p{ font-size:13.5px; line-height:1.7; color:rgba(51,16,22,.75); margin-top:2px; }
.clauses{ margin-top:30px; border-top:2.5px solid var(--paper-ink); }
.clause{
  display:flex; gap:16px; align-items:flex-start;
  padding:13px 2px; border-bottom:1.5px dashed rgba(51,16,22,.3);
}
.seal{
  flex-shrink:0; min-width:52px; text-align:center;
  background:var(--card); color:var(--cream); border-radius:6px;
  font-size:12px; font-weight:900; letter-spacing:.1em; padding:6px 8px;
  box-shadow:2.5px 2.5px 0 rgba(51,16,22,.85); transform:rotate(-2deg);
}
.clause p{ font-size:14px; line-height:1.8; color:rgba(51,16,22,.85); }
.clause p b{ color:var(--paper-ink); }

/* ---------------- footer stub ---------------- */
.end-stub{ padding:30px 46px 40px; }
.end-barcode{ width:100%; height:44px; display:block; }
.end-lines{ margin-top:22px; display:flex; flex-direction:column; gap:9px; }
.end-line{ display:flex; align-items:baseline; gap:16px; }
.end-line .ek{ font-size:10.5px; font-weight:800; letter-spacing:.26em; color:var(--cream-3); min-width:52px; }
.end-addr{ font-family:var(--mono); font-size:13px; letter-spacing:.06em; color:var(--cream); word-break:break-all; }
.end-links a{ font-weight:800; color:var(--gold); }
.end-links span{ color:var(--cream-3); font-size:13px; }
.end-fine{
  margin-top:22px; padding-top:14px; border-top:2px dashed rgba(255,246,229,.35);
  display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  font-size:11.5px; color:var(--cream-3);
}

/* ---------------- toast ---------------- */
#notice{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%, 16px);
  background:var(--cream); border:3px solid var(--ink); color:var(--ink);
  padding:12px 20px; font-size:13.5px; font-weight:700; border-radius:10px; z-index:200;
  opacity:0; pointer-events:none; transition:opacity .25s var(--ease), transform .25s var(--ease);
  max-width:min(92vw, 560px); text-align:center; line-height:1.6;
  box-shadow:var(--shadow-sm);
}
#notice.show{ opacity:1; transform:translate(-50%, 0); }
#notice.err{ background:#FFD9D2; }

/* ---------------- agent modal (agent.js, sc- classes) ---------------- */
.sc-modal-backdrop{
  position:fixed; inset:0; z-index:300; display:none;
  align-items:center; justify-content:center; padding:20px;
  background:rgba(24,3,6,.82);
}
.sc-modal{
  width:min(430px, 94vw); max-height:92vh; overflow:auto;
  background:var(--bg-panel); border:3px solid var(--ink); border-radius:16px;
  box-shadow:var(--shadow); padding:32px 30px 26px; text-align:center; color:var(--cream);
}
.sc-modal-eyebrow{ font-size:10.5px; font-weight:800; letter-spacing:.3em; color:var(--gold); }
.sc-modal-title{ font-family:var(--anton); font-size:23px; margin-top:8px; }
.sc-qr-box{
  margin:22px auto 6px; width:264px; height:264px; background:#fff;
  border:3px solid var(--ink); border-radius:10px;
  display:flex; align-items:center; justify-content:center;
}
.sc-qr-fallback{ color:#111; font-size:10px; word-break:break-all; padding:12px; }
.sc-pair-code{
  display:flex; justify-content:center; gap:12px; align-items:baseline; margin-top:12px;
  font-size:12.5px; color:var(--cream-2); letter-spacing:.16em;
}
.sc-pair-code strong{ font-size:17px; color:var(--cream); letter-spacing:.22em; font-variant-numeric:tabular-nums; }
.sc-pair-steps{ text-align:left; margin:20px auto 0; max-width:330px; color:var(--cream-2); font-size:13.5px; line-height:1.75; padding-left:20px; }
.sc-pair-steps b{ color:var(--cream); }
.sc-pair-note{ text-align:left; max-width:330px; margin:14px auto 0; font-size:12px; color:var(--cream-3); line-height:1.7; }
.sc-pair-status{ min-height:24px; margin:16px 0 6px; font-size:13.5px; font-weight:700; color:var(--gold); }
.sc-btn{ display:inline-block; padding:10px 22px; border:3px solid var(--ink); border-radius:9px; font-size:13px; font-weight:800; letter-spacing:.12em; color:var(--cream); background:var(--card); box-shadow:3px 3px 0 var(--ink); }
.sc-btn-ghost:hover{ background:var(--card-soft); }

/* ---------------- reveal ---------------- */
.print-in{ opacity:0; transform:translateY(10px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
.print-in.on{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .print-in{ opacity:1; transform:none; transition:none; }
  html{ scroll-behavior:auto; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px){
  .nb-stats{ grid-template-columns:1fr 1fr; }
  .nb-stat:nth-child(3){ border-left:none; }
  .nb-stat{ border-top:2px dashed rgba(255,246,229,.25); }
  .nb-stat:nth-child(-n+2){ border-top:none; }
  .steps-print{ grid-template-columns:1fr; }
}
@media (max-width: 640px){
  .seg{ padding:42px 22px 48px; }
  .hero-stage{ padding:40px 20px 42px; }
  .stub-head{ padding:13px 16px 11px; }
  .stub-issue{ display:none; }
  .stub-name{ font-size:21px; }
  .big-ticket{ transform:rotate(-1.6deg); margin:4px 2px 0; }
  .bt-band{ padding:11px 14px; }
  .bt-stars{ display:none; }
  .bt-name{ font-size:13.5px; }
  .bt-slogan{ padding:20px 18px 2px; }
  .bt-jackpot,.bt-draw{ padding-left:18px; padding-right:18px; }
  .bt-foil{ margin:16px 18px 0; height:128px; }
  .bt-margin,.bt-foot{ margin-left:18px; margin-right:18px; padding-left:0; padding-right:0; }
  .bt-margin{ padding-top:14px; }
  .bt-coin{ width:62px; height:62px; font-size:26px; right:-10px; bottom:110px; }
  .draw-num{ font-size:27px; }
  .draw-cells{ gap:5px; }
  .win-sign-t{ font-size:27px; }
  .window{ box-shadow:5px 5px 0 var(--ink); }
  .win-body{ padding:18px 16px 20px; }
  .receipt{ transform:none; }
  .price-table th,.price-table td{ padding-left:10px; padding-right:10px; white-space:nowrap; }
  .price-list{ overflow-x:auto; }
  .notice-board{ padding:22px 18px 20px; }
  .nb-title{ font-size:24px; }
  .nb-sub{ margin-left:0; }
  #scratchCanvas{ height:250px; }
  .fan-btns{ flex-direction:column; }
  .paper{ padding:48px 18px 54px; }
  .paper-stamp{ font-size:14px; top:-8px; }
  .fact-row{ grid-template-columns:1fr; }
  .end-stub{ padding:26px 22px 34px; }
  .specks{ display:none; }
}

/* =====================================================================
   CRAFT OVERHAUL v4 — "real print, not UI cards".
   Texture layers only: paper grain, halftone, guilloche security print,
   foil sheen, engraved coin, letterpress serials, punched perforation,
   torn receipt. Skeleton, palette, copy and behaviour unchanged.
   ===================================================================== */
:root{
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
.svg-defs{ position:absolute; width:0; height:0; overflow:hidden; }

/* faint halftone dot fields worked into the counter + the red roll */
body{ background-image:radial-gradient(rgba(255,184,0,.045) 1px, transparent 1.7px); background-size:26px 26px; }
.roll{
  background-image:radial-gradient(rgba(43,6,11,.13) .8px, transparent 1.4px);
  background-size:9px 9px;
}

/* crop / registration marks at the roll's top corners */
.roll::before,.roll::after{
  content:''; position:absolute; top:9px; width:19px; height:19px; z-index:4;
  pointer-events:none; opacity:.5; background-repeat:no-repeat;
  background-image:
    radial-gradient(circle, transparent 5.5px, rgba(255,246,229,.85) 6px, rgba(255,246,229,.85) 7px, transparent 7.5px),
    linear-gradient(rgba(255,246,229,.85), rgba(255,246,229,.85)),
    linear-gradient(rgba(255,246,229,.85), rgba(255,246,229,.85));
  background-size:19px 19px, 19px 1.5px, 1.5px 19px;
  background-position:center, center, center;
}
.roll::before{ left:9px; }
.roll::after{ right:9px; }

/* paper grain over the printed pieces (print tooth, pointer-transparent) */
.big-ticket::after,.window::after,.notice-board::after,.stage-ticket::after,.price-list::after{
  content:''; position:absolute; inset:0; border-radius:inherit; z-index:30;
  background-image:var(--grain); opacity:.07; mix-blend-mode:overlay; pointer-events:none;
}
.window,.notice-board,.price-list{ position:relative; }
.paper::before{
  content:''; position:absolute; inset:0; z-index:2;
  background-image:var(--grain); opacity:.09; mix-blend-mode:overlay; pointer-events:none;
}
.fan{ background-image:var(--grain); background-blend-mode:overlay; }

/* ---- real perforation: a row of punched holes, not a dashed line ---- */
.perf{ border-top:none; }
.perf::before{
  content:''; position:absolute; left:0; right:0; top:-13px; height:26px;
  background-image:
    radial-gradient(circle, var(--bg-deep) 12.5px, transparent 13.5px),
    radial-gradient(circle, var(--bg-deep) 12.5px, transparent 13.5px),
    radial-gradient(circle, var(--bg-deep) 3.6px, rgba(0,0,0,.30) 4.7px, transparent 5.8px);
  background-size:27px 27px, 27px 27px, 21px 11px;
  background-position:-16px center, calc(100% + 16px) center, center;
  background-repeat:no-repeat, no-repeat, repeat-x;
}
.perf::after{ display:none; }

/* ---- confetti killed: sparse printed spark marks only ---- */
.specks i{
  clip-path:polygon(50% 0%, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0% 50%, 37% 37%);
  border-radius:0; opacity:.26;
}
.specks i.s1{ width:15px; height:15px; background:var(--gold-d); }
.specks i.s2{ width:16px; height:16px; background:var(--card); }
.specks i.s4{ width:12px; height:12px; background:var(--gold-d); }
.specks i.s5{ width:13px; height:13px; background:var(--card-soft); }
.specks i.s6{ width:15px; height:15px; background:var(--gold-d); }
.specks i.s8{ width:14px; height:14px; background:var(--card); }
.specks i.s10{ width:11px; height:11px; background:var(--silver-d); }
.specks i.s12{ width:11px; height:11px; background:var(--gold-d); }
.specks i.s3,.specks i.s7,.specks i.s9,.specks i.s11{ display:none; }

/* ---- guilloche security frame + corner rosettes on the hero ticket ---- */
.bt-guill{
  position:absolute; inset:9px; width:calc(100% - 18px); height:calc(100% - 18px);
  border:1.5px solid rgba(255,184,0,.45); border-radius:13px;
  box-shadow:inset 0 0 0 5px var(--card), inset 0 0 0 6.5px rgba(255,184,0,.35);
  z-index:0; pointer-events:none;
}
.bt-ros{ position:absolute; width:54px; height:54px; z-index:2; pointer-events:none; opacity:.92; }
.bt-ros.tl{ top:64px; left:4px; }
.bt-ros.tr{ top:64px; right:4px; }
.bt-ros.bl{ bottom:6px; left:4px; }
.bt-ros.br{ bottom:6px; right:4px; }
.bt-jackpot{ position:relative; }
.bt-jp-guill{ position:absolute; inset:0; width:100%; height:100%; opacity:.12; pointer-events:none; }
.bt-jackpot>*:not(.bt-jp-guill){ position:relative; z-index:1; }

/* ---- microprint line under the ticket head ---- */
.bt-micro{
  padding:7px 30px 0; font-family:var(--mono); font-size:6px; letter-spacing:.34em;
  color:rgba(255,246,229,.48); white-space:nowrap; overflow:hidden;
}

/* ---- letterpress: embossed serials + sunken print numerals ---- */
.bt-issue{ text-shadow:0 1px 0 rgba(255,246,229,.45), 0 -1px 1px rgba(43,6,11,.35); }
.bt-name{ text-shadow:0 1px 0 rgba(255,246,229,.35); }
.stb-no{ text-shadow:0 1px 0 rgba(255,246,229,.45), 0 -1px 1px rgba(43,6,11,.3); }
.bt-foot .mono{ text-shadow:0 -1px 1px rgba(43,6,11,.55), 0 1px 0 rgba(255,246,229,.16); }
.stub-issue{ text-shadow:0 -1px 1px rgba(0,0,0,.4); }
.draw-num{ text-shadow:0 2px 0 rgba(0,0,0,.35), 0 -1px 0 rgba(255,246,229,.14); }
.odo-cell{ text-shadow:0 2px 0 rgba(0,0,0,.4); }

/* ---- foil realism: fine lines + diagonal sheen + torn streaks ---- */
.bt-foil{ background:linear-gradient(155deg, #D9DEE7 0%, var(--silver) 42%, #B4BBC7 78%, #C9CFDA 100%); }
.bt-foil::before{
  background:repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 1px, transparent 1px 3px, rgba(43,6,11,.06) 3px 4px, transparent 4px 6px);
}
.bt-foil::after{
  content:''; position:absolute; top:-25%; bottom:-25%; left:16%; width:36%;
  background:linear-gradient(100deg, transparent 0%, rgba(255,255,255,.34) 42%, rgba(255,255,255,.08) 62%, transparent 100%);
  transform:skewX(-18deg); pointer-events:none;
}
.bt-streak{ border-radius:0; }
.bt-streak.k1{ clip-path:polygon(0 22%, 3% 4%, 97% 0%, 100% 38%, 98% 74%, 62% 100%, 4% 88%, 0 52%); }
.bt-streak.k2{ clip-path:polygon(0 30%, 5% 6%, 95% 2%, 100% 44%, 96% 82%, 55% 100%, 3% 90%, 0 58%); }
.bt-streak.k3{ clip-path:polygon(0 18%, 4% 2%, 98% 6%, 100% 42%, 97% 80%, 58% 98%, 2% 92%, 0 48%); }

/* ---- engraved coin: SVG takes over the coin body ---- */
.bt-coin{ background:none; border:none; box-shadow:none; padding:0; }
.bt-coin svg{ display:block; width:100%; height:100%; filter:drop-shadow(5px 5px 0 var(--ink)); }

/* ---- receipt realism: thermal streaks, torn zigzag foot, barcode ---- */
.receipt{
  position:relative;
  background-image:repeating-linear-gradient(90deg, rgba(51,16,22,.030) 0 5px, transparent 5px 13px, rgba(255,255,255,.5) 13px 14px, transparent 14px 23px);
}
.receipt::after{
  content:''; position:absolute; left:2px; right:2px; bottom:-10px; height:10px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10'%3E%3Cpath d='M0 0 L7 10 L14 0 Z' fill='%23FFF6E5'/%3E%3C/svg%3E");
  background-repeat:repeat-x; background-size:14px 10px;
  filter:drop-shadow(3px 3px 0 rgba(43,6,11,.8));
}
.barcode.dark rect{ fill:var(--paper-ink); }
.rc-barcode{ display:block; width:150px; height:30px; margin:12px auto 4px; }
.rc-no{ text-align:center; font-size:10px; letter-spacing:.34em; color:rgba(51,16,22,.55); }

/* ---- rough ink edges on stamps + seals, uneven seal angles ---- */
.paper-stamp{
  filter:url(#roughInk); opacity:.82;
  text-shadow:1.5px 0 0 rgba(198,16,46,.30), -1px 0 0 rgba(198,16,46,.18);
}
.st-stamp{ filter:url(#roughInkSm); }
.seal{ filter:url(#roughInkSm); text-shadow:0 1px 0 rgba(51,16,22,.25); }
.clause:nth-child(even) .seal{ transform:rotate(1.6deg); }
.clause:nth-child(3n) .seal{ transform:rotate(-3.6deg); }
.back-table td.pct{ text-shadow:.6px 0 0 rgba(198,16,46,.25); }

@media (max-width: 640px){
  .bt-ros{ width:42px; height:42px; }
  .bt-ros.tl,.bt-ros.tr{ top:54px; }
  .bt-micro{ padding:6px 18px 0; }
  .bt-coin{ font-size:0; }
}
