.hope-reveal {
  --paper:#fff1d1; --ink:#4b2e32; --gilt:#efbe62;
  color:var(--paper); position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none;
  box-sizing:border-box; margin:0; padding: max(14px,env(safe-area-inset-top)) 12px max(14px,env(safe-area-inset-bottom));
  border:0; background:transparent; overflow:auto; overscroll-behavior:contain;
  font-family:system-ui,"PingFang TC",sans-serif; text-align:center; isolation:isolate;
}
.hope-reveal[open] { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(12px,3vh,26px); }
#screens:has(.hope-reveal[open]) { background:transparent; }
#screens:has(.hope-reveal[open]) .sc-results { visibility:hidden; }
.hope-reveal[open] { visibility:visible; outline:0; }
.hope-reveal::backdrop { background:radial-gradient(ellipse at 50% 44%,#48292f77 0%,#2e1b24d9 58%,#201720ef 100%); }
.hope-reveal::before { content:""; position:absolute; z-index:-1; inset:0; pointer-events:none; opacity:0; }
.hope-reveal[data-tier="SSR"]::before { background:repeating-conic-gradient(from 7deg at 50% 42%,#fbe29320 0deg 3deg,transparent 7deg 18deg),radial-gradient(ellipse at 50% 42%,#ffda7490,transparent 57%); animation:hope-gold 1.8s ease-out both; }
.hope-card-stage {
  position:relative; width:min(64vw,35vh,274px); aspect-ratio:2/3; flex:none; perspective:1000px;
  animation:hope-fly 1.15s cubic-bezier(.14,.72,.2,1) both;
}
.hope-flip { position:absolute; inset:0; transform-style:preserve-3d; animation:hope-turn 1.35s cubic-bezier(.33,.04,.15,1) both; }
.hope-face {
  position:absolute; inset:0; display:flex; align-items:center; flex-direction:column; justify-content:center;
  box-sizing:border-box; backface-visibility:hidden; -webkit-backface-visibility:hidden;
  background-size:100% 100%; background-repeat:no-repeat; color:var(--ink); text-shadow:none;
  filter:drop-shadow(0 8px 10px #180e1ca8); padding:12% 10% 10%;
}
.hope-front { transform:rotateY(180deg) translateZ(1px); }
.hope-back,.hope-reveal[data-tier="R"] .hope-front { background-image:url('../assets/hope-city/frame-r.webp'); }
.hope-reveal[data-tier="SR"] .hope-front { background-image:url('../assets/hope-city/frame-sr.webp'); }
.hope-reveal[data-tier="SSR"] .hope-front { background-image:url('../assets/hope-city/frame-ssr.webp'); }
.hope-card-city { font-weight:750; font-size:clamp(10px,1.65vh,14px); letter-spacing:.14em; }
.hope-grade { font:italic 900 clamp(23px,4vh,40px)/1 Georgia,serif; letter-spacing:.02em; color:#864d2d; }
.hope-reveal[data-tier="SR"] .hope-grade { color:#336869; }
.hope-reveal[data-tier="SSR"] .hope-grade { color:#875419; text-shadow:0 1px #fff9d9,1px 0 #ffe48d; }
.hope-reward-art { display:block; width:86%; height:44%; object-fit:contain; margin:2% 0; }
.hope-back .hope-reward-art { width:63%; margin:8% 0 5%; }
.hope-seal-title,.hope-prize-name { font:900 clamp(17px,3vh,29px)/1.13 Georgia,"Songti TC",serif; }
.hope-seal-title { letter-spacing:.05em; }
.hope-missing { font-size:clamp(12px,1.9vh,17px); color:#8c3e36; }
.hope-card-note { max-width:92%; margin-top:5%; line-height:1.3; font-size:clamp(10px,1.55vh,14px); color:#67483e; }
.hope-reward-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; animation:hope-actions 1.6s both; }
.hope-results-button,.hope-claim { font:700 14px/1.2 system-ui,sans-serif; padding:12px 18px; border:1px solid #f4deb38a; border-radius:12px; background:#3f2931; color:#fff0d5; text-decoration:none; min-height:44px; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.hope-claim { border-color:#fbe1a0; color:#4b291c; background:#f5ce80; }
.hope-claim-saved { padding:8px 13px; font-size:13px; }
.hope-reveal :focus-visible,.hope-claim:focus-visible { outline:3px solid #fff6c2; outline-offset:3px; }
@keyframes hope-fly {
  0% { opacity:.07; transform:translateY(25vh) scale(.15) rotate(-21deg); }
  30% { opacity:1; transform:translateY(-5vh) scale(.91) rotate(5deg); }
  48% { transform:translateY(0) scale(1) rotate(-1deg); }
  68%,100% { transform:translateY(0) scale(1) rotate(0); }
}
@keyframes hope-turn { 0%,45% {transform:rotateY(0);} 80% {transform:rotateY(190deg);} 100% {transform:rotateY(180deg);} }
@keyframes hope-gold { 0%,43% {opacity:0;} 61% {opacity:1;} 100% {opacity:.64;} }
@keyframes hope-actions { 0%,74% {visibility:hidden; opacity:0;} 100% {visibility:visible; opacity:1;} }
@media (prefers-reduced-motion:reduce) {
  .hope-card-stage,.hope-reward-actions { animation:none; }
  .hope-flip { animation:none; transform:rotateY(180deg); }
  .hope-reveal[data-tier="SSR"]::before { animation:none; opacity:.6; }
}
