/* Castle arrival — a cinematic pre-login scene, not a boxed setup form.
   Reuses the game's castle photography, logo, home-screen icon and Trajan styling. */
#brm-install-guide[hidden],#brm-install-guide [hidden]{display:none!important}
#brm-install-guide{
 position:fixed;inset:0;z-index:60000;isolation:isolate;
 box-sizing:border-box;display:flex;align-items:center;justify-content:center;
 min-height:0;padding:calc(12px + env(safe-area-inset-top)) 15px calc(12px + env(safe-area-inset-bottom));
 overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
 color:#f5e7d0;font-family:var(--app-font,"trajan-pro-3",Georgia,serif);
 background:
  radial-gradient(ellipse 75% 78% at 50% 38%,#14100625 0%,#060606a6 90%),
  linear-gradient(180deg,#0c0a09ce 0%,#11100a80 35%,#080907ed 100%),
  url('/assets/login-v4.webp') center 40%/cover no-repeat;
}
#brm-install-guide::before{
 content:"";position:fixed;z-index:-1;inset:0;pointer-events:none;
 background:linear-gradient(90deg,#080805ca,transparent 21%,transparent 79%,#070705d1),
  linear-gradient(180deg,#08070680,transparent 13%,transparent 72%,#050606ba);
}
#brm-install-guide .brm-install-panel{
 position:relative;flex:none;width:min(100%,540px);max-height:100%;
 padding:clamp(12px,3vh,25px) clamp(15px,4.3vw,32px) 8px;
 overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;
 scrollbar-color:#8d7047 transparent;
 border:0;border-radius:0;background:linear-gradient(90deg,#0b0c09b8,#0e0f0bde 18%,#10110be3 50%,#0e0f0bde 82%,#0b0c09b8);
 box-shadow:0 16px 55px #0008,inset 1px 0 #ae91632e,inset -1px 0 #ae91632e;
}
#brm-install-guide .brm-install-panel::before,
#brm-install-guide .brm-install-panel::after{
 content:"";position:absolute;left:7%;right:7%;height:1px;pointer-events:none;
 background:linear-gradient(90deg,transparent,#937047 17%,#efd39a 50%,#937047 83%,transparent);
}
#brm-install-guide .brm-install-panel::before{top:5px}
#brm-install-guide .brm-install-panel::after{bottom:6px}
#brm-install-guide .brm-install-brand{
 display:flex;flex-direction:column;align-items:center;gap:0;
 padding:0 0 12px;margin:0;text-align:center;
 border:0;border-bottom:0;background:none;
}
#brm-install-guide .brm-guide-kicker{
 order:1;display:block;margin:6px 0 4px;
 font:500 9px/1.4 var(--app-font,Georgia,serif);
 letter-spacing:.25em;color:#d2af78;text-shadow:0 2px 5px #000c;
}
#brm-install-guide .brm-install-mark{
 order:0;display:block;max-width:82%;width:230px;height:clamp(74px,12vh,105px);
 object-fit:contain;filter:drop-shadow(0 5px 12px #000a) drop-shadow(0 0 16px #d3a45930);
}
#brm-install-guide .brm-install-flourish{
 order:2;display:flex;align-items:center;justify-content:center;gap:12px;
 width:85%;margin:2px auto 5px;font-size:15px;line-height:1;color:#dfbd7e;
 text-shadow:0 0 13px #cba26480;
}
#brm-install-guide .brm-install-flourish::before,
#brm-install-guide .brm-install-flourish::after{
 content:"";display:block;height:1px;flex:1;
 background:linear-gradient(90deg,transparent,#c8a46ac4);
}
#brm-install-guide .brm-install-flourish::after{transform:rotate(180deg)}
#brm-install-guide h1{
 order:3;margin:0;
 color:#f5dcb2;font:400 clamp(22px,5.8vw,32px)/1.14 var(--app-font,Georgia,serif);
 text-transform:uppercase;letter-spacing:.045em;
 text-shadow:0 3px 8px #000e,0 0 20px #aa7b3a60;
}
#brm-install-guide .brm-install-lead{
 order:4;margin:7px 0 0;max-width:380px;
 color:#e6d6b9;font:400 clamp(11px,2.9vw,13px)/1.48 var(--app-font,Georgia,serif);
 text-shadow:0 2px 6px #000d;
}
#brm-install-guide .brm-install-body{padding:0}
#brm-install-guide .brm-guide-system{
 display:flex;align-items:center;justify-content:space-between;gap:10px;
 margin:0 0 3px;padding:7px 3px 8px;
 border-bottom:1px solid #c4a27261;
 font:600 9px/1.4 var(--app-font,Georgia,serif);text-transform:uppercase;
 letter-spacing:.10em;color:#c6a66f;
}
#brm-install-guide .brm-guide-stage{color:#e7d29f;white-space:nowrap;letter-spacing:.11em}
#brm-install-guide .brm-guide-steps{
 position:relative;display:flex;flex-direction:column;gap:0;
 padding:4px 0 3px;
}
#brm-install-guide .brm-guide-steps::before{
 content:"";position:absolute;left:13px;top:20px;bottom:23px;
 width:1px;pointer-events:none;
 background:linear-gradient(180deg,transparent,#bea16c 12%,#745733 50%,#bea16c 90%,transparent);
 opacity:.7;
}
#brm-install-guide .brm-guide-step{
 position:relative;display:grid;
 grid-template-columns:22px 42px minmax(0,1fr);
 gap:12px;align-items:center;width:100%;min-width:0;
 min-height:85px;margin:0;padding:9px 5px 9px 2px;
 border:0;border-bottom:1px solid #be9f6a30;border-radius:0;
 background:none;box-shadow:none;color:#f2e3c6;
 text-align:left;cursor:pointer;opacity:.76;transform:none;
 transition:opacity .2s ease,filter .2s ease,background .2s ease;
}
#brm-install-guide .brm-guide-step:last-child{border-bottom:0}
#brm-install-guide .brm-guide-step.brm-guide-active{
 opacity:1;border-color:#d9ba8161;
 background:linear-gradient(90deg,#ad824800,#a27c4026 18%,#c2a47712 66%,transparent);
 box-shadow:inset 0 0 12px #b58e3922;
}
#brm-install-guide .brm-guide-step.brm-guide-complete{opacity:.88}
#brm-install-guide .brm-guide-step:hover:not(:disabled){filter:brightness(1.13)}
#brm-install-guide .brm-guide-step:focus-visible{
 outline:2px solid #f2d7a3;outline-offset:0;
}
#brm-install-guide .brm-guide-number{
 align-self:center;justify-self:center;z-index:1;
 display:block;padding:4px 1px;background:#11120ee8;border:0;border-radius:0;
 color:#bba47b;font:400 11px/1.3 var(--app-font,Georgia,serif);
 text-shadow:0 2px 5px #000;
}
#brm-install-guide .brm-guide-active .brm-guide-number{color:#f0d093}
#brm-install-guide .brm-guide-control{
 position:relative;display:grid;place-items:center;
 width:40px;height:40px;padding:0;flex:none;max-width:none;min-height:0;
 color:#e6c88f;border:1px solid #ae8e55b5;border-radius:50%;
 background:radial-gradient(circle at 32% 20%,#71522b 0%,#292315 48%,#10130d 100%);
 box-shadow:inset 0 0 0 2px #1b1b13,0 2px 8px #0008;
}
#brm-install-guide .brm-guide-active .brm-guide-control{
 border-color:#f2d39a;box-shadow:inset 0 0 0 2px #302719,0 0 14px #d5ab606e,0 2px 7px #0009;
}
#brm-install-guide .brm-guide-svg{display:block;width:21px;height:21px;color:#f2d49d;stroke-width:1.8}
#brm-install-guide .brm-guide-step-body{display:flex;flex-direction:column;gap:3px;min-width:0}
#brm-install-guide .brm-guide-step-title{
 color:#f1d9ad;font:500 clamp(13px,3.35vw,15px)/1.2 var(--app-font,Georgia,serif);
 text-shadow:0 2px 5px #000c;
}
#brm-install-guide .brm-guide-step-text{
 color:#ded4bd;font:400 clamp(10.5px,2.8vw,12px)/1.44 var(--app-font,Georgia,serif);
}
#brm-install-guide .brm-guide-control-label{
 margin-top:2px;color:#c7a977;
 font:600 9px/1.32 var(--app-font,Georgia,serif);
 letter-spacing:.06em;overflow-wrap:anywhere;text-transform:uppercase;
}
#brm-install-guide .brm-guide-final{
 display:flex;align-items:center;justify-content:center;gap:14px;
 margin:8px 0 5px;padding:10px 6px;
 border:0;border-top:1px solid #ad905e77;border-bottom:1px solid #ad905e77;
 background:linear-gradient(90deg,transparent,#93744824 33%,#93744824 67%,transparent);
}
#brm-install-guide .brm-guide-final-halo{
 flex:none;display:grid;place-items:center;width:62px;height:62px;
 border-radius:17px;border:1px solid #d9b97c8a;
 box-shadow:0 0 0 3px #a9824124,0 0 14px #bc99553b;
 background:#15130e;
}
#brm-install-guide .brm-guide-final img{
 display:block;width:56px;height:56px;object-fit:contain;border-radius:14px;
 box-shadow:0 2px 12px #000b;
}
#brm-install-guide .brm-guide-final p{
 display:flex;flex-direction:column;gap:4px;min-width:0;margin:0;
 font:400 11px/1.4 var(--app-font,Georgia,serif);color:#d7c9af;
}
#brm-install-guide .brm-guide-final strong{
 color:#f1d59d;font:600 12px/1.3 var(--app-font,Georgia,serif);letter-spacing:.03em;
}
#brm-install-guide .brm-guide-actions{
 padding:8px 5px 0;text-align:center;
}
#brm-install-guide .brm-install-next,
#brm-install-guide .brm-install-native{
 display:block;width:100%;min-height:42px;margin:0;padding:9px 15px;
 border:1px solid #c2a16b;border-radius:2px;color:#f8dfb0;
 background:
  linear-gradient(#4a1520ab,#260b12e6),
  url('/assets/button-plate-v3.png') center/100% 100% no-repeat;
 box-shadow:inset 0 1px #fff1ca24,0 4px 10px #000a;
 font:600 12px/1.3 var(--app-font,Georgia,serif);letter-spacing:.07em;
 text-transform:uppercase;
}
#brm-install-guide .brm-install-next:hover:not(:disabled),
#brm-install-guide .brm-install-native:hover:not(:disabled){filter:brightness(1.17)}
#brm-install-guide .brm-install-native{
 margin:0 0 8px;border-color:#c6ad78;
 background:linear-gradient(#374c30ca,#142a20e0),url('/assets/button-plate-v3.png') center/100% 100% no-repeat;
}
#brm-install-guide .brm-install-skip{
 display:block;width:100%;min-height:35px;margin:6px 0 0;padding:6px 0;
 border:0;border-radius:0;background:none;box-shadow:none;
 color:#c6b89a;text-decoration:underline;text-underline-offset:3px;
 font:400 10px/1.3 var(--app-font,Georgia,serif);
}
#brm-install-guide button:focus-visible{outline:2px solid #f7dfa6;outline-offset:3px}
#brm-install-guide .brm-install-foot{
 display:flex;align-items:center;gap:13px;
 margin:0 12% 1px;color:#b8965c;font-size:10px;justify-content:center;
}
#brm-install-guide .brm-install-foot::before,
#brm-install-guide .brm-install-foot::after{
 content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,#987744);
}
#brm-install-guide .brm-install-foot::after{transform:rotate(180deg)}
#brm-install-guide.brm-guide-finished .brm-guide-final-halo{
 border-color:#edc879;box-shadow:0 0 0 4px #d3ac4c24,0 0 27px #e9c7775c;
}
#brm-install-guide.brm-guide-finished .brm-guide-final{
 background:linear-gradient(90deg,transparent,#8f9d6c24 50%,transparent);
}
#brm-install-guide .brm-guide-edge{display:none}
@media(max-width:760px){
 #brm-install-guide[data-pointer="top"] .brm-guide-edge,
 #brm-install-guide[data-pointer="bottom"] .brm-guide-edge{
  position:fixed;z-index:60002;right:11px;display:flex;
  align-items:center;gap:8px;max-width:154px;
  padding:8px 10px;border:1px solid #897048;border-left:3px solid #d4b27b;
  border-radius:2px;background:linear-gradient(165deg,#2d261fef,#15130ff5);
  box-shadow:0 3px 10px #000a;
  color:#efdbb9;font:600 10px/1.3 var(--app-font,Georgia,serif);
  letter-spacing:.025em;pointer-events:none;
 }
 #brm-install-guide[data-pointer="top"] .brm-guide-edge{top:calc(4px + env(safe-area-inset-top))}
 #brm-install-guide[data-pointer="bottom"] .brm-guide-edge{bottom:calc(4px + env(safe-area-inset-bottom))}
 #brm-install-guide .brm-guide-edge i{
  display:block;flex:none;width:0;height:0;
  border-left:6px solid transparent;border-right:6px solid transparent;
 }
 #brm-install-guide[data-pointer="top"] .brm-guide-edge i{border-bottom:9px solid #d4b27b}
 #brm-install-guide[data-pointer="bottom"] .brm-guide-edge i{border-top:9px solid #d4b27b}
}
@media(max-width:390px){
 #brm-install-guide{padding-inline:7px}
 #brm-install-guide .brm-install-panel{padding-inline:12px}
 #brm-install-guide .brm-guide-step{grid-template-columns:20px 37px minmax(0,1fr);gap:9px;padding-right:0}
 #brm-install-guide .brm-guide-steps::before{left:11px}
 #brm-install-guide .brm-guide-control{width:37px;height:37px}
 #brm-install-guide .brm-install-mark{height:78px}
}
@media(max-height:740px){
 #brm-install-guide{align-items:flex-start}
 #brm-install-guide .brm-install-panel{padding-top:12px}
 #brm-install-guide .brm-install-mark{height:62px}
 #brm-install-guide .brm-install-brand{padding-bottom:5px}
 #brm-install-guide .brm-guide-kicker{margin-block:2px}
 #brm-install-guide .brm-install-flourish{margin-block:0 3px}
 #brm-install-guide h1{font-size:23px}
 #brm-install-guide .brm-guide-step{min-height:69px;padding-block:5px}
 #brm-install-guide .brm-guide-final{padding-block:5px;margin-block:4px}
 #brm-install-guide .brm-guide-final-halo{width:50px;height:50px;border-radius:13px}
 #brm-install-guide .brm-guide-final img{width:46px;height:46px;border-radius:11px}
}
@media(prefers-reduced-motion:reduce){
 #brm-install-guide *,#brm-install-guide .brm-guide-edge{animation:none!important;transition:none!important}
}