/* The Connect wallet window on the website: a portal into the hall. Self-contained (the website has no game styles). */
.solMark { flex: none; width: 22px; height: 18px; vertical-align: middle; }

dialog.walletDlg { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 8px; overflow-x: hidden; overflow-y: auto; color: #f6eee6; font: 15px/1.45 "Segoe UI", system-ui, sans-serif; border: 0; background: transparent; }
dialog.walletDlg::backdrop { background: radial-gradient(ellipse at center, rgba(40, 12, 70, .72), rgba(4, 1, 9, .94)); backdrop-filter: blur(3px); }
dialog.walletDlg[open] { animation: wpIn .32s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes wpIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.wp { position: relative; display: grid; justify-items: center; gap: 10px; padding: 26px 24px 20px; text-align: center;
  background: radial-gradient(ellipse 90% 45% at 50% 0%, #4a1d7a 0%, transparent 70%), linear-gradient(#1f0f35, #0d0619 70%);
  box-shadow: 0 0 0 2px #1a0d06, 0 0 0 5px #b8862f, 0 0 0 7px #1a0d06, inset 0 0 0 1px #f6c04f55, 0 0 60px #9945ff55, 0 24px 60px rgba(0, 0, 0, .75); }
.wp::before, .wp::after { content: ""; position: absolute; top: -5px; width: 14px; height: 14px; background: #f6c04f; box-shadow: 0 0 0 2px #1a0d06, 0 0 10px #f6c04f; transform: rotate(45deg); }
.wp::before { left: -5px; } .wp::after { right: -5px; }
.wp-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; font: 400 26px/1 Georgia, serif; color: #cdbfd6; cursor: pointer; border: 0; background: none; }
.wp-x:hover { color: #fff; }

/* The portal: three rings in Solana colours turning behind the logo, with rising sparks */
.wp-portal { position: relative; display: grid; place-items: center; width: 260px; height: 150px; margin-top: 2px; perspective: 600px; }
/* Rings lie flat like a magic circle on the floor (tilted back) and turn in place */
.wp-portal i { position: absolute; left: 50%; top: 62%; border-radius: 50%; transform: translate(-50%, -50%) rotateX(72deg) rotate(0deg); }
.wp-portal .r1 { width: 230px; height: 230px; border: 4px dashed #14f195; box-shadow: 0 0 24px #14f195aa, inset 0 0 24px #14f19577; animation: wpSpin 9s linear infinite; }
.wp-portal .r2 { width: 172px; height: 172px; border: 3px solid #b77aff; box-shadow: 0 0 26px #9945ffcc, inset 0 0 20px #9945ff99; animation: wpSpin 6s linear infinite reverse; }
.wp-portal .r3 { width: 270px; height: 270px; background: radial-gradient(circle, #b77affaa, #14f19544 42%, transparent 68%); animation: wpPulse 2.6s ease-in-out infinite; }
.wp-portal img { position: relative; top: -10px; width: 210px; height: auto; filter: drop-shadow(0 6px 10px #000c) drop-shadow(0 0 14px #9945ff88); }
@keyframes wpSpin { to { transform: translate(-50%, -50%) rotateX(72deg) rotate(360deg); } }
@keyframes wpPulse { 50% { opacity: .5; } }
.wp-sparks { position: absolute; inset: 0; pointer-events: none; }
.wp-sparks b { position: absolute; bottom: 18px; width: 3px; height: 3px; background: #14f195; box-shadow: 0 0 6px #14f195; animation: wpRise 2.4s ease-in infinite; opacity: 0; }
.wp-sparks b:nth-child(2n) { background: #c79bff; box-shadow: 0 0 6px #9945ff; }
.wp-sparks b:nth-child(1) { left: 22%; animation-delay: 0s; } .wp-sparks b:nth-child(2) { left: 36%; animation-delay: .5s; }
.wp-sparks b:nth-child(3) { left: 50%; animation-delay: 1.1s; } .wp-sparks b:nth-child(4) { left: 62%; animation-delay: .3s; }
.wp-sparks b:nth-child(5) { left: 74%; animation-delay: 1.6s; } .wp-sparks b:nth-child(6) { left: 84%; animation-delay: .9s; }
@keyframes wpRise { 10% { opacity: 1; } to { opacity: 0; transform: translateY(-90px); } }

.wp h2 { margin: 0; font: 700 28px/1.15 "Palatino Linotype", Palatino, Georgia, serif; color: #ffd36a; text-shadow: 0 2px 0 #4d0c08, 0 0 18px #f6c04f66; }
.wp-sub { margin: 0; max-width: 34ch; color: #cdbfd6; }
.wp-sub b { color: #f6eee6; }
.wp-net { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; font: 700 12px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #e9fff5; border-radius: 999px; background: linear-gradient(90deg, #9945ff33, #14f19533); box-shadow: inset 0 0 0 1px #14f19577; }
.wp-net .solMark { width: 18px; height: 15px; }

.walletList { display: grid; gap: 8px; width: 100%; margin: 6px 0 0; }
dialog.walletDlg .wp-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin: 0; padding: 8px 14px; text-align: left; color: #f6eee6; text-decoration: none; font: 700 17px/1.2 "Segoe UI", system-ui, sans-serif; cursor: pointer; border: 0;
  background: linear-gradient(#2e1650, #1a0c2e); box-shadow: inset 0 0 0 2px #5a3d85, inset 0 2px #ffffff14; transition: transform .12s, box-shadow .15s, background .15s; }
dialog.walletDlg .wp-card:hover, dialog.walletDlg .wp-card:focus-visible { transform: translateY(-2px); background: linear-gradient(#3a1d63, #200f38); box-shadow: inset 0 0 0 2px #14f195, 0 0 18px #14f19544, 0 6px 14px #0008; outline: none; }
.wp-card img, .wIco { flex: none; width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px #ffffff22; }
.wIco { background: linear-gradient(135deg, #9945ff, #14f195); }
.wIco.wc { background: #3b99fc; }
.wp-name { flex: 1; display: grid; gap: 2px; }
.wp-name small { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 "Segoe UI", system-ui, sans-serif; color: #9fe9c8; }
.wp-name small i { width: 7px; height: 7px; border-radius: 50%; background: #14f195; box-shadow: 0 0 8px #14f195; }
.wp-link .wp-name small { color: #cdbfd6; }
.wp-go { font: 400 28px/1 Georgia, serif; color: #f6c04f; transition: translate .15s; }
.wp-card:hover .wp-go { translate: 4px 0; }
.wp-none { margin: 4px 0 0; color: #cdbfd6; font-size: 14px; }
.wp-foot { margin: 6px 0 0; font-size: 12px; color: #9d8fae; }

/* Waiting for the wallet: the portal turns faster and the dots blink */
.wp-wait .wp-portal .r1 { animation-duration: 1.6s; }
.wp-wait .wp-portal .r2 { animation-duration: 1.1s; }
.wp-dots { margin: 0; font-weight: 700; color: #9fe9c8; }
.wp-dots b { animation: wpBlink 1.2s infinite; } .wp-dots b:nth-child(2) { animation-delay: .2s; } .wp-dots b:nth-child(3) { animation-delay: .4s; }
@keyframes wpBlink { 50% { opacity: .15; } }

/* WalletConnect view and the error note reuse the frame */
dialog.walletDlg > h2, dialog.walletDlg > p, dialog.walletDlg > .wcBox, dialog.walletDlg > .walletList, dialog.walletDlg > .row { margin-inline: 22px; }
dialog.walletDlg > h2:first-child { margin-top: 22px; font: 700 24px/1.2 "Palatino Linotype", Palatino, Georgia, serif; color: #ffd36a; }
dialog.walletDlg:has(> h2) { padding-bottom: 18px; background: linear-gradient(#1f0f35, #0d0619); box-shadow: 0 0 0 2px #1a0d06, 0 0 0 5px #b8862f, 0 0 50px #9945ff44; }
dialog.walletDlg .row { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
dialog.walletDlg .row button { min-height: 40px; padding: 6px 16px; font: 700 15px/1 "Segoe UI", system-ui, sans-serif; color: #2a1606; cursor: pointer; border: 0; background: linear-gradient(#ffd877, #d99a2b); box-shadow: inset 0 -3px #8a5a1a; }
.wcBox { display: grid; justify-items: center; gap: 10px; }
.wcBox canvas, .wcBox img { width: 240px; height: 240px; background: #fff; padding: 8px; image-rendering: pixelated; }
.walletErr { color: #ff8a7a; }

@media (prefers-reduced-motion: reduce) {
  dialog.walletDlg[open], .wp-portal i, .wp-sparks b, .wp-dots b { animation: none !important; }
}
