.erp-quest-root{
  width:100%;
  max-width:var(--erp-quest-max-width,1100px);
  margin:0 auto;
  min-height:0;
  display:block;
  box-sizing:border-box;
  padding:clamp(8px,2vw,18px);
  overflow:hidden;
  overscroll-behavior:contain;
  touch-action:none;
  contain:layout paint;
  background:radial-gradient(circle at 50% 0%,#1b76c9,#102450 42%,#050816);
  color:#ffe28a;
  font-family:Impact,Arial Black,sans-serif;
  border-radius:24px;
}
.erp-quest-root *{box-sizing:border-box}
.erp-quest-cabinet{
  padding:clamp(8px,1.8vw,18px);
  border-radius:22px;
  text-align:center;
  background:linear-gradient(#1d315c,#090d19);
  border:clamp(3px,.55vw,5px) solid #c9972d;
  box-shadow:0 0 0 4px #03050b,0 0 35px #39d6ff66,inset 0 0 28px #000;
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.erp-quest-cabinet h1{
  margin:0;
  font-size:clamp(30px,5vw,64px);
  letter-spacing:clamp(2px,.6vw,7px);
  color:#ffd86b;
  -webkit-text-stroke:1.5px #1f0d00;
  text-shadow:0 4px #000,0 0 22px #36dfff;
  line-height:1.02;
}
.erp-quest-subtitle{
  margin:2px 0 10px;
  color:#7ceaff;
  letter-spacing:clamp(1px,.38vw,5px);
  font-family:Arial,sans-serif;
  font-size:clamp(11px,1.6vw,16px);
  font-weight:900;
  line-height:1.2;
  text-shadow:0 2px #000;
}
.erp-quest-root canvas{
  width:100%;
  max-width:1280px;
  height:auto;
  aspect-ratio:16/9;
  display:block;
  margin:0 auto;
  background:#111;
  border:clamp(2px,.45vw,4px) solid #060914;
  border-radius:12px;
  image-rendering:auto;
  box-shadow:0 0 0 4px #c9972d,0 0 28px #39d6ff55;
  touch-action:none;
}
.erp-quest-controls{
  margin-top:10px;
  font-family:Arial,sans-serif;
  font-size:clamp(11px,1.4vw,16px);
  font-weight:800;
  line-height:1.35;
  color:#f8f0df;
  text-shadow:0 2px #000;
}
.erp-quest-root .mobile-controls{
  display:none;
  gap:12px;
  justify-content:space-between;
  align-items:center;
  margin-top:12px;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.erp-quest-root .mobile-controls button{
  min-width:58px;
  min-height:50px;
  border-radius:14px;
  border:3px solid #c9972d;
  background:linear-gradient(#234f9b,#10234d);
  color:#fff0b8;
  font-family:Arial Black,Arial,sans-serif;
  font-size:16px;
  box-shadow:0 3px 0 #000,0 0 10px #39d6ff88;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.erp-quest-root .mobile-controls .pad{
  display:grid;
  grid-template-columns:repeat(3,58px);
  grid-template-rows:repeat(2,50px);
  gap:7px;
}
.erp-quest-root .mobile-controls .pad button:nth-child(1){grid-column:1;grid-row:2}
.erp-quest-root .mobile-controls .pad button:nth-child(2){grid-column:2;grid-row:1}
.erp-quest-root .mobile-controls .pad button:nth-child(3){grid-column:3;grid-row:2}
.erp-quest-root .mobile-controls .pad button:nth-child(4){grid-column:2;grid-row:2}
.erp-quest-root .mobile-controls .actions{
  display:grid;
  grid-template-columns:repeat(2,64px);
  gap:7px;
}
@media (max-width:900px),(pointer:coarse){
  .erp-quest-root .mobile-controls{display:flex}
}
@media (max-width:767px){
  .erp-quest-root{
    padding:7px;
    border-radius:16px;
  }
  .erp-quest-cabinet{
    padding:7px;
    border-radius:16px;
  }
  .erp-quest-controls{
    display:none;
  }
  .erp-quest-root .mobile-controls{
    display:grid;
    grid-template-columns:1fr;
    justify-items:center;
    gap:8px;
    margin-top:9px;
  }
  .erp-quest-root .mobile-controls .actions{
    grid-template-columns:repeat(4,58px);
  }
  .erp-quest-root .mobile-controls button{
    min-width:54px;
    min-height:46px;
    font-size:14px;
    border-width:2px;
  }
  .erp-quest-root .mobile-controls .pad{
    grid-template-columns:repeat(3,54px);
    grid-template-rows:repeat(2,46px);
    gap:6px;
  }
}
@media (max-width:360px){
  .erp-quest-root .mobile-controls .actions{grid-template-columns:repeat(2,58px)}
}

.erp-quest-title-logo{
  display:block;
  width:min(92%, 980px);
  height:auto;
  margin:0 auto 4px;
  filter:drop-shadow(0 4px 0 #000) drop-shadow(0 0 18px rgba(54,223,255,.28));
}
.erp-quest-sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}
.erp-quest-root .mobile-controls{
  width:min(100%, 430px);
  margin:12px auto 0;
  display:grid;
  grid-template-columns:auto auto;
  justify-content:space-between;
  align-items:end;
  column-gap:16px;
}
.erp-quest-root .mobile-controls .pad,
.erp-quest-root .mobile-controls .actions{
  align-self:end;
}
.erp-quest-root .mobile-controls .pad{
  grid-template-columns:repeat(3,58px);
  grid-template-rows:repeat(2,50px);
}
.erp-quest-root .mobile-controls .actions{
  grid-template-columns:repeat(2,64px);
}
.erp-quest-root .mobile-controls button{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  line-height:1;
}
@media (max-width:767px){
  .erp-quest-title-logo{
    width:min(96%, 720px);
    margin-bottom:2px;
  }
  .erp-quest-root .mobile-controls{
    width:min(100%, 340px);
    grid-template-columns:auto auto;
    column-gap:12px;
    margin-top:10px;
  }
  .erp-quest-root .mobile-controls .pad{
    grid-template-columns:repeat(3,48px);
    grid-template-rows:repeat(2,42px);
    gap:6px;
  }
  .erp-quest-root .mobile-controls .actions{
    grid-template-columns:repeat(2,52px);
    gap:6px;
  }
  .erp-quest-root .mobile-controls button{
    min-width:48px;
    min-height:42px;
    font-size:14px;
  }
}
@media (max-width:380px){
  .erp-quest-root .mobile-controls{
    width:min(100%, 304px);
    column-gap:8px;
  }
  .erp-quest-root .mobile-controls .pad{
    grid-template-columns:repeat(3,44px);
    grid-template-rows:repeat(2,40px);
    gap:5px;
  }
  .erp-quest-root .mobile-controls .actions{
    grid-template-columns:repeat(2,48px);
    gap:5px;
  }
  .erp-quest-root .mobile-controls button{
    min-width:44px;
    min-height:40px;
    font-size:13px;
  }
}

/* v1.3 mobile polish */
.erp-quest-player-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  margin:0 auto 9px;
  font-family:Arial,sans-serif;
  color:#f8f0df;
  font-weight:900;
  font-size:clamp(11px,1.35vw,14px);
  text-shadow:0 2px #000;
}
.erp-quest-player-name{
  width:min(180px,48vw);
  min-height:32px;
  border:2px solid #c9972d;
  border-radius:10px;
  background:#081122;
  color:#fff0b8;
  padding:5px 10px;
  font-family:Arial,sans-serif;
  font-size:14px;
  font-weight:800;
  outline:none;
  box-shadow:inset 0 0 10px #000,0 0 10px #39d6ff44;
}
.erp-quest-player-name:focus{
  border-color:#7ceaff;
  box-shadow:inset 0 0 10px #000,0 0 14px #39d6ff88;
}
.erp-quest-root .mobile-controls .erp-dir{
  font-size:0 !important;
  position:relative;
}
.erp-quest-root .mobile-controls .erp-dir span{
  display:block;
  width:0;
  height:0;
  filter:drop-shadow(0 2px 0 #000);
}
.erp-quest-root .mobile-controls .erp-dir-left span{
  border-top:11px solid transparent;
  border-bottom:11px solid transparent;
  border-right:16px solid #fff0b8;
}
.erp-quest-root .mobile-controls .erp-dir-right span{
  border-top:11px solid transparent;
  border-bottom:11px solid transparent;
  border-left:16px solid #fff0b8;
}
.erp-quest-root .mobile-controls .erp-dir-up span{
  border-left:11px solid transparent;
  border-right:11px solid transparent;
  border-bottom:16px solid #fff0b8;
}
.erp-quest-root .mobile-controls .erp-dir-down span{
  border-left:11px solid transparent;
  border-right:11px solid transparent;
  border-top:16px solid #fff0b8;
}
@media (max-width:767px){
  .erp-quest-player-row{
    margin-bottom:7px;
    gap:6px;
  }
  .erp-quest-player-name{
    min-height:30px;
    font-size:13px;
  }
  .erp-quest-root .mobile-controls{
    display:grid !important;
    grid-template-columns:auto auto !important;
    justify-content:space-between !important;
    align-items:end !important;
  }
}
@media (max-width:380px){
  .erp-quest-player-row{
    flex-direction:column;
    gap:3px;
  }
}


/* v1.4 compact phone-landscape shortcode support */
.erp-quest-root.erp-quest-compact{
  padding:4px;
}
.erp-quest-root.erp-quest-compact .erp-quest-cabinet{
  padding:5px;
  border-radius:14px;
}
.erp-quest-root.erp-quest-compact .erp-quest-title-logo{
  width:min(76%, 560px);
  max-height:68px;
  object-fit:contain;
  margin-bottom:0;
}
.erp-quest-root.erp-quest-compact .erp-quest-subtitle{
  margin:0 0 4px;
  font-size:11px;
  letter-spacing:1px;
}
.erp-quest-root.erp-quest-compact .erp-quest-player-row{
  margin-bottom:4px;
  font-size:11px;
}
.erp-quest-root.erp-quest-compact .erp-quest-player-name{
  min-height:26px;
  padding:3px 8px;
  font-size:12px;
}
.erp-quest-root.erp-quest-compact canvas{
  width:min(100%, calc(var(--erp-quest-canvas-max-height, 54vh) * 1.7778));
  max-height:var(--erp-quest-canvas-max-height, 54vh);
}
.erp-quest-root.erp-quest-compact .mobile-controls{
  margin-top:5px;
}
.erp-quest-root.erp-quest-compact .mobile-controls .pad{
  grid-template-columns:repeat(3,42px);
  grid-template-rows:repeat(2,36px);
  gap:5px;
}
.erp-quest-root.erp-quest-compact .mobile-controls .actions{
  grid-template-columns:repeat(2,48px);
  gap:5px;
}
.erp-quest-root.erp-quest-compact .mobile-controls button{
  min-width:42px;
  min-height:36px;
  font-size:12px;
  border-width:2px;
  border-radius:10px;
}
@media (orientation:landscape) and (max-height:520px){
  .erp-quest-root.erp-quest-compact .erp-quest-subtitle,
  .erp-quest-root.erp-quest-compact .erp-quest-controls{
    display:none;
  }
  .erp-quest-root.erp-quest-compact .erp-quest-title-logo{
    max-height:46px;
    width:min(62%, 440px);
  }
  .erp-quest-root.erp-quest-compact .erp-quest-player-row{
    margin-bottom:3px;
  }
}


/* v1.5 mobile fullscreen and rotate guidance */
html.erp-quest-lock-scroll,
body.erp-quest-lock-scroll{
  overflow:hidden !important;
  height:100% !important;
}
.erp-quest-mobile-toolbar{
  display:none;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0 auto 6px;
  font-family:Arial,sans-serif;
  font-size:12px;
  font-weight:900;
  color:#f8f0df;
  text-shadow:0 2px #000;
}
.erp-quest-fullscreen-button,
.erp-quest-exit-fullscreen-button,
.erp-quest-play-portrait-button{
  border:2px solid #c9972d;
  border-radius:11px;
  background:linear-gradient(#234f9b,#10234d);
  color:#fff0b8;
  font-family:Arial Black,Arial,sans-serif;
  font-size:12px;
  font-weight:900;
  line-height:1;
  padding:8px 10px;
  box-shadow:0 2px 0 #000,0 0 10px #39d6ff66;
  cursor:pointer;
  touch-action:manipulation;
}
.erp-quest-exit-fullscreen-button{display:none;}
.erp-quest-rotate-overlay{display:none;}
.erp-quest-root.erp-quest-mobile-fullscreen{
  position:fixed !important;
  inset:0 !important;
  z-index:999999 !important;
  width:100vw !important;
  height:100dvh !important;
  max-width:none !important;
  margin:0 !important;
  padding:4px !important;
  border-radius:0 !important;
  overflow:hidden !important;
  background:#050816 !important;
  contain:none !important;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-cabinet{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto auto auto minmax(0,1fr) auto;
  align-content:start;
  padding:5px;
  border-width:2px;
  border-radius:0;
  box-shadow:inset 0 0 20px #000;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-title-logo{
  max-height:42px;
  width:min(62%,520px);
  margin-bottom:0;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-subtitle,
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-controls{
  display:none !important;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-row{
  margin:1px auto 4px;
  font-size:10px;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-name{
  min-height:24px;
  padding:2px 8px;
  font-size:12px;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-mobile-toolbar{
  display:flex !important;
  margin-bottom:4px;
}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-fullscreen-button{display:none;}
.erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-exit-fullscreen-button{display:inline-flex;}
.erp-quest-root.erp-quest-mobile-fullscreen canvas{
  align-self:center;
  justify-self:center;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:calc(100dvh - 132px) !important;
  aspect-ratio:16/9;
  border-width:2px;
  border-radius:8px;
  box-shadow:0 0 0 2px #c9972d,0 0 18px #39d6ff44;
}
.erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls{
  display:grid !important;
  grid-template-columns:auto auto !important;
  justify-content:space-between !important;
  align-items:end !important;
  width:min(100%, 390px) !important;
  margin:5px auto 0 !important;
  gap:8px !important;
}
.erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .pad{
  grid-template-columns:repeat(3,44px);
  grid-template-rows:repeat(2,38px);
  gap:5px;
}
.erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .actions{
  grid-template-columns:repeat(2,52px);
  gap:5px;
}
.erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls button{
  min-width:44px;
  min-height:38px;
  border-width:2px;
  border-radius:10px;
  font-size:12px;
}
@media (max-width:900px),(pointer:coarse){
  .erp-quest-mobile-toolbar{display:flex;}
}
@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root[data-rotate-prompt="yes"]:not(.erp-quest-portrait-ok) .erp-quest-rotate-overlay{
    display:flex;
    position:absolute;
    z-index:20;
    inset:0;
    align-items:center;
    justify-content:center;
    padding:16px;
    background:rgba(5,8,22,.86);
    backdrop-filter:blur(3px);
  }
  .erp-quest-root{
    position:relative;
  }
  .erp-quest-rotate-card{
    width:min(92vw,360px);
    border:3px solid #c9972d;
    border-radius:20px;
    background:linear-gradient(#1d315c,#090d19);
    box-shadow:0 0 0 4px #03050b,0 0 30px #39d6ff66;
    padding:18px 14px;
    text-align:center;
    color:#f8f0df;
    font-family:Arial,sans-serif;
  }
  .erp-quest-rotate-card strong{
    display:block;
    color:#ffd86b;
    font-family:Impact,Arial Black,sans-serif;
    font-size:30px;
    letter-spacing:1px;
    text-shadow:0 3px #000;
    margin-bottom:6px;
  }
  .erp-quest-rotate-card p{
    margin:0 auto 12px;
    font-size:15px;
    line-height:1.35;
  }
  .erp-quest-rotate-card button{
    display:block;
    width:100%;
    margin:8px 0 0;
    min-height:42px;
    font-size:13px;
  }
  .erp-quest-rotate-icon{
    font-size:46px;
    line-height:1;
    color:#7ceaff;
    text-shadow:0 2px #000,0 0 16px #39d6ff88;
    margin-bottom:4px;
  }
}
@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root:not(.erp-quest-mobile-fullscreen){
    padding:5px;
  }
  .erp-quest-root:not(.erp-quest-mobile-fullscreen) .erp-quest-cabinet{
    padding:5px;
  }
  .erp-quest-root:not(.erp-quest-mobile-fullscreen) .erp-quest-title-logo{
    max-height:58px;
    width:min(92%,520px);
  }
  .erp-quest-root:not(.erp-quest-mobile-fullscreen) .erp-quest-subtitle{
    display:none;
  }
  .erp-quest-root:not(.erp-quest-mobile-fullscreen) canvas{
    max-height:38dvh;
  }
  .erp-quest-root:not(.erp-quest-mobile-fullscreen) .mobile-controls{
    width:min(100%, 330px) !important;
    margin-top:7px;
  }
}
@media (orientation:landscape) and (max-height:560px){
  .erp-quest-root[data-mobile-fullscreen="yes"]{
    max-width:none;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-title-logo{
    max-height:30px;
    width:min(42%,420px);
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-row{
    margin:0 auto 2px;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-row label{
    display:none;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-name{
    min-height:22px;
    width:140px;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-mobile-toolbar{
    position:absolute;
    top:6px;
    right:8px;
    margin:0;
    z-index:5;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-mobile-toolbar span{display:none;}
  .erp-quest-root.erp-quest-mobile-fullscreen canvas{
    max-height:calc(100dvh - 86px) !important;
    max-width:min(100%, calc((100dvh - 86px) * 1.7778)) !important;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls{
    width:min(100%, 430px) !important;
    margin-top:3px !important;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .pad{
    grid-template-columns:repeat(3,46px);
    grid-template-rows:repeat(2,38px);
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .actions{
    grid-template-columns:repeat(4,52px);
  }
}
@media (max-height:420px) and (orientation:landscape){
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-title-logo,
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-player-row{
    display:none;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .erp-quest-cabinet{
    grid-template-rows:auto minmax(0,1fr) auto;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen canvas{
    max-height:calc(100dvh - 58px) !important;
    max-width:min(100%, calc((100dvh - 58px) * 1.7778)) !important;
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .pad{
    grid-template-columns:repeat(3,42px);
    grid-template-rows:repeat(2,34px);
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls .actions{
    grid-template-columns:repeat(4,48px);
  }
  .erp-quest-root.erp-quest-mobile-fullscreen .mobile-controls button{
    min-height:34px;
  }
}


/* v1.6 portrait-first phone layout */
.erp-quest-root.erp-quest-portrait-first .erp-quest-rotate-overlay{
  display:none !important;
}
.erp-quest-root.erp-quest-portrait-first .erp-quest-mobile-toolbar span{
  font-size:11px;
}

@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root.erp-quest-portrait-first{
    width:100% !important;
    max-width:none !important;
    margin:0 auto !important;
    padding:4px !important;
    border-radius:14px !important;
    overflow:hidden !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-cabinet{
    display:grid !important;
    grid-template-rows:auto auto auto auto auto;
    align-content:start !important;
    gap:0 !important;
    padding:5px !important;
    border-width:2px !important;
    border-radius:14px !important;
    box-shadow:0 0 0 2px #03050b,0 0 20px #39d6ff55,inset 0 0 18px #000 !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-title-logo{
    width:min(92%, 430px) !important;
    max-height:46px !important;
    object-fit:contain !important;
    margin:0 auto 1px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-subtitle,
  .erp-quest-root.erp-quest-portrait-first .erp-quest-controls{
    display:none !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-player-row{
    width:100% !important;
    margin:0 auto 4px !important;
    gap:6px !important;
    flex-direction:row !important;
    font-size:11px !important;
    line-height:1 !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-player-row label{
    white-space:nowrap !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-player-name{
    width:min(176px, 52vw) !important;
    min-height:26px !important;
    height:26px !important;
    padding:2px 8px !important;
    font-size:12px !important;
    border-radius:8px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-mobile-toolbar{
    display:flex !important;
    margin:0 auto 4px !important;
    min-height:26px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-mobile-toolbar span{
    display:none !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-fullscreen-button,
  .erp-quest-root.erp-quest-portrait-first .erp-quest-exit-fullscreen-button{
    min-height:26px !important;
    padding:5px 9px !important;
    font-size:11px !important;
    border-radius:9px !important;
  }
  .erp-quest-root.erp-quest-portrait-first canvas{
    width:100% !important;
    max-width:100% !important;
    height:min(40dvh, calc(100vw * .70)) !important;
    max-height:310px !important;
    aspect-ratio:auto !important;
    object-fit:fill !important;
    border-width:2px !important;
    border-radius:8px !important;
    box-shadow:0 0 0 2px #c9972d,0 0 16px #39d6ff44 !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls{
    display:grid !important;
    grid-template-columns:auto auto !important;
    justify-content:space-between !important;
    align-items:end !important;
    width:min(100%, 360px) !important;
    margin:6px auto 0 !important;
    gap:10px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .pad{
    grid-template-columns:repeat(3,48px) !important;
    grid-template-rows:repeat(2,42px) !important;
    gap:5px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .actions{
    grid-template-columns:repeat(2,54px) !important;
    gap:5px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls button{
    min-width:48px !important;
    min-height:42px !important;
    border-width:2px !important;
    border-radius:10px !important;
    font-size:13px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .actions button{
    min-width:54px !important;
  }
}

@media (max-width:380px) and (orientation:portrait){
  .erp-quest-root.erp-quest-portrait-first .erp-quest-title-logo{
    max-height:40px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-player-row{
    font-size:10px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .erp-quest-player-name{
    width:150px !important;
  }
  .erp-quest-root.erp-quest-portrait-first canvas{
    height:min(38dvh, calc(100vw * .68)) !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls{
    width:min(100%, 320px) !important;
    gap:6px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .pad{
    grid-template-columns:repeat(3,43px) !important;
    grid-template-rows:repeat(2,38px) !important;
    gap:5px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .actions{
    grid-template-columns:repeat(2,50px) !important;
    gap:5px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls button{
    min-width:43px !important;
    min-height:38px !important;
    font-size:12px !important;
  }
  .erp-quest-root.erp-quest-portrait-first .mobile-controls .actions button{
    min-width:50px !important;
  }
}

@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen{
    position:fixed !important;
    inset:0 !important;
    z-index:999999 !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:none !important;
    margin:0 !important;
    padding:4px !important;
    border-radius:0 !important;
    background:#050816 !important;
    contain:none !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-cabinet{
    height:100% !important;
    min-height:0 !important;
    border-radius:0 !important;
    grid-template-rows:auto auto auto minmax(0,1fr) auto !important;
    align-content:stretch !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-title-logo{
    max-height:38px !important;
    width:min(86%, 400px) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-player-row{
    margin-bottom:3px !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-mobile-toolbar{
    position:absolute !important;
    top:5px !important;
    right:6px !important;
    z-index:5 !important;
    margin:0 !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-fullscreen-button{
    display:none !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-exit-fullscreen-button{
    display:inline-flex !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen canvas{
    align-self:center !important;
    justify-self:center !important;
    width:100% !important;
    height:min(calc(100vw * .72), calc(100dvh - 180px)) !important;
    max-height:none !important;
    max-width:100% !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls{
    width:min(100%, 370px) !important;
    margin:5px auto 0 !important;
    gap:8px !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .pad{
    grid-template-columns:repeat(3,50px) !important;
    grid-template-rows:repeat(2,44px) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .actions{
    grid-template-columns:repeat(2,56px) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls button{
    min-width:50px !important;
    min-height:44px !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .actions button{
    min-width:56px !important;
  }
}

@media (max-height:700px) and (max-width:767px) and (orientation:portrait){
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-title-logo{
    max-height:30px !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .erp-quest-player-row label{
    display:none !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen canvas{
    height:min(calc(100vw * .68), calc(100dvh - 160px)) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .pad{
    grid-template-columns:repeat(3,45px) !important;
    grid-template-rows:repeat(2,39px) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .actions{
    grid-template-columns:repeat(2,51px) !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls button{
    min-width:45px !important;
    min-height:39px !important;
    font-size:12px !important;
  }
  .erp-quest-root.erp-quest-portrait-first.erp-quest-mobile-fullscreen .mobile-controls .actions button{
    min-width:51px !important;
  }
}


/* v1.7 portrait default phone layout: no fullscreen button, no rotate prompt */
.erp-quest-root.erp-quest-phone-portrait-default .erp-quest-mobile-toolbar,
.erp-quest-root.erp-quest-phone-portrait-default .erp-quest-fullscreen-button,
.erp-quest-root.erp-quest-phone-portrait-default .erp-quest-exit-fullscreen-button,
.erp-quest-root.erp-quest-phone-portrait-default .erp-quest-rotate-overlay{
  display:none !important;
}

@media (max-width:767px) and (orientation:portrait){
  html.erp-quest-lock-scroll,
  body.erp-quest-lock-scroll{
    overflow:hidden !important;
    height:100% !important;
    max-height:100% !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default{
    position:fixed !important;
    inset:0 !important;
    z-index:999999 !important;
    width:100vw !important;
    height:100svh !important;
    min-height:100svh !important;
    max-width:none !important;
    margin:0 !important;
    padding:6px 5px calc(6px + env(safe-area-inset-bottom, 0px)) 5px !important;
    border-radius:0 !important;
    overflow:hidden !important;
    background:#000 !important;
    contain:none !important;
    touch-action:none !important;
  }

  @supports (height:100dvh){
    .erp-quest-root.erp-quest-phone-portrait-default{
      height:100dvh !important;
      min-height:100dvh !important;
    }
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-cabinet{
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
    align-content:stretch !important;
    gap:0 !important;
    padding:7px !important;
    border-width:2px !important;
    border-radius:16px !important;
    overflow:hidden !important;
    box-shadow:0 0 0 2px #03050b,0 0 24px #39d6ff66,inset 0 0 24px #000 !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-title-logo{
    grid-row:1 !important;
    width:auto !important;
    max-width:78% !important;
    height:clamp(38px, 7.2svh, 62px) !important;
    max-height:62px !important;
    object-fit:contain !important;
    margin:0 auto 3px !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-subtitle,
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-controls{
    display:none !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row{
    grid-row:2 !important;
    width:100% !important;
    min-height:clamp(30px, 5svh, 42px) !important;
    margin:0 auto 6px !important;
    padding:0 4px !important;
    display:flex !important;
    flex-direction:row !important;
    justify-content:center !important;
    align-items:center !important;
    gap:8px !important;
    font-size:clamp(12px, 3.2vw, 16px) !important;
    line-height:1 !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row label{
    white-space:nowrap !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-name{
    width:min(54vw, 220px) !important;
    height:clamp(30px, 5svh, 42px) !important;
    min-height:30px !important;
    padding:4px 10px !important;
    border-radius:10px !important;
    font-size:clamp(15px, 4vw, 22px) !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default canvas{
    grid-row:3 !important;
    align-self:stretch !important;
    justify-self:stretch !important;
    display:block !important;
    width:100% !important;
    height:100% !important;
    min-height:0 !important;
    max-width:none !important;
    max-height:none !important;
    aspect-ratio:auto !important;
    object-fit:fill !important;
    margin:0 auto !important;
    border-width:2px !important;
    border-radius:10px !important;
    box-shadow:0 0 0 2px #c9972d,0 0 20px #39d6ff55 !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls{
    grid-row:4 !important;
    display:grid !important;
    grid-template-columns:auto auto !important;
    justify-content:space-between !important;
    align-items:end !important;
    width:100% !important;
    max-width:430px !important;
    margin:8px auto 0 !important;
    gap:10px !important;
    padding:0 1px !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .pad{
    display:grid !important;
    grid-template-columns:repeat(3, clamp(50px, 14.8vw, 66px)) !important;
    grid-template-rows:repeat(2, clamp(44px, 12.8vw, 58px)) !important;
    gap:clamp(5px, 1.6vw, 8px) !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .actions{
    display:grid !important;
    grid-template-columns:repeat(2, clamp(58px, 16.4vw, 74px)) !important;
    grid-template-rows:repeat(2, clamp(44px, 12.8vw, 58px)) !important;
    gap:clamp(5px, 1.6vw, 8px) !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls button{
    min-width:clamp(50px, 14.8vw, 66px) !important;
    min-height:clamp(44px, 12.8vw, 58px) !important;
    border-width:2px !important;
    border-radius:12px !important;
    font-size:clamp(13px, 3.9vw, 19px) !important;
    box-shadow:0 3px 0 #000,0 0 14px #39d6ff88 !important;
  }

  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .actions button{
    min-width:clamp(58px, 16.4vw, 74px) !important;
  }
}

@media (max-width:767px) and (orientation:portrait) and (max-height:720px){
  .erp-quest-root.erp-quest-phone-portrait-default{
    padding:4px 4px calc(4px + env(safe-area-inset-bottom, 0px)) 4px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-cabinet{
    padding:5px !important;
    border-radius:13px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-title-logo{
    height:clamp(28px, 6.2svh, 42px) !important;
    margin-bottom:1px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row{
    min-height:28px !important;
    margin-bottom:4px !important;
    font-size:12px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-name{
    height:28px !important;
    font-size:14px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls{
    margin-top:5px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .pad{
    grid-template-columns:repeat(3, clamp(45px, 13.6vw, 58px)) !important;
    grid-template-rows:repeat(2, clamp(39px, 11.8vw, 50px)) !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .actions{
    grid-template-columns:repeat(2, clamp(51px, 15.2vw, 65px)) !important;
    grid-template-rows:repeat(2, clamp(39px, 11.8vw, 50px)) !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls button{
    min-width:clamp(45px, 13.6vw, 58px) !important;
    min-height:clamp(39px, 11.8vw, 50px) !important;
    font-size:12px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls .actions button{
    min-width:clamp(51px, 15.2vw, 65px) !important;
  }
}

@media (max-width:370px) and (orientation:portrait){
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row label{
    font-size:10px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-name{
    width:52vw !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls{
    gap:6px !important;
  }
}


/* v1.8 final portrait polish: break out of page header and keep the logo visible */
@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root.erp-quest-phone-portrait-default,
  .erp-quest-root.erp-quest-phone-portrait-default.erp-quest-body-overlay{
    position:fixed !important;
    top:0 !important;
    right:0 !important;
    bottom:auto !important;
    left:0 !important;
    z-index:2147483647 !important;
    width:100vw !important;
    height:100svh !important;
    min-height:100svh !important;
    max-height:100svh !important;
    padding:5px 5px calc(5px + env(safe-area-inset-bottom, 0px)) 5px !important;
  }
  @supports (height:100dvh){
    .erp-quest-root.erp-quest-phone-portrait-default,
    .erp-quest-root.erp-quest-phone-portrait-default.erp-quest-body-overlay{
      height:100dvh !important;
      min-height:100dvh !important;
      max-height:100dvh !important;
    }
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-cabinet{
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
    padding:6px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-title-logo{
    display:block !important;
    height:clamp(34px, 6.2svh, 54px) !important;
    max-height:54px !important;
    width:auto !important;
    max-width:76% !important;
    margin:0 auto 2px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row{
    min-height:clamp(28px, 4.6svh, 38px) !important;
    margin:0 auto 5px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-name{
    height:clamp(28px, 4.6svh, 38px) !important;
    min-height:28px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls{
    margin-top:6px !important;
  }
}

@media (max-width:767px) and (orientation:portrait) and (max-height:740px){
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-title-logo{
    height:clamp(30px, 5.6svh, 42px) !important;
    max-height:42px !important;
    margin-bottom:1px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row{
    min-height:27px !important;
    margin-bottom:4px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-name{
    height:27px !important;
    min-height:27px !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .mobile-controls{
    margin-top:4px !important;
  }
}


/* v2.0 Android-safe leaderboard name entry */
.erp-quest-player-name.erp-quest-name-needed{
  outline:3px solid #ffd86b !important;
  box-shadow:0 0 0 4px rgba(255,216,107,.35), inset 0 0 18px rgba(255,255,255,.9) !important;
}


/* v2.0 Android-safe leaderboard name entry */
.erp-quest-player-row,
.erp-quest-player-row *,
.erp-quest-player-name{
  pointer-events:auto !important;
}
.erp-quest-player-name{
  touch-action:auto !important;
  -webkit-user-select:text !important;
  user-select:text !important;
  -webkit-touch-callout:default !important;
  caret-color:#0b1833 !important;
  position:relative !important;
  z-index:2147483647 !important;
  ime-mode:auto;
}
.erp-quest-root.erp-quest-typing-name,
.erp-quest-root.erp-quest-typing-name .erp-quest-cabinet{
  touch-action:auto !important;
}
.erp-quest-root.erp-quest-typing-name canvas,
.erp-quest-root.erp-quest-typing-name .mobile-controls{
  pointer-events:none !important;
}
@media (max-width:767px) and (orientation:portrait){
  .erp-quest-root.erp-quest-phone-portrait-default.erp-quest-typing-name{
    height:100dvh !important;
    min-height:100dvh !important;
  }
  .erp-quest-root.erp-quest-phone-portrait-default .erp-quest-player-row{
    position:relative !important;
    z-index:2147483647 !important;
  }
}
