.guest-gate { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 10%, #34304d88, transparent 65%), #0b1022; }
.guest-card { width: min(100%, 460px); text-align: center; margin: auto; }
.guest-crown { font-size: 60px; color: #d9c593; line-height: 1; margin: 30px 0 20px; }
.guest-pill { display: inline-block; border: 1px solid #cebb853d; border-radius: 50px; color: #dfcca0; background: #d3bd7310; padding: 7px 13px; font: 600 9px system-ui; letter-spacing: 2px; }
.guest-card h1 { color: #f0e7d6; font: 400 clamp(38px, 7vw, 52px)/1.05 Georgia, serif; letter-spacing: -1.6px; margin: 22px 0 15px; }
#guest-message { font-size: 14px; line-height: 1.65; color: #aebbd1; margin: 0 auto 24px; max-width: 360px; }
#guest-join, #guest-use-invite { width: 100%; min-height: 54px; border-radius: 8px; font: 600 15px system-ui; cursor: pointer; }
#guest-join span { margin-left: 30px; }
#guest-join:disabled { opacity: .5; cursor: wait; }
.guest-footnote { color: #8391ac; font-size: 12px; line-height: 1.8; margin: 22px 0; }
.guest-card a, .guest-help a { font-size: 11px; color: #8f9bb3; text-decoration: none; }
#guest-invite-entry { text-align: left; }
#guest-invite-entry label { display: block; margin-bottom: 8px; font-size: 12px; color: #c2cbe0; }
#guest-invite { width: 100%; resize: vertical; font: 16px/1.5 system-ui; padding: 12px; margin-bottom: 12px; border: 1px solid #6f7d9b55; border-radius: 8px; background: #151e32; color: #d5ddee; }
#guest-qr-scan { margin-top: 12px; border-top: 1px solid #52627b66; color: #c2cbe0; }
#guest-qr-scan summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-size: 12px; }
#guest-qr-scan summary::after { content: '+'; font-size: 20px; }
#guest-qr-scan[open] summary::after { content: '−'; }
#guest-qr-status { margin: 0 0 10px; color: #9fb0ca; font-size: 12px; line-height: 1.5; }
#guest-qr-video { display: block; width: 100%; max-height: 260px; margin-bottom: 10px; border: 1px solid #6f7d9b88; border-radius: 8px; background: #050a13; object-fit: cover; }
#guest-qr-video[hidden] { display: none; }
#guest-qr-start { width: 100%; min-height: 44px; border: 1px solid #7da0c2; border-radius: 7px; background: #253f5d; color: #f1f7ff; font: 700 12px system-ui; cursor: pointer; }
#guest-qr-start:disabled { opacity: .55; cursor: default; }
.guest-help { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 16px; background: #020715ba; }
.guest-help section { position: relative; width: min(100%, 440px); max-height: calc(var(--arena-height, 100dvh) - 32px); overflow-y: auto; overscroll-behavior: contain; background: #141d32; border: 1px solid #8d9bb43b; border-radius: 18px; padding: 32px 24px 22px; }
.guest-help h2 { font: 30px Georgia; color: #e6d8b8; margin: 18px 0; }
.guest-help p { font-size: 13px; color: #9baec9; line-height: 1.7; }
.guest-help dl { margin: 20px 0; }
.guest-help dl div { padding: 10px 0; border-bottom: 1px solid #99b7df18; }
.guest-help dt { font-size: 12px; color: #e0d1ae; }
.guest-help dd { margin: 4px 0 0; font-size: 12px; color: #a9b9d3; }
.guest-help .guest-small { font-size: 11px; }
.guest-help button { min-height: 44px; padding: 0 13px; border: 1px solid #8a9abb44; border-radius: 8px; color: #c8d4eb; background: #25334c; font-size: 12px; cursor: pointer; }
.guest-help a { display: block; margin-top: 20px; }
.guest-help .guest-close { position: absolute; top: 8px; right: 8px; font-size: 22px; min-width: 44px; background: transparent; border: 0; }
#guest-video-wait { position: absolute; inset: 0; display: grid; place-items: end center; box-sizing: border-box; padding: 0 24px clamp(92px,12vh,150px); margin: 0; overflow: hidden; isolation: isolate; font: 700 clamp(12px,1.1vw,17px)/1.4 system-ui,sans-serif; letter-spacing: .04em; color: #dce9ff; text-align: center; text-shadow: 0 2px 12px #020713; background-color: #071225; background-image: linear-gradient(90deg,rgba(3,12,31,.96) 0%,rgba(6,18,41,.7) 33%,rgba(4,11,27,.12) 67%,rgba(3,9,23,.48)),linear-gradient(0deg,rgba(2,8,22,.97) 0%,transparent 42%),var(--loading-fighter-a),var(--loading-fighter-b),url('/oblivion-brawl-logo-v2.png'),var(--loading-arena); background-repeat:no-repeat; background-position:center,center,64% 52%,78% 54%,7% 8%,center; background-size:cover,cover,min(32vw,430px) auto,min(29vw,390px) auto,min(31vw,430px) auto,cover; }
#guest-video-wait::before { content:'LOADING  ◒'; position:absolute; right:clamp(22px,4vw,72px); bottom:clamp(24px,4vh,54px); color:#d9ecff; font-size:clamp(14px,1.5vw,24px); letter-spacing:.16em; animation:loading-pulse 1.1s ease-in-out infinite alternate; }
#guest-video-wait::after { content:'PRO TIP\A' attr(data-tip); white-space:pre-wrap; position:absolute; left:clamp(22px,4vw,72px); right:min(42vw,640px); bottom:clamp(24px,4vh,54px); color:#d7e3f6; text-align:left; font-weight:500; letter-spacing:0; }
@keyframes loading-pulse { to { opacity:.45; transform:translateX(3px); } }
@media (max-width:700px){#guest-video-wait{padding-bottom:118px;background-position:center,center,56% 46%,85% 48%,6% 6%,center;background-size:cover,cover,58vw auto,52vw auto,54vw auto,cover}#guest-video-wait::after{right:24px;bottom:58px;font-size:11px}#guest-video-wait::before{bottom:20px;font-size:12px}}
.duel-active .touch-top-center { display: none; }
body.help-open .touch-controls { visibility: hidden; }
body:not(.duel-active) .touch-controls { display: none; }
#guest-sound[aria-pressed="false"] { color: #8190ab; }
@media (max-height: 500px) and (orientation: landscape) {
 .guest-gate { padding: 20px 24px; }
 .guest-crown { display: none; }
 .guest-pill { margin-top: 16px; }
 .guest-card h1 { font-size: 36px; margin: 12px 0; }
 #guest-message { margin-bottom: 16px; font-size: 12px; }
 .guest-footnote { margin: 12px 0; font-size: 11px; }
}

/* Native modal keeps keyboard and screen-reader focus inside the controls. */
dialog.guest-help{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;color:inherit}
dialog.guest-help:not([open]){display:none}

#guest-remap { display: grid; gap: .5rem; margin: 1rem 0; }
#guest-remap > div { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: .4rem; }
#guest-remap button { min-width: 0; overflow-wrap: anywhere; font-size: .75rem; padding: .6rem .4rem; }
.guest-help details { margin-top: 1rem; }
.guest-help summary { cursor: pointer; padding: .6rem 0; }
