/* MACAU POCKET GP v0.7.1 — prize draw / collection UI. Original look: ink-blue panels, rarity colours as thin rims, no copied game styling. */
:root{--r-common:#9fb4bf;--r-rare:#4ec3ff;--r-epic:#c58bff;--r-legend:#ffc23d}
#prizeScreen,#drawScreen{z-index:30;padding:0;background:linear-gradient(100deg,#0d2533e6 0,#0d253399 60%,#0d253322 100%);align-items:stretch;overflow:hidden}
#drawScreen{z-index:40;background:radial-gradient(circle at 50% 38%,#173a50fa 0,#0b1e2bfc 70%);align-items:center;justify-content:center;overflow:auto}
.pz-card{display:flex;flex-direction:column;width:min(520px,100%);height:100%;padding:max(14px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:#172c39f2;border-right:1px solid #ffffff22;box-shadow:12px 0 50px #06162266}
.pz-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:8px}.pz-head h2,.pz-title h2{margin:4px 0 0;font-size:22px;font-weight:900;line-height:1.1}
.pz-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:6px}.pz-title{flex:1 1 0;min-width:0;order:0}.pz-top .ti-close{order:1}.pz-br{order:2;flex:0 0 100%;height:0}.pz-top>.pz-chip,.pz-top>.pz-go{order:3}
.pz-chip{flex:none;padding:8px 11px;border-radius:999px;background:#ffffff14;border:1px solid #ffffff26;font-weight:800;font-size:13px;font-variant-numeric:tabular-nums}
.pz-go{flex:1;width:auto;margin:0!important;padding:10px 14px!important;font-size:15px!important;min-height:44px;justify-content:center!important}
.pz-free{margin:0 0 8px;font-size:11px;line-height:1.5;color:var(--muted)}.pz-free.flash{color:var(--yellow);font-weight:800}
.pz-veh{display:flex;align-items:center;gap:8px;margin-bottom:8px}.pz-vname{flex:1;text-align:center;min-width:0}.pz-vname small{display:block;font-size:10px;letter-spacing:1px;color:var(--muted)}.pz-vname b{font-size:16px}
.pz-tabs{flex:none;margin-bottom:8px}.pz-tabs button{position:relative;min-height:44px}.pz-dot{position:absolute;top:2px;right:4px;min-width:17px;height:17px;border-radius:9px;background:var(--red);color:#fff;font-size:10px;font-style:normal;line-height:17px;padding:0 4px;font-weight:900}
.pz-grid{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 2px 6px}
.pz-sec{margin:10px 0 6px;font-size:12px;letter-spacing:1px;color:var(--yellow);font-weight:900}.pz-sec:first-child{margin-top:2px}
.pz-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:7px}
.pz-item{position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:96px;padding:8px 4px 6px;border-radius:12px;background:#ffffff12;border:2px solid var(--rc,#ffffff26);text-align:center;color:#fff}
.pz-item.r-common{--rc:#9fb4bf66}.pz-item.r-rare{--rc:#4ec3ffaa}.pz-item.r-epic{--rc:#c58bffcc}.pz-item.r-legend{--rc:#ffc23d;box-shadow:0 0 14px #ffc23d44}
.pz-item.locked{opacity:.62;filter:saturate(.55)}.pz-item.sel{background:#ffffff26;outline:3px solid var(--yellow);outline-offset:1px}.pz-item.eq{background:#2c5a45}.pz-item.none{border-style:dashed;--rc:#ffffff33}.pz-item:disabled{opacity:.35}
.pz-ico{display:grid;place-items:center;width:44px;height:44px;font-size:28px;line-height:1;border-radius:50%}.pz-ico img{width:40px;height:40px;image-rendering:pixelated;border-radius:8px}
.pz-ico.sw{background:var(--sw);border:3px solid #ffffffcc;box-shadow:inset 0 -9px 0 -3px var(--st,transparent)}
.pz-ico.medal.t0{filter:grayscale(1);opacity:.6}.pz-ico.medal.t1{filter:sepia(1) saturate(2.5) hue-rotate(-12deg) brightness(.8)}.pz-ico.medal.t2{filter:grayscale(1) brightness(1.5)}.pz-ico.medal.t3{filter:none}
.pz-nm{font-size:12px;font-weight:800;line-height:1.2}.pz-rt{font-size:10px;color:var(--muted)}
.pz-new{position:absolute;top:-6px;right:-3px;padding:2px 6px;border-radius:8px;background:var(--red);font-size:9px;font-style:normal;font-weight:900;letter-spacing:.5px;animation:pzPulse 1.4s ease-in-out infinite}
.pz-eq{position:absolute;top:3px;left:5px;font-style:normal;font-weight:900;color:#8cf0b0}.pz-lock{position:absolute;top:3px;right:5px;font-style:normal;font-size:12px}
.pz-detail{flex:none;margin-top:8px;padding:10px 12px;border-radius:12px;background:#0d2533;border:1px solid #ffffff22;max-height:34%;overflow:auto;font-size:13px;line-height:1.5}
.pz-detail p{margin:4px 0}.pz-dh{display:flex;justify-content:space-between;align-items:baseline;gap:8px}.pz-dh b{font-size:16px}.pz-dh small{font-weight:900}
.r-common{color:var(--r-common)}.r-rare{color:var(--r-rare)}.r-epic{color:var(--r-epic)}.r-legend{color:var(--r-legend)}.pz-item[class*=" r-"]{color:#fff}
.pz-hint{font-size:12px;color:var(--muted)}.pz-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px;align-items:center}
.pz-acts .primary,.pz-acts .secondary{width:auto;flex:1 1 140px;margin:0;min-height:44px;padding:10px 14px;font-size:14px;justify-content:center}
.pz-acts .secondary{display:flex;border:1px solid #ffd15c66;background:#0d253388;color:#ffe8a8;border-radius:12px;font-weight:800}
.pz-acts .primary:disabled{opacity:.45;box-shadow:none;cursor:not-allowed}
.pz-step{display:flex;align-items:center;gap:6px}.pz-step button{width:44px;height:44px;border-radius:10px;background:#ffffff1c;font-size:22px;font-weight:900}.pz-step b{min-width:3ch;text-align:center;font-size:16px}
.pz-finish{margin:10px 0 0;padding:10px 12px;border-radius:12px;background:#ffd15c1f;border:1px solid #ffd15c88;font-size:13px;line-height:1.55;color:#fff}.pz-finish b{color:var(--yellow);font-size:16px}.pz-medal{display:block;margin-top:3px;color:#ffe8a8;font-weight:800}
#prizeFinishBtn{margin-top:10px}
#hornBtn{background:#172c39cc;border:1px solid #ffffff20;border-radius:7px;font-size:11px;padding:9px 12px;min-height:34px}@media(pointer:coarse){#hornBtn{min-height:44px;min-width:44px}}
/* ---- draw ---- */
.dr-card{width:min(440px,100%);margin:auto;padding:max(14px,env(safe-area-inset-top)) 18px 14px;display:flex;flex-direction:column;gap:6px}
.dr-stage{position:relative;height:min(250px,34vh);display:grid;place-items:center;--rc:#4ec3ff;touch-action:manipulation}
.dr-stage::before{content:"";position:absolute;width:240px;height:240px;border-radius:50%;background:radial-gradient(circle,var(--rc) 0,transparent 66%);opacity:0;transition:opacity .35s}
.dr-stage.show::before{opacity:.55}.dr-stage.show.r-legend::before{opacity:.8}
.cap{position:relative;width:128px;height:128px;transition:transform .3s}.cap i{position:absolute;left:0;right:0;display:block;border:3px solid #0d2533}
.cap-top{top:0;height:64px;border-radius:64px 64px 0 0;background:linear-gradient(#5ee0c8,#1fa59a);transform-origin:50% 100%}.cap-bot{bottom:0;height:64px;border-radius:0 0 64px 64px;background:linear-gradient(#fff2c9,#ffc86b)}
.cap-shine{top:14px!important;left:22px!important;right:auto!important;width:22px;height:12px;border:0!important;border-radius:50%;background:#ffffffaa;transform:rotate(-30deg)}
.cap.shake{animation:capShake .42s ease-in-out infinite}.cap.open .cap-top{animation:capOpen .55s ease-out forwards}.cap.open{animation:capDrop .6s ease-out forwards}.cap.gone{display:none}
.dr-reveal{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-align:center}.dr-reveal.pop{animation:revPop .55s cubic-bezier(.2,1.4,.4,1) both}.dr-reveal.still{animation:none}
.dr-icon{display:grid;place-items:center;width:88px;height:88px;font-size:54px;border-radius:50%;background:#ffffff18;border:4px solid var(--rc);box-shadow:0 0 26px var(--rc)}.dr-icon img{width:72px;height:72px;image-rendering:pixelated;border-radius:10px}
.dr-icon.sw{background:var(--sw);border-color:#fff;box-shadow:0 0 26px var(--rc),inset 0 -14px 0 -4px var(--st,transparent)}
#drRarity{margin-top:6px;font-size:12px;letter-spacing:4px;font-weight:900;color:var(--rc)}#drName{font-size:24px;font-weight:900}#drSub{font-size:13px;color:#e4eef1}
.dr-msg{margin:0;min-height:1.5em;text-align:center;font-weight:800;color:var(--yellow)}.dr-pity{margin:0;text-align:center;font-size:11px;color:var(--muted)}
.dr-actions{display:grid;gap:8px;margin-top:4px}.dr-actions .primary{justify-content:center;margin:0;min-height:48px}.dr-actions .secondary{display:flex;justify-content:center;align-items:center;min-height:44px;margin:0;border:1px solid #ffd15c66;background:#0d253388;color:#ffe8a8;border-radius:12px;font-weight:800;padding:10px 14px}.dr-actions .primary:disabled{opacity:.5;box-shadow:none}
@keyframes capShake{0%,100%{transform:rotate(0)}20%{transform:translateX(-8px) rotate(-9deg)}40%{transform:translateX(7px) rotate(8deg)}60%{transform:translateX(-5px) rotate(-5deg)}80%{transform:translateX(4px) rotate(4deg)}}
@keyframes capOpen{to{transform:translateY(-70px) rotate(-38deg);opacity:0}}@keyframes capDrop{to{transform:translateY(26px) scale(.9);opacity:0}}
@keyframes revPop{0%{transform:scale(.2);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes pzPulse{50%{transform:scale(1.12)}}
@media(prefers-reduced-motion:reduce){.cap.shake,.cap.open,.cap.open .cap-top,.dr-reveal.pop,.pz-new{animation:none!important}}
/* ---- layout: phone portrait = bottom sheet (car stays visible above), landscape = left column ---- */
@media(orientation:portrait),(max-width:600px){
  #prizeScreen{align-items:flex-end;background:linear-gradient(180deg,#0d253300 0,#0d253300 34%,#0d2533cc 100%)}
  .pz-title .eyebrow{display:none}.pz-card{width:100%;height:72%;border-right:0;border-radius:18px 18px 0 0;border-top:1px solid #ffffff22;box-shadow:0 -12px 40px #06162299}
  .pz-title h2{font-size:19px}.pz-veh{margin-bottom:4px}.pz-free{font-size:10px;margin-bottom:5px}.pz-row{grid-template-columns:repeat(auto-fill,minmax(82px,1fr))}.pz-detail{max-height:30%}
}
@media(max-height:560px) and (orientation:landscape){
  .pz-card{width:min(470px,58vw);padding-top:8px;padding-bottom:8px}.pz-head{margin-bottom:4px}.pz-head h2{font-size:17px}.pz-head .eyebrow{display:none}
  .pz-title,.pz-br{display:none}.pz-top{margin-bottom:4px;flex-wrap:nowrap}.pz-top .ti-close{order:9;padding:9px 12px}.pz-chip{padding:5px 9px}.pz-go{min-height:40px;padding:6px 12px!important}.pz-free{display:none}.pz-veh{margin-bottom:3px}.pz-veh .g-arrow{width:40px;height:40px}.pz-vname small{display:none}.pz-tabs{margin-bottom:4px}.pz-tabs button{min-height:40px}
  .pz-item{min-height:78px;padding:5px 3px 4px}.pz-ico{width:36px;height:36px;font-size:23px}.pz-ico img{width:34px;height:34px}.pz-row{grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:5px}.pz-detail{margin-top:5px;padding:7px 10px;max-height:38%;font-size:12px}
  .dr-card{padding-top:8px;gap:3px}.dr-stage{height:150px}.cap{width:92px;height:92px}.cap-top,.cap-bot{height:46px}.dr-icon{width:62px;height:62px;font-size:38px}#drName{font-size:19px}.dr-actions{grid-template-columns:1fr 1fr}.dr-pity{display:none}.pz-head{margin-bottom:2px}
}

/* menu pill (always visible on the title screen, also when the card is scrolled) */
#prizePill{position:fixed;top:max(10px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:25;min-height:44px;padding:8px 14px;border-radius:999px;background:#ffd15c;color:var(--ink);font-weight:900;font-size:14px;box-shadow:0 4px 0 #b78b27,0 6px 20px #06162266;display:flex;align-items:center;gap:6px}
#prizePill .pz-dot{position:static;display:inline-block}
@media(orientation:portrait){#prizePill{top:max(10px,env(safe-area-inset-top))}}
