/* Cinematic paper entrance. The desk underneath is unchanged. */
@property --cw-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
html.gate-skip #cw { display: none !important; }
html:not(.gate-skip):has(#cw:not(.hide)) { overflow: hidden; }

.cw {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: calc(8vh + env(safe-area-inset-top)) 22px calc(8vh + env(safe-area-inset-bottom));
  color: #f4f0ff; font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(ellipse 70% 46% at 50% 62%, rgba(128, 78, 214, .42), transparent 62%),
    radial-gradient(ellipse 50% 24% at 50% 108%, rgba(255, 150, 70, .22), transparent 70%),
    #07060b;
}
.cw.hide { visibility: hidden; opacity: 0; pointer-events: none; }
.cw.go { animation: cw-iris .72s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes cw-iris { from { clip-path: circle(140% at 50% 46%); } to { clip-path: circle(0% at 50% 46%); } }

.cw-stage { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cw-bar { position: absolute; left: 0; right: 0; height: 7vh; min-height: 28px; background: #000; z-index: 2; }
.cw-bar-top { top: 0; } .cw-bar-bot { bottom: 0; }
.cw-flare {
  position: absolute; left: -8%; right: -8%; top: 46%; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 186, 110, .12) 18%, rgba(255, 225, 176, .9) 50%, rgba(188, 160, 255, .7) 62%, transparent 100%);
  box-shadow: 0 0 36px 8px rgba(255, 170, 90, .22);
}
.cw-halo { position: absolute; left: 50%; top: 46%; width: min(640px, 108vw); aspect-ratio: 1; transform: translate(-50%, -50%); }
.cw-halo i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(214, 196, 255, .38); }
.cw-halo i:nth-child(1) { border-style: dashed; animation: cw-spin 22s linear infinite; }
.cw-halo i:nth-child(1)::after { content: ''; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #ffb25a; box-shadow: 0 0 14px #ffb25a; }
.cw-halo i:nth-child(2) { inset: 10%; border-color: rgba(255, 178, 90, .55); animation: cw-spin 14s linear infinite reverse; }
.cw-halo i:nth-child(3) { inset: 21%; border-color: rgba(140, 220, 255, .4); animation: cw-spin 9s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }
.cw-grain, .cw-scan { position: absolute; inset: 0; }
.cw-grain {
  opacity: .22; mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 17% 31%, transparent 0 1px, rgba(255, 255, 255, .16) 1.5px, transparent 2px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px);
  animation: cw-drift 7s steps(2) infinite;
}
.cw-scan { background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .045) 0 1px, transparent 1px 4px); opacity: .35; }
@keyframes cw-drift { 50% { transform: translate3d(-1%, 1%, 0); } }

.cwb { position: relative; z-index: 3; width: min(480px, 100%); max-height: 100%; overflow: auto; text-align: center; scrollbar-width: none; }
.cwb::-webkit-scrollbar { display: none; }
.cwb img { width: 64px; height: 64px; filter: drop-shadow(0 0 18px rgba(196, 160, 255, .55)); }
.cw-kicker { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; }
.cwb .pm { display: inline-block; }
.cw-standby { display: inline-flex; align-items: center; gap: 6px; font: 700 10px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: #d9d2ea; }
.cw-standby i { width: 6px; height: 6px; border-radius: 50%; background: #ffb25a; box-shadow: 0 0 8px #ffb25a; animation: cw-blink 1.4s steps(1) infinite; }
@keyframes cw-blink { 50% { opacity: .25; } }
.cwb h2 { margin: 12px 0 0; font: 800 15px/1 Inter, system-ui, sans-serif; letter-spacing: .42em; text-indent: .42em; text-transform: lowercase; color: #f7f3ff; }
.cw-deck { margin: 10px auto 0; max-width: 26em; color: #cfc8e2; font: 500 14px/1.45 Inter, system-ui, sans-serif; }

.cwpaper {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%;
  height: clamp(132px, 30vh, 220px); margin-top: 22px; padding: 0 18px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: 32px; color: #160d1c;
  --cw-ang: 0deg;
  background:
    linear-gradient(180deg, #fffaf4 0%, #f4e4ff 100%) padding-box,
    conic-gradient(from var(--cw-ang), #ffb25a, #fff, #b388ff, #7ee0ff, #ffb25a) border-box;
  box-shadow: 0 18px 70px rgba(150, 90, 255, .35), 0 0 90px rgba(255, 176, 90, .18);
  animation: cw-border 3.4s linear infinite;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@keyframes cw-border { to { --cw-ang: 360deg; } }
.cwpaper:active { transform: scale(.982); }
.cwpaper:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.cw-sheen { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .7) 48%, transparent 62%); transform: translateX(-130%); animation: cw-sheen 3.8s ease-in-out infinite; }
@keyframes cw-sheen { 0%, 58% { transform: translateX(-130%); } 82%, 100% { transform: translateX(130%); } }
.cw-face { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cw-confirm { font: 800 clamp(44px, 12vw, 76px)/.88 Inter, system-ui, sans-serif; letter-spacing: -.045em; white-space: nowrap; }
.cw-start { font: 700 12px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .22em; text-transform: uppercase; }

.cw-secondary { margin-top: 16px; }
.cw-or { display: block; margin-bottom: 8px; color: #d4d0e2; font: 700 11px/1 Inter, system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 10px #07060b; }
.cw-wallets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cwbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 10px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: #f4f0ff;
  font: 700 14px/1 Inter, system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.cwbtn:active { background: rgba(255, 255, 255, .09); }
.cwbtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cwbtn .ico { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.cw-wl { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.cw-wl b { font-weight: 700; }
.cwbtn small { color: #b7b2c9; font: 500 10px/1 Inter, system-ui, sans-serif; }
.cwfine { margin: 14px auto 0; max-width: 36em; color: #b7b2c9; font: 500 12px/1.45 Inter, system-ui, sans-serif; }
.cwst { min-height: 16px; margin-top: 8px; color: #ffb25a; font: 500 12px/1.4 'JetBrains Mono', ui-monospace, monospace; word-break: break-all; }

@media (max-width: 420px) {
  .cw-wallets { grid-template-columns: 1fr; }
  .cw-start { letter-spacing: .14em; }
}
@media (max-height: 740px) {
  .cwb img { width: 48px; height: 48px; }
  .cwpaper { height: clamp(112px, 24vh, 160px); margin-top: 14px; }
  .cw-deck { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .cw.go, .cw-halo i, .cw-sheen, .cw-standby i, .cw-grain, .cwpaper { animation: none !important; }
}
