/* The recording frame is the dungeon canvas, not the browser window. */
.viewportModalShade{position:absolute;inset:0;z-index:40;background:#03070db8;pointer-events:none}
.viewportModalShade[hidden]{display:none}
dialog.viewportPanel{
  position:fixed;inset:auto;margin:0;box-sizing:border-box;
  left:calc(var(--game-panel-left) + var(--game-panel-width)/2);
  top:calc(var(--game-panel-top) + var(--game-panel-height)/2);
  transform:translate(-50%,-50%);
  max-width:calc(var(--game-panel-width) - 16px);
  max-height:calc(var(--game-panel-height) - 16px);
  overflow:auto;overscroll-behavior:contain;
  box-shadow:inset 0 0 0 1px #070b0f;
  container-type:inline-size;
}
dialog.viewportPanel::backdrop{background:transparent;backdrop-filter:none}
dialog.viewportPanel.equipDialog{
  width:1320px;
  overflow:hidden;
}
dialog.viewportPanel.equipDialog[open]{
  display:flex;
  flex-direction:column;
}
#equipment.viewportPanel{z-index:41}
.equipDialog .gearContent{
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#61714f #171e17;
}
.equipDialog .gearTopBar{
  display:flex;
  flex:none;
  align-items:center;
  gap:8px;
  padding:8px 20px;
  border-bottom:1px solid #81745a;
}
.equipDialog .gearTopBar .partySelector{
  min-width:0;
  padding:0;
  border:0;
}
.equipDialog #closeGear{
  flex:none;
  margin-inline-start:auto;
  min-height:40px;
  padding:6px 12px;
  white-space:nowrap;
}
.equipDialog .backpack{grid-template-columns:repeat(5,minmax(0,1fr))}
.viewportPanel .gearLayout{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.15fr)}
.viewportPanel .gearLayout>section{min-width:0}
@container (max-width:820px){
  .viewportPanel .gearLayout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:14px;gap:16px}
  .viewportPanel .comparisonSection{grid-column:1/-1}
}
@container (max-width:600px){
  .viewportPanel .gearLayout{grid-template-columns:minmax(0,1fr)}
  .viewportPanel .chestCards{grid-template-columns:minmax(0,1fr)}
  .viewportPanel .chestFoot{flex-wrap:wrap}
  .viewportPanel .resultStats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .viewportPanel .resultEquipment{grid-template-columns:minmax(0,1fr)}
}

@container (max-width:420px){
  .equipDialog .gearTopBar{padding:6px;gap:6px}
  .equipDialog .partySelector{flex:1}
  .equipDialog .partySelector button{min-width:0;overflow-wrap:anywhere}
  .equipDialog .partySelector canvas{display:none}
  .equipDialog #closeGear{padding-inline:8px}
  .equipDialog #closeGear kbd{display:none}
}

/* Readability adjustment: chest choices and equipment dialogs only. */
#chestChoice .chestCard h3{font-size:18px}
#chestChoice .chestCard .gearStat,
#chestChoice .chestCard .optionSlot,
#chestChoice .chestCard>button,
#chestChoice .chestFoot,
#chestChoice .chestHeading p,
#chestChoice .chestNotice{font-size:16px}
.equipDialog .optionSlot,
.equipDialog .bagHint,
.equipDialog .slotHint,
.equipDialog .equipheading{font-size:16px}
.equipDialog .gearStat{font-size:17px}
.equipDialog .compareCard h3{font-size:20px}
