/* A stage for a memory game, independent of the reserve wire prototype. */
.memory-intro .intro-symbol{border:0;background:none;box-shadow:none;width:115px;height:115px;margin-block:14px}.memory-intro h1 em{color:#d6abd5}.memory-preview{display:flex;gap:9px;margin-top:23px}.memory-preview span{display:grid;place-items:center;width:49px;height:49px;border:1px solid #9e87c94d;background:#25263f;border-radius:15px;font-size:24px;color:#ccb9ef}.memory-preview span:nth-child(2){color:#d8adc8}.memory-preview span:nth-child(3){color:#94c1e4}.memory-preview span:nth-child(4){color:#d5b592}.lab-head nav a{font-size:11px;color:#aaa3c7;text-decoration:none;padding:7px;align-self:center}
.memory-arena{flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:16px 20px;background:radial-gradient(ellipse at 50% 37%,#37304f 0,#1d223c 40%,#101527 85%)}
.memory-arena:before{content:'';position:absolute;width:min(640px,85vw);aspect-ratio:1;border:1px solid #a48ce818;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-55%);box-shadow:0 0 0 45px #a48ce803,0 0 0 46px #a48ce810,0 0 0 90px #a48ce803,0 0 0 91px #a48ce809;z-index:-1;pointer-events:none}
.memory-carrier{display:flex;align-items:center;gap:12px;flex-shrink:0}.memory-carrier .portrait{width:48px;height:48px}.memory-carrier small{color:var(--dim);font-size:11px;display:block}.memory-carrier b{font-size:23px;color:#e3d7f2}.memory-carrier .turn-label{padding:4px 10px;border-radius:20px;background:#b4a0db12;border:1px solid #b4a0db33;font-size:10px;color:#c4b6db}
.memory-bomb{position:relative;width:clamp(140px,25vh,260px);aspect-ratio:1;flex-shrink:0;display:grid;place-items:center;filter:drop-shadow(0 24px 24px #070b2399)}.memory-bomb svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.memory-bomb .bomb-display{position:relative;margin-top:20%;margin-right:7%;width:54%;height:44%;border-radius:50%;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;color:#ded0f2;text-align:center}.bomb-display b{font-size:clamp(30px,6vh,66px);line-height:1.1;font-variant-numeric:tabular-nums}.bomb-display small{font-size:10px;color:#b8a5ca}.memory-bomb.lit{filter:drop-shadow(0 0 24px #ae88d866)}.memory-bomb.lit .bomb-display b{color:var(--symbol,#d8c1ff);text-shadow:0 0 25px currentColor}.memory-bomb.urgent .bomb-display b{color:#e99dc9}.memory-bomb.urgent{animation:memory-breathe .6s infinite alternate}.memory-headline{text-align:center;flex-shrink:0}.memory-headline h2{font-size:27px;font-weight:800;color:#e9def7;margin-bottom:3px}.memory-headline p{font-size:12px;color:#a6a4c6}.memory-progress{display:flex;justify-content:center;gap:7px;min-height:14px;direction:ltr;flex-shrink:0}.memory-progress i{width:9px;height:9px;border:1px solid #8c79b1;border-radius:50%;background:#272441}.memory-progress i.done{background:#c5a8e6;box-shadow:0 0 9px #b497d555}.memory-progress i.active{border-color:#e2c6f5;transform:scale(1.3)}
.memory-pads{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;width:min(560px,100%);direction:ltr;flex-shrink:0;margin-top:6px}.bm-game .memory-pad{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;padding:11px 10px;border-radius:17px;background:linear-gradient(145deg,#302b48,#202641);border:1px solid #a797c64d;box-shadow:0 5px 0 #10152b;transition:background .15s,transform .15s,box-shadow .15s;min-width:0}.memory-pad>span{font-size:32px;color:var(--symbol);line-height:1.1}.memory-pad b{font-size:11px;color:#bbb1d0;font-weight:500}.memory-pad small{position:absolute;top:7px;left:9px;font:10px monospace;color:#aca0c0}.bm-game .memory-pad:disabled{opacity:.65}.bm-game .memory-pad.lit{opacity:1;background:#4d3c66;box-shadow:0 0 25px #bd96dc33,0 4px 0 #191b33;border-color:var(--symbol);transform:translateY(-3px)}.bm-game .memory-pad:hover:enabled{background:#3b3455;border-color:var(--symbol)}.memory-timer{width:min(520px,90%);height:3px;background:#333046;overflow:hidden;border-radius:3px;flex-shrink:0;margin-top:9px}.memory-timer i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#7e9bcc,#b69ae1,#d3a1c4)}
.memory-arena .event{background:#12162bed}.memory-arena.blast{animation:bm-blast .55s ease-out}.memory-arena.pass .memory-bomb{animation:memory-pass .5s ease-out}.memory-meta{color:#b6aacb;font-size:11px}.memory-paused{position:absolute;inset:0;z-index:4;background:#11162bea;backdrop-filter:blur(12px);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:14px}.memory-paused b{font-size:28px}.memory-paused span{color:var(--dim);font-size:13px}.memory-mode-note{margin-top:5px;font-size:11px;color:#baaccf}
@keyframes memory-breathe{to{filter:drop-shadow(0 0 24px #d083ad55)}}@keyframes memory-pass{0%{transform:rotate(-7deg) scale(.94)}60%{transform:rotate(5deg) scale(1.05)}100%{transform:none}}
@media(max-width:760px){.memory-preview{justify-content:center}.memory-arena{padding:10px 15px;gap:9px}.memory-bomb{width:clamp(130px,23vh,210px)}.memory-headline h2{font-size:23px}.memory-headline p{font-size:11px}.memory-pads{gap:8px}.bm-game .memory-pad{padding:10px 6px;border-radius:13px}.memory-pad>span{font-size:29px}.memory-carrier .portrait{width:39px;height:39px}.memory-carrier b{font-size:20px}.memory-carrier .turn-label{font-size:9px}.lab-head nav a{font-size:9px;padding:0}.lab-identity small{display:none}.lab-head{gap:9px}.memory-meta{display:none}}
@media(max-height:700px){.memory-arena{gap:7px;padding-block:8px}.memory-bomb{width:clamp(110px,21vh,170px)}.memory-headline h2{font-size:21px}.memory-carrier .portrait{width:35px;height:35px}.memory-carrier b{font-size:18px}.memory-pad>span{font-size:25px}.bm-game .memory-pad{padding-block:8px}.bomb-display b{font-size:32px}.memory-timer{margin-top:3px}}
@media(max-height:520px) and (min-width:650px){.memory-arena{display:grid;grid-template-columns:minmax(150px,.65fr) minmax(300px,1fr);grid-template-rows:auto auto auto auto;gap:7px 30px;padding:10px max(25px,8vw);align-content:center}.memory-bomb{grid-column:1;grid-row:1/5;justify-self:center;width:clamp(130px,44vh,205px)}.memory-carrier{grid-column:2;justify-content:center}.memory-headline{grid-column:2}.memory-progress{grid-column:2}.memory-pads{grid-column:2;margin:0;width:100%}.memory-timer{display:none}.memory-headline h2{font-size:18px}.memory-headline p{font-size:10px}.memory-carrier small,.memory-carrier .turn-label{display:none}.memory-carrier .portrait{width:27px;height:27px}.memory-carrier b{font-size:15px}.bm-game .memory-pad{padding:5px}.memory-pad>span{font-size:25px}.memory-pad b{font-size:9px}.memory-pad small{font-size:8px;top:4px;left:5px}}
@media(max-height:540px) and (max-width:649px){.memory-arena{overflow:auto;justify-content:flex-start}.memory-bomb{width:105px}}
@media(prefers-reduced-motion:reduce){.memory-bomb,.memory-arena,.memory-pad{animation:none!important;transition:none!important}}

.bm-game{height:100%;width:100%;min-height:0;display:flex;flex-direction:column;background:var(--bg);color:var(--txt);container-type:inline-size}
.bm-game [hidden]{display:none!important}
.bm-game .game-top{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;background:#151a32;flex-shrink:0;border-bottom:1px solid var(--line)}
.bm-game .game-top h1{font-size:21px}.bm-game .eyebrow{font-size:10px;color:var(--dim)}
.bm-game .game-stats{display:flex;gap:18px;align-items:center;font-size:12px;color:var(--dim)}.bm-game .game-stats b{font-size:20px;color:var(--star);padding:0 4px}
.bm-game .game-footer{display:flex;align-items:center;gap:15px;padding:10px 18px;background:#181d34;border-top:1px solid var(--line-2);flex-shrink:0}
.bm-game .game-footer>div:first-child{flex:1;min-width:0}.bm-game .game-footer b{font-size:12px}.bm-game .game-footer small{display:block;font-size:10px;color:var(--dim);margin-top:4px}
.bm-game .primary{padding:9px 14px;background:linear-gradient(115deg,#9784d8,#baa4e7);color:#17172f;border:1px solid #cfbfee80;border-radius:10px;font:700 13px Tajawal,sans-serif;cursor:pointer;flex-shrink:0}
.bm-game .memory-pad{font-family:inherit;cursor:pointer}.bm-game button:focus-visible{outline:3px solid #cfb2ee;outline-offset:3px}
.bm-game .event{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center;backdrop-filter:blur(5px);padding:20px;overflow:auto}
.bm-game .event h2{font-size:30px;color:#e2afcf}.bm-game .event p{font-size:13px;color:var(--dim)}
.bm-game .memory-carrier{width:min(400px,90%)}.bm-game .bm-holder{width:100%;margin:0;max-height:90px}.bm-game .bm-holder .av{width:48px;height:48px;flex-shrink:0}.bm-game .bm-holder .pb-name{font-size:19px}.bm-game .bm-holder .pb-at{display:none}
.bm-game .bm-eliminated{width:min(390px,95%);max-width:none;padding:18px}.bm-game .bm-eliminated .av{width:84px;height:84px;flex-shrink:0}.bm-game .bm-eliminated .pb-name{font-size:24px}
.bm-game .players-strip{display:flex;align-items:center;gap:7px;max-width:50%;overflow-x:auto;min-width:0;padding:4px}
.bm-game .bm-mini{width:105px;min-width:105px;padding:5px;gap:5px;margin:0}.bm-game .bm-mini .av{width:28px;height:28px;flex-shrink:0}.bm-game .bm-mini .pb-name{font-size:10px}.bm-game .bm-mini .pb-meta,.bm-game .bm-mini .pb-at,.bm-game .bm-mini .mark,.bm-game .bm-mini .pb-tier{display:none}
.bm-game .bm-mini.current{border-color:#b8a0dd}.bm-game .bm-more{font-size:12px;color:var(--dim)}
.bm-game .pb-main{min-width:0}.bm-game .pb-name{overflow:hidden;text-overflow:ellipsis}
@keyframes bm-blast{0%{filter:brightness(2.5)}25%{transform:translate(6px,-2px)}50%{transform:translate(-4px,2px)}100%{filter:none;transform:none}}
@container(max-width:600px){.bm-game .game-top{padding:7px 12px}.bm-game .game-top h1{font-size:16px}.bm-game .game-top .eyebrow{display:none}.bm-game .game-stats{gap:8px;font-size:10px}.bm-game .game-stats b{font-size:16px}.bm-game .game-footer{flex-wrap:wrap;padding:7px 10px;gap:7px}.bm-game .players-strip{max-width:100%;width:100%;order:3}.bm-game .bm-holder .av{width:36px;height:36px}.bm-game .bm-holder .pb-name{font-size:16px}.bm-game .bm-holder{padding:7px}.bm-game .primary{font-size:11px;padding:8px}.bm-game .bm-mini{min-width:85px;width:85px}.bm-game .bm-mini .av{width:24px;height:24px}.bm-game .game-footer small{font-size:9px}}
@media(max-height:520px){.bm-game .game-top{padding:5px 12px}.bm-game .game-top .eyebrow{display:none}.bm-game .game-footer{flex-wrap:nowrap;padding:5px 10px}.bm-game .players-strip{width:auto;max-width:35%}.bm-game .bm-holder{padding:4px}.bm-game .bm-holder .av{width:30px;height:30px}.bm-game .bm-holder .pb-name{font-size:13px}.bm-game .bm-holder .pb-meta{display:none}.bm-game .memory-carrier{width:100%;justify-self:center}.bm-game .bm-mini{min-width:50px;width:50px}.bm-game .bm-mini .pb-main{display:none}.bm-game .memory-bomb{max-height:100%}}
/* The active match owns the viewport; removing bomb-memory-active restores the native lobby. */
body:has(#stage.bomb-memory-active){padding:0!important;overflow:hidden!important}
body:has(#stage.bomb-memory-active) #topbar,
body:has(#stage.bomb-memory-active) #rail,
body:has(#stage.bomb-memory-active) #chatpane,
body:has(#stage.bomb-memory-active) #brandmark{display:none!important}
body:has(#stage.bomb-memory-active) #toolrail{
 position:fixed!important;inset:0 0 auto!important;width:100%!important;
 height:calc(46px + env(safe-area-inset-top))!important;
 padding:env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left))!important;
 flex-direction:row!important;gap:10px!important;overflow:visible!important;
 border:0!important;background:#171e30!important;box-shadow:none!important
}
body:has(#stage.bomb-memory-active) #toolrail .brand{width:auto!important;flex-direction:row!important;padding:0!important}
body:has(#stage.bomb-memory-active) #toolrail .brand-logo{width:30px;height:30px;padding:4px}
body:has(#stage.bomb-memory-active) #toolrail .brand-text span,
body:has(#stage.bomb-memory-active) #toolrail .tr-foot,
body:has(#stage.bomb-memory-active) #toolrail::after{display:none!important}
body:has(#stage.bomb-memory-active) #toolrail .tools{flex-direction:row!important;width:auto!important;margin:0 auto 0 0!important;gap:6px!important}
body:has(#stage.bomb-memory-active) #toolrail .tools>button:not(#btnSound):not(#btnCfg):not(#btnFull){display:none!important}
body:has(#stage.bomb-memory-active) #toolrail .btn-icon{width:34px!important;height:34px!important}
body:has(#stage.bomb-memory-active) #layout{
 position:fixed!important;inset:calc(46px + env(safe-area-inset-top)) 0 0!important;
 display:block!important;width:auto!important;height:auto!important;
 min-height:0!important;padding:0!important;margin:0!important;overflow:hidden!important
}
body:has(#stage.bomb-memory-active) #stageWrap{
 position:absolute!important;inset:0!important;display:flex!important;flex-direction:column!important;
 width:100%!important;height:100%!important;max-width:none!important;min-height:0!important;
 margin:0!important;padding:0!important;gap:0!important;background:#0d1526
}
body:has(#stage.bomb-memory-active) #stageBar{
 position:relative!important;inset:auto!important;display:flex!important;order:2;
 flex:0 0 auto!important;justify-content:center!important;overflow:visible!important;
 padding:5px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;
 border:0!important;border-radius:0!important;background:#171e30!important;box-shadow:none!important
}
body:has(#stage.bomb-memory-active) #stageBar .sb-right,
body:has(#stage.bomb-memory-active) #stageBar .sb-mid{display:none!important}
body:has(#stage.bomb-memory-active) #stageBar .sb-left{
 position:static!important;inset:auto!important;display:flex!important;width:auto!important;max-width:100%!important;
 flex-wrap:wrap!important;justify-content:center!important;margin:0!important;padding:0!important;
 gap:6px!important;background:none!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important
}
body:has(#stage.bomb-memory-active) #stageBar .btn{min-height:34px;padding:5px 12px!important}
body:has(#stage.bomb-memory-active) #stage.bomb-memory-active{
 position:relative!important;inset:auto!important;order:0;flex:1 1 0!important;
 width:100%!important;height:auto!important;min-height:0!important;max-width:none!important;
 margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important
}
#stage.bomb-memory-active::before,#stage.bomb-memory-active::after{display:none!important}
#stage.bomb-memory-active .g-body{max-width:none!important;margin:0!important}
body:has(#stage.bomb-memory-active) #practice{
 position:relative!important;inset:auto!important;order:1;flex:0 0 auto!important;
 width:100%!important;max-height:24dvh!important;overflow:auto!important;
 margin:0!important;border-radius:0!important;padding:6px 10px!important
}
body:has(#stage.bomb-memory-active) #gdock{right:0!important;max-height:100dvh!important}

#stage.bomb-memory-active{overflow:hidden!important}
#stage.bomb-memory-active>.g-wrap{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;max-width:none!important;min-height:0!important;transform:none!important;gap:0!important;padding:0!important}
#stage.bomb-memory-active .g-how,#stage.bomb-memory-active .g-top,#stage.bomb-memory-active #gtimer{display:none!important}
#stage.bomb-memory-active .g-body{display:block!important;flex:1!important;width:100%!important;height:100%!important;min-height:0!important;padding:0!important;overflow:hidden!important}
